[llvm-branch-commits] [libcxx] 4fe8bd0 - RENAME ALL THE THINGS

Michael Schellenberger Costa via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Oct 10 02:55:32 PDT 2022


Author: Michael Schellenberger Costa
Date: 2022-09-08T11:55:50+02:00
New Revision: 4fe8bd01fa5e626023749e132ee534a0ab23e1fd

URL: https://github.com/llvm/llvm-project/commit/4fe8bd01fa5e626023749e132ee534a0ab23e1fd
DIFF: https://github.com/llvm/llvm-project/commit/4fe8bd01fa5e626023749e132ee534a0ab23e1fd.diff

LOG: RENAME ALL THE THINGS

Added: 
    

Modified: 
    libcxx/.clang-format
    libcxx/CMakeLists.txt
    libcxx/benchmarks/std_format_spec_string_unicode.bench.cpp
    libcxx/cmake/Modules/HandleLibCXXABI.cmake
    libcxx/docs/BuildingLibcxx.rst
    libcxx/docs/Contributing.rst
    libcxx/docs/DesignDocs/ABIVersioning.rst
    libcxx/docs/DesignDocs/DebugMode.rst
    libcxx/docs/DesignDocs/ExperimentalFeatures.rst
    libcxx/docs/DesignDocs/ThreadingSupportAPI.rst
    libcxx/docs/DesignDocs/UnspecifiedBehaviorRandomization.rst
    libcxx/docs/DesignDocs/VisibilityMacros.rst
    libcxx/docs/ReleaseNotes.rst
    libcxx/docs/UsingLibcxx.rst
    libcxx/include/__algorithm/adjacent_find.h
    libcxx/include/__algorithm/all_of.h
    libcxx/include/__algorithm/any_of.h
    libcxx/include/__algorithm/binary_search.h
    libcxx/include/__algorithm/clamp.h
    libcxx/include/__algorithm/comp.h
    libcxx/include/__algorithm/comp_ref_type.h
    libcxx/include/__algorithm/copy.h
    libcxx/include/__algorithm/copy_backward.h
    libcxx/include/__algorithm/copy_if.h
    libcxx/include/__algorithm/copy_n.h
    libcxx/include/__algorithm/count.h
    libcxx/include/__algorithm/count_if.h
    libcxx/include/__algorithm/equal.h
    libcxx/include/__algorithm/equal_range.h
    libcxx/include/__algorithm/fill.h
    libcxx/include/__algorithm/fill_n.h
    libcxx/include/__algorithm/find.h
    libcxx/include/__algorithm/find_end.h
    libcxx/include/__algorithm/find_first_of.h
    libcxx/include/__algorithm/find_if.h
    libcxx/include/__algorithm/find_if_not.h
    libcxx/include/__algorithm/for_each.h
    libcxx/include/__algorithm/for_each_n.h
    libcxx/include/__algorithm/generate.h
    libcxx/include/__algorithm/generate_n.h
    libcxx/include/__algorithm/half_positive.h
    libcxx/include/__algorithm/in_found_result.h
    libcxx/include/__algorithm/in_fun_result.h
    libcxx/include/__algorithm/in_in_out_result.h
    libcxx/include/__algorithm/in_in_result.h
    libcxx/include/__algorithm/in_out_out_result.h
    libcxx/include/__algorithm/in_out_result.h
    libcxx/include/__algorithm/includes.h
    libcxx/include/__algorithm/inplace_merge.h
    libcxx/include/__algorithm/is_heap.h
    libcxx/include/__algorithm/is_heap_until.h
    libcxx/include/__algorithm/is_partitioned.h
    libcxx/include/__algorithm/is_permutation.h
    libcxx/include/__algorithm/is_sorted.h
    libcxx/include/__algorithm/is_sorted_until.h
    libcxx/include/__algorithm/iter_swap.h
    libcxx/include/__algorithm/iterator_operations.h
    libcxx/include/__algorithm/lexicographical_compare.h
    libcxx/include/__algorithm/lower_bound.h
    libcxx/include/__algorithm/make_heap.h
    libcxx/include/__algorithm/make_projected.h
    libcxx/include/__algorithm/max.h
    libcxx/include/__algorithm/max_element.h
    libcxx/include/__algorithm/merge.h
    libcxx/include/__algorithm/min.h
    libcxx/include/__algorithm/min_element.h
    libcxx/include/__algorithm/min_max_result.h
    libcxx/include/__algorithm/minmax.h
    libcxx/include/__algorithm/minmax_element.h
    libcxx/include/__algorithm/mismatch.h
    libcxx/include/__algorithm/move.h
    libcxx/include/__algorithm/move_backward.h
    libcxx/include/__algorithm/next_permutation.h
    libcxx/include/__algorithm/none_of.h
    libcxx/include/__algorithm/nth_element.h
    libcxx/include/__algorithm/partial_sort.h
    libcxx/include/__algorithm/partial_sort_copy.h
    libcxx/include/__algorithm/partition.h
    libcxx/include/__algorithm/partition_copy.h
    libcxx/include/__algorithm/partition_point.h
    libcxx/include/__algorithm/pop_heap.h
    libcxx/include/__algorithm/prev_permutation.h
    libcxx/include/__algorithm/push_heap.h
    libcxx/include/__algorithm/ranges_adjacent_find.h
    libcxx/include/__algorithm/ranges_all_of.h
    libcxx/include/__algorithm/ranges_any_of.h
    libcxx/include/__algorithm/ranges_binary_search.h
    libcxx/include/__algorithm/ranges_clamp.h
    libcxx/include/__algorithm/ranges_copy.h
    libcxx/include/__algorithm/ranges_copy_backward.h
    libcxx/include/__algorithm/ranges_copy_if.h
    libcxx/include/__algorithm/ranges_copy_n.h
    libcxx/include/__algorithm/ranges_count.h
    libcxx/include/__algorithm/ranges_count_if.h
    libcxx/include/__algorithm/ranges_equal.h
    libcxx/include/__algorithm/ranges_equal_range.h
    libcxx/include/__algorithm/ranges_fill.h
    libcxx/include/__algorithm/ranges_fill_n.h
    libcxx/include/__algorithm/ranges_find.h
    libcxx/include/__algorithm/ranges_find_end.h
    libcxx/include/__algorithm/ranges_find_first_of.h
    libcxx/include/__algorithm/ranges_find_if.h
    libcxx/include/__algorithm/ranges_find_if_not.h
    libcxx/include/__algorithm/ranges_for_each.h
    libcxx/include/__algorithm/ranges_for_each_n.h
    libcxx/include/__algorithm/ranges_generate.h
    libcxx/include/__algorithm/ranges_generate_n.h
    libcxx/include/__algorithm/ranges_includes.h
    libcxx/include/__algorithm/ranges_inplace_merge.h
    libcxx/include/__algorithm/ranges_is_heap.h
    libcxx/include/__algorithm/ranges_is_heap_until.h
    libcxx/include/__algorithm/ranges_is_partitioned.h
    libcxx/include/__algorithm/ranges_is_permutation.h
    libcxx/include/__algorithm/ranges_is_sorted.h
    libcxx/include/__algorithm/ranges_is_sorted_until.h
    libcxx/include/__algorithm/ranges_iterator_concept.h
    libcxx/include/__algorithm/ranges_lexicographical_compare.h
    libcxx/include/__algorithm/ranges_lower_bound.h
    libcxx/include/__algorithm/ranges_make_heap.h
    libcxx/include/__algorithm/ranges_max.h
    libcxx/include/__algorithm/ranges_max_element.h
    libcxx/include/__algorithm/ranges_merge.h
    libcxx/include/__algorithm/ranges_min.h
    libcxx/include/__algorithm/ranges_min_element.h
    libcxx/include/__algorithm/ranges_minmax.h
    libcxx/include/__algorithm/ranges_minmax_element.h
    libcxx/include/__algorithm/ranges_mismatch.h
    libcxx/include/__algorithm/ranges_move.h
    libcxx/include/__algorithm/ranges_move_backward.h
    libcxx/include/__algorithm/ranges_next_permutation.h
    libcxx/include/__algorithm/ranges_none_of.h
    libcxx/include/__algorithm/ranges_nth_element.h
    libcxx/include/__algorithm/ranges_partial_sort.h
    libcxx/include/__algorithm/ranges_partial_sort_copy.h
    libcxx/include/__algorithm/ranges_partition.h
    libcxx/include/__algorithm/ranges_partition_copy.h
    libcxx/include/__algorithm/ranges_partition_point.h
    libcxx/include/__algorithm/ranges_pop_heap.h
    libcxx/include/__algorithm/ranges_prev_permutation.h
    libcxx/include/__algorithm/ranges_push_heap.h
    libcxx/include/__algorithm/ranges_remove.h
    libcxx/include/__algorithm/ranges_remove_copy.h
    libcxx/include/__algorithm/ranges_remove_copy_if.h
    libcxx/include/__algorithm/ranges_remove_if.h
    libcxx/include/__algorithm/ranges_replace.h
    libcxx/include/__algorithm/ranges_replace_copy.h
    libcxx/include/__algorithm/ranges_replace_copy_if.h
    libcxx/include/__algorithm/ranges_replace_if.h
    libcxx/include/__algorithm/ranges_reverse.h
    libcxx/include/__algorithm/ranges_reverse_copy.h
    libcxx/include/__algorithm/ranges_rotate.h
    libcxx/include/__algorithm/ranges_rotate_copy.h
    libcxx/include/__algorithm/ranges_sample.h
    libcxx/include/__algorithm/ranges_search.h
    libcxx/include/__algorithm/ranges_search_n.h
    libcxx/include/__algorithm/ranges_set_difference.h
    libcxx/include/__algorithm/ranges_set_intersection.h
    libcxx/include/__algorithm/ranges_set_symmetric_difference.h
    libcxx/include/__algorithm/ranges_set_union.h
    libcxx/include/__algorithm/ranges_shuffle.h
    libcxx/include/__algorithm/ranges_sort.h
    libcxx/include/__algorithm/ranges_sort_heap.h
    libcxx/include/__algorithm/ranges_stable_partition.h
    libcxx/include/__algorithm/ranges_stable_sort.h
    libcxx/include/__algorithm/ranges_swap_ranges.h
    libcxx/include/__algorithm/ranges_transform.h
    libcxx/include/__algorithm/ranges_unique.h
    libcxx/include/__algorithm/ranges_unique_copy.h
    libcxx/include/__algorithm/ranges_upper_bound.h
    libcxx/include/__algorithm/remove.h
    libcxx/include/__algorithm/remove_copy.h
    libcxx/include/__algorithm/remove_copy_if.h
    libcxx/include/__algorithm/remove_if.h
    libcxx/include/__algorithm/replace.h
    libcxx/include/__algorithm/replace_copy.h
    libcxx/include/__algorithm/replace_copy_if.h
    libcxx/include/__algorithm/replace_if.h
    libcxx/include/__algorithm/reverse.h
    libcxx/include/__algorithm/reverse_copy.h
    libcxx/include/__algorithm/rotate.h
    libcxx/include/__algorithm/rotate_copy.h
    libcxx/include/__algorithm/sample.h
    libcxx/include/__algorithm/search.h
    libcxx/include/__algorithm/search_n.h
    libcxx/include/__algorithm/set_difference.h
    libcxx/include/__algorithm/set_intersection.h
    libcxx/include/__algorithm/set_symmetric_difference.h
    libcxx/include/__algorithm/set_union.h
    libcxx/include/__algorithm/shift_left.h
    libcxx/include/__algorithm/shift_right.h
    libcxx/include/__algorithm/shuffle.h
    libcxx/include/__algorithm/sift_down.h
    libcxx/include/__algorithm/sort.h
    libcxx/include/__algorithm/sort_heap.h
    libcxx/include/__algorithm/stable_partition.h
    libcxx/include/__algorithm/stable_sort.h
    libcxx/include/__algorithm/swap_ranges.h
    libcxx/include/__algorithm/transform.h
    libcxx/include/__algorithm/uniform_random_bit_generator_adaptor.h
    libcxx/include/__algorithm/unique.h
    libcxx/include/__algorithm/unique_copy.h
    libcxx/include/__algorithm/unwrap_iter.h
    libcxx/include/__algorithm/unwrap_range.h
    libcxx/include/__algorithm/upper_bound.h
    libcxx/include/__assert
    libcxx/include/__availability
    libcxx/include/__bit/bit_cast.h
    libcxx/include/__bit/byteswap.h
    libcxx/include/__bit_reference
    libcxx/include/__bits
    libcxx/include/__bsd_locale_defaults.h
    libcxx/include/__bsd_locale_fallbacks.h
    libcxx/include/__charconv/chars_format.h
    libcxx/include/__charconv/from_chars_result.h
    libcxx/include/__charconv/tables.h
    libcxx/include/__charconv/to_chars_base_10.h
    libcxx/include/__charconv/to_chars_result.h
    libcxx/include/__chrono/calendar.h
    libcxx/include/__chrono/convert_to_timespec.h
    libcxx/include/__chrono/day.h
    libcxx/include/__chrono/duration.h
    libcxx/include/__chrono/file_clock.h
    libcxx/include/__chrono/hh_mm_ss.h
    libcxx/include/__chrono/high_resolution_clock.h
    libcxx/include/__chrono/literals.h
    libcxx/include/__chrono/month.h
    libcxx/include/__chrono/month_weekday.h
    libcxx/include/__chrono/monthday.h
    libcxx/include/__chrono/steady_clock.h
    libcxx/include/__chrono/system_clock.h
    libcxx/include/__chrono/time_point.h
    libcxx/include/__chrono/weekday.h
    libcxx/include/__chrono/year.h
    libcxx/include/__chrono/year_month.h
    libcxx/include/__chrono/year_month_day.h
    libcxx/include/__chrono/year_month_weekday.h
    libcxx/include/__compare/common_comparison_category.h
    libcxx/include/__compare/compare_partial_order_fallback.h
    libcxx/include/__compare/compare_strong_order_fallback.h
    libcxx/include/__compare/compare_three_way.h
    libcxx/include/__compare/compare_three_way_result.h
    libcxx/include/__compare/compare_weak_order_fallback.h
    libcxx/include/__compare/is_eq.h
    libcxx/include/__compare/ordering.h
    libcxx/include/__compare/partial_order.h
    libcxx/include/__compare/strong_order.h
    libcxx/include/__compare/synth_three_way.h
    libcxx/include/__compare/three_way_comparable.h
    libcxx/include/__compare/weak_order.h
    libcxx/include/__concepts/arithmetic.h
    libcxx/include/__concepts/assignable.h
    libcxx/include/__concepts/boolean_testable.h
    libcxx/include/__concepts/class_or_enum.h
    libcxx/include/__concepts/common_reference_with.h
    libcxx/include/__concepts/common_with.h
    libcxx/include/__concepts/constructible.h
    libcxx/include/__concepts/convertible_to.h
    libcxx/include/__concepts/copyable.h
    libcxx/include/__concepts/derived_from.h
    libcxx/include/__concepts/destructible.h
    libcxx/include/__concepts/different_from.h
    libcxx/include/__concepts/equality_comparable.h
    libcxx/include/__concepts/invocable.h
    libcxx/include/__concepts/movable.h
    libcxx/include/__concepts/predicate.h
    libcxx/include/__concepts/regular.h
    libcxx/include/__concepts/relation.h
    libcxx/include/__concepts/same_as.h
    libcxx/include/__concepts/semiregular.h
    libcxx/include/__concepts/swappable.h
    libcxx/include/__concepts/totally_ordered.h
    libcxx/include/__config
    libcxx/include/__config_site.in
    libcxx/include/__coroutine/coroutine_handle.h
    libcxx/include/__coroutine/coroutine_traits.h
    libcxx/include/__coroutine/noop_coroutine_handle.h
    libcxx/include/__coroutine/trivial_awaitables.h
    libcxx/include/__debug
    libcxx/include/__debug_utils/randomize_range.h
    libcxx/include/__errc
    libcxx/include/__filesystem/copy_options.h
    libcxx/include/__filesystem/directory_entry.h
    libcxx/include/__filesystem/directory_iterator.h
    libcxx/include/__filesystem/directory_options.h
    libcxx/include/__filesystem/file_status.h
    libcxx/include/__filesystem/file_time_type.h
    libcxx/include/__filesystem/file_type.h
    libcxx/include/__filesystem/filesystem_error.h
    libcxx/include/__filesystem/operations.h
    libcxx/include/__filesystem/path.h
    libcxx/include/__filesystem/path_iterator.h
    libcxx/include/__filesystem/perm_options.h
    libcxx/include/__filesystem/perms.h
    libcxx/include/__filesystem/recursive_directory_iterator.h
    libcxx/include/__filesystem/space_info.h
    libcxx/include/__filesystem/u8path.h
    libcxx/include/__format/buffer.h
    libcxx/include/__format/concepts.h
    libcxx/include/__format/enable_insertable.h
    libcxx/include/__format/extended_grapheme_cluster_table.h
    libcxx/include/__format/format_arg.h
    libcxx/include/__format/format_arg_store.h
    libcxx/include/__format/format_args.h
    libcxx/include/__format/format_context.h
    libcxx/include/__format/format_error.h
    libcxx/include/__format/format_fwd.h
    libcxx/include/__format/format_parse_context.h
    libcxx/include/__format/format_string.h
    libcxx/include/__format/format_to_n_result.h
    libcxx/include/__format/formatter.h
    libcxx/include/__format/formatter_bool.h
    libcxx/include/__format/formatter_char.h
    libcxx/include/__format/formatter_floating_point.h
    libcxx/include/__format/formatter_integer.h
    libcxx/include/__format/formatter_integral.h
    libcxx/include/__format/formatter_output.h
    libcxx/include/__format/formatter_pointer.h
    libcxx/include/__format/formatter_string.h
    libcxx/include/__format/parser_std_format_spec.h
    libcxx/include/__format/unicode.h
    libcxx/include/__functional/binary_function.h
    libcxx/include/__functional/binary_negate.h
    libcxx/include/__functional/bind.h
    libcxx/include/__functional/bind_back.h
    libcxx/include/__functional/bind_front.h
    libcxx/include/__functional/binder1st.h
    libcxx/include/__functional/binder2nd.h
    libcxx/include/__functional/boyer_moore_searcher.h
    libcxx/include/__functional/compose.h
    libcxx/include/__functional/default_searcher.h
    libcxx/include/__functional/function.h
    libcxx/include/__functional/hash.h
    libcxx/include/__functional/identity.h
    libcxx/include/__functional/invoke.h
    libcxx/include/__functional/is_transparent.h
    libcxx/include/__functional/mem_fn.h
    libcxx/include/__functional/mem_fun_ref.h
    libcxx/include/__functional/not_fn.h
    libcxx/include/__functional/operations.h
    libcxx/include/__functional/perfect_forward.h
    libcxx/include/__functional/pointer_to_binary_function.h
    libcxx/include/__functional/pointer_to_unary_function.h
    libcxx/include/__functional/ranges_operations.h
    libcxx/include/__functional/reference_wrapper.h
    libcxx/include/__functional/unary_function.h
    libcxx/include/__functional/unary_negate.h
    libcxx/include/__functional/unwrap_ref.h
    libcxx/include/__functional/weak_result_type.h
    libcxx/include/__fwd/span.h
    libcxx/include/__fwd/string_view.h
    libcxx/include/__hash_table
    libcxx/include/__ios/fpos.h
    libcxx/include/__iterator/access.h
    libcxx/include/__iterator/advance.h
    libcxx/include/__iterator/back_insert_iterator.h
    libcxx/include/__iterator/bounded_iter.h
    libcxx/include/__iterator/common_iterator.h
    libcxx/include/__iterator/concepts.h
    libcxx/include/__iterator/counted_iterator.h
    libcxx/include/__iterator/data.h
    libcxx/include/__iterator/default_sentinel.h
    libcxx/include/__iterator/distance.h
    libcxx/include/__iterator/empty.h
    libcxx/include/__iterator/erase_if_container.h
    libcxx/include/__iterator/front_insert_iterator.h
    libcxx/include/__iterator/incrementable_traits.h
    libcxx/include/__iterator/indirectly_comparable.h
    libcxx/include/__iterator/insert_iterator.h
    libcxx/include/__iterator/istream_iterator.h
    libcxx/include/__iterator/istreambuf_iterator.h
    libcxx/include/__iterator/iter_move.h
    libcxx/include/__iterator/iter_swap.h
    libcxx/include/__iterator/iterator.h
    libcxx/include/__iterator/iterator_traits.h
    libcxx/include/__iterator/mergeable.h
    libcxx/include/__iterator/move_iterator.h
    libcxx/include/__iterator/move_sentinel.h
    libcxx/include/__iterator/next.h
    libcxx/include/__iterator/ostream_iterator.h
    libcxx/include/__iterator/ostreambuf_iterator.h
    libcxx/include/__iterator/permutable.h
    libcxx/include/__iterator/prev.h
    libcxx/include/__iterator/projected.h
    libcxx/include/__iterator/readable_traits.h
    libcxx/include/__iterator/reverse_access.h
    libcxx/include/__iterator/reverse_iterator.h
    libcxx/include/__iterator/size.h
    libcxx/include/__iterator/sortable.h
    libcxx/include/__iterator/unreachable_sentinel.h
    libcxx/include/__iterator/wrap_iter.h
    libcxx/include/__locale
    libcxx/include/__mbstate_t.h
    libcxx/include/__memory/addressof.h
    libcxx/include/__memory/allocate_at_least.h
    libcxx/include/__memory/allocation_guard.h
    libcxx/include/__memory/allocator.h
    libcxx/include/__memory/allocator_arg_t.h
    libcxx/include/__memory/allocator_traits.h
    libcxx/include/__memory/assume_aligned.h
    libcxx/include/__memory/auto_ptr.h
    libcxx/include/__memory/compressed_pair.h
    libcxx/include/__memory/concepts.h
    libcxx/include/__memory/construct_at.h
    libcxx/include/__memory/pointer_traits.h
    libcxx/include/__memory/ranges_construct_at.h
    libcxx/include/__memory/ranges_uninitialized_algorithms.h
    libcxx/include/__memory/raw_storage_iterator.h
    libcxx/include/__memory/shared_ptr.h
    libcxx/include/__memory/swap_allocator.h
    libcxx/include/__memory/temporary_buffer.h
    libcxx/include/__memory/uninitialized_algorithms.h
    libcxx/include/__memory/unique_ptr.h
    libcxx/include/__memory/uses_allocator.h
    libcxx/include/__memory/voidify.h
    libcxx/include/__mutex_base
    libcxx/include/__node_handle
    libcxx/include/__numeric/accumulate.h
    libcxx/include/__numeric/adjacent_difference.h
    libcxx/include/__numeric/exclusive_scan.h
    libcxx/include/__numeric/gcd_lcm.h
    libcxx/include/__numeric/inclusive_scan.h
    libcxx/include/__numeric/inner_product.h
    libcxx/include/__numeric/iota.h
    libcxx/include/__numeric/midpoint.h
    libcxx/include/__numeric/partial_sum.h
    libcxx/include/__numeric/reduce.h
    libcxx/include/__numeric/transform_exclusive_scan.h
    libcxx/include/__numeric/transform_inclusive_scan.h
    libcxx/include/__numeric/transform_reduce.h
    libcxx/include/__random/bernoulli_distribution.h
    libcxx/include/__random/binomial_distribution.h
    libcxx/include/__random/cauchy_distribution.h
    libcxx/include/__random/chi_squared_distribution.h
    libcxx/include/__random/clamp_to_integral.h
    libcxx/include/__random/default_random_engine.h
    libcxx/include/__random/discard_block_engine.h
    libcxx/include/__random/discrete_distribution.h
    libcxx/include/__random/exponential_distribution.h
    libcxx/include/__random/extreme_value_distribution.h
    libcxx/include/__random/fisher_f_distribution.h
    libcxx/include/__random/gamma_distribution.h
    libcxx/include/__random/generate_canonical.h
    libcxx/include/__random/geometric_distribution.h
    libcxx/include/__random/independent_bits_engine.h
    libcxx/include/__random/is_seed_sequence.h
    libcxx/include/__random/is_valid.h
    libcxx/include/__random/knuth_b.h
    libcxx/include/__random/linear_congruential_engine.h
    libcxx/include/__random/log2.h
    libcxx/include/__random/lognormal_distribution.h
    libcxx/include/__random/mersenne_twister_engine.h
    libcxx/include/__random/negative_binomial_distribution.h
    libcxx/include/__random/normal_distribution.h
    libcxx/include/__random/piecewise_constant_distribution.h
    libcxx/include/__random/piecewise_linear_distribution.h
    libcxx/include/__random/poisson_distribution.h
    libcxx/include/__random/random_device.h
    libcxx/include/__random/ranlux.h
    libcxx/include/__random/seed_seq.h
    libcxx/include/__random/shuffle_order_engine.h
    libcxx/include/__random/student_t_distribution.h
    libcxx/include/__random/subtract_with_carry_engine.h
    libcxx/include/__random/uniform_int_distribution.h
    libcxx/include/__random/uniform_random_bit_generator.h
    libcxx/include/__random/uniform_real_distribution.h
    libcxx/include/__random/weibull_distribution.h
    libcxx/include/__ranges/access.h
    libcxx/include/__ranges/all.h
    libcxx/include/__ranges/common_view.h
    libcxx/include/__ranges/concepts.h
    libcxx/include/__ranges/copyable_box.h
    libcxx/include/__ranges/counted.h
    libcxx/include/__ranges/dangling.h
    libcxx/include/__ranges/data.h
    libcxx/include/__ranges/drop_view.h
    libcxx/include/__ranges/empty.h
    libcxx/include/__ranges/empty_view.h
    libcxx/include/__ranges/enable_borrowed_range.h
    libcxx/include/__ranges/enable_view.h
    libcxx/include/__ranges/filter_view.h
    libcxx/include/__ranges/iota_view.h
    libcxx/include/__ranges/join_view.h
    libcxx/include/__ranges/lazy_split_view.h
    libcxx/include/__ranges/non_propagating_cache.h
    libcxx/include/__ranges/owning_view.h
    libcxx/include/__ranges/range_adaptor.h
    libcxx/include/__ranges/rbegin.h
    libcxx/include/__ranges/ref_view.h
    libcxx/include/__ranges/rend.h
    libcxx/include/__ranges/reverse_view.h
    libcxx/include/__ranges/single_view.h
    libcxx/include/__ranges/size.h
    libcxx/include/__ranges/subrange.h
    libcxx/include/__ranges/take_view.h
    libcxx/include/__ranges/transform_view.h
    libcxx/include/__ranges/view_interface.h
    libcxx/include/__ranges/views.h
    libcxx/include/__ranges/zip_view.h
    libcxx/include/__split_buffer
    libcxx/include/__std_stream
    libcxx/include/__string/char_traits.h
    libcxx/include/__string/extern_template_lists.h
    libcxx/include/__support/android/locale_bionic.h
    libcxx/include/__support/fuchsia/xlocale.h
    libcxx/include/__support/ibm/gettod_zos.h
    libcxx/include/__support/ibm/locale_mgmt_zos.h
    libcxx/include/__support/ibm/nanosleep.h
    libcxx/include/__support/ibm/xlocale.h
    libcxx/include/__support/musl/xlocale.h
    libcxx/include/__support/newlib/xlocale.h
    libcxx/include/__support/openbsd/xlocale.h
    libcxx/include/__support/solaris/xlocale.h
    libcxx/include/__support/win32/limits_msvc_win32.h
    libcxx/include/__support/win32/locale_win32.h
    libcxx/include/__support/xlocale/__nop_locale_mgmt.h
    libcxx/include/__support/xlocale/__posix_l_fallback.h
    libcxx/include/__support/xlocale/__strtonum_fallback.h
    libcxx/include/__thread/poll_with_backoff.h
    libcxx/include/__thread/timed_backoff_policy.h
    libcxx/include/__threading_support
    libcxx/include/__tree
    libcxx/include/__tuple
    libcxx/include/__type_traits/add_const.h
    libcxx/include/__type_traits/add_cv.h
    libcxx/include/__type_traits/add_lvalue_reference.h
    libcxx/include/__type_traits/add_pointer.h
    libcxx/include/__type_traits/add_rvalue_reference.h
    libcxx/include/__type_traits/add_volatile.h
    libcxx/include/__type_traits/aligned_storage.h
    libcxx/include/__type_traits/aligned_union.h
    libcxx/include/__type_traits/alignment_of.h
    libcxx/include/__type_traits/apply_cv.h
    libcxx/include/__type_traits/common_reference.h
    libcxx/include/__type_traits/common_type.h
    libcxx/include/__type_traits/conditional.h
    libcxx/include/__type_traits/conjunction.h
    libcxx/include/__type_traits/copy_cv.h
    libcxx/include/__type_traits/copy_cvref.h
    libcxx/include/__type_traits/decay.h
    libcxx/include/__type_traits/disjunction.h
    libcxx/include/__type_traits/enable_if.h
    libcxx/include/__type_traits/extent.h
    libcxx/include/__type_traits/has_unique_object_representation.h
    libcxx/include/__type_traits/has_virtual_destructor.h
    libcxx/include/__type_traits/integral_constant.h
    libcxx/include/__type_traits/is_abstract.h
    libcxx/include/__type_traits/is_aggregate.h
    libcxx/include/__type_traits/is_arithmetic.h
    libcxx/include/__type_traits/is_array.h
    libcxx/include/__type_traits/is_assignable.h
    libcxx/include/__type_traits/is_base_of.h
    libcxx/include/__type_traits/is_bounded_array.h
    libcxx/include/__type_traits/is_callable.h
    libcxx/include/__type_traits/is_class.h
    libcxx/include/__type_traits/is_compound.h
    libcxx/include/__type_traits/is_const.h
    libcxx/include/__type_traits/is_constant_evaluated.h
    libcxx/include/__type_traits/is_constructible.h
    libcxx/include/__type_traits/is_convertible.h
    libcxx/include/__type_traits/is_copy_assignable.h
    libcxx/include/__type_traits/is_copy_constructible.h
    libcxx/include/__type_traits/is_core_convertible.h
    libcxx/include/__type_traits/is_default_constructible.h
    libcxx/include/__type_traits/is_destructible.h
    libcxx/include/__type_traits/is_empty.h
    libcxx/include/__type_traits/is_enum.h
    libcxx/include/__type_traits/is_final.h
    libcxx/include/__type_traits/is_floating_point.h
    libcxx/include/__type_traits/is_function.h
    libcxx/include/__type_traits/is_fundamental.h
    libcxx/include/__type_traits/is_integral.h
    libcxx/include/__type_traits/is_literal_type.h
    libcxx/include/__type_traits/is_member_function_pointer.h
    libcxx/include/__type_traits/is_member_object_pointer.h
    libcxx/include/__type_traits/is_member_pointer.h
    libcxx/include/__type_traits/is_move_assignable.h
    libcxx/include/__type_traits/is_move_constructible.h
    libcxx/include/__type_traits/is_nothrow_assignable.h
    libcxx/include/__type_traits/is_nothrow_constructible.h
    libcxx/include/__type_traits/is_nothrow_convertible.h
    libcxx/include/__type_traits/is_nothrow_copy_assignable.h
    libcxx/include/__type_traits/is_nothrow_copy_constructible.h
    libcxx/include/__type_traits/is_nothrow_default_constructible.h
    libcxx/include/__type_traits/is_nothrow_destructible.h
    libcxx/include/__type_traits/is_nothrow_move_assignable.h
    libcxx/include/__type_traits/is_nothrow_move_constructible.h
    libcxx/include/__type_traits/is_null_pointer.h
    libcxx/include/__type_traits/is_object.h
    libcxx/include/__type_traits/is_pod.h
    libcxx/include/__type_traits/is_pointer.h
    libcxx/include/__type_traits/is_polymorphic.h
    libcxx/include/__type_traits/is_primary_template.h
    libcxx/include/__type_traits/is_reference.h
    libcxx/include/__type_traits/is_reference_wrapper.h
    libcxx/include/__type_traits/is_referenceable.h
    libcxx/include/__type_traits/is_same.h
    libcxx/include/__type_traits/is_scalar.h
    libcxx/include/__type_traits/is_scoped_enum.h
    libcxx/include/__type_traits/is_signed.h
    libcxx/include/__type_traits/is_signed_integer.h
    libcxx/include/__type_traits/is_standard_layout.h
    libcxx/include/__type_traits/is_trivial.h
    libcxx/include/__type_traits/is_trivially_assignable.h
    libcxx/include/__type_traits/is_trivially_constructible.h
    libcxx/include/__type_traits/is_trivially_copy_assignable.h
    libcxx/include/__type_traits/is_trivially_copy_constructible.h
    libcxx/include/__type_traits/is_trivially_copyable.h
    libcxx/include/__type_traits/is_trivially_default_constructible.h
    libcxx/include/__type_traits/is_trivially_destructible.h
    libcxx/include/__type_traits/is_trivially_move_assignable.h
    libcxx/include/__type_traits/is_trivially_move_constructible.h
    libcxx/include/__type_traits/is_unbounded_array.h
    libcxx/include/__type_traits/is_union.h
    libcxx/include/__type_traits/is_unsigned.h
    libcxx/include/__type_traits/is_unsigned_integer.h
    libcxx/include/__type_traits/is_valid_expansion.h
    libcxx/include/__type_traits/is_void.h
    libcxx/include/__type_traits/is_volatile.h
    libcxx/include/__type_traits/lazy.h
    libcxx/include/__type_traits/make_32_64_or_128_bit.h
    libcxx/include/__type_traits/make_signed.h
    libcxx/include/__type_traits/make_unsigned.h
    libcxx/include/__type_traits/nat.h
    libcxx/include/__type_traits/negation.h
    libcxx/include/__type_traits/promote.h
    libcxx/include/__type_traits/rank.h
    libcxx/include/__type_traits/remove_all_extents.h
    libcxx/include/__type_traits/remove_const.h
    libcxx/include/__type_traits/remove_cv.h
    libcxx/include/__type_traits/remove_cvref.h
    libcxx/include/__type_traits/remove_extent.h
    libcxx/include/__type_traits/remove_pointer.h
    libcxx/include/__type_traits/remove_reference.h
    libcxx/include/__type_traits/remove_volatile.h
    libcxx/include/__type_traits/type_identity.h
    libcxx/include/__type_traits/type_list.h
    libcxx/include/__type_traits/underlying_type.h
    libcxx/include/__type_traits/void_t.h
    libcxx/include/__utility/as_const.h
    libcxx/include/__utility/auto_cast.h
    libcxx/include/__utility/cmp.h
    libcxx/include/__utility/declval.h
    libcxx/include/__utility/exchange.h
    libcxx/include/__utility/forward.h
    libcxx/include/__utility/in_place.h
    libcxx/include/__utility/integer_sequence.h
    libcxx/include/__utility/move.h
    libcxx/include/__utility/pair.h
    libcxx/include/__utility/piecewise_construct.h
    libcxx/include/__utility/priority_tag.h
    libcxx/include/__utility/rel_ops.h
    libcxx/include/__utility/swap.h
    libcxx/include/__utility/to_underlying.h
    libcxx/include/__utility/transaction.h
    libcxx/include/__utility/unreachable.h
    libcxx/include/__variant/monostate.h
    libcxx/include/__verbose_abort
    libcxx/include/algorithm
    libcxx/include/any
    libcxx/include/array
    libcxx/include/atomic
    libcxx/include/barrier
    libcxx/include/bit
    libcxx/include/bitset
    libcxx/include/cassert
    libcxx/include/ccomplex
    libcxx/include/cctype
    libcxx/include/cerrno
    libcxx/include/cfenv
    libcxx/include/cfloat
    libcxx/include/charconv
    libcxx/include/chrono
    libcxx/include/cinttypes
    libcxx/include/ciso646
    libcxx/include/climits
    libcxx/include/clocale
    libcxx/include/cmath
    libcxx/include/codecvt
    libcxx/include/compare
    libcxx/include/complex
    libcxx/include/complex.h
    libcxx/include/concepts
    libcxx/include/condition_variable
    libcxx/include/coroutine
    libcxx/include/csetjmp
    libcxx/include/csignal
    libcxx/include/cstdarg
    libcxx/include/cstdbool
    libcxx/include/cstddef
    libcxx/include/cstdint
    libcxx/include/cstdio
    libcxx/include/cstdlib
    libcxx/include/cstring
    libcxx/include/ctgmath
    libcxx/include/ctime
    libcxx/include/ctype.h
    libcxx/include/cuchar
    libcxx/include/cwchar
    libcxx/include/cwctype
    libcxx/include/deque
    libcxx/include/errno.h
    libcxx/include/exception
    libcxx/include/execution
    libcxx/include/experimental/__config
    libcxx/include/experimental/__memory
    libcxx/include/experimental/algorithm
    libcxx/include/experimental/coroutine
    libcxx/include/experimental/deque
    libcxx/include/experimental/forward_list
    libcxx/include/experimental/functional
    libcxx/include/experimental/iterator
    libcxx/include/experimental/list
    libcxx/include/experimental/map
    libcxx/include/experimental/memory_resource
    libcxx/include/experimental/propagate_const
    libcxx/include/experimental/regex
    libcxx/include/experimental/set
    libcxx/include/experimental/simd
    libcxx/include/experimental/string
    libcxx/include/experimental/type_traits
    libcxx/include/experimental/unordered_map
    libcxx/include/experimental/unordered_set
    libcxx/include/experimental/utility
    libcxx/include/experimental/vector
    libcxx/include/ext/__hash
    libcxx/include/ext/hash_map
    libcxx/include/ext/hash_set
    libcxx/include/fenv.h
    libcxx/include/filesystem
    libcxx/include/float.h
    libcxx/include/format
    libcxx/include/forward_list
    libcxx/include/fstream
    libcxx/include/functional
    libcxx/include/future
    libcxx/include/initializer_list
    libcxx/include/inttypes.h
    libcxx/include/iomanip
    libcxx/include/ios
    libcxx/include/iosfwd
    libcxx/include/iostream
    libcxx/include/istream
    libcxx/include/iterator
    libcxx/include/latch
    libcxx/include/limits
    libcxx/include/limits.h
    libcxx/include/list
    libcxx/include/locale
    libcxx/include/locale.h
    libcxx/include/map
    libcxx/include/math.h
    libcxx/include/memory
    libcxx/include/mutex
    libcxx/include/new
    libcxx/include/numbers
    libcxx/include/numeric
    libcxx/include/optional
    libcxx/include/ostream
    libcxx/include/queue
    libcxx/include/random
    libcxx/include/ranges
    libcxx/include/ratio
    libcxx/include/regex
    libcxx/include/scoped_allocator
    libcxx/include/semaphore
    libcxx/include/set
    libcxx/include/setjmp.h
    libcxx/include/shared_mutex
    libcxx/include/span
    libcxx/include/sstream
    libcxx/include/stack
    libcxx/include/stdatomic.h
    libcxx/include/stdbool.h
    libcxx/include/stddef.h
    libcxx/include/stdexcept
    libcxx/include/stdint.h
    libcxx/include/stdio.h
    libcxx/include/stdlib.h
    libcxx/include/streambuf
    libcxx/include/string
    libcxx/include/string.h
    libcxx/include/string_view
    libcxx/include/strstream
    libcxx/include/system_error
    libcxx/include/tgmath.h
    libcxx/include/thread
    libcxx/include/tuple
    libcxx/include/type_traits
    libcxx/include/typeindex
    libcxx/include/typeinfo
    libcxx/include/uchar.h
    libcxx/include/unordered_map
    libcxx/include/unordered_set
    libcxx/include/utility
    libcxx/include/valarray
    libcxx/include/variant
    libcxx/include/vector
    libcxx/include/version
    libcxx/include/wchar.h
    libcxx/include/wctype.h
    libcxx/lib/abi/CHANGELOG.TXT
    libcxx/lib/abi/arm64-apple-darwin.libcxxabi.v1.stable.exceptions.nonew.abilist
    libcxx/lib/abi/powerpc-ibm-aix.libcxxabi.v1.stable.exceptions.nonew.abilist
    libcxx/lib/abi/powerpc64-ibm-aix.libcxxabi.v1.stable.exceptions.nonew.abilist
    libcxx/lib/abi/x86_64-apple-darwin.libcxxabi.v1.stable.exceptions.nonew.abilist
    libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.exceptions.nonew.abilist
    libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.noexceptions.nonew.abilist
    libcxx/src/CMakeLists.txt
    libcxx/src/algorithm.cpp
    libcxx/src/any.cpp
    libcxx/src/atomic.cpp
    libcxx/src/barrier.cpp
    libcxx/src/bind.cpp
    libcxx/src/charconv.cpp
    libcxx/src/chrono.cpp
    libcxx/src/chrono_system_time_init.h
    libcxx/src/condition_variable.cpp
    libcxx/src/condition_variable_destructor.cpp
    libcxx/src/debug.cpp
    libcxx/src/exception.cpp
    libcxx/src/experimental/memory_resource.cpp
    libcxx/src/experimental/memory_resource_init_helper.h
    libcxx/src/filesystem/directory_iterator.cpp
    libcxx/src/filesystem/filesystem_common.h
    libcxx/src/filesystem/int128_builtins.cpp
    libcxx/src/filesystem/operations.cpp
    libcxx/src/filesystem/posix_compat.h
    libcxx/src/format.cpp
    libcxx/src/functional.cpp
    libcxx/src/future.cpp
    libcxx/src/hash.cpp
    libcxx/src/include/apple_availability.h
    libcxx/src/include/atomic_support.h
    libcxx/src/include/config_elast.h
    libcxx/src/include/refstring.h
    libcxx/src/include/ryu/common.h
    libcxx/src/include/ryu/d2fixed.h
    libcxx/src/include/ryu/d2fixed_full_table.h
    libcxx/src/include/ryu/d2s.h
    libcxx/src/include/ryu/d2s_full_table.h
    libcxx/src/include/ryu/d2s_intrinsics.h
    libcxx/src/include/ryu/digit_table.h
    libcxx/src/include/ryu/f2s.h
    libcxx/src/include/ryu/ryu.h
    libcxx/src/include/sso_allocator.h
    libcxx/src/include/to_chars_floating_point.h
    libcxx/src/ios.cpp
    libcxx/src/ios.instantiations.cpp
    libcxx/src/iostream.cpp
    libcxx/src/iostream_init.h
    libcxx/src/legacy_debug_handler.cpp
    libcxx/src/legacy_pointer_safety.cpp
    libcxx/src/locale.cpp
    libcxx/src/memory.cpp
    libcxx/src/mutex.cpp
    libcxx/src/mutex_destructor.cpp
    libcxx/src/new.cpp
    libcxx/src/optional.cpp
    libcxx/src/random.cpp
    libcxx/src/random_shuffle.cpp
    libcxx/src/regex.cpp
    libcxx/src/ryu/d2fixed.cpp
    libcxx/src/ryu/d2s.cpp
    libcxx/src/ryu/f2s.cpp
    libcxx/src/shared_mutex.cpp
    libcxx/src/stdexcept.cpp
    libcxx/src/string.cpp
    libcxx/src/strstream.cpp
    libcxx/src/support/ibm/mbsnrtowcs.cpp
    libcxx/src/support/ibm/wcsnrtombs.cpp
    libcxx/src/support/ibm/xlocale_zos.cpp
    libcxx/src/support/runtime/exception_fallback.ipp
    libcxx/src/support/runtime/exception_libcxxabi.ipp
    libcxx/src/support/runtime/exception_msvc.ipp
    libcxx/src/support/runtime/exception_pointer_cxxabi.ipp
    libcxx/src/support/runtime/exception_pointer_glibcxx.ipp
    libcxx/src/support/runtime/exception_pointer_msvc.ipp
    libcxx/src/support/runtime/exception_pointer_unimplemented.ipp
    libcxx/src/support/runtime/new_handler_fallback.ipp
    libcxx/src/support/runtime/stdexcept_default.ipp
    libcxx/src/support/runtime/stdexcept_vcruntime.ipp
    libcxx/src/support/win32/locale_win32.cpp
    libcxx/src/support/win32/support.cpp
    libcxx/src/support/win32/thread_win32.cpp
    libcxx/src/system_error.cpp
    libcxx/src/thread.cpp
    libcxx/src/typeinfo.cpp
    libcxx/src/utility.cpp
    libcxx/src/valarray.cpp
    libcxx/src/vector.cpp
    libcxx/src/verbose_abort.cpp
    libcxx/test/libcxx/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.cxx1z.pass.cpp
    libcxx/test/libcxx/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.depr_in_cxx14.verify.cpp
    libcxx/test/libcxx/algorithms/alg.modifying.operations/copy.pass.cpp
    libcxx/test/libcxx/algorithms/alg.sorting/alg.heap.operations/make.heap/complexity.pass.cpp
    libcxx/test/libcxx/algorithms/alg.sorting/alg.heap.operations/sort.heap/complexity.pass.cpp
    libcxx/test/libcxx/algorithms/alg.sorting/assert.min.max.pass.cpp
    libcxx/test/libcxx/algorithms/debug_less.inconsistent.pass.cpp
    libcxx/test/libcxx/algorithms/debug_less.pass.cpp
    libcxx/test/libcxx/algorithms/nth_element_stability.pass.cpp
    libcxx/test/libcxx/algorithms/partial_sort_stability.pass.cpp
    libcxx/test/libcxx/algorithms/ranges_robust_against_copying_comparators.pass.cpp
    libcxx/test/libcxx/algorithms/ranges_robust_against_copying_projections.pass.cpp
    libcxx/test/libcxx/algorithms/sort_stability.pass.cpp
    libcxx/test/libcxx/algorithms/specialized.algorithms/special.mem.concepts/nothrow_forward_iterator.compile.pass.cpp
    libcxx/test/libcxx/algorithms/specialized.algorithms/special.mem.concepts/nothrow_forward_range.compile.pass.cpp
    libcxx/test/libcxx/algorithms/specialized.algorithms/special.mem.concepts/nothrow_input_iterator.compile.pass.cpp
    libcxx/test/libcxx/algorithms/specialized.algorithms/special.mem.concepts/nothrow_input_range.compile.pass.cpp
    libcxx/test/libcxx/algorithms/specialized.algorithms/special.mem.concepts/nothrow_sentinel_for.compile.pass.cpp
    libcxx/test/libcxx/algorithms/version.pass.cpp
    libcxx/test/libcxx/assertions/assertions_disabled.pass.cpp
    libcxx/test/libcxx/assertions/customize_verbose_abort.backdeployment.pass.cpp
    libcxx/test/libcxx/assertions/customize_verbose_abort.pass.cpp
    libcxx/test/libcxx/assertions/debug_mode_compatibility.pass.cpp
    libcxx/test/libcxx/assertions/default_verbose_abort.pass.cpp
    libcxx/test/libcxx/assertions/headers_declare_verbose_abort.sh.cpp
    libcxx/test/libcxx/assertions/single_expression.sh.cpp
    libcxx/test/libcxx/atomics/version.pass.cpp
    libcxx/test/libcxx/clang_tidy.sh.cpp
    libcxx/test/libcxx/containers/associative/map/version.pass.cpp
    libcxx/test/libcxx/containers/associative/set/version.pass.cpp
    libcxx/test/libcxx/containers/container.adaptors/queue/version.pass.cpp
    libcxx/test/libcxx/containers/container.adaptors/stack/version.pass.cpp
    libcxx/test/libcxx/containers/sequences/array/array.zero/assert.back.pass.cpp
    libcxx/test/libcxx/containers/sequences/array/array.zero/assert.front.pass.cpp
    libcxx/test/libcxx/containers/sequences/array/array.zero/assert.subscript.pass.cpp
    libcxx/test/libcxx/containers/sequences/array/version.pass.cpp
    libcxx/test/libcxx/containers/sequences/deque/assert.pop_back.empty.pass.cpp
    libcxx/test/libcxx/containers/sequences/deque/incomplete.pass.cpp
    libcxx/test/libcxx/containers/sequences/deque/version.pass.cpp
    libcxx/test/libcxx/containers/sequences/forwardlist/version.pass.cpp
    libcxx/test/libcxx/containers/sequences/list/list.cons/debug.copy.pass.cpp
    libcxx/test/libcxx/containers/sequences/list/list.modifiers/assert.erase_iter.end.pass.cpp
    libcxx/test/libcxx/containers/sequences/list/list.modifiers/assert.pop_back.empty.pass.cpp
    libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.emplace.pass.cpp
    libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.erase.iter.pass.cpp
    libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.erase.iter_iter.pass.cpp
    libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.insert.iter_iter_iter.pass.cpp
    libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.insert.iter_rvalue.pass.cpp
    libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.insert.iter_size_value.pass.cpp
    libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.insert.iter_value.pass.cpp
    libcxx/test/libcxx/containers/sequences/list/list.ops/debug.splice.pos_list.pass.cpp
    libcxx/test/libcxx/containers/sequences/list/list.ops/debug.splice.pos_list_iter.pass.cpp
    libcxx/test/libcxx/containers/sequences/list/list.ops/debug.splice.pos_list_iter_iter.pass.cpp
    libcxx/test/libcxx/containers/sequences/list/version.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/assert.back.empty.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/assert.cback.empty.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/assert.cfront.empty.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/assert.cindex.oob.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/assert.front.empty.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/assert.index.oob.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/assert.pop_back.empty.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/debug.iterator.add.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/debug.iterator.compare.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/debug.iterator.decrement.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/debug.iterator.dereference.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/debug.iterator.increment.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/debug.iterator.index.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/debug.iterator.subtract.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/version.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.map/assert.bucket.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.map/assert.bucket_size.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.map/assert.max_load_factor.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.map/debug.insert.hint_const_lvalue.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.map/debug.insert.hint_rvalue.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.map/debug.iterator.dereference.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.map/debug.iterator.increment.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.map/debug.local_iterator.dereference.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.map/debug.local_iterator.increment.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.map/debug.swap.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/debug.erase.iter.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/debug.erase.iter_iter.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.map/version.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multimap/assert.bucket.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multimap/assert.bucket_size.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multimap/assert.max_load_factor.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multimap/debug.insert.hint_const_lvalue.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multimap/debug.insert.hint_rvalue.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multimap/debug.iterator.dereference.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multimap/debug.iterator.increment.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multimap/debug.local_iterator.dereference.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multimap/debug.local_iterator.increment.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multimap/debug.swap.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/debug.erase.iter.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/debug.erase.iter_iter.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multiset/assert.bucket.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multiset/assert.bucket_size.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multiset/assert.max_load_factor.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multiset/debug.erase.iter.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multiset/debug.erase.iter_iter.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multiset/debug.insert.hint_const_lvalue.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multiset/debug.iterator.dereference.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multiset/debug.iterator.increment.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multiset/debug.local_iterator.dereference.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multiset/debug.local_iterator.increment.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multiset/debug.swap.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.set/assert.bucket.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.set/assert.bucket_size.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.set/assert.max_load_factor.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.set/debug.erase.iter.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.set/debug.erase.iter_iter.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.set/debug.insert.hint_const_lvalue.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.set/debug.iterator.dereference.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.set/debug.iterator.increment.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.set/debug.local_iterator.dereference.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.set/debug.local_iterator.increment.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.set/debug.swap.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.set/version.pass.cpp
    libcxx/test/libcxx/containers/views/views.span/debug.iterator-indexing.pass.cpp
    libcxx/test/libcxx/containers/views/views.span/span.cons/assert.iter_sent.pass.cpp
    libcxx/test/libcxx/containers/views/views.span/span.cons/assert.iter_size.pass.cpp
    libcxx/test/libcxx/containers/views/views.span/span.cons/assert.other_span.pass.cpp
    libcxx/test/libcxx/containers/views/views.span/span.cons/assert.range.pass.cpp
    libcxx/test/libcxx/containers/views/views.span/span.cons/range.pass.cpp
    libcxx/test/libcxx/containers/views/views.span/span.cons/range.verify.cpp
    libcxx/test/libcxx/containers/views/views.span/span.elem/assert.back.pass.cpp
    libcxx/test/libcxx/containers/views/views.span/span.elem/assert.front.pass.cpp
    libcxx/test/libcxx/containers/views/views.span/span.elem/assert.op_idx.pass.cpp
    libcxx/test/libcxx/containers/views/views.span/span.sub/assert.first.pass.cpp
    libcxx/test/libcxx/containers/views/views.span/span.sub/assert.last.pass.cpp
    libcxx/test/libcxx/containers/views/views.span/span.sub/assert.subspan.pass.cpp
    libcxx/test/libcxx/debug/containers.multithread.pass.cpp
    libcxx/test/libcxx/debug/containers/associative_containers.pass.cpp
    libcxx/test/libcxx/debug/containers/sequence_container_iterators.pass.cpp
    libcxx/test/libcxx/debug/containers/string.pass.cpp
    libcxx/test/libcxx/debug/containers/unord_containers.pass.cpp
    libcxx/test/libcxx/debug/debug.assertions-enabled.compile.pass.cpp
    libcxx/test/libcxx/debug/debug.catch-legacy-macro.verify.cpp
    libcxx/test/libcxx/debug/extern-templates.sh.cpp
    libcxx/test/libcxx/depr/depr.auto.ptr/auto.ptr/auto_ptr.cxx1z.pass.cpp
    libcxx/test/libcxx/depr/depr.auto.ptr/auto.ptr/auto_ptr.depr_in_cxx11.verify.cpp
    libcxx/test/libcxx/depr/depr.c.headers/ciso646.pass.cpp
    libcxx/test/libcxx/depr/depr.c.headers/complex.h.pass.cpp
    libcxx/test/libcxx/depr/depr.c.headers/extern_c.pass.cpp
    libcxx/test/libcxx/depr/depr.c.headers/fenv.pass.cpp
    libcxx/test/libcxx/depr/depr.c.headers/locale_h.pass.cpp
    libcxx/test/libcxx/depr/depr.c.headers/no_fgetpos_fsetpos.verify.cpp
    libcxx/test/libcxx/depr/depr.c.headers/tgmath_h.pass.cpp
    libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/address.cxx2a.pass.cpp
    libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/address.depr_in_cxx17.verify.cpp
    libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/allocate.cxx2a.pass.cpp
    libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/allocate.cxx2a.verify.cpp
    libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/allocate.depr_in_cxx17.verify.cpp
    libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/construct.cxx2a.pass.cpp
    libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/max_size.cxx2a.pass.cpp
    libcxx/test/libcxx/depr/depr.default.allocator/allocator_types.cxx2a.pass.cpp
    libcxx/test/libcxx/depr/depr.func.adaptor.typedefs/typedefs.depr_in_cxx17.verify.cpp
    libcxx/test/libcxx/depr/depr.function.objects/adaptors.depr_in_cxx11.verify.cpp
    libcxx/test/libcxx/depr/depr.function.objects/depr.adaptors.cxx1z.pass.cpp
    libcxx/test/libcxx/depr/depr.str.strstreams/version.pass.cpp
    libcxx/test/libcxx/depr/enable_removed_cpp17_features.pass.cpp
    libcxx/test/libcxx/depr/exception.unexpected/get_unexpected.pass.cpp
    libcxx/test/libcxx/depr/exception.unexpected/set_unexpected.pass.cpp
    libcxx/test/libcxx/depr/exception.unexpected/unexpected.pass.cpp
    libcxx/test/libcxx/diagnostics/assertions/version_cassert.pass.cpp
    libcxx/test/libcxx/diagnostics/enable_nodiscard.verify.cpp
    libcxx/test/libcxx/diagnostics/enable_nodiscard_disable_after_cxx17.verify.cpp
    libcxx/test/libcxx/diagnostics/enable_nodiscard_disable_nodiscard_ext.verify.cpp
    libcxx/test/libcxx/diagnostics/errno/version_cerrno.pass.cpp
    libcxx/test/libcxx/diagnostics/nodiscard.pass.cpp
    libcxx/test/libcxx/diagnostics/nodiscard_aftercxx17.pass.cpp
    libcxx/test/libcxx/diagnostics/nodiscard_aftercxx17.verify.cpp
    libcxx/test/libcxx/diagnostics/nodiscard_extensions.pass.cpp
    libcxx/test/libcxx/diagnostics/nodiscard_extensions.verify.cpp
    libcxx/test/libcxx/diagnostics/std.exceptions/version.pass.cpp
    libcxx/test/libcxx/diagnostics/syserr/version.pass.cpp
    libcxx/test/libcxx/double_include.sh.cpp
    libcxx/test/libcxx/experimental/algorithms/header.algorithm.synop/includes.pass.cpp
    libcxx/test/libcxx/experimental/algorithms/version.pass.cpp
    libcxx/test/libcxx/experimental/fexperimental-library.compile.pass.cpp
    libcxx/test/libcxx/experimental/language.support/support.coroutines/version.pass.cpp
    libcxx/test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/assert.deallocate.pass.cpp
    libcxx/test/libcxx/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/assert.deallocate.pass.cpp
    libcxx/test/libcxx/experimental/memory/memory.resource.aliases/header_deque_libcpp_version.pass.cpp
    libcxx/test/libcxx/experimental/memory/memory.resource.aliases/header_forward_list_libcpp_version.pass.cpp
    libcxx/test/libcxx/experimental/memory/memory.resource.aliases/header_list_libcpp_version.pass.cpp
    libcxx/test/libcxx/experimental/memory/memory.resource.aliases/header_map_libcpp_version.pass.cpp
    libcxx/test/libcxx/experimental/memory/memory.resource.aliases/header_regex_libcpp_version.pass.cpp
    libcxx/test/libcxx/experimental/memory/memory.resource.aliases/header_set_libcpp_version.pass.cpp
    libcxx/test/libcxx/experimental/memory/memory.resource.aliases/header_string_libcpp_version.pass.cpp
    libcxx/test/libcxx/experimental/memory/memory.resource.aliases/header_unordered_map_libcpp_version.pass.cpp
    libcxx/test/libcxx/experimental/memory/memory.resource.aliases/header_unordered_set_libcpp_version.pass.cpp
    libcxx/test/libcxx/experimental/memory/memory.resource.aliases/header_vector_libcpp_version.pass.cpp
    libcxx/test/libcxx/experimental/memory/memory.resource.synop/version.pass.cpp
    libcxx/test/libcxx/fuzzing/fuzz.h
    libcxx/test/libcxx/include_as_c.sh.cpp
    libcxx/test/libcxx/inclusions/algorithm.inclusions.compile.pass.cpp
    libcxx/test/libcxx/inclusions/array.inclusions.compile.pass.cpp
    libcxx/test/libcxx/inclusions/bitset.inclusions.compile.pass.cpp
    libcxx/test/libcxx/inclusions/chrono.inclusions.compile.pass.cpp
    libcxx/test/libcxx/inclusions/cinttypes.inclusions.compile.pass.cpp
    libcxx/test/libcxx/inclusions/complex.h.inclusions.compile.pass.cpp
    libcxx/test/libcxx/inclusions/coroutine.inclusions.compile.pass.cpp
    libcxx/test/libcxx/inclusions/deque.inclusions.compile.pass.cpp
    libcxx/test/libcxx/inclusions/filesystem.inclusions.compile.pass.cpp
    libcxx/test/libcxx/inclusions/forward_list.inclusions.compile.pass.cpp
    libcxx/test/libcxx/inclusions/ios.inclusions.compile.pass.cpp
    libcxx/test/libcxx/inclusions/iostream.inclusions.compile.pass.cpp
    libcxx/test/libcxx/inclusions/iterator.inclusions.compile.pass.cpp
    libcxx/test/libcxx/inclusions/list.inclusions.compile.pass.cpp
    libcxx/test/libcxx/inclusions/map.inclusions.compile.pass.cpp
    libcxx/test/libcxx/inclusions/memory.inclusions.compile.pass.cpp
    libcxx/test/libcxx/inclusions/optional.inclusions.compile.pass.cpp
    libcxx/test/libcxx/inclusions/queue.inclusions.compile.pass.cpp
    libcxx/test/libcxx/inclusions/random.inclusions.compile.pass.cpp
    libcxx/test/libcxx/inclusions/ranges.inclusions.compile.pass.cpp
    libcxx/test/libcxx/inclusions/regex.inclusions.compile.pass.cpp
    libcxx/test/libcxx/inclusions/set.inclusions.compile.pass.cpp
    libcxx/test/libcxx/inclusions/stack.inclusions.compile.pass.cpp
    libcxx/test/libcxx/inclusions/string.inclusions.compile.pass.cpp
    libcxx/test/libcxx/inclusions/string_view.inclusions.compile.pass.cpp
    libcxx/test/libcxx/inclusions/system_error.inclusions.compile.pass.cpp
    libcxx/test/libcxx/inclusions/tgmath.h.inclusions.compile.pass.cpp
    libcxx/test/libcxx/inclusions/thread.inclusions.compile.pass.cpp
    libcxx/test/libcxx/inclusions/tuple.inclusions.compile.pass.cpp
    libcxx/test/libcxx/inclusions/typeindex.inclusions.compile.pass.cpp
    libcxx/test/libcxx/inclusions/unordered_map.inclusions.compile.pass.cpp
    libcxx/test/libcxx/inclusions/unordered_set.inclusions.compile.pass.cpp
    libcxx/test/libcxx/inclusions/utility.inclusions.compile.pass.cpp
    libcxx/test/libcxx/inclusions/valarray.inclusions.compile.pass.cpp
    libcxx/test/libcxx/inclusions/variant.inclusions.compile.pass.cpp
    libcxx/test/libcxx/inclusions/vector.inclusions.compile.pass.cpp
    libcxx/test/libcxx/input.output/file.streams/c.files/version_ccstdio.pass.cpp
    libcxx/test/libcxx/input.output/file.streams/c.files/version_cinttypes.pass.cpp
    libcxx/test/libcxx/input.output/file.streams/fstreams/fstream.cons/wchar_pointer.pass.cpp
    libcxx/test/libcxx/input.output/file.streams/fstreams/fstream.members/open_wchar_pointer.pass.cpp
    libcxx/test/libcxx/input.output/file.streams/fstreams/ifstream.cons/wchar_pointer.pass.cpp
    libcxx/test/libcxx/input.output/file.streams/fstreams/ifstream.members/open_wchar_pointer.pass.cpp
    libcxx/test/libcxx/input.output/file.streams/fstreams/ofstream.cons/wchar_pointer.pass.cpp
    libcxx/test/libcxx/input.output/file.streams/fstreams/ofstream.members/open_wchar_pointer.pass.cpp
    libcxx/test/libcxx/input.output/file.streams/fstreams/version.pass.cpp
    libcxx/test/libcxx/input.output/filesystems/class.path/path.itr/assert.iterator.pass.cpp
    libcxx/test/libcxx/input.output/filesystems/version.pass.cpp
    libcxx/test/libcxx/input.output/iostream.format/input.streams/version.pass.cpp
    libcxx/test/libcxx/input.output/iostream.format/output.streams/version.pass.cpp
    libcxx/test/libcxx/input.output/iostream.format/std.manip/version.pass.cpp
    libcxx/test/libcxx/input.output/iostream.forward/version.pass.cpp
    libcxx/test/libcxx/input.output/iostream.objects/version.pass.cpp
    libcxx/test/libcxx/input.output/iostreams.base/version.pass.cpp
    libcxx/test/libcxx/input.output/stream.buffers/version.pass.cpp
    libcxx/test/libcxx/input.output/string.streams/version.pass.cpp
    libcxx/test/libcxx/iterators/assert.advance.pass.cpp
    libcxx/test/libcxx/iterators/assert.next.pass.cpp
    libcxx/test/libcxx/iterators/assert.prev.pass.cpp
    libcxx/test/libcxx/iterators/bounded_iter/dereference.pass.cpp
    libcxx/test/libcxx/iterators/iterator.requirements/iterator.assoc.types/iterator.traits/legacy_bidirectional_iterator.compile.pass.cpp
    libcxx/test/libcxx/iterators/iterator.requirements/iterator.assoc.types/iterator.traits/legacy_forward_iterator.compile.pass.cpp
    libcxx/test/libcxx/iterators/iterator.requirements/iterator.assoc.types/iterator.traits/legacy_input_iterator.compile.pass.cpp
    libcxx/test/libcxx/iterators/iterator.requirements/iterator.assoc.types/iterator.traits/legacy_iterator.compile.pass.cpp
    libcxx/test/libcxx/iterators/iterator.requirements/iterator.assoc.types/iterator.traits/legacy_random_access_iterator.compile.pass.cpp
    libcxx/test/libcxx/iterators/unwrap_iter.pass.cpp
    libcxx/test/libcxx/iterators/version.pass.cpp
    libcxx/test/libcxx/language.support/cmp/version.pass.cpp
    libcxx/test/libcxx/language.support/cstdint/version.pass.cpp
    libcxx/test/libcxx/language.support/support.dynamic/libcpp_deallocate.sh.cpp
    libcxx/test/libcxx/language.support/support.dynamic/version.pass.cpp
    libcxx/test/libcxx/language.support/support.exception/version.pass.cpp
    libcxx/test/libcxx/language.support/support.initlist/version.pass.cpp
    libcxx/test/libcxx/language.support/support.limits/c.limits/version_cfloat.pass.cpp
    libcxx/test/libcxx/language.support/support.limits/c.limits/version_climits.pass.cpp
    libcxx/test/libcxx/language.support/support.limits/limits/version.pass.cpp
    libcxx/test/libcxx/language.support/support.limits/version.pass.cpp
    libcxx/test/libcxx/language.support/support.rtti/type.info/type_info.comparison.apple.compile.pass.cpp
    libcxx/test/libcxx/language.support/support.rtti/type.info/type_info.comparison.merged.sh.cpp
    libcxx/test/libcxx/language.support/support.rtti/type.info/type_info.comparison.unmerged.sh.cpp
    libcxx/test/libcxx/language.support/support.rtti/version.pass.cpp
    libcxx/test/libcxx/language.support/support.runtime/version_csetjmp.pass.cpp
    libcxx/test/libcxx/language.support/support.runtime/version_csignal.pass.cpp
    libcxx/test/libcxx/language.support/support.runtime/version_cstdarg.pass.cpp
    libcxx/test/libcxx/language.support/support.runtime/version_cstdbool.pass.cpp
    libcxx/test/libcxx/language.support/support.runtime/version_cstdlib.pass.cpp
    libcxx/test/libcxx/language.support/support.runtime/version_ctime.pass.cpp
    libcxx/test/libcxx/language.support/support.types/version.pass.cpp
    libcxx/test/libcxx/libcpp_alignof.pass.cpp
    libcxx/test/libcxx/libcpp_freestanding.sh.cpp
    libcxx/test/libcxx/localization/c.locales/version.pass.cpp
    libcxx/test/libcxx/localization/locale.stdcvt/version.pass.cpp
    libcxx/test/libcxx/localization/locales/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp
    libcxx/test/libcxx/localization/version.pass.cpp
    libcxx/test/libcxx/memory/aligned_allocation_macro.compile.pass.cpp
    libcxx/test/libcxx/memory/trivial_abi/shared_ptr_arg.pass.cpp
    libcxx/test/libcxx/memory/trivial_abi/unique_ptr_arg.pass.cpp
    libcxx/test/libcxx/memory/trivial_abi/unique_ptr_array.pass.cpp
    libcxx/test/libcxx/memory/trivial_abi/unique_ptr_destruction_order.pass.cpp
    libcxx/test/libcxx/memory/trivial_abi/unique_ptr_ret.pass.cpp
    libcxx/test/libcxx/memory/trivial_abi/weak_ptr_ret.pass.cpp
    libcxx/test/libcxx/min_max_macros.compile.pass.cpp
    libcxx/test/libcxx/modules_include.sh.cpp
    libcxx/test/libcxx/nasty_macros.compile.pass.cpp
    libcxx/test/libcxx/no_assert_include.compile.pass.cpp
    libcxx/test/libcxx/numerics/c.math/constexpr-fns.pass.cpp
    libcxx/test/libcxx/numerics/c.math/ctgmath.pass.cpp
    libcxx/test/libcxx/numerics/c.math/tgmath_h.pass.cpp
    libcxx/test/libcxx/numerics/c.math/version_cmath.pass.cpp
    libcxx/test/libcxx/numerics/cfenv/version.pass.cpp
    libcxx/test/libcxx/numerics/complex.number/ccmplx/ccomplex.pass.cpp
    libcxx/test/libcxx/numerics/complex.number/version.pass.cpp
    libcxx/test/libcxx/numerics/numarray/version.pass.cpp
    libcxx/test/libcxx/numerics/numeric.ops/version.pass.cpp
    libcxx/test/libcxx/numerics/rand/rand.synopsis/version.pass.cpp
    libcxx/test/libcxx/ranges/has-no-incomplete-ranges.compile.pass.cpp
    libcxx/test/libcxx/ranges/range.adaptors/range.all/all.nodiscard.verify.cpp
    libcxx/test/libcxx/ranges/range.adaptors/range.common.view/adaptor.nodiscard.verify.cpp
    libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/arrow.pass.cpp
    libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/assign.copy.pass.cpp
    libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/assign.move.pass.cpp
    libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/ctor.default.pass.cpp
    libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/ctor.in_place.pass.cpp
    libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/deref.pass.cpp
    libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/has_value.pass.cpp
    libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/no_unique_address.pass.cpp
    libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/properties.compile.pass.cpp
    libcxx/test/libcxx/ranges/range.adaptors/range.counted/adaptor.nodiscard.verify.cpp
    libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/no_unique_address.compile.pass.cpp
    libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/range.lazy.split.inner/assert.equal.pass.cpp
    libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/range.lazy.split.outer/assert.equal.pass.cpp
    libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/types.h
    libcxx/test/libcxx/ranges/range.adaptors/range.reverse/adaptor.nodiscard.verify.cpp
    libcxx/test/libcxx/ranges/range.adaptors/range.transform/adaptor.nodiscard.verify.cpp
    libcxx/test/libcxx/ranges/range.nonprop.cache/assign.copy.pass.cpp
    libcxx/test/libcxx/ranges/range.nonprop.cache/assign.move.pass.cpp
    libcxx/test/libcxx/ranges/range.nonprop.cache/constraints.compile.pass.cpp
    libcxx/test/libcxx/ranges/range.nonprop.cache/ctor.copy.pass.cpp
    libcxx/test/libcxx/ranges/range.nonprop.cache/ctor.default.pass.cpp
    libcxx/test/libcxx/ranges/range.nonprop.cache/ctor.move.pass.cpp
    libcxx/test/libcxx/ranges/range.nonprop.cache/deref.pass.cpp
    libcxx/test/libcxx/ranges/range.nonprop.cache/emplace.pass.cpp
    libcxx/test/libcxx/ranges/range.nonprop.cache/emplace_from.pass.cpp
    libcxx/test/libcxx/ranges/range.nonprop.cache/has_value.pass.cpp
    libcxx/test/libcxx/ranges/range.utility.helpers/simple_view.compile.pass.cpp
    libcxx/test/libcxx/ranges/version.compile.pass.cpp
    libcxx/test/libcxx/selftest/test_macros.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.access/assert.back.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.access/assert.cback.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.access/assert.cfront.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.access/assert.cindex.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.access/assert.front.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.access/assert.index.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.capacity/PR53170.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.capacity/max_size.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.cons/copy_shrunk_long.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.add.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.compare.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.decrement.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.dereference.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.increment.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.index.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.subtract.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.modifiers/assert.erase_iter.null.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.modifiers/assert.pop_back.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.erase.iter.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.erase.iter_iter.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.insert.iter_char.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.insert.iter_iter_iter.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.insert.iter_size_char.pass.cpp
    libcxx/test/libcxx/strings/c.strings/version_cctype.pass.cpp
    libcxx/test/libcxx/strings/c.strings/version_cstring.pass.cpp
    libcxx/test/libcxx/strings/c.strings/version_cuchar.pass.cpp
    libcxx/test/libcxx/strings/c.strings/version_cwchar.pass.cpp
    libcxx/test/libcxx/strings/c.strings/version_cwctype.pass.cpp
    libcxx/test/libcxx/strings/string.view/assert.ctor.pointer.pass.cpp
    libcxx/test/libcxx/strings/version.pass.cpp
    libcxx/test/libcxx/thread/futures/futures.promise/assert.set_exception.pass.cpp
    libcxx/test/libcxx/thread/futures/futures.promise/assert.set_exception_at_thread_exit.pass.cpp
    libcxx/test/libcxx/thread/futures/version.pass.cpp
    libcxx/test/libcxx/thread/thread.barrier/version.compile.pass.cpp
    libcxx/test/libcxx/thread/thread.condition/PR30202_notify_from_pthread_created_thread.pass.cpp
    libcxx/test/libcxx/thread/thread.condition/thread.condition.condvar/native_handle.pass.cpp
    libcxx/test/libcxx/thread/thread.condition/version.pass.cpp
    libcxx/test/libcxx/thread/thread.latch/version.compile.pass.cpp
    libcxx/test/libcxx/thread/thread.lock/thread.lock.guard/nodiscard.verify.cpp
    libcxx/test/libcxx/thread/thread.mutex/thread.mutex.requirements/thread.mutex.requirements.mutex/thread.mutex.class/native_handle.pass.cpp
    libcxx/test/libcxx/thread/thread.mutex/thread.mutex.requirements/thread.mutex.requirements.mutex/thread.mutex.recursive/native_handle.pass.cpp
    libcxx/test/libcxx/thread/thread.mutex/thread_safety_annotations_not_enabled.pass.cpp
    libcxx/test/libcxx/thread/thread.mutex/thread_safety_lock_guard.pass.cpp
    libcxx/test/libcxx/thread/thread.mutex/thread_safety_lock_unlock.pass.cpp
    libcxx/test/libcxx/thread/thread.mutex/thread_safety_missing_unlock.fail.cpp
    libcxx/test/libcxx/thread/thread.mutex/thread_safety_requires_capability.pass.cpp
    libcxx/test/libcxx/thread/thread.mutex/version.pass.cpp
    libcxx/test/libcxx/thread/thread.semaphore/version.compile.pass.cpp
    libcxx/test/libcxx/thread/thread.threads/thread.thread.class/thread.thread.member/native_handle.pass.cpp
    libcxx/test/libcxx/thread/thread.threads/thread.thread.class/types.pass.cpp
    libcxx/test/libcxx/thread/thread.threads/version.pass.cpp
    libcxx/test/libcxx/time/version.pass.cpp
    libcxx/test/libcxx/transitive_includes.sh.cpp
    libcxx/test/libcxx/type_traits/is_constant_evaluated.pass.cpp
    libcxx/test/libcxx/utilities/any/version.pass.cpp
    libcxx/test/libcxx/utilities/format/enable_insertable.compile.pass.cpp
    libcxx/test/libcxx/utilities/format/format.arguments/format.arg/arg_t.compile.pass.cpp
    libcxx/test/libcxx/utilities/format/format.arguments/format.arg/visit_format_arg.pass.cpp
    libcxx/test/libcxx/utilities/format/format.arguments/format.args/get.pass.cpp
    libcxx/test/libcxx/utilities/format/format.formatter/format.context/types.compile.pass.cpp
    libcxx/test/libcxx/utilities/format/format.formatter/format.formatter.spec/formattable.compile.pass.cpp
    libcxx/test/libcxx/utilities/format/format.string/format.string.std/extended_grapheme_cluster.pass.cpp
    libcxx/test/libcxx/utilities/format/format.string/format.string.std/test_exception.h
    libcxx/test/libcxx/utilities/format/version.compile.pass.cpp
    libcxx/test/libcxx/utilities/function.objects/func.wrap/depr_in_cxx03.verify.cpp
    libcxx/test/libcxx/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/move_reentrant.pass.cpp
    libcxx/test/libcxx/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/nullptr_t_assign_reentrant.pass.cpp
    libcxx/test/libcxx/utilities/function.objects/refwrap/binary.pass.cpp
    libcxx/test/libcxx/utilities/function.objects/refwrap/unary.pass.cpp
    libcxx/test/libcxx/utilities/function.objects/version.pass.cpp
    libcxx/test/libcxx/utilities/memory/default.allocator/allocator_types.void.cxx20_allocator_void_no_members.verify.cpp
    libcxx/test/libcxx/utilities/memory/default.allocator/allocator_types.void.cxx20_with_removed_members.compile.pass.cpp
    libcxx/test/libcxx/utilities/memory/version.pass.cpp
    libcxx/test/libcxx/utilities/meta/version.pass.cpp
    libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/assert.dereference.pass.cpp
    libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/assert.op_arrow.pass.cpp
    libcxx/test/libcxx/utilities/optional/version.pass.cpp
    libcxx/test/libcxx/utilities/ratio/version.pass.cpp
    libcxx/test/libcxx/utilities/template.bitset/includes.pass.cpp
    libcxx/test/libcxx/utilities/template.bitset/version.pass.cpp
    libcxx/test/libcxx/utilities/tuple/version.pass.cpp
    libcxx/test/libcxx/utilities/type.index/version.pass.cpp
    libcxx/test/libcxx/utilities/utility/pairs/pairs.pair/non_trivial_copy_move_ABI.pass.cpp
    libcxx/test/libcxx/utilities/utility/version.pass.cpp
    libcxx/test/libcxx/utilities/variant/variant.variant/variant_size.pass.cpp
    libcxx/test/libcxx/utilities/variant/version.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/ranges.copy.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/ranges.copy_backward.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/ranges.copy_if.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/ranges.copy_n.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.fill/ranges.fill.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.fill/ranges.fill_n.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.generate/ranges_generate.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.generate/ranges_generate_n.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.move/ranges.move.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.move/ranges.move_backward.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_partition.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_partition_copy.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_partition_point.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_stable_partition.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.random.sample/ranges_sample.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.random.sample/sample.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle_rand.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle_urng.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/ranges_shuffle.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.remove/ranges.remove.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.remove/ranges.remove_if.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.remove/ranges_remove_copy.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.remove/ranges_remove_copy_if.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.replace/ranges.replace.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.replace/ranges.replace_if.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.replace/ranges_replace_copy.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.replace/ranges_replace_copy_if.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.reverse/ranges.reverse.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.reverse/ranges.reverse_copy.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.rotate/ranges.rotate_copy.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.rotate/ranges_rotate.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.swap/ranges.swap_ranges.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.transform/ranges.transform.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.unique/ranges_unique.pass.cpp
    libcxx/test/std/algorithms/alg.modifying.operations/alg.unique/ranges_unique_copy.pass.cpp
    libcxx/test/std/algorithms/alg.nonmodifying/alg.adjacent.find/ranges.adjacent_find.pass.cpp
    libcxx/test/std/algorithms/alg.nonmodifying/alg.all_of/ranges.all_of.pass.cpp
    libcxx/test/std/algorithms/alg.nonmodifying/alg.any_of/ranges.any_of.pass.cpp
    libcxx/test/std/algorithms/alg.nonmodifying/alg.count/ranges.count.pass.cpp
    libcxx/test/std/algorithms/alg.nonmodifying/alg.count/ranges.count_if.pass.cpp
    libcxx/test/std/algorithms/alg.nonmodifying/alg.equal/ranges.equal.pass.cpp
    libcxx/test/std/algorithms/alg.nonmodifying/alg.find.end/ranges.find_end.pass.cpp
    libcxx/test/std/algorithms/alg.nonmodifying/alg.find.first.of/ranges.find_first_of.pass.cpp
    libcxx/test/std/algorithms/alg.nonmodifying/alg.find/ranges.find.pass.cpp
    libcxx/test/std/algorithms/alg.nonmodifying/alg.find/ranges.find_if.pass.cpp
    libcxx/test/std/algorithms/alg.nonmodifying/alg.find/ranges.find_if_not.pass.cpp
    libcxx/test/std/algorithms/alg.nonmodifying/alg.foreach/ranges.for_each.pass.cpp
    libcxx/test/std/algorithms/alg.nonmodifying/alg.foreach/ranges.for_each_n.pass.cpp
    libcxx/test/std/algorithms/alg.nonmodifying/alg.is_permutation/ranges.is_permutation.pass.cpp
    libcxx/test/std/algorithms/alg.nonmodifying/alg.none_of/ranges.none_of.pass.cpp
    libcxx/test/std/algorithms/alg.nonmodifying/alg.search/ranges.search.pass.cpp
    libcxx/test/std/algorithms/alg.nonmodifying/alg.search/ranges.search_n.pass.cpp
    libcxx/test/std/algorithms/alg.nonmodifying/mismatch/ranges_mismatch.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.binary.search/binary.search/ranges.binary_search.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.binary.search/equal.range/ranges_equal_range.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/ranges.lower_bound.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/ranges.upper_bound.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.clamp/assert.ranges_clamp.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.clamp/ranges.clamp.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/ranges_is_heap.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/ranges_is_heap_until.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/make.heap/ranges_make_heap.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/assert.pop_heap.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/assert.ranges_pop_heap.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/ranges_pop_heap.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/push.heap/ranges_push_heap.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/ranges_sort_heap.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.lex.comparison/ranges.lexicographical_compare.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.merge/inplace_merge_comp.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.merge/ranges_inplace_merge.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.merge/ranges_merge.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.min.max/ranges.max.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.min.max/ranges.max_element.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.min.max/ranges.min.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.min.max/ranges.min_element.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.min.max/ranges.minmax.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.min.max/ranges.minmax_element.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.nth.element/ranges_nth_element.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.partitions/ranges.is_partitioned.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.permutation.generators/ranges.next_permutation.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.permutation.generators/ranges.prev_permutation.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.set.operations/includes/ranges_includes.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.set.operations/set.difference/ranges_set_difference.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.set.operations/set.intersection/ranges_set_intersection.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.set.operations/set.symmetric.difference/ranges_set_symmetric_difference.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.set.operations/set.union/ranges_set_union.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.sort/is.sorted/ranges.is_sorted.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.sort/is.sorted/ranges.is_sorted_until.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.sort/partial.sort.copy/ranges_partial_sort_copy.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.sort/partial.sort/ranges_partial_sort.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/ranges.sort.pass.cpp
    libcxx/test/std/algorithms/alg.sorting/alg.sort/stable.sort/ranges.stable.sort.pass.cpp
    libcxx/test/std/algorithms/algorithms.results/in_found_result.pass.cpp
    libcxx/test/std/algorithms/algorithms.results/in_fun_result.pass.cpp
    libcxx/test/std/algorithms/algorithms.results/in_in_out_result.pass.cpp
    libcxx/test/std/algorithms/algorithms.results/in_in_result.pass.cpp
    libcxx/test/std/algorithms/algorithms.results/in_out_out_result.pass.cpp
    libcxx/test/std/algorithms/algorithms.results/in_out_result.pass.cpp
    libcxx/test/std/algorithms/algorithms.results/min_max_result.pass.cpp
    libcxx/test/std/algorithms/algorithms.results/no_unique_address.compile.pass.cpp
    libcxx/test/std/algorithms/ranges_result_alias_declarations.compile.pass.cpp
    libcxx/test/std/algorithms/ranges_robust_against_dangling.pass.cpp
    libcxx/test/std/algorithms/ranges_robust_against_differing_projections.pass.cpp
    libcxx/test/std/algorithms/ranges_robust_against_nonbool_predicates.pass.cpp
    libcxx/test/std/algorithms/ranges_robust_against_omitting_invoke.pass.cpp
    libcxx/test/std/algorithms/ranges_robust_against_proxy_iterators.pass.cpp
    libcxx/test/std/atomics/atomics.flag/atomic_flag_test_explicit.pass.cpp
    libcxx/test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp
    libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_init.pass.cpp
    libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_var_init.pass.cpp
    libcxx/test/std/atomics/stdatomic.h.syn/types.compile.pass.cpp
    libcxx/test/std/concepts/concepts.lang/concept.default.init/default_initializable.compile.pass.cpp
    libcxx/test/std/concepts/concepts.lang/concept.default.init/default_initializable.verify.cpp
    libcxx/test/std/containers/associative/map/map.access/max_size.pass.cpp
    libcxx/test/std/containers/associative/map/map.cons/assign_initializer_list.pass.cpp
    libcxx/test/std/containers/associative/map/map.cons/copy_assign.pass.cpp
    libcxx/test/std/containers/associative/map/map.cons/default_noexcept.pass.cpp
    libcxx/test/std/containers/associative/map/map.cons/dtor_noexcept.pass.cpp
    libcxx/test/std/containers/associative/map/map.cons/move_alloc.pass.cpp
    libcxx/test/std/containers/associative/map/map.cons/move_assign.pass.cpp
    libcxx/test/std/containers/associative/map/map.cons/move_assign_noexcept.pass.cpp
    libcxx/test/std/containers/associative/map/map.cons/move_noexcept.pass.cpp
    libcxx/test/std/containers/associative/map/map.special/swap_noexcept.pass.cpp
    libcxx/test/std/containers/associative/map/range_concept_conformance.compile.pass.cpp
    libcxx/test/std/containers/associative/multimap/max_size.pass.cpp
    libcxx/test/std/containers/associative/multimap/multimap.cons/default_noexcept.pass.cpp
    libcxx/test/std/containers/associative/multimap/multimap.cons/dtor_noexcept.pass.cpp
    libcxx/test/std/containers/associative/multimap/multimap.cons/move_alloc.pass.cpp
    libcxx/test/std/containers/associative/multimap/multimap.cons/move_assign.pass.cpp
    libcxx/test/std/containers/associative/multimap/multimap.cons/move_assign_noexcept.pass.cpp
    libcxx/test/std/containers/associative/multimap/multimap.cons/move_noexcept.pass.cpp
    libcxx/test/std/containers/associative/multimap/multimap.special/swap_noexcept.pass.cpp
    libcxx/test/std/containers/associative/multimap/range_concept_conformance.compile.pass.cpp
    libcxx/test/std/containers/associative/multiset/max_size.pass.cpp
    libcxx/test/std/containers/associative/multiset/multiset.cons/default_noexcept.pass.cpp
    libcxx/test/std/containers/associative/multiset/multiset.cons/dtor_noexcept.pass.cpp
    libcxx/test/std/containers/associative/multiset/multiset.cons/move_alloc.pass.cpp
    libcxx/test/std/containers/associative/multiset/multiset.cons/move_assign.pass.cpp
    libcxx/test/std/containers/associative/multiset/multiset.cons/move_assign_noexcept.pass.cpp
    libcxx/test/std/containers/associative/multiset/multiset.cons/move_noexcept.pass.cpp
    libcxx/test/std/containers/associative/multiset/multiset.special/swap_noexcept.pass.cpp
    libcxx/test/std/containers/associative/multiset/range_concept_conformance.compile.pass.cpp
    libcxx/test/std/containers/associative/set/max_size.pass.cpp
    libcxx/test/std/containers/associative/set/range_concept_conformance.compile.pass.cpp
    libcxx/test/std/containers/associative/set/set.cons/assign_initializer_list.pass.cpp
    libcxx/test/std/containers/associative/set/set.cons/default_noexcept.pass.cpp
    libcxx/test/std/containers/associative/set/set.cons/dtor_noexcept.pass.cpp
    libcxx/test/std/containers/associative/set/set.cons/move_alloc.pass.cpp
    libcxx/test/std/containers/associative/set/set.cons/move_assign.pass.cpp
    libcxx/test/std/containers/associative/set/set.cons/move_assign_noexcept.pass.cpp
    libcxx/test/std/containers/associative/set/set.cons/move_noexcept.pass.cpp
    libcxx/test/std/containers/associative/set/set.special/swap_noexcept.pass.cpp
    libcxx/test/std/containers/container.adaptors/priority.queue/priqueue.cons/deduct.pass.cpp
    libcxx/test/std/containers/container.adaptors/priority.queue/priqueue.cons/default_noexcept.pass.cpp
    libcxx/test/std/containers/container.adaptors/queue/queue.cons/default_noexcept.pass.cpp
    libcxx/test/std/containers/container.adaptors/queue/queue.cons/move_noexcept.pass.cpp
    libcxx/test/std/containers/container.adaptors/stack/stack.cons/default_noexcept.pass.cpp
    libcxx/test/std/containers/container.adaptors/stack/stack.cons/move_noexcept.pass.cpp
    libcxx/test/std/containers/container.requirements/container.requirements.general/allocator_move.pass.cpp
    libcxx/test/std/containers/sequences/array/front_back.pass.cpp
    libcxx/test/std/containers/sequences/array/front_back_const.pass.cpp
    libcxx/test/std/containers/sequences/array/indexing.pass.cpp
    libcxx/test/std/containers/sequences/array/indexing_const.pass.cpp
    libcxx/test/std/containers/sequences/array/range_concept_conformance.compile.pass.cpp
    libcxx/test/std/containers/sequences/array/types.pass.cpp
    libcxx/test/std/containers/sequences/deque/deque.capacity/access.pass.cpp
    libcxx/test/std/containers/sequences/deque/deque.capacity/max_size.pass.cpp
    libcxx/test/std/containers/sequences/deque/deque.cons/default_noexcept.pass.cpp
    libcxx/test/std/containers/sequences/deque/deque.cons/dtor_noexcept.pass.cpp
    libcxx/test/std/containers/sequences/deque/deque.cons/move_alloc.pass.cpp
    libcxx/test/std/containers/sequences/deque/deque.cons/move_assign_noexcept.pass.cpp
    libcxx/test/std/containers/sequences/deque/deque.cons/move_noexcept.pass.cpp
    libcxx/test/std/containers/sequences/deque/deque.cons/size.pass.cpp
    libcxx/test/std/containers/sequences/deque/deque.cons/size_value.pass.cpp
    libcxx/test/std/containers/sequences/deque/deque.special/swap_noexcept.pass.cpp
    libcxx/test/std/containers/sequences/deque/range_concept_conformance.compile.pass.cpp
    libcxx/test/std/containers/sequences/deque/types.pass.cpp
    libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/default_noexcept.pass.cpp
    libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/dtor_noexcept.pass.cpp
    libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/move_assign_noexcept.pass.cpp
    libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/move_noexcept.pass.cpp
    libcxx/test/std/containers/sequences/forwardlist/forwardlist.spec/swap_noexcept.pass.cpp
    libcxx/test/std/containers/sequences/forwardlist/max_size.pass.cpp
    libcxx/test/std/containers/sequences/forwardlist/range_concept_conformance.compile.pass.cpp
    libcxx/test/std/containers/sequences/list/list.capacity/max_size.pass.cpp
    libcxx/test/std/containers/sequences/list/list.cons/default_noexcept.pass.cpp
    libcxx/test/std/containers/sequences/list/list.cons/dtor_noexcept.pass.cpp
    libcxx/test/std/containers/sequences/list/list.cons/move_assign_noexcept.pass.cpp
    libcxx/test/std/containers/sequences/list/list.cons/move_noexcept.pass.cpp
    libcxx/test/std/containers/sequences/list/list.special/swap_noexcept.pass.cpp
    libcxx/test/std/containers/sequences/list/range_concept_conformance.compile.pass.cpp
    libcxx/test/std/containers/sequences/list/types.pass.cpp
    libcxx/test/std/containers/sequences/vector.bool/assign_move.pass.cpp
    libcxx/test/std/containers/sequences/vector.bool/const_reference.pass.cpp
    libcxx/test/std/containers/sequences/vector.bool/construct_default.pass.cpp
    libcxx/test/std/containers/sequences/vector.bool/construct_iter_iter.pass.cpp
    libcxx/test/std/containers/sequences/vector.bool/construct_iter_iter_alloc.pass.cpp
    libcxx/test/std/containers/sequences/vector.bool/construct_size.pass.cpp
    libcxx/test/std/containers/sequences/vector.bool/construct_size_value.pass.cpp
    libcxx/test/std/containers/sequences/vector.bool/construct_size_value_alloc.pass.cpp
    libcxx/test/std/containers/sequences/vector.bool/copy.pass.cpp
    libcxx/test/std/containers/sequences/vector.bool/copy_alloc.pass.cpp
    libcxx/test/std/containers/sequences/vector.bool/default_noexcept.pass.cpp
    libcxx/test/std/containers/sequences/vector.bool/dtor_noexcept.pass.cpp
    libcxx/test/std/containers/sequences/vector.bool/iterators.pass.cpp
    libcxx/test/std/containers/sequences/vector.bool/move_assign_noexcept.pass.cpp
    libcxx/test/std/containers/sequences/vector.bool/move_noexcept.pass.cpp
    libcxx/test/std/containers/sequences/vector.bool/range_concept_conformance.compile.pass.cpp
    libcxx/test/std/containers/sequences/vector.bool/reference/triviality.compile.pass.cpp
    libcxx/test/std/containers/sequences/vector.bool/swap_noexcept.pass.cpp
    libcxx/test/std/containers/sequences/vector.bool/types.pass.cpp
    libcxx/test/std/containers/sequences/vector/constant_initialization.pass.cpp
    libcxx/test/std/containers/sequences/vector/range_concept_conformance.compile.pass.cpp
    libcxx/test/std/containers/sequences/vector/types.pass.cpp
    libcxx/test/std/containers/sequences/vector/vector.capacity/max_size.pass.cpp
    libcxx/test/std/containers/sequences/vector/vector.capacity/shrink_to_fit.pass.cpp
    libcxx/test/std/containers/sequences/vector/vector.cons/construct_default.pass.cpp
    libcxx/test/std/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp
    libcxx/test/std/containers/sequences/vector/vector.cons/construct_iter_iter_alloc.pass.cpp
    libcxx/test/std/containers/sequences/vector/vector.cons/construct_size.pass.cpp
    libcxx/test/std/containers/sequences/vector/vector.cons/construct_size_value.pass.cpp
    libcxx/test/std/containers/sequences/vector/vector.cons/construct_size_value_alloc.pass.cpp
    libcxx/test/std/containers/sequences/vector/vector.cons/copy.pass.cpp
    libcxx/test/std/containers/sequences/vector/vector.cons/copy_alloc.pass.cpp
    libcxx/test/std/containers/sequences/vector/vector.cons/dtor_noexcept.pass.cpp
    libcxx/test/std/containers/sequences/vector/vector.modifiers/clear.pass.cpp
    libcxx/test/std/containers/sequences/vector/vector.special/swap_noexcept.compile.pass.cpp
    libcxx/test/std/containers/unord/unord.map/bucket.pass.cpp
    libcxx/test/std/containers/unord/unord.map/bucket_count.pass.cpp
    libcxx/test/std/containers/unord/unord.map/bucket_size.pass.cpp
    libcxx/test/std/containers/unord/unord.map/iterator_concept_conformance.compile.pass.cpp
    libcxx/test/std/containers/unord/unord.map/max_size.pass.cpp
    libcxx/test/std/containers/unord/unord.map/range_concept_conformance.compile.pass.cpp
    libcxx/test/std/containers/unord/unord.map/rehash.pass.cpp
    libcxx/test/std/containers/unord/unord.map/reserve.pass.cpp
    libcxx/test/std/containers/unord/unord.map/swap_member.pass.cpp
    libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/allocator.pass.cpp
    libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/assign_copy.pass.cpp
    libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/assign_move.pass.cpp
    libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/copy.pass.cpp
    libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/copy_alloc.pass.cpp
    libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/default.pass.cpp
    libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/default_noexcept.pass.cpp
    libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/dtor_noexcept.pass.cpp
    libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/init_size.pass.cpp
    libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/init_size_allocator.pass.cpp
    libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/init_size_hash.pass.cpp
    libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/init_size_hash_allocator.pass.cpp
    libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/init_size_hash_equal.pass.cpp
    libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/init_size_hash_equal_allocator.pass.cpp
    libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/iter_iter_size.pass.cpp
    libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/iter_iter_size_allocator.pass.cpp
    libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/iter_iter_size_hash.pass.cpp
    libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/iter_iter_size_hash_allocator.pass.cpp
    libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/iter_iter_size_hash_equal.pass.cpp
    libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/iter_iter_size_hash_equal_allocator.pass.cpp
    libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/move.pass.cpp
    libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/move_alloc.pass.cpp
    libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/move_assign_noexcept.pass.cpp
    libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/move_noexcept.pass.cpp
    libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/size.compile.fail.cpp
    libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/size.pass.cpp
    libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/size_allocator.pass.cpp
    libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/size_hash.pass.cpp
    libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/size_hash_allocator.pass.cpp
    libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/size_hash_equal.pass.cpp
    libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/size_hash_equal_allocator.pass.cpp
    libcxx/test/std/containers/unord/unord.map/unord.map.swap/swap_noexcept.pass.cpp
    libcxx/test/std/containers/unord/unord.map/unord.map.swap/swap_non_member.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/bucket.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/bucket_count.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/bucket_size.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/iterator_concept_conformance.compile.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/iterators.compile.fail.cpp
    libcxx/test/std/containers/unord/unord.multimap/local_iterators.compile.fail.cpp
    libcxx/test/std/containers/unord/unord.multimap/max_size.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/range_concept_conformance.compile.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/rehash.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/reserve.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/swap_member.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/allocator.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/assign_copy.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/assign_move.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/copy.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/copy_alloc.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/default.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/default_noexcept.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/dtor_noexcept.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_allocator.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_hash.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_hash_allocator.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_hash_equal.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_hash_equal_allocator.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/iter_iter_size.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/iter_iter_size_allocator.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/iter_iter_size_hash.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/iter_iter_size_hash_allocator.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/iter_iter_size_hash_equal.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/iter_iter_size_hash_equal_allocator.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move_alloc.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move_assign_noexcept.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move_noexcept.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/size.compile.fail.cpp
    libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/size.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/size_allocator.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/size_hash.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/size_hash_allocator.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/size_hash_equal.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/size_hash_equal_allocator.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/emplace_hint.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/unord.multimap.swap/swap_noexcept.pass.cpp
    libcxx/test/std/containers/unord/unord.multimap/unord.multimap.swap/swap_non_member.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/bucket.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/bucket_count.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/bucket_size.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/iterator_concept_conformance.compile.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/iterators.compile.fail.cpp
    libcxx/test/std/containers/unord/unord.multiset/local_iterators.compile.fail.cpp
    libcxx/test/std/containers/unord/unord.multiset/max_size.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/range_concept_conformance.compile.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/rehash.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/reserve.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/swap_member.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/allocator.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/assign_copy.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/assign_move.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/copy.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/copy_alloc.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/default.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/default_noexcept.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/dtor_noexcept.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_allocator.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash_allocator.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash_equal.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash_equal_allocator.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/iter_iter_size.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/iter_iter_size_allocator.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/iter_iter_size_hash.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/iter_iter_size_hash_allocator.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/iter_iter_size_hash_equal.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/iter_iter_size_hash_equal_allocator.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move_alloc.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move_assign_noexcept.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move_noexcept.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/size.compile.fail.cpp
    libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/size.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/size_allocator.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/size_hash.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/size_hash_allocator.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/size_hash_equal.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/size_hash_equal_allocator.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/unord.multiset.swap/swap_noexcept.pass.cpp
    libcxx/test/std/containers/unord/unord.multiset/unord.multiset.swap/swap_non_member.pass.cpp
    libcxx/test/std/containers/unord/unord.set/bucket.pass.cpp
    libcxx/test/std/containers/unord/unord.set/bucket_count.pass.cpp
    libcxx/test/std/containers/unord/unord.set/bucket_size.pass.cpp
    libcxx/test/std/containers/unord/unord.set/iterator_concept_conformance.compile.pass.cpp
    libcxx/test/std/containers/unord/unord.set/max_size.pass.cpp
    libcxx/test/std/containers/unord/unord.set/range_concept_conformance.compile.pass.cpp
    libcxx/test/std/containers/unord/unord.set/rehash.pass.cpp
    libcxx/test/std/containers/unord/unord.set/reserve.pass.cpp
    libcxx/test/std/containers/unord/unord.set/swap_member.pass.cpp
    libcxx/test/std/containers/unord/unord.set/unord.set.cnstr/allocator.pass.cpp
    libcxx/test/std/containers/unord/unord.set/unord.set.cnstr/assign_copy.pass.cpp
    libcxx/test/std/containers/unord/unord.set/unord.set.cnstr/assign_move.pass.cpp
    libcxx/test/std/containers/unord/unord.set/unord.set.cnstr/copy.pass.cpp
    libcxx/test/std/containers/unord/unord.set/unord.set.cnstr/copy_alloc.pass.cpp
    libcxx/test/std/containers/unord/unord.set/unord.set.cnstr/default.pass.cpp
    libcxx/test/std/containers/unord/unord.set/unord.set.cnstr/default_noexcept.pass.cpp
    libcxx/test/std/containers/unord/unord.set/unord.set.cnstr/dtor_noexcept.pass.cpp
    libcxx/test/std/containers/unord/unord.set/unord.set.cnstr/init_size.pass.cpp
    libcxx/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_allocator.pass.cpp
    libcxx/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash.pass.cpp
    libcxx/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash_allocator.pass.cpp
    libcxx/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash_equal.pass.cpp
    libcxx/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash_equal_allocator.pass.cpp
    libcxx/test/std/containers/unord/unord.set/unord.set.cnstr/iter_iter_size.pass.cpp
    libcxx/test/std/containers/unord/unord.set/unord.set.cnstr/iter_iter_size_allocator.pass.cpp
    libcxx/test/std/containers/unord/unord.set/unord.set.cnstr/iter_iter_size_hash.pass.cpp
    libcxx/test/std/containers/unord/unord.set/unord.set.cnstr/iter_iter_size_hash_allocator.pass.cpp
    libcxx/test/std/containers/unord/unord.set/unord.set.cnstr/iter_iter_size_hash_equal.pass.cpp
    libcxx/test/std/containers/unord/unord.set/unord.set.cnstr/iter_iter_size_hash_equal_allocator.pass.cpp
    libcxx/test/std/containers/unord/unord.set/unord.set.cnstr/move.pass.cpp
    libcxx/test/std/containers/unord/unord.set/unord.set.cnstr/move_assign_noexcept.pass.cpp
    libcxx/test/std/containers/unord/unord.set/unord.set.cnstr/move_noexcept.pass.cpp
    libcxx/test/std/containers/unord/unord.set/unord.set.cnstr/size.compile.fail.cpp
    libcxx/test/std/containers/unord/unord.set/unord.set.cnstr/size.pass.cpp
    libcxx/test/std/containers/unord/unord.set/unord.set.cnstr/size_allocator.pass.cpp
    libcxx/test/std/containers/unord/unord.set/unord.set.cnstr/size_hash.pass.cpp
    libcxx/test/std/containers/unord/unord.set/unord.set.cnstr/size_hash_allocator.pass.cpp
    libcxx/test/std/containers/unord/unord.set/unord.set.cnstr/size_hash_equal.pass.cpp
    libcxx/test/std/containers/unord/unord.set/unord.set.cnstr/size_hash_equal_allocator.pass.cpp
    libcxx/test/std/containers/unord/unord.set/unord.set.swap/swap_noexcept.pass.cpp
    libcxx/test/std/containers/unord/unord.set/unord.set.swap/swap_non_member.pass.cpp
    libcxx/test/std/containers/views/views.span/range_concept_conformance.compile.pass.cpp
    libcxx/test/std/containers/views/views.span/span.cons/range.pass.cpp
    libcxx/test/std/containers/views/views.span/span.elem/back.pass.cpp
    libcxx/test/std/containers/views/views.span/span.elem/front.pass.cpp
    libcxx/test/std/containers/views/views.span/span.elem/op_idx.pass.cpp
    libcxx/test/std/containers/views/views.span/span.iterators/iterator_concept_conformance.compile.pass.cpp
    libcxx/test/std/containers/views/views.span/span.sub/first.pass.cpp
    libcxx/test/std/containers/views/views.span/span.sub/last.pass.cpp
    libcxx/test/std/containers/views/views.span/span.sub/subspan.pass.cpp
    libcxx/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/assignment.pass.cpp
    libcxx/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/convert.pass.cpp
    libcxx/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/convert_assignment.compile.fail.cpp
    libcxx/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/convert_assignment.pass.cpp
    libcxx/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/copy.compile.fail.cpp
    libcxx/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/copy.pass.cpp
    libcxx/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/explicit.compile.fail.cpp
    libcxx/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/pointer.pass.cpp
    libcxx/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.conv/assign_from_auto_ptr_ref.pass.cpp
    libcxx/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.conv/convert_from_auto_ptr_ref.pass.cpp
    libcxx/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.conv/convert_to_auto_ptr.pass.cpp
    libcxx/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.conv/convert_to_auto_ptr_ref.pass.cpp
    libcxx/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.members/arrow.pass.cpp
    libcxx/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.members/deref.pass.cpp
    libcxx/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.members/release.pass.cpp
    libcxx/test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.members/reset.pass.cpp
    libcxx/test/std/depr/depr.auto.ptr/auto.ptr/element_type.pass.cpp
    libcxx/test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/pointer_to_binary_function.cxx1z.compile.fail.cpp
    libcxx/test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/pointer_to_binary_function.pass.cpp
    libcxx/test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/pointer_to_unary_function.cxx1z.compile.fail.cpp
    libcxx/test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/pointer_to_unary_function.pass.cpp
    libcxx/test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/ptr_fun1.cxx1z.compile.fail.cpp
    libcxx/test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/ptr_fun1.pass.cpp
    libcxx/test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/ptr_fun2.cxx1z.compile.fail.cpp
    libcxx/test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/ptr_fun2.pass.cpp
    libcxx/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun.cxx1z.compile.fail.cpp
    libcxx/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun.pass.cpp
    libcxx/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1.cxx1z.compile.fail.cpp
    libcxx/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1.pass.cpp
    libcxx/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1_ref_t.cxx1z.compile.fail.cpp
    libcxx/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1_ref_t.pass.cpp
    libcxx/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1_t.cxx1z.compile.fail.cpp
    libcxx/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1_t.pass.cpp
    libcxx/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref.cxx1z.compile.fail.cpp
    libcxx/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref.pass.cpp
    libcxx/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref1.cxx1z.compile.fail.cpp
    libcxx/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref1.pass.cpp
    libcxx/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref_t.cxx1z.compile.fail.cpp
    libcxx/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref_t.pass.cpp
    libcxx/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_t.cxx1z.compile.fail.cpp
    libcxx/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_t.pass.cpp
    libcxx/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun.cxx1z.compile.fail.cpp
    libcxx/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun.pass.cpp
    libcxx/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1.cxx1z.compile.fail.cpp
    libcxx/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1.pass.cpp
    libcxx/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1_ref_t.cxx1z.compile.fail.cpp
    libcxx/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1_ref_t.pass.cpp
    libcxx/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1_t.cxx1z.compile.fail.cpp
    libcxx/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1_t.pass.cpp
    libcxx/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref.cxx1z.compile.fail.cpp
    libcxx/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref.pass.cpp
    libcxx/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref1.cxx1z.compile.fail.cpp
    libcxx/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref1.pass.cpp
    libcxx/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref_t.cxx1z.compile.fail.cpp
    libcxx/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref_t.pass.cpp
    libcxx/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_t.cxx1z.compile.fail.cpp
    libcxx/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_t.pass.cpp
    libcxx/test/std/depr/depr.function.objects/depr.base/binary_function.pass.cpp
    libcxx/test/std/depr/depr.function.objects/depr.base/unary_function.pass.cpp
    libcxx/test/std/depr/depr.lib.binders/depr.lib.bind.1st/bind1st.depr_in_cxx11.verify.cpp
    libcxx/test/std/depr/depr.lib.binders/depr.lib.bind.1st/bind1st.pass.cpp
    libcxx/test/std/depr/depr.lib.binders/depr.lib.bind.2nd/bind2nd.depr_in_cxx11.verify.cpp
    libcxx/test/std/depr/depr.lib.binders/depr.lib.bind.2nd/bind2nd.pass.cpp
    libcxx/test/std/depr/depr.lib.binders/depr.lib.binder.1st/binder1st.depr_in_cxx11.verify.cpp
    libcxx/test/std/depr/depr.lib.binders/depr.lib.binder.1st/binder1st.pass.cpp
    libcxx/test/std/depr/depr.lib.binders/depr.lib.binder.2nd/binder2nd.depr_in_cxx11.verify.cpp
    libcxx/test/std/depr/depr.lib.binders/depr.lib.binder.2nd/binder2nd.pass.cpp
    libcxx/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/default.pass.cpp
    libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/generic_category.pass.cpp
    libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/system_category.pass.cpp
    libcxx/test/std/diagnostics/syserr/syserr.hash/error_code.pass.cpp
    libcxx/test/std/diagnostics/syserr/syserr.hash/error_condition.pass.cpp
    libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/default.pass.cpp
    libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/hash.pass.cpp
    libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/hash.pred.pass.cpp
    libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/pred.pass.cpp
    libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/default.pass.cpp
    libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/hash.pass.cpp
    libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/hash.pred.pass.cpp
    libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/pred.pass.cpp
    libcxx/test/std/experimental/func/func.searchers/func.searchers.default/default.pass.cpp
    libcxx/test/std/experimental/func/func.searchers/func.searchers.default/default.pred.pass.cpp
    libcxx/test/std/experimental/func/func.searchers/func.searchers.default/func.searchers.default.creation/make_default_searcher.pass.cpp
    libcxx/test/std/experimental/func/func.searchers/func.searchers.default/func.searchers.default.creation/make_default_searcher.pred.pass.cpp
    libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.completion/done.pass.cpp
    libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.prom/promise.pass.cpp
    libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.resumption/destroy.pass.cpp
    libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.resumption/resume.pass.cpp
    libcxx/test/std/experimental/language.support/support.coroutines/coroutine.trivial.awaitables/suspend_always.pass.cpp
    libcxx/test/std/experimental/language.support/support.coroutines/coroutine.trivial.awaitables/suspend_never.pass.cpp
    libcxx/test/std/experimental/language.support/support.coroutines/end.to.end/oneshot_func.pass.cpp
    libcxx/test/std/experimental/simd/simd.abi/vector_extension.pass.cpp
    libcxx/test/std/experimental/utilities/utility/utility.synop/includes.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/filebuf.virtuals/pbackfail.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/filebuf.virtuals/seekoff.pass.cpp
    libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/path.pass.cpp
    libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/assign.pass.cpp
    libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/refresh.pass.cpp
    libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/replace_filename.pass.cpp
    libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/file_size.pass.cpp
    libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/hard_link_count.pass.cpp
    libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/last_write_time.pass.cpp
    libcxx/test/std/input.output/filesystems/class.directory_iterator/range_concept_conformance.compile.pass.cpp
    libcxx/test/std/input.output/filesystems/class.path/path.itr/iterator.pass.cpp
    libcxx/test/std/input.output/filesystems/class.path/path.member/path.append.pass.cpp
    libcxx/test/std/input.output/filesystems/class.path/path.member/path.assign/source.pass.cpp
    libcxx/test/std/input.output/filesystems/class.path/path.member/path.charconv.pass.cpp
    libcxx/test/std/input.output/filesystems/class.path/path.member/path.concat.pass.cpp
    libcxx/test/std/input.output/filesystems/class.path/path.nonmember/path.factory.pass.cpp
    libcxx/test/std/input.output/filesystems/class.path/range_concept_conformance.compile.pass.cpp
    libcxx/test/std/input.output/filesystems/class.rec.dir.itr/range_concept_conformance.compile.pass.cpp
    libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/recursion_pending.pass.cpp
    libcxx/test/std/input.output/filesystems/fs.enum/enum.copy_options.pass.cpp
    libcxx/test/std/input.output/filesystems/fs.enum/enum.directory_options.pass.cpp
    libcxx/test/std/input.output/filesystems/fs.enum/enum.file_type.pass.cpp
    libcxx/test/std/input.output/filesystems/fs.enum/enum.path.format.pass.cpp
    libcxx/test/std/input.output/filesystems/fs.enum/enum.perm_options.pass.cpp
    libcxx/test/std/input.output/filesystems/fs.enum/enum.perms.pass.cpp
    libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.absolute/absolute.pass.cpp
    libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.canonical/canonical.pass.cpp
    libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.permissions/permissions.pass.cpp
    libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp
    libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters/streambuf.pass.cpp
    libcxx/test/std/iterators/iterator.container/size.pass.cpp
    libcxx/test/std/iterators/iterator.container/ssize.pass.cpp
    libcxx/test/std/iterators/iterator.primitives/iterator.basic/iterator.pass.cpp
    libcxx/test/std/iterators/iterator.primitives/iterator.traits/cxx20_iterator_traits.compile.pass.cpp
    libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.advance/constraints.verify.cpp
    libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.advance/iterator_count.pass.cpp
    libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.advance/iterator_count_sentinel.pass.cpp
    libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.advance/iterator_sentinel.pass.cpp
    libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.distance/iterator_sentinel.pass.cpp
    libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.distance/lwg3664.pass.cpp
    libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.distance/range.pass.cpp
    libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.next/constraints.compile.pass.cpp
    libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.next/iterator.pass.cpp
    libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.next/iterator_count.pass.cpp
    libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.next/iterator_count_sentinel.pass.cpp
    libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.next/iterator_sentinel.pass.cpp
    libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.prev/constraints.compile.pass.cpp
    libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.prev/iterator.pass.cpp
    libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.prev/iterator_count.pass.cpp
    libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.prev/iterator_count_sentinel.pass.cpp
    libcxx/test/std/iterators/iterator.requirements/iterator.concepts/incrementable.h
    libcxx/test/std/iterators/iterator.requirements/iterator.cust/iterator.cust.move/iter_move.nodiscard.verify.cpp
    libcxx/test/std/iterators/iterator.requirements/iterator.cust/unqualified_lookup_wrapper.h
    libcxx/test/std/iterators/predef.iterators/counted.iterator/compare.pass.cpp
    libcxx/test/std/iterators/predef.iterators/insert.iterators/insert.iterator/cxx20_iter_member.pass.cpp
    libcxx/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.comp/op_spaceship.pass.cpp
    libcxx/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.const/default.pass.cpp
    libcxx/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.ref/op_arrow.pass.cpp
    libcxx/test/std/iterators/predef.iterators/move.iterators/move.iterator/iterator_concept_conformance.compile.pass.cpp
    libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/types.pass.cpp
    libcxx/test/std/language.support/cmp/cmp.alg/compare_strong_order_fallback.pass.cpp
    libcxx/test/std/language.support/cmp/cmp.alg/compare_weak_order_fallback.pass.cpp
    libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.capacity/operator_bool.pass.cpp
    libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.compare/equal_comp.pass.cpp
    libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.compare/less_comp.pass.cpp
    libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.completion/done.pass.cpp
    libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.con/assign.pass.cpp
    libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.con/construct.pass.cpp
    libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.export/address.pass.cpp
    libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.export/from_address.pass.cpp
    libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.hash/hash.pass.cpp
    libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.noop/noop_coroutine.pass.cpp
    libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.prom/promise.pass.cpp
    libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.resumption/destroy.pass.cpp
    libcxx/test/std/language.support/support.coroutines/coroutine.handle/coroutine.handle.resumption/resume.pass.cpp
    libcxx/test/std/language.support/support.coroutines/coroutine.handle/void_handle.pass.cpp
    libcxx/test/std/language.support/support.coroutines/coroutine.traits/promise_type.pass.cpp
    libcxx/test/std/language.support/support.coroutines/coroutine.trivial.awaitables/suspend_always.pass.cpp
    libcxx/test/std/language.support/support.coroutines/coroutine.trivial.awaitables/suspend_never.pass.cpp
    libcxx/test/std/language.support/support.coroutines/end.to.end/await_result.pass.cpp
    libcxx/test/std/language.support/support.coroutines/end.to.end/bool_await_suspend.pass.cpp
    libcxx/test/std/language.support/support.coroutines/end.to.end/expected.pass.cpp
    libcxx/test/std/language.support/support.coroutines/end.to.end/fullexpr-dtor.pass.cpp
    libcxx/test/std/language.support/support.coroutines/end.to.end/generator.pass.cpp
    libcxx/test/std/language.support/support.coroutines/end.to.end/go.pass.cpp
    libcxx/test/std/language.support/support.coroutines/end.to.end/multishot_func.pass.cpp
    libcxx/test/std/language.support/support.coroutines/end.to.end/oneshot_func.pass.cpp
    libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow_replace.pass.cpp
    libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_replace.pass.cpp
    libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_nothrow_replace.pass.cpp
    libcxx/test/std/language.support/support.exception/propagation/make_exception_ptr.pass.cpp
    libcxx/test/std/language.support/support.exception/propagation/rethrow_exception.pass.cpp
    libcxx/test/std/language.support/support.limits/support.limits.general/algorithm.version.compile.pass.cpp
    libcxx/test/std/language.support/support.limits/support.limits.general/atomic.version.compile.pass.cpp
    libcxx/test/std/language.support/support.limits/support.limits.general/barrier.version.compile.pass.cpp
    libcxx/test/std/language.support/support.limits/support.limits.general/bit.version.compile.pass.cpp
    libcxx/test/std/language.support/support.limits/support.limits.general/charconv.version.compile.pass.cpp
    libcxx/test/std/language.support/support.limits/support.limits.general/cmath.version.compile.pass.cpp
    libcxx/test/std/language.support/support.limits/support.limits.general/compare.version.compile.pass.cpp
    libcxx/test/std/language.support/support.limits/support.limits.general/complex.version.compile.pass.cpp
    libcxx/test/std/language.support/support.limits/support.limits.general/cstdlib.version.compile.pass.cpp
    libcxx/test/std/language.support/support.limits/support.limits.general/deque.version.compile.pass.cpp
    libcxx/test/std/language.support/support.limits/support.limits.general/execution.version.compile.pass.cpp
    libcxx/test/std/language.support/support.limits/support.limits.general/filesystem.version.compile.pass.cpp
    libcxx/test/std/language.support/support.limits/support.limits.general/format.version.compile.pass.cpp
    libcxx/test/std/language.support/support.limits/support.limits.general/forward_list.version.compile.pass.cpp
    libcxx/test/std/language.support/support.limits/support.limits.general/functional.version.compile.pass.cpp
    libcxx/test/std/language.support/support.limits/support.limits.general/iterator.version.compile.pass.cpp
    libcxx/test/std/language.support/support.limits/support.limits.general/latch.version.compile.pass.cpp
    libcxx/test/std/language.support/support.limits/support.limits.general/list.version.compile.pass.cpp
    libcxx/test/std/language.support/support.limits/support.limits.general/map.version.compile.pass.cpp
    libcxx/test/std/language.support/support.limits/support.limits.general/memory.version.compile.pass.cpp
    libcxx/test/std/language.support/support.limits/support.limits.general/numeric.version.compile.pass.cpp
    libcxx/test/std/language.support/support.limits/support.limits.general/queue.version.compile.pass.cpp
    libcxx/test/std/language.support/support.limits/support.limits.general/ranges.version.compile.pass.cpp
    libcxx/test/std/language.support/support.limits/support.limits.general/semaphore.version.compile.pass.cpp
    libcxx/test/std/language.support/support.limits/support.limits.general/set.version.compile.pass.cpp
    libcxx/test/std/language.support/support.limits/support.limits.general/shared_mutex.version.compile.pass.cpp
    libcxx/test/std/language.support/support.limits/support.limits.general/stack.version.compile.pass.cpp
    libcxx/test/std/language.support/support.limits/support.limits.general/string.version.compile.pass.cpp
    libcxx/test/std/language.support/support.limits/support.limits.general/thread.version.compile.pass.cpp
    libcxx/test/std/language.support/support.limits/support.limits.general/tuple.version.compile.pass.cpp
    libcxx/test/std/language.support/support.limits/support.limits.general/type_traits.version.compile.pass.cpp
    libcxx/test/std/language.support/support.limits/support.limits.general/typeinfo.version.compile.pass.cpp
    libcxx/test/std/language.support/support.limits/support.limits.general/unordered_map.version.compile.pass.cpp
    libcxx/test/std/language.support/support.limits/support.limits.general/unordered_set.version.compile.pass.cpp
    libcxx/test/std/language.support/support.limits/support.limits.general/utility.version.compile.pass.cpp
    libcxx/test/std/language.support/support.limits/support.limits.general/vector.version.compile.pass.cpp
    libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp
    libcxx/test/std/library/description/conventions/customization.point.object/cpo.compile.pass.cpp
    libcxx/test/std/library/description/conventions/customization.point.object/niebloid.compile.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_char16_t.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_char32_t.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/ctor_char16_t.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/ctor_char32_t.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_always_noconv.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_encoding.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_in.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_length.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_max_length.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_out.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_unshift.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_always_noconv.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_encoding.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_in.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_length.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_max_length.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_out.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_unshift.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/utf_sanity_check.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char16_t.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_char32_t.pass.cpp
    libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_date.pass.cpp
    libcxx/test/std/localization/locale.stdcvt/codecvt_mode.pass.cpp
    libcxx/test/std/localization/locale.stdcvt/codecvt_utf16.pass.cpp
    libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_always_noconv.pass.cpp
    libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_encoding.pass.cpp
    libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_in.pass.cpp
    libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_length.pass.cpp
    libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_max_length.pass.cpp
    libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_out.pass.cpp
    libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_unshift.pass.cpp
    libcxx/test/std/localization/locale.stdcvt/codecvt_utf8.pass.cpp
    libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_always_noconv.pass.cpp
    libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_encoding.pass.cpp
    libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_in.pass.cpp
    libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_length.pass.cpp
    libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_max_length.pass.cpp
    libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_out.pass.cpp
    libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_unshift.pass.cpp
    libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_always_noconv.pass.cpp
    libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_encoding.pass.cpp
    libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_in.pass.cpp
    libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_length.pass.cpp
    libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_max_length.pass.cpp
    libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_out.pass.cpp
    libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_unshift.pass.cpp
    libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/ctor.pass.cpp
    libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/overflow.pass.cpp
    libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/pbackfail.pass.cpp
    libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/rdbuf.pass.cpp
    libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/seekoff.pass.cpp
    libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/state.pass.cpp
    libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/test.pass.cpp
    libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/underflow.pass.cpp
    libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/converted.pass.cpp
    libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_codecvt.pass.cpp
    libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_codecvt_state.pass.cpp
    libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_copy.pass.cpp
    libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_err_string.pass.cpp
    libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/from_bytes.pass.cpp
    libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/state.pass.cpp
    libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/to_bytes.pass.cpp
    libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/types.pass.cpp
    libcxx/test/std/localization/locales/locale/locale.cons/assign.pass.cpp
    libcxx/test/std/localization/locales/locale/locale.cons/char_pointer.pass.cpp
    libcxx/test/std/localization/locales/locale/locale.cons/copy.pass.cpp
    libcxx/test/std/localization/locales/locale/locale.cons/default.pass.cpp
    libcxx/test/std/localization/locales/locale/locale.cons/locale_char_pointer_cat.pass.cpp
    libcxx/test/std/localization/locales/locale/locale.cons/locale_facetptr.pass.cpp
    libcxx/test/std/localization/locales/locale/locale.cons/locale_locale_cat.pass.cpp
    libcxx/test/std/localization/locales/locale/locale.cons/locale_string_cat.pass.cpp
    libcxx/test/std/localization/locales/locale/locale.cons/string.pass.cpp
    libcxx/test/std/localization/locales/locale/locale.members/combine.pass.cpp
    libcxx/test/std/localization/locales/locale/locale.statics/classic.pass.cpp
    libcxx/test/std/localization/locales/locale/locale.statics/global.pass.cpp
    libcxx/test/std/numerics/bit/bit.pow.two/bit_ceil.pass.cpp
    libcxx/test/std/numerics/bit/bit.pow.two/bit_floor.pass.cpp
    libcxx/test/std/numerics/c.math/lerp.pass.cpp
    libcxx/test/std/numerics/numarray/valarray.nonmembers/valarray.transcend/valarray_helper.h
    libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/eval.pass.cpp
    libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/result_type.pass.cpp
    libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/eval.pass.cpp
    libcxx/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/result_type.pass.cpp
    libcxx/test/std/numerics/rand/rand.device/ctor.pass.cpp
    libcxx/test/std/numerics/rand/rand.device/eval.pass.cpp
    libcxx/test/std/numerics/rand/rand.dist/rand.dist.bern/rand.dist.bern.bin/eval.pass.cpp
    libcxx/test/std/numerics/rand/rand.dist/rand.dist.bern/rand.dist.bern.geo/eval.pass.cpp
    libcxx/test/std/numerics/rand/rand.dist/rand.dist.bern/rand.dist.bern.negbin/eval.pass.cpp
    libcxx/test/std/numerics/rand/rand.dist/rand.dist.norm/rand.dist.norm.lognormal/eval_param.PR52906.pass.cpp
    libcxx/test/std/numerics/rand/rand.dist/rand.dist.pois/rand.dist.pois.poisson/eval.pass.cpp
    libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.discrete/eval.pass.cpp
    libcxx/test/std/numerics/rand/rand.dist/rand.dist.uni/rand.dist.uni.int/eval.pass.cpp
    libcxx/test/std/numerics/rand/rand.predef/default_random_engine.pass.cpp
    libcxx/test/std/ranges/range.access/begin.pass.cpp
    libcxx/test/std/ranges/range.access/begin.verify.cpp
    libcxx/test/std/ranges/range.access/data.verify.cpp
    libcxx/test/std/ranges/range.access/empty.pass.cpp
    libcxx/test/std/ranges/range.access/empty.verify.cpp
    libcxx/test/std/ranges/range.access/end.verify.cpp
    libcxx/test/std/ranges/range.access/rbegin.pass.cpp
    libcxx/test/std/ranges/range.access/rbegin.verify.cpp
    libcxx/test/std/ranges/range.access/rend.pass.cpp
    libcxx/test/std/ranges/range.access/rend.verify.cpp
    libcxx/test/std/ranges/range.access/size.verify.cpp
    libcxx/test/std/ranges/range.access/ssize.pass.cpp
    libcxx/test/std/ranges/range.access/ssize.verify.cpp
    libcxx/test/std/ranges/range.adaptors/range.all/all.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.all/all_t.compile.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.all/range.owning.view/base.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.all/range.owning.view/begin_end.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.all/range.owning.view/borrowing.compile.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.all/range.owning.view/constructor.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.all/range.owning.view/data.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.all/range.owning.view/empty.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.all/range.owning.view/size.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.all/range.ref.view/borrowing.compile.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.all/range.ref.view/range.ref.view.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.common.view/adaptor.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.common.view/base.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.common.view/begin.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.common.view/borrowing.compile.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.common.view/ctad.compile.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.common.view/ctor.default.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.common.view/ctor.view.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.common.view/end.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.common.view/size.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.counted/counted.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.drop/adaptor.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.drop/base.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.drop/begin.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.drop/ctad.compile.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.drop/ctor.default.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.drop/ctor.view.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.drop/dangling.cache.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.drop/end.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.drop/general.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.drop/size.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.empty/borrowing.compile.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.empty/empty_view.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.empty/views.empty.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.filter/adaptor.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.filter/base.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.filter/begin.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.filter/constraints.compile.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.filter/ctad.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.filter/ctor.default.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.filter/ctor.view_pred.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.filter/end.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.filter/iterator/arrow.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.filter/iterator/base.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.filter/iterator/compare.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.filter/iterator/ctor.default.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.filter/iterator/ctor.parent_iter.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.filter/iterator/decrement.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.filter/iterator/deref.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.filter/iterator/increment.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.filter/iterator/iter_move.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.filter/iterator/iter_swap.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.filter/iterator/types.compile.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.filter/pred.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.filter/sentinel/base.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.filter/sentinel/compare.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.filter/sentinel/ctor.default.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.filter/sentinel/ctor.parent.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.join.view/adaptor.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.join.view/base.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.join.view/begin.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.join.view/ctad.compile.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.join.view/ctad.verify.cpp
    libcxx/test/std/ranges/range.adaptors/range.join.view/ctor.default.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.join.view/ctor.view.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.join.view/end.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.join.view/general.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/arrow.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/ctor.default.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/ctor.other.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/ctor.parent.outer.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/decrement.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/eq.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/increment.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/iter.move.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/iter.swap.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/member_types.compile.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/star.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.join.view/sentinel/ctor.default.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.join.view/sentinel/ctor.other.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.join.view/sentinel/ctor.parent.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.join.view/sentinel/eq.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.join.view/types.h
    libcxx/test/std/ranges/range.adaptors/range.lazy.split/adaptor.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.lazy.split/base.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.lazy.split/begin.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.lazy.split/constraints.compile.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.lazy.split/ctad.compile.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.lazy.split/ctor.copy_move.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.lazy.split/ctor.default.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.lazy.split/ctor.range.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.lazy.split/ctor.view.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.lazy.split/end.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.lazy.split/general.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.inner/base.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.inner/ctor.default.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.inner/ctor.outer_iterator.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.inner/deref.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.inner/equal.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.inner/increment.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.inner/iter_move.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.inner/iter_swap.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.inner/types.compile.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.outer.value/begin.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.outer.value/ctor.default.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.outer.value/ctor.iter.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.outer.value/end.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.outer.value/view_interface.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.outer/ctor.copy.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.outer/ctor.default.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.outer/ctor.parent.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.outer/ctor.parent_base.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.outer/deref.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.outer/equal.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.outer/increment.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.outer/types.compile.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.lazy.split/types.h
    libcxx/test/std/ranges/range.adaptors/range.lazy.split/view_interface.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.reverse/adaptor.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.reverse/base.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.reverse/begin.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.reverse/borrowing.compile.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.reverse/ctad.compile.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.reverse/ctor.default.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.reverse/ctor.view.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.reverse/end.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.reverse/range_concept_conformance.compile.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.reverse/size.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.take/adaptor.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.take/base.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.take/begin.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.take/borrowing.compile.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.take/ctad.compile.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.take/ctor.default.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.take/ctor.view_count.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.take/end.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.take/range_concept_conformance.compile.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.take/sentinel/base.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.take/sentinel/ctor.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.take/sentinel/eq.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.take/size.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.transform/adaptor.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.transform/base.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.transform/begin.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.transform/ctad.compile.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.transform/ctor.default.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.transform/ctor.view_function.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.transform/end.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.transform/general.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.transform/iterator/arithmetic.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.transform/iterator/base.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.transform/iterator/compare.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.transform/iterator/ctor.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.transform/iterator/deref.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.transform/iterator/iter_move.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.transform/iterator/plus_minus.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.transform/iterator/requirements.compile.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.transform/iterator/sentinel.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.transform/iterator/subscript.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.transform/iterator/types.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.transform/size.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.zip/begin.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.zip/borrowing.compile.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.zip/cpo.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.zip/ctad.compile.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.zip/ctor.default.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.zip/ctor.views.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.zip/end.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.zip/general.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.zip/iterator/arithmetic.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.zip/iterator/compare.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.zip/iterator/ctor.default.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.zip/iterator/ctor.other.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.zip/iterator/decrement.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.zip/iterator/deref.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.zip/iterator/increment.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.zip/iterator/iter_move.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.zip/iterator/iter_swap.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.zip/iterator/member_types.compile.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.zip/iterator/singular.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.zip/iterator/subscript.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.zip/range.concept.compile.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.zip/sentinel/ctor.default.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.zip/sentinel/ctor.other.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.zip/sentinel/eq.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.zip/sentinel/minus.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.zip/size.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.zip/types.h
    libcxx/test/std/ranges/range.factories/range.iota.view/begin.pass.cpp
    libcxx/test/std/ranges/range.factories/range.iota.view/borrowing.compile.pass.cpp
    libcxx/test/std/ranges/range.factories/range.iota.view/ctad.compile.pass.cpp
    libcxx/test/std/ranges/range.factories/range.iota.view/ctor.default.pass.cpp
    libcxx/test/std/ranges/range.factories/range.iota.view/ctor.first.last.pass.cpp
    libcxx/test/std/ranges/range.factories/range.iota.view/ctor.value.bound.pass.cpp
    libcxx/test/std/ranges/range.factories/range.iota.view/ctor.value.pass.cpp
    libcxx/test/std/ranges/range.factories/range.iota.view/end.pass.cpp
    libcxx/test/std/ranges/range.factories/range.iota.view/iterator/compare.pass.cpp
    libcxx/test/std/ranges/range.factories/range.iota.view/iterator/ctor.default.pass.cpp
    libcxx/test/std/ranges/range.factories/range.iota.view/iterator/ctor.value.pass.cpp
    libcxx/test/std/ranges/range.factories/range.iota.view/iterator/decrement.pass.cpp
    libcxx/test/std/ranges/range.factories/range.iota.view/iterator/increment.pass.cpp
    libcxx/test/std/ranges/range.factories/range.iota.view/iterator/member_typedefs.compile.pass.cpp
    libcxx/test/std/ranges/range.factories/range.iota.view/iterator/minus.pass.cpp
    libcxx/test/std/ranges/range.factories/range.iota.view/iterator/minus_eq.pass.cpp
    libcxx/test/std/ranges/range.factories/range.iota.view/iterator/plus.pass.cpp
    libcxx/test/std/ranges/range.factories/range.iota.view/iterator/plus_eq.pass.cpp
    libcxx/test/std/ranges/range.factories/range.iota.view/iterator/star.pass.cpp
    libcxx/test/std/ranges/range.factories/range.iota.view/iterator/subscript.pass.cpp
    libcxx/test/std/ranges/range.factories/range.iota.view/range_concept_conformance.compile.pass.cpp
    libcxx/test/std/ranges/range.factories/range.iota.view/sentinel/ctor.default.pass.cpp
    libcxx/test/std/ranges/range.factories/range.iota.view/sentinel/ctor.value.pass.cpp
    libcxx/test/std/ranges/range.factories/range.iota.view/sentinel/eq.pass.cpp
    libcxx/test/std/ranges/range.factories/range.iota.view/sentinel/minus.pass.cpp
    libcxx/test/std/ranges/range.factories/range.iota.view/size.pass.cpp
    libcxx/test/std/ranges/range.factories/range.iota.view/type.compile.pass.cpp
    libcxx/test/std/ranges/range.factories/range.iota.view/views_iota.pass.cpp
    libcxx/test/std/ranges/range.factories/range.single.view/assign.pass.cpp
    libcxx/test/std/ranges/range.factories/range.single.view/begin.pass.cpp
    libcxx/test/std/ranges/range.factories/range.single.view/borrowing.compile.pass.cpp
    libcxx/test/std/ranges/range.factories/range.single.view/cpo.pass.cpp
    libcxx/test/std/ranges/range.factories/range.single.view/ctad.compile.pass.cpp
    libcxx/test/std/ranges/range.factories/range.single.view/ctor.default.pass.cpp
    libcxx/test/std/ranges/range.factories/range.single.view/ctor.in_place.pass.cpp
    libcxx/test/std/ranges/range.factories/range.single.view/ctor.value.pass.cpp
    libcxx/test/std/ranges/range.factories/range.single.view/data.pass.cpp
    libcxx/test/std/ranges/range.factories/range.single.view/end.pass.cpp
    libcxx/test/std/ranges/range.factories/range.single.view/range_concept_conformance.compile.pass.cpp
    libcxx/test/std/ranges/range.factories/range.single.view/size.pass.cpp
    libcxx/test/std/ranges/range.req/range.range/helper_aliases.compile.pass.cpp
    libcxx/test/std/ranges/range.req/range.range/iterator_t.compile.pass.cpp
    libcxx/test/std/ranges/range.req/range.range/range.compile.pass.cpp
    libcxx/test/std/ranges/range.req/range.range/range_size_t.compile.pass.cpp
    libcxx/test/std/ranges/range.req/range.range/sentinel_t.compile.pass.cpp
    libcxx/test/std/ranges/range.req/range.refinements/bidirectional_range.compile.pass.cpp
    libcxx/test/std/ranges/range.req/range.refinements/contiguous_range.compile.pass.cpp
    libcxx/test/std/ranges/range.req/range.refinements/forward_range.compile.pass.cpp
    libcxx/test/std/ranges/range.req/range.refinements/input_range.compile.pass.cpp
    libcxx/test/std/ranges/range.req/range.refinements/output_range.compile.pass.cpp
    libcxx/test/std/ranges/range.req/range.refinements/random_access_range.compile.pass.cpp
    libcxx/test/std/ranges/range.req/range.refinements/viewable_range.compile.pass.cpp
    libcxx/test/std/ranges/range.req/range.sized/sized_range.compile.pass.cpp
    libcxx/test/std/ranges/range.req/range.sized/subsumption.compile.pass.cpp
    libcxx/test/std/ranges/range.req/range.view/enable_view.compile.pass.cpp
    libcxx/test/std/ranges/range.req/range.view/view.compile.pass.cpp
    libcxx/test/std/ranges/range.req/range.view/view.subsumption.compile.pass.cpp
    libcxx/test/std/ranges/range.req/range.view/view_base.compile.pass.cpp
    libcxx/test/std/ranges/range.utility/range.dangling/borrowed_iterator.compile.pass.cpp
    libcxx/test/std/ranges/range.utility/range.dangling/borrowed_subrange.compile.pass.cpp
    libcxx/test/std/ranges/range.utility/range.dangling/dangling.pass.cpp
    libcxx/test/std/ranges/range.utility/range.subrange/advance.pass.cpp
    libcxx/test/std/ranges/range.utility/range.subrange/borrowing.compile.pass.cpp
    libcxx/test/std/ranges/range.utility/range.subrange/ctad.compile.pass.cpp
    libcxx/test/std/ranges/range.utility/range.subrange/ctor.begin_end.pass.cpp
    libcxx/test/std/ranges/range.utility/range.subrange/ctor.begin_end_size.pass.cpp
    libcxx/test/std/ranges/range.utility/range.subrange/ctor.default.pass.cpp
    libcxx/test/std/ranges/range.utility/range.subrange/ctor.pair_like_conv.pass.cpp
    libcxx/test/std/ranges/range.utility/range.subrange/ctor.range.pass.cpp
    libcxx/test/std/ranges/range.utility/range.subrange/ctor.range_size.pass.cpp
    libcxx/test/std/ranges/range.utility/range.subrange/general.compile.pass.cpp
    libcxx/test/std/ranges/range.utility/range.subrange/get.pass.cpp
    libcxx/test/std/ranges/range.utility/range.subrange/lwg3470.pass.cpp
    libcxx/test/std/ranges/range.utility/range.subrange/primitives.pass.cpp
    libcxx/test/std/ranges/range.utility/range.subrange/structured_bindings.pass.cpp
    libcxx/test/std/ranges/range.utility/view.interface/view.interface.pass.cpp
    libcxx/test/std/re/re.alg/re.alg.match/exponential.pass.cpp
    libcxx/test/std/re/re.alg/re.alg.replace/exponential.pass.cpp
    libcxx/test/std/re/re.alg/re.alg.search/exponential.pass.cpp
    libcxx/test/std/re/re.badexp/regex_error.pass.cpp
    libcxx/test/std/re/re.const/re.err/error_type.pass.cpp
    libcxx/test/std/re/re.const/re.synopt/syntax_option_type.pass.cpp
    libcxx/test/std/re/re.grammar/excessive_brace_min_max.pass.cpp
    libcxx/test/std/re/re.results/range_concept_conformance.compile.pass.cpp
    libcxx/test/std/re/re.traits/lookup_classname.pass.cpp
    libcxx/test/std/strings/basic.string/range_concept_conformance.compile.pass.cpp
    libcxx/test/std/strings/basic.string/string.access/back.pass.cpp
    libcxx/test/std/strings/basic.string/string.access/front.pass.cpp
    libcxx/test/std/strings/basic.string/string.access/index.pass.cpp
    libcxx/test/std/strings/basic.string/string.capacity/reserve.pass.cpp
    libcxx/test/std/strings/basic.string/string.capacity/reserve_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.capacity/resize_and_overwrite.pass.cpp
    libcxx/test/std/strings/basic.string/string.capacity/resize_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.capacity/resize_size_char.pass.cpp
    libcxx/test/std/strings/basic.string/string.capacity/shrink_to_fit.pass.cpp
    libcxx/test/std/strings/basic.string/string.cons/T_size_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.cons/alloc.pass.cpp
    libcxx/test/std/strings/basic.string/string.cons/char_assignment.pass.cpp
    libcxx/test/std/strings/basic.string/string.cons/copy.pass.cpp
    libcxx/test/std/strings/basic.string/string.cons/copy_alloc.pass.cpp
    libcxx/test/std/strings/basic.string/string.cons/copy_assignment.pass.cpp
    libcxx/test/std/strings/basic.string/string.cons/default.pass.cpp
    libcxx/test/std/strings/basic.string/string.cons/dtor.pass.cpp
    libcxx/test/std/strings/basic.string/string.cons/iter_alloc.pass.cpp
    libcxx/test/std/strings/basic.string/string.cons/move.pass.cpp
    libcxx/test/std/strings/basic.string/string.cons/move_alloc.pass.cpp
    libcxx/test/std/strings/basic.string/string.cons/move_assignment.pass.cpp
    libcxx/test/std/strings/basic.string/string.cons/pointer_alloc.pass.cpp
    libcxx/test/std/strings/basic.string/string.cons/pointer_assignment.pass.cpp
    libcxx/test/std/strings/basic.string/string.cons/pointer_size_alloc.pass.cpp
    libcxx/test/std/strings/basic.string/string.cons/size_char_alloc.pass.cpp
    libcxx/test/std/strings/basic.string/string.cons/string_view.pass.cpp
    libcxx/test/std/strings/basic.string/string.cons/string_view_assignment.pass.cpp
    libcxx/test/std/strings/basic.string/string.cons/substr.pass.cpp
    libcxx/test/std/strings/basic.string/string.ends_with/ends_with.ptr.pass.cpp
    libcxx/test/std/strings/basic.string/string.modifiers/string_append/T_size_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.modifiers/string_append/iterator.pass.cpp
    libcxx/test/std/strings/basic.string/string.modifiers/string_append/pointer.pass.cpp
    libcxx/test/std/strings/basic.string/string.modifiers/string_append/pointer_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.modifiers/string_append/push_back.pass.cpp
    libcxx/test/std/strings/basic.string/string.modifiers/string_append/size_char.pass.cpp
    libcxx/test/std/strings/basic.string/string.modifiers/string_append/string.pass.cpp
    libcxx/test/std/strings/basic.string/string.modifiers/string_append/string_size_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.modifiers/string_append/string_view.pass.cpp
    libcxx/test/std/strings/basic.string/string.modifiers/string_assign/T_size_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.modifiers/string_assign/iterator.pass.cpp
    libcxx/test/std/strings/basic.string/string.modifiers/string_assign/pointer.pass.cpp
    libcxx/test/std/strings/basic.string/string.modifiers/string_assign/pointer_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.modifiers/string_assign/rv_string.pass.cpp
    libcxx/test/std/strings/basic.string/string.modifiers/string_assign/size_char.pass.cpp
    libcxx/test/std/strings/basic.string/string.modifiers/string_assign/string.pass.cpp
    libcxx/test/std/strings/basic.string/string.modifiers/string_assign/string_size_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.modifiers/string_assign/string_view.pass.cpp
    libcxx/test/std/strings/basic.string/string.modifiers/string_erase/iter.pass.cpp
    libcxx/test/std/strings/basic.string/string.modifiers/string_erase/iter_iter.pass.cpp
    libcxx/test/std/strings/basic.string/string.modifiers/string_erase/pop_back.pass.cpp
    libcxx/test/std/strings/basic.string/string.modifiers/string_erase/size_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.modifiers/string_insert/iter_char.pass.cpp
    libcxx/test/std/strings/basic.string/string.modifiers/string_insert/iter_iter_iter.pass.cpp
    libcxx/test/std/strings/basic.string/string.modifiers/string_insert/iter_size_char.pass.cpp
    libcxx/test/std/strings/basic.string/string.modifiers/string_insert/size_T_size_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.modifiers/string_insert/size_pointer.pass.cpp
    libcxx/test/std/strings/basic.string/string.modifiers/string_insert/size_pointer_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.modifiers/string_insert/size_size_char.pass.cpp
    libcxx/test/std/strings/basic.string/string.modifiers/string_insert/size_string.pass.cpp
    libcxx/test/std/strings/basic.string/string.modifiers/string_insert/size_string_size_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.modifiers/string_insert/string_view.pass.cpp
    libcxx/test/std/strings/basic.string/string.modifiers/string_op_plus_equal/char.pass.cpp
    libcxx/test/std/strings/basic.string/string.modifiers/string_op_plus_equal/pointer.pass.cpp
    libcxx/test/std/strings/basic.string/string.modifiers/string_op_plus_equal/string.pass.cpp
    libcxx/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_iter_iter.pass.cpp
    libcxx/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_pointer.pass.cpp
    libcxx/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_pointer_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_size_char.pass.cpp
    libcxx/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_string.pass.cpp
    libcxx/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_string_view.pass.cpp
    libcxx/test/std/strings/basic.string/string.modifiers/string_replace/size_size_T_size_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.modifiers/string_replace/size_size_pointer.pass.cpp
    libcxx/test/std/strings/basic.string/string.modifiers/string_replace/size_size_pointer_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.modifiers/string_replace/size_size_size_char.pass.cpp
    libcxx/test/std/strings/basic.string/string.modifiers/string_replace/size_size_string.pass.cpp
    libcxx/test/std/strings/basic.string/string.modifiers/string_replace/size_size_string_size_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.modifiers/string_replace/size_size_string_view.pass.cpp
    libcxx/test/std/strings/basic.string/string.modifiers/string_swap/swap.pass.cpp
    libcxx/test/std/strings/basic.string/string.nonmembers/string.special/swap.pass.cpp
    libcxx/test/std/strings/basic.string/string.nonmembers/string.special/swap_noexcept.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_compare/pointer.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_compare/string.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_compare/string_view.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_find.first.not.of/char_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_find.first.not.of/pointer_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_find.first.not.of/pointer_size_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_find.first.not.of/string_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_find.first.not.of/string_view_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_find.first.of/char_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_find.first.of/pointer_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_find.first.of/pointer_size_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_find.first.of/string_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_find.first.of/string_view_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_find.last.not.of/char_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_find.last.not.of/pointer_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_find.last.not.of/pointer_size_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_find.last.not.of/string_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_find.last.not.of/string_view_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_find.last.of/char_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_find.last.of/pointer_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_find.last.of/pointer_size_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_find.last.of/string_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_find.last.of/string_view_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_find/char_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_find/pointer_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_find/pointer_size_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_find/string_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_find/string_view_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_rfind/char_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_rfind/pointer_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_rfind/pointer_size_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_rfind/string_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_rfind/string_view_size.pass.cpp
    libcxx/test/std/strings/basic.string/string.ops/string_substr/substr.pass.cpp
    libcxx/test/std/strings/basic.string/string.starts_with/starts_with.ptr.pass.cpp
    libcxx/test/std/strings/string.view/range_concept_conformance.compile.pass.cpp
    libcxx/test/std/strings/string.view/string.view.access/back.pass.cpp
    libcxx/test/std/strings/string.view/string.view.access/front.pass.cpp
    libcxx/test/std/strings/string.view/string.view.access/index.pass.cpp
    libcxx/test/std/strings/string.view/string.view.capacity/capacity.pass.cpp
    libcxx/test/std/strings/string.view/string.view.cons/from_literal.pass.cpp
    libcxx/test/std/strings/string.view/string.view.cons/from_ptr_len.pass.cpp
    libcxx/test/std/strings/string.view/string.view.cons/from_range.pass.cpp
    libcxx/test/std/strings/string.view/string.view.deduct/range.pass.cpp
    libcxx/test/std/strings/string.view/string.view.find/find_char_size.pass.cpp
    libcxx/test/std/strings/string.view/string.view.find/find_first_not_of_char_size.pass.cpp
    libcxx/test/std/strings/string.view/string.view.find/find_first_not_of_pointer_size.pass.cpp
    libcxx/test/std/strings/string.view/string.view.find/find_first_not_of_pointer_size_size.pass.cpp
    libcxx/test/std/strings/string.view/string.view.find/find_first_not_of_string_view_size.pass.cpp
    libcxx/test/std/strings/string.view/string.view.find/find_first_of_char_size.pass.cpp
    libcxx/test/std/strings/string.view/string.view.find/find_first_of_pointer_size.pass.cpp
    libcxx/test/std/strings/string.view/string.view.find/find_first_of_pointer_size_size.pass.cpp
    libcxx/test/std/strings/string.view/string.view.find/find_first_of_string_view_size.pass.cpp
    libcxx/test/std/strings/string.view/string.view.find/find_last_not_of_char_size.pass.cpp
    libcxx/test/std/strings/string.view/string.view.find/find_last_not_of_pointer_size.pass.cpp
    libcxx/test/std/strings/string.view/string.view.find/find_last_not_of_pointer_size_size.pass.cpp
    libcxx/test/std/strings/string.view/string.view.find/find_last_not_of_string_view_size.pass.cpp
    libcxx/test/std/strings/string.view/string.view.find/find_last_of_char_size.pass.cpp
    libcxx/test/std/strings/string.view/string.view.find/find_last_of_pointer_size.pass.cpp
    libcxx/test/std/strings/string.view/string.view.find/find_last_of_pointer_size_size.pass.cpp
    libcxx/test/std/strings/string.view/string.view.find/find_last_of_string_view_size.pass.cpp
    libcxx/test/std/strings/string.view/string.view.find/find_pointer_size.pass.cpp
    libcxx/test/std/strings/string.view/string.view.find/find_pointer_size_size.pass.cpp
    libcxx/test/std/strings/string.view/string.view.find/find_string_view_size.pass.cpp
    libcxx/test/std/strings/string.view/string.view.find/rfind_char_size.pass.cpp
    libcxx/test/std/strings/string.view/string.view.find/rfind_pointer_size.pass.cpp
    libcxx/test/std/strings/string.view/string.view.find/rfind_pointer_size_size.pass.cpp
    libcxx/test/std/strings/string.view/string.view.find/rfind_string_view_size.pass.cpp
    libcxx/test/std/strings/string.view/string.view.iterators/iterator_concept_conformance.compile.pass.cpp
    libcxx/test/std/strings/string.view/string.view.template/ends_with.ptr.pass.cpp
    libcxx/test/std/strings/string.view/string.view.template/starts_with.ptr.pass.cpp
    libcxx/test/std/strings/strings.erasure/erase.pass.cpp
    libcxx/test/std/strings/strings.erasure/erase_if.pass.cpp
    libcxx/test/std/thread/futures/futures.async/async.pass.cpp
    libcxx/test/std/thread/futures/futures.future_error/what.pass.cpp
    libcxx/test/std/thread/futures/futures.overview/launch.pass.cpp
    libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp
    libcxx/test/std/time/time.duration/time.duration.special/max.pass.cpp
    libcxx/test/std/time/time.duration/time.duration.special/min.pass.cpp
    libcxx/test/std/time/time.duration/time.duration.special/zero.pass.cpp
    libcxx/test/std/time/time.point/time.point.special/max.pass.cpp
    libcxx/test/std/time/time.point/time.point.special/min.pass.cpp
    libcxx/test/std/time/time.traits/time.traits.duration_values/max.pass.cpp
    libcxx/test/std/time/time.traits/time.traits.duration_values/min.pass.cpp
    libcxx/test/std/time/time.traits/time.traits.duration_values/zero.pass.cpp
    libcxx/test/std/utilities/any/any.class/any.assign/move.pass.cpp
    libcxx/test/std/utilities/any/any.class/any.assign/value.pass.cpp
    libcxx/test/std/utilities/any/any.class/any.cons/move.pass.cpp
    libcxx/test/std/utilities/any/any.class/any.modifiers/swap.pass.cpp
    libcxx/test/std/utilities/format/format.arguments/format.arg.store/make_format_args.pass.cpp
    libcxx/test/std/utilities/format/format.arguments/format.arg.store/make_format_args.sh.cpp
    libcxx/test/std/utilities/format/format.arguments/format.arg.store/make_wformat_args.pass.cpp
    libcxx/test/std/utilities/format/format.arguments/format.arg/ctor.pass.cpp
    libcxx/test/std/utilities/format/format.arguments/format.arg/operator_bool.pass.cpp
    libcxx/test/std/utilities/format/format.arguments/format.args/ctor.pass.cpp
    libcxx/test/std/utilities/format/format.arguments/format.args/types.compile.pass.cpp
    libcxx/test/std/utilities/format/format.error/format.error.pass.cpp
    libcxx/test/std/utilities/format/format.fmt.string/ctor.verify.cpp
    libcxx/test/std/utilities/format/format.fmt.string/get.pass.cpp
    libcxx/test/std/utilities/format/format.fmt.string/types.compile.pass.cpp
    libcxx/test/std/utilities/format/format.formatter/format.context/format.context/advance_to.pass.cpp
    libcxx/test/std/utilities/format/format.formatter/format.context/format.context/arg.pass.cpp
    libcxx/test/std/utilities/format/format.formatter/format.context/format.context/ctor.pass.cpp
    libcxx/test/std/utilities/format/format.formatter/format.context/format.context/locale.pass.cpp
    libcxx/test/std/utilities/format/format.formatter/format.context/format.context/out.pass.cpp
    libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.bool.pass.cpp
    libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.c_string.pass.cpp
    libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.char.pass.cpp
    libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.char_array.pass.cpp
    libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.const_char_array.pass.cpp
    libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.floating_point.pass.cpp
    libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.handle.pass.cpp
    libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.pointer.pass.cpp
    libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.signed_integral.pass.cpp
    libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.string.pass.cpp
    libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.unsigned_integral.pass.cpp
    libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/types.compile.pass.cpp
    libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/advance_to.pass.cpp
    libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/begin.pass.cpp
    libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/check_arg_id.pass.cpp
    libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/check_arg_id.verify.cpp
    libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/ctor.pass.cpp
    libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/end.pass.cpp
    libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/next_arg_id.pass.cpp
    libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/types.compile.pass.cpp
    libcxx/test/std/utilities/format/format.functions/P2418.pass.cpp
    libcxx/test/std/utilities/format/format.functions/ascii.pass.cpp
    libcxx/test/std/utilities/format/format.functions/format.locale.pass.cpp
    libcxx/test/std/utilities/format/format.functions/format.locale.verify.cpp
    libcxx/test/std/utilities/format/format.functions/format.pass.cpp
    libcxx/test/std/utilities/format/format.functions/format.verify.cpp
    libcxx/test/std/utilities/format/format.functions/format_tests.h
    libcxx/test/std/utilities/format/format.functions/format_to.locale.pass.cpp
    libcxx/test/std/utilities/format/format.functions/format_to.locale.verify.cpp
    libcxx/test/std/utilities/format/format.functions/format_to.pass.cpp
    libcxx/test/std/utilities/format/format.functions/format_to.verify.cpp
    libcxx/test/std/utilities/format/format.functions/format_to_n.locale.pass.cpp
    libcxx/test/std/utilities/format/format.functions/format_to_n.locale.verify.cpp
    libcxx/test/std/utilities/format/format.functions/format_to_n.pass.cpp
    libcxx/test/std/utilities/format/format.functions/format_to_n.verify.cpp
    libcxx/test/std/utilities/format/format.functions/formatted_size.locale.pass.cpp
    libcxx/test/std/utilities/format/format.functions/formatted_size.locale.verify.cpp
    libcxx/test/std/utilities/format/format.functions/formatted_size.pass.cpp
    libcxx/test/std/utilities/format/format.functions/formatted_size.verify.cpp
    libcxx/test/std/utilities/format/format.functions/locale-specific_form.pass.cpp
    libcxx/test/std/utilities/format/format.functions/unicode.pass.cpp
    libcxx/test/std/utilities/format/format.functions/vformat.locale.pass.cpp
    libcxx/test/std/utilities/format/format.functions/vformat.pass.cpp
    libcxx/test/std/utilities/format/format.functions/vformat_to.locale.pass.cpp
    libcxx/test/std/utilities/format/format.functions/vformat_to.pass.cpp
    libcxx/test/std/utilities/format/format.syn/format_to_n_result.pass.cpp
    libcxx/test/std/utilities/function.objects/arithmetic.operations/divides.pass.cpp
    libcxx/test/std/utilities/function.objects/arithmetic.operations/minus.pass.cpp
    libcxx/test/std/utilities/function.objects/arithmetic.operations/modulus.pass.cpp
    libcxx/test/std/utilities/function.objects/arithmetic.operations/multiplies.pass.cpp
    libcxx/test/std/utilities/function.objects/arithmetic.operations/negate.pass.cpp
    libcxx/test/std/utilities/function.objects/arithmetic.operations/plus.pass.cpp
    libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/bind_return_type.pass.cpp
    libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.isbind/is_bind_expression.pass.cpp
    libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.isplace/is_placeholder.pass.cpp
    libcxx/test/std/utilities/function.objects/bitwise.operations/bit_and.pass.cpp
    libcxx/test/std/utilities/function.objects/bitwise.operations/bit_not.pass.cpp
    libcxx/test/std/utilities/function.objects/bitwise.operations/bit_or.pass.cpp
    libcxx/test/std/utilities/function.objects/bitwise.operations/bit_xor.pass.cpp
    libcxx/test/std/utilities/function.objects/comparisons/equal_to.pass.cpp
    libcxx/test/std/utilities/function.objects/comparisons/greater.pass.cpp
    libcxx/test/std/utilities/function.objects/comparisons/greater_equal.pass.cpp
    libcxx/test/std/utilities/function.objects/comparisons/less.pass.cpp
    libcxx/test/std/utilities/function.objects/comparisons/less_equal.pass.cpp
    libcxx/test/std/utilities/function.objects/comparisons/not_equal_to.pass.cpp
    libcxx/test/std/utilities/function.objects/func.invoke/invoke.pass.cpp
    libcxx/test/std/utilities/function.objects/func.invoke/invoke_constexpr.pass.cpp
    libcxx/test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp
    libcxx/test/std/utilities/function.objects/func.require/binary_function.pass.cpp
    libcxx/test/std/utilities/function.objects/func.require/unary_function.pass.cpp
    libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/addressof.pass.cpp
    libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.alg/swap.pass.cpp
    libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.cap/operator_bool.pass.cpp
    libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F.pass.cpp
    libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F_assign.pass.cpp
    libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F_incomplete.pass.cpp
    libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F_nullptr.pass.cpp
    libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc.pass.cpp
    libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.pass.cpp
    libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.pass.cpp
    libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_nullptr.pass.cpp
    libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_assign.pass.cpp
    libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_move.pass.cpp
    libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/default.pass.cpp
    libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/nullptr_t.pass.cpp
    libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/nullptr_t_assign.pass.cpp
    libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke.pass.cpp
    libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.mod/assign_F_alloc.pass.cpp
    libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.mod/swap.pass.cpp
    libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.nullptr/operator_==.pass.cpp
    libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.targ/target.pass.cpp
    libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.targ/target_type.pass.cpp
    libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/noncopyable_return_type.pass.cpp
    libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/types.pass.cpp
    libcxx/test/std/utilities/function.objects/logical.operations/logical_and.pass.cpp
    libcxx/test/std/utilities/function.objects/logical.operations/logical_not.pass.cpp
    libcxx/test/std/utilities/function.objects/logical.operations/logical_or.pass.cpp
    libcxx/test/std/utilities/function.objects/negators/binary_negate.depr_in_cxx17.verify.cpp
    libcxx/test/std/utilities/function.objects/negators/binary_negate.pass.cpp
    libcxx/test/std/utilities/function.objects/negators/not1.depr_in_cxx17.verify.cpp
    libcxx/test/std/utilities/function.objects/negators/not1.pass.cpp
    libcxx/test/std/utilities/function.objects/negators/not2.depr_in_cxx17.verify.cpp
    libcxx/test/std/utilities/function.objects/negators/not2.pass.cpp
    libcxx/test/std/utilities/function.objects/negators/unary_negate.depr_in_cxx17.verify.cpp
    libcxx/test/std/utilities/function.objects/negators/unary_negate.pass.cpp
    libcxx/test/std/utilities/function.objects/refwrap/binder_typedefs.compile.pass.cpp
    libcxx/test/std/utilities/function.objects/refwrap/weak_result.pass.cpp
    libcxx/test/std/utilities/function.objects/unord.hash/enum.pass.cpp
    libcxx/test/std/utilities/function.objects/unord.hash/floating.pass.cpp
    libcxx/test/std/utilities/function.objects/unord.hash/integral.pass.cpp
    libcxx/test/std/utilities/function.objects/unord.hash/pointer.pass.cpp
    libcxx/test/std/utilities/intseq/intseq.make/make_integer_seq.fail.cpp
    libcxx/test/std/utilities/intseq/intseq.make/make_integer_seq_fallback.compile.fail.cpp
    libcxx/test/std/utilities/intseq/intseq.make/make_integer_seq_fallback.pass.cpp
    libcxx/test/std/utilities/memory/default.allocator/allocator.dtor.pass.cpp
    libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.constexpr.size.verify.cpp
    libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.size.pass.cpp
    libcxx/test/std/utilities/memory/default.allocator/allocator_types.pass.cpp
    libcxx/test/std/utilities/memory/default.allocator/allocator_types.void.compile.pass.cpp
    libcxx/test/std/utilities/memory/specialized.algorithms/buffer.h
    libcxx/test/std/utilities/memory/specialized.algorithms/counted.h
    libcxx/test/std/utilities/memory/specialized.algorithms/specialized.construct/ranges_construct_at.pass.cpp
    libcxx/test/std/utilities/memory/specialized.algorithms/specialized.destroy/ranges_destroy.pass.cpp
    libcxx/test/std/utilities/memory/specialized.algorithms/specialized.destroy/ranges_destroy_at.pass.cpp
    libcxx/test/std/utilities/memory/specialized.algorithms/specialized.destroy/ranges_destroy_n.pass.cpp
    libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.construct.default/ranges_uninitialized_default_construct.pass.cpp
    libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.construct.default/ranges_uninitialized_default_construct_n.pass.cpp
    libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.construct.value/ranges_uninitialized_value_construct.pass.cpp
    libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.construct.value/ranges_uninitialized_value_construct_n.pass.cpp
    libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.copy/ranges_uninitialized_copy.pass.cpp
    libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.copy/ranges_uninitialized_copy_n.pass.cpp
    libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.fill.n/ranges_uninitialized_fill_n.pass.cpp
    libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.fill/ranges_uninitialized_fill.pass.cpp
    libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.move/ranges_uninitialized_move.pass.cpp
    libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.move/ranges_uninitialized_move_n.pass.cpp
    libcxx/test/std/utilities/memory/storage.iterator/deprecated.verify.cpp
    libcxx/test/std/utilities/memory/storage.iterator/raw_storage_iterator.base.pass.cpp
    libcxx/test/std/utilities/memory/storage.iterator/raw_storage_iterator.pass.cpp
    libcxx/test/std/utilities/memory/storage.iterator/types.compile.pass.cpp
    libcxx/test/std/utilities/memory/temporary.buffer/overaligned.pass.cpp
    libcxx/test/std/utilities/memory/temporary.buffer/temporary_buffer.pass.cpp
    libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/auto_ptr_Y.pass.cpp
    libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/shared_ptr.pass.cpp
    libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/unique_ptr_Y.pass.cpp
    libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/auto_ptr.pass.cpp
    libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_pointer.pass.cpp
    libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp
    libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared.pass.cpp
    libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.ownerless/owner_less.pass.cpp
    libcxx/test/std/utilities/meta/meta.rel/is_convertible_fallback.pass.cpp
    libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/result_of.deprecated.verify.cpp
    libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/result_of.pass.cpp
    libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/result_of11.pass.cpp
    libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_literal_type.deprecated.verify.cpp
    libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_literal_type.pass.cpp
    libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_swappable_include_order.pass.cpp
    libcxx/test/std/utilities/optional/optional.object/optional.object.assign/copy.pass.cpp
    libcxx/test/std/utilities/optional/optional.object/optional.object.assign/move.pass.cpp
    libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/copy.pass.cpp
    libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/default.pass.cpp
    libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/move.pass.cpp
    libcxx/test/std/utilities/optional/optional.object/optional.object.observe/dereference.pass.cpp
    libcxx/test/std/utilities/optional/optional.object/optional.object.observe/dereference_const.pass.cpp
    libcxx/test/std/utilities/optional/optional.object/optional.object.observe/dereference_const_rvalue.pass.cpp
    libcxx/test/std/utilities/optional/optional.object/optional.object.observe/dereference_rvalue.pass.cpp
    libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/auto_pointer.pass.cpp
    libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/pointer_deleter.pass.cpp
    libcxx/test/std/utilities/template.bitset/bitset.hash/bitset.pass.cpp
    libcxx/test/std/utilities/template.bitset/bitset.members/index_const.pass.cpp
    libcxx/test/std/utilities/template.bitset/bitset_test_cases.h
    libcxx/test/std/utilities/tuple/tuple.general/ignore.pass.cpp
    libcxx/test/std/utilities/tuple/tuple.tuple/tuple.apply/apply.pass.cpp
    libcxx/test/std/utilities/tuple/tuple.tuple/tuple.apply/make_from_tuple.pass.cpp
    libcxx/test/std/utilities/tuple/tuple.tuple/tuple.assign/derived_from_tuple_like.pass.cpp
    libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple.include.ranges.pass.cpp
    libcxx/test/std/utilities/utility/forward/forward.pass.cpp
    libcxx/test/std/utilities/utility/forward/move.pass.cpp
    libcxx/test/std/utilities/utility/pairs/pairs.pair/trivial_copy_move.pass.cpp
    libcxx/test/std/utilities/variant/variant.hash/hash.pass.cpp
    libcxx/test/std/utilities/variant/variant.variant/variant.swap/swap.pass.cpp
    libcxx/test/support/any_helpers.h
    libcxx/test/support/asan_testing.h
    libcxx/test/support/check_assertion.h
    libcxx/test/support/container_debug_tests.h
    libcxx/test/support/container_test_types.h
    libcxx/test/support/count_new.h
    libcxx/test/support/deduction_guides_sfinae_checks.h
    libcxx/test/support/experimental_any_helpers.h
    libcxx/test/support/external_threads.cpp
    libcxx/test/support/filesystem_include.h
    libcxx/test/support/filesystem_test_helper.h
    libcxx/test/support/msvc_stdlib_force_include.h
    libcxx/test/support/nasty_containers.h
    libcxx/test/support/parse_integer.h
    libcxx/test/support/platform_support.h
    libcxx/test/support/poisoned_hash_helper.h
    libcxx/test/support/read_write.h
    libcxx/test/support/test.support/make_string_header.pass.cpp
    libcxx/test/support/test.support/test_check_assertion.pass.cpp
    libcxx/test/support/test.support/test_proxy.pass.cpp
    libcxx/test/support/test_format_context.h
    libcxx/test/support/test_iterators.h
    libcxx/test/support/test_macros.h
    libcxx/test/support/variant_test_helpers.h
    libcxx/utils/ci/oss-fuzz.sh
    libcxx/utils/ci/run-buildbot
    libcxx/utils/gdb/libcxx/printers.py
    libcxx/utils/generate_extended_grapheme_cluster_table.py
    libcxx/utils/generate_feature_test_macro_components.py
    libcxx/utils/generate_header_inclusion_tests.py
    libcxx/utils/generate_header_tests.py
    libcxx/utils/libcxx/test/dsl.py
    libcxx/utils/libcxx/test/features.py
    libcxx/utils/libcxx/test/params.py
    libcxxabi/CMakeLists.txt
    libcxxabi/include/cxxabi.h
    libcxxabi/src/CMakeLists.txt
    libcxxabi/src/cxa_default_handlers.cpp
    libcxxabi/src/cxa_exception.cpp
    libcxxabi/src/cxa_exception_storage.cpp
    libcxxabi/src/cxa_guard.cpp
    libcxxabi/src/cxa_guard_impl.h
    libcxxabi/src/cxa_handlers.cpp
    libcxxabi/src/cxa_thread_atexit.cpp
    libcxxabi/src/fallback_malloc.cpp
    libcxxabi/src/stdlib_new_delete.cpp
    libcxxabi/src/stdlib_stdexcept.cpp
    libcxxabi/test/configs/apple-libc++abi-backdeployment.cfg.in
    libcxxabi/test/configs/apple-libc++abi-shared.cfg.in
    libcxxabi/test/configs/ibm-libc++abi-shared.cfg.in
    libcxxabi/test/configs/llvm-libc++abi-merged.cfg.in
    libcxxabi/test/configs/llvm-libc++abi-mingw.cfg.in
    libcxxabi/test/configs/llvm-libc++abi-shared-clangcl.cfg.in
    libcxxabi/test/configs/llvm-libc++abi-shared-gcc.cfg.in
    libcxxabi/test/configs/llvm-libc++abi-shared.cfg.in
    libcxxabi/test/configs/llvm-libc++abi-static-clangcl.cfg.in
    libcxxabi/test/configs/llvm-libc++abi-static.cfg.in
    libcxxabi/test/guard_test_basic.pass.cpp
    libcxxabi/test/guard_threaded_test.pass.cpp
    libcxxabi/test/libcxxabi/test/config.py
    libcxxabi/test/test_exception_storage.pass.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/.clang-format b/libcxx/.clang-format
index acc6773c16de..0252600de999 100644
--- a/libcxx/.clang-format
+++ b/libcxx/.clang-format
@@ -10,49 +10,49 @@ AllowAllArgumentsOnNextLine: true
 AllowAllParametersOfDeclarationOnNextLine: true
 AllowShortFunctionsOnASingleLine: true
 AllowShortLambdasOnASingleLine: All
-AttributeMacros: ['_LIBCPP_HIDE_FROM_ABI',
-                  '_LIBCPP_CONSTEXPR',
-                  '_LIBCPP_CONSTEXPR_AFTER_CXX11',
-                  '_LIBCPP_CONSTEXPR_AFTER_CXX14',
-                  '_LIBCPP_CONSTEXPR_AFTER_CXX17',
-                  '_LIBCPP_CONSTEXPR_AFTER_CXX20',
-                  '_LIBCPP_ALIGNOF',
+AttributeMacros: ['_LIBCUDACXX_HIDE_FROM_ABI',
+                  '_LIBCUDACXX_CONSTEXPR',
+                  '_LIBCUDACXX_CONSTEXPR_AFTER_CXX11',
+                  '_LIBCUDACXX_CONSTEXPR_AFTER_CXX14',
+                  '_LIBCUDACXX_CONSTEXPR_AFTER_CXX17',
+                  '_LIBCUDACXX_CONSTEXPR_AFTER_CXX20',
+                  '_LIBCUDACXX_ALIGNOF',
                   '_ALIGNAS_TYPE',
                   '_ALIGNAS',
-                  '_LIBCPP_NORETURN',
-                  '_LIBCPP_ALWAYS_INLINE',
-                  '_LIBCPP_DISABLE_EXTENTSION_WARNING',
-                  '_LIBCPP_HIDDEN',
-                  '_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS',
-                  '_LIBCPP_FUNC_VIS',
-                  '_LIBCPP_TYPE_VIS',
-                  '_LIBCPP_TEMPLATE_VIS',
-                  '_LIBCPP_TEMPLATE_DATA_VIS',
-                  '_LIBCPP_EXPORTED_FROM_ABI',
-                  '_LIBCPP_OVERRIDABLE_FUNC_VIS',
-                  '_LIBCPP_EXCEPTION_ABI',
-                  '_LIBCPP_ENUM_VIS',
-                  '_LIBCPP_EXTERN_TEMPLATE_TYPE_VIS',
-                  '_LIBCPP_INTERNAL_LINKAGE',
-                  '_LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION',
-                  '_LIBCPP_HIDE_FROM_ABI_AFTER_V1',
-                  '_LIBCPP_INLINE_VISIBILITY',
-                  '_LIBCPP_CONSTEVAL',
-                  '_LIBCPP_NOALIAS',
-                  '_LIBCPP_USING_IF_EXISTS',
-                  '_LIBCPP_DEPRECATED',
-                  '_LIBCPP_DEPRECATED_IN_CXX11',
-                  '_LIBCPP_DEPRECATED_IN_CXX14',
-                  '_LIBCPP_DEPRECATED_IN_CXX17',
-                  '_LIBCPP_DEPRECATED_IN_CXX20',
-                  '_LIBCPP_NODISCARD',
-                  '_LIBCPP_NODISCARD_EXT',
-                  '_LIBCPP_NO_DESTROY',
-                  '_LIBCPP_WEAK',
-                  '_LIBCPP_CONSTINIT',
-                  '_LIBCPP_FALLTHROUGH',
-                  '_LIBCPP_STANDALONE_DEBUG',
-                  '_LIBCPP_NO_UNIQUE_ADDRESS',
+                  '_LIBCUDACXX_NORETURN',
+                  '_LIBCUDACXX_ALWAYS_INLINE',
+                  '_LIBCUDACXX_DISABLE_EXTENTSION_WARNING',
+                  '_LIBCUDACXX_HIDDEN',
+                  '_LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS',
+                  '_LIBCUDACXX_FUNC_VIS',
+                  '_LIBCUDACXX_TYPE_VIS',
+                  '_LIBCUDACXX_TEMPLATE_VIS',
+                  '_LIBCUDACXX_TEMPLATE_DATA_VIS',
+                  '_LIBCUDACXX_EXPORTED_FROM_ABI',
+                  '_LIBCUDACXX_OVERRIDABLE_FUNC_VIS',
+                  '_LIBCUDACXX_EXCEPTION_ABI',
+                  '_LIBCUDACXX_ENUM_VIS',
+                  '_LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS',
+                  '_LIBCUDACXX_INTERNAL_LINKAGE',
+                  '_LIBCUDACXX_EXCLUDE_FROM_EXPLICIT_INSTANTIATION',
+                  '_LIBCUDACXX_HIDE_FROM_ABI_AFTER_V1',
+                  '_LIBCUDACXX_INLINE_VISIBILITY',
+                  '_LIBCUDACXX_CONSTEVAL',
+                  '_LIBCUDACXX_NOALIAS',
+                  '_LIBCUDACXX_USING_IF_EXISTS',
+                  '_LIBCUDACXX_DEPRECATED',
+                  '_LIBCUDACXX_DEPRECATED_IN_CXX11',
+                  '_LIBCUDACXX_DEPRECATED_IN_CXX14',
+                  '_LIBCUDACXX_DEPRECATED_IN_CXX17',
+                  '_LIBCUDACXX_DEPRECATED_IN_CXX20',
+                  '_LIBCUDACXX_NODISCARD',
+                  '_LIBCUDACXX_NODISCARD_EXT',
+                  '_LIBCUDACXX_NO_DESTROY',
+                  '_LIBCUDACXX_WEAK',
+                  '_LIBCUDACXX_CONSTINIT',
+                  '_LIBCUDACXX_FALLTHROUGH',
+                  '_LIBCUDACXX_STANDALONE_DEBUG',
+                  '_LIBCUDACXX_NO_UNIQUE_ADDRESS',
                  ]
 BinPackArguments: false
 BinPackParameters: false

diff  --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
index 74eff2002fc9..281f1d570d75 100644
--- a/libcxx/CMakeLists.txt
+++ b/libcxx/CMakeLists.txt
@@ -557,25 +557,25 @@ function(cxx_add_basic_build_flags target)
 
   # Let the library headers know they are currently being used to build the
   # library.
-  target_compile_definitions(${target} PRIVATE -D_LIBCPP_BUILDING_LIBRARY)
+  target_compile_definitions(${target} PRIVATE -D_LIBCUDACXX_BUILDING_LIBRARY)
 
   if (NOT LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS)
-    target_compile_definitions(${target} PRIVATE -D_LIBCPP_DISABLE_NEW_DELETE_DEFINITIONS)
+    target_compile_definitions(${target} PRIVATE -D_LIBCUDACXX_DISABLE_NEW_DELETE_DEFINITIONS)
   endif()
 
   if (C_SUPPORTS_COMMENT_LIB_PRAGMA)
     if (LIBCXX_HAS_PTHREAD_LIB)
-      target_compile_definitions(${target} PRIVATE -D_LIBCPP_LINK_PTHREAD_LIB)
+      target_compile_definitions(${target} PRIVATE -D_LIBCUDACXX_LINK_PTHREAD_LIB)
     endif()
     if (LIBCXX_HAS_RT_LIB)
-      target_compile_definitions(${target} PRIVATE -D_LIBCPP_LINK_RT_LIB)
+      target_compile_definitions(${target} PRIVATE -D_LIBCUDACXX_LINK_RT_LIB)
     endif()
   endif()
 endfunction()
 
 # Warning flags ===============================================================
 function(cxx_add_warning_flags target)
-  target_compile_definitions(${target} PUBLIC -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+  target_compile_definitions(${target} PUBLIC -D_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
   if (MSVC)
     # -W4 is the cl.exe/clang-cl equivalent of -Wall. (In cl.exe and clang-cl,
     # -Wall is equivalent to -Weverything in GCC style compiler drivers.)
@@ -833,45 +833,45 @@ function(cxx_add_windows_flags target)
 endfunction()
 
 # Configuration file flags =====================================================
-config_define(${LIBCXX_ABI_VERSION} _LIBCPP_ABI_VERSION)
-config_define(${LIBCXX_ABI_NAMESPACE} _LIBCPP_ABI_NAMESPACE)
-config_define_if(LIBCXX_ABI_FORCE_ITANIUM _LIBCPP_ABI_FORCE_ITANIUM)
-config_define_if(LIBCXX_ABI_FORCE_MICROSOFT _LIBCPP_ABI_FORCE_MICROSOFT)
-config_define_if_not(LIBCXX_ENABLE_THREADS _LIBCPP_HAS_NO_THREADS)
-config_define_if_not(LIBCXX_ENABLE_MONOTONIC_CLOCK _LIBCPP_HAS_NO_MONOTONIC_CLOCK)
+config_define(${LIBCXX_ABI_VERSION} _LIBCUDACXX_ABI_VERSION)
+config_define(${LIBCXX_ABI_NAMESPACE} _LIBCUDACXX_ABI_NAMESPACE)
+config_define_if(LIBCXX_ABI_FORCE_ITANIUM _LIBCUDACXX_ABI_FORCE_ITANIUM)
+config_define_if(LIBCXX_ABI_FORCE_MICROSOFT _LIBCUDACXX_ABI_FORCE_MICROSOFT)
+config_define_if_not(LIBCXX_ENABLE_THREADS _LIBCUDACXX_HAS_NO_THREADS)
+config_define_if_not(LIBCXX_ENABLE_MONOTONIC_CLOCK _LIBCUDACXX_HAS_NO_MONOTONIC_CLOCK)
 if (NOT LIBCXX_TYPEINFO_COMPARISON_IMPLEMENTATION STREQUAL "default")
-  config_define("${LIBCXX_TYPEINFO_COMPARISON_IMPLEMENTATION}" _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION)
-endif()
-config_define_if(LIBCXX_HAS_PTHREAD_API _LIBCPP_HAS_THREAD_API_PTHREAD)
-config_define_if(LIBCXX_HAS_EXTERNAL_THREAD_API _LIBCPP_HAS_THREAD_API_EXTERNAL)
-config_define_if(LIBCXX_HAS_WIN32_THREAD_API _LIBCPP_HAS_THREAD_API_WIN32)
-config_define_if(LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY _LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL)
-config_define_if(LIBCXX_HAS_MUSL_LIBC _LIBCPP_HAS_MUSL_LIBC)
-config_define_if(LIBCXX_NO_VCRUNTIME _LIBCPP_NO_VCRUNTIME)
-config_define_if(LIBCXX_ENABLE_PARALLEL_ALGORITHMS _LIBCPP_HAS_PARALLEL_ALGORITHMS)
-config_define_if_not(LIBCXX_ENABLE_FILESYSTEM _LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
-config_define_if_not(LIBCXX_ENABLE_RANDOM_DEVICE _LIBCPP_HAS_NO_RANDOM_DEVICE)
-config_define_if_not(LIBCXX_ENABLE_LOCALIZATION _LIBCPP_HAS_NO_LOCALIZATION)
-config_define_if_not(LIBCXX_ENABLE_UNICODE _LIBCPP_HAS_NO_UNICODE)
-config_define_if_not(LIBCXX_ENABLE_WIDE_CHARACTERS _LIBCPP_HAS_NO_WIDE_CHARACTERS)
-config_define_if_not(LIBCXX_ENABLE_VENDOR_AVAILABILITY_ANNOTATIONS _LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS)
-config_define_if(LIBCXX_ENABLE_DEBUG_MODE _LIBCPP_ENABLE_DEBUG_MODE)
+  config_define("${LIBCXX_TYPEINFO_COMPARISON_IMPLEMENTATION}" _LIBCUDACXX_TYPEINFO_COMPARISON_IMPLEMENTATION)
+endif()
+config_define_if(LIBCXX_HAS_PTHREAD_API _LIBCUDACXX_HAS_THREAD_API_PTHREAD)
+config_define_if(LIBCXX_HAS_EXTERNAL_THREAD_API _LIBCUDACXX_HAS_THREAD_API_EXTERNAL)
+config_define_if(LIBCXX_HAS_WIN32_THREAD_API _LIBCUDACXX_HAS_THREAD_API_WIN32)
+config_define_if(LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY _LIBCUDACXX_HAS_THREAD_LIBRARY_EXTERNAL)
+config_define_if(LIBCXX_HAS_MUSL_LIBC _LIBCUDACXX_HAS_MUSL_LIBC)
+config_define_if(LIBCXX_NO_VCRUNTIME _LIBCUDACXX_NO_VCRUNTIME)
+config_define_if(LIBCXX_ENABLE_PARALLEL_ALGORITHMS _LIBCUDACXX_HAS_PARALLEL_ALGORITHMS)
+config_define_if_not(LIBCXX_ENABLE_FILESYSTEM _LIBCUDACXX_HAS_NO_FILESYSTEM_LIBRARY)
+config_define_if_not(LIBCXX_ENABLE_RANDOM_DEVICE _LIBCUDACXX_HAS_NO_RANDOM_DEVICE)
+config_define_if_not(LIBCXX_ENABLE_LOCALIZATION _LIBCUDACXX_HAS_NO_LOCALIZATION)
+config_define_if_not(LIBCXX_ENABLE_UNICODE _LIBCUDACXX_HAS_NO_UNICODE)
+config_define_if_not(LIBCXX_ENABLE_WIDE_CHARACTERS _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS)
+config_define_if_not(LIBCXX_ENABLE_VENDOR_AVAILABILITY_ANNOTATIONS _LIBCUDACXX_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS)
+config_define_if(LIBCXX_ENABLE_DEBUG_MODE _LIBCUDACXX_ENABLE_DEBUG_MODE)
 if (LIBCXX_ENABLE_ASSERTIONS)
-  config_define(1 _LIBCPP_ENABLE_ASSERTIONS_DEFAULT)
+  config_define(1 _LIBCUDACXX_ENABLE_ASSERTIONS_DEFAULT)
 else()
-  config_define(0 _LIBCPP_ENABLE_ASSERTIONS_DEFAULT)
+  config_define(0 _LIBCUDACXX_ENABLE_ASSERTIONS_DEFAULT)
 endif()
 
 if (LIBCXX_ABI_DEFINES)
   set(abi_defines)
   foreach (abi_define ${LIBCXX_ABI_DEFINES})
-    if (NOT abi_define MATCHES "^_LIBCPP_ABI_")
+    if (NOT abi_define MATCHES "^_LIBCUDACXX_ABI_")
       message(SEND_ERROR "Invalid ABI macro ${abi_define} in LIBCXX_ABI_DEFINES")
     endif()
     list(APPEND abi_defines "#define ${abi_define}")
   endforeach()
   string(REPLACE ";" "\n" abi_defines "${abi_defines}")
-  config_define(${abi_defines} _LIBCPP_ABI_DEFINES)
+  config_define(${abi_defines} _LIBCUDACXX_ABI_DEFINES)
 endif()
 
 if (LIBCXX_EXTRA_SITE_DEFINES)
@@ -882,7 +882,7 @@ if (LIBCXX_EXTRA_SITE_DEFINES)
     list(APPEND extra_site_defines "#define ${extra_site_define}")
   endforeach()
   string(REPLACE ";" "\n" extra_site_defines "${extra_site_defines}")
-  config_define(${extra_site_defines} _LIBCPP_EXTRA_SITE_DEFINES)
+  config_define(${extra_site_defines} _LIBCUDACXX_EXTRA_SITE_DEFINES)
 endif()
 
 # By default libc++ on Windows expects to use a shared library, which requires
@@ -890,7 +890,7 @@ endif()
 # static library only we modify the headers to disable DLL import/export.
 if (DEFINED WIN32 AND LIBCXX_ENABLE_STATIC AND NOT LIBCXX_ENABLE_SHARED)
   message(STATUS "Generating custom __config for non-DLL Windows build")
-  config_define(ON _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
+  config_define(ON _LIBCUDACXX_DISABLE_VISIBILITY_ANNOTATIONS)
 endif()
 
 if (WIN32 AND LIBCXX_ENABLE_STATIC_ABI_LIBRARY)

diff  --git a/libcxx/benchmarks/std_format_spec_string_unicode.bench.cpp b/libcxx/benchmarks/std_format_spec_string_unicode.bench.cpp
index 3769e964269d..a8ac579f3618 100644
--- a/libcxx/benchmarks/std_format_spec_string_unicode.bench.cpp
+++ b/libcxx/benchmarks/std_format_spec_string_unicode.bench.cpp
@@ -4,7 +4,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_HAS_NO_UNICODE
+#ifndef _LIBCUDACXX_HAS_NO_UNICODE
 
 #  include <format>
 #  include <string_view>

diff  --git a/libcxx/cmake/Modules/HandleLibCXXABI.cmake b/libcxx/cmake/Modules/HandleLibCXXABI.cmake
index e77a4156071b..a194f94d3e06 100644
--- a/libcxx/cmake/Modules/HandleLibCXXABI.cmake
+++ b/libcxx/cmake/Modules/HandleLibCXXABI.cmake
@@ -170,7 +170,7 @@ elseif ("${LIBCXX_CXX_ABI}" STREQUAL "vcruntime")
 # Don't link against any ABI library
 elseif ("${LIBCXX_CXX_ABI}" STREQUAL "none")
   add_library(libcxx-abi-headers INTERFACE)
-  target_compile_definitions(libcxx-abi-headers INTERFACE "-D_LIBCPP_BUILDING_HAS_NO_ABI_LIBRARY")
+  target_compile_definitions(libcxx-abi-headers INTERFACE "-D_LIBCUDACXX_BUILDING_HAS_NO_ABI_LIBRARY")
 
   add_library(libcxx-abi-shared INTERFACE)
   target_link_libraries(libcxx-abi-shared INTERFACE libcxx-abi-headers)

diff  --git a/libcxx/docs/BuildingLibcxx.rst b/libcxx/docs/BuildingLibcxx.rst
index f365aac7e81a..fb4036689d94 100644
--- a/libcxx/docs/BuildingLibcxx.rst
+++ b/libcxx/docs/BuildingLibcxx.rst
@@ -218,7 +218,7 @@ libc++ specific options
 
   Build libc++ with assertions enabled in the compiled library, and enable assertions
   by default when building user code as well. Assertions can be turned off by users
-  by defining ``_LIBCPP_ENABLE_ASSERTIONS=0``. For details, see
+  by defining ``_LIBCUDACXX_ENABLE_ASSERTIONS=0``. For details, see
   :ref:`the documentation <assertions-mode>`.
 
 .. option:: LIBCXX_ENABLE_SHARED:BOOL

diff  --git a/libcxx/docs/Contributing.rst b/libcxx/docs/Contributing.rst
index 15c75e8c5168..b3b0af01dc9d 100644
--- a/libcxx/docs/Contributing.rst
+++ b/libcxx/docs/Contributing.rst
@@ -39,7 +39,7 @@ sure you don't forget anything:
 
   - Did you add it to ``include/module.modulemap.in``?
   - Did you add it to ``include/CMakeLists.txt``?
-  - If it's a public header, did you add a test under ``test/libcxx`` that the new header defines ``_LIBCPP_VERSION``? See ``test/libcxx/algorithms/version.pass.cpp`` for an example. NOTE: This should be automated.
+  - If it's a public header, did you add a test under ``test/libcxx`` that the new header defines ``_LIBCUDACXX_VERSION``? See ``test/libcxx/algorithms/version.pass.cpp`` for an example. NOTE: This should be automated.
   - If it's a public header, did you update ``utils/generate_header_inclusion_tests.py``?
 
 - Did you add the relevant feature test macro(s) for your feature? Did you update the ``generate_feature_test_macro_components.py`` script with it?
@@ -66,9 +66,9 @@ Post-release check list
 
 After branching for an LLVM release:
 
-1. Update ``_LIBCPP_VERSION`` in ``libcxx/include/__config``
+1. Update ``_LIBCUDACXX_VERSION`` in ``libcxx/include/__config``
 2. Update the version number in ``libcxx/docs/conf.py``
-3. Update ``_LIBCPPABI_VERSION`` in ``libcxxabi/include/cxxabi.h``
+3. Update ``_LIBCUDACXXABI_VERSION`` in ``libcxxabi/include/cxxabi.h``
 4. Update ``_LIBUNWIND_VERSION`` in ``libunwind/include/__libunwind_config.h``
 
 Exporting new symbols from the library

diff  --git a/libcxx/docs/DesignDocs/ABIVersioning.rst b/libcxx/docs/DesignDocs/ABIVersioning.rst
index 3b82f3cc60a4..9086003c0e11 100644
--- a/libcxx/docs/DesignDocs/ABIVersioning.rst
+++ b/libcxx/docs/DesignDocs/ABIVersioning.rst
@@ -18,7 +18,7 @@ To always use the most cutting-edge, most unstable ABI (which is currently ``2``
 but at some point will become ``3``), set the CMake option ``LIBCXX_ABI_UNSTABLE``.
 
 Internally, each ABI-changing feature is placed under its own C++ macro,
-``_LIBCPP_ABI_XXX``. These macros' definitions are controlled by the C++ macro
-``_LIBCPP_ABI_VERSION``, which is controlled by the ``LIBCXX_ABI_VERSION`` set
+``_LIBCUDACXX_ABI_XXX``. These macros' definitions are controlled by the C++ macro
+``_LIBCUDACXX_ABI_VERSION``, which is controlled by the ``LIBCXX_ABI_VERSION`` set
 at build time. Libc++ does not intend users to interact with these C++ macros
 directly.

diff  --git a/libcxx/docs/DesignDocs/DebugMode.rst b/libcxx/docs/DesignDocs/DebugMode.rst
index 9d0e78e7581b..538d0fa3fd61 100644
--- a/libcxx/docs/DesignDocs/DebugMode.rst
+++ b/libcxx/docs/DesignDocs/DebugMode.rst
@@ -58,4 +58,4 @@ the relative order of equal elements in ``std::sort`` or randomizing both parts
 partition after calling ``std::nth_element``. This effort helps migrating to potential
 future faster versions of these algorithms that might not have the exact same behavior.
 In particular, it makes it easier to deflake tests that depend on unspecified behavior.
-A seed can be used to make such failures reproducible: use ``_LIBCPP_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY_SEED=seed``.
+A seed can be used to make such failures reproducible: use ``_LIBCUDACXX_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY_SEED=seed``.

diff  --git a/libcxx/docs/DesignDocs/ExperimentalFeatures.rst b/libcxx/docs/DesignDocs/ExperimentalFeatures.rst
index defe0e4e2428..ef51a04083c6 100644
--- a/libcxx/docs/DesignDocs/ExperimentalFeatures.rst
+++ b/libcxx/docs/DesignDocs/ExperimentalFeatures.rst
@@ -43,7 +43,7 @@ warning for the corresponding experimental feature warning users to move off
 of it and to the now-standardized feature.
 
 These deprecation warnings are guarded by a macro of the form
-``_LIBCPP_NO_EXPERIMENTAL_DEPRECATION_WARNING_<FEATURE>``, which
+``_LIBCUDACXX_NO_EXPERIMENTAL_DEPRECATION_WARNING_<FEATURE>``, which
 can be defined by users to disable the deprecation warning. Whenever
 possible, deprecation warnings are put on a per-declaration basis
 using the ``[[deprecated]]`` attribute, which also allows disabling

diff  --git a/libcxx/docs/DesignDocs/ThreadingSupportAPI.rst b/libcxx/docs/DesignDocs/ThreadingSupportAPI.rst
index 330ce74cf77a..d37292615ff3 100644
--- a/libcxx/docs/DesignDocs/ThreadingSupportAPI.rst
+++ b/libcxx/docs/DesignDocs/ThreadingSupportAPI.rst
@@ -25,7 +25,7 @@ In order to support vendors with custom threading API's libc++ allows the
 entire internal threading interface to be provided by an external,
 vendor provided, header.
 
-When ``_LIBCPP_HAS_THREAD_API_EXTERNAL`` is defined the ``<__threading_support>``
+When ``_LIBCUDACXX_HAS_THREAD_API_EXTERNAL`` is defined the ``<__threading_support>``
 header simply forwards to the ``<__external_threading>`` header (which must exist).
 It is expected that the ``<__external_threading>`` header provide the exact
 interface normally provided by ``<__threading_support>``.
@@ -53,30 +53,30 @@ developers.
 Threading Configuration Macros
 ==============================
 
-**_LIBCPP_HAS_NO_THREADS**
+**_LIBCUDACXX_HAS_NO_THREADS**
   This macro is defined when libc++ is built without threading support. It
   should not be manually defined by the user.
 
-**_LIBCPP_HAS_THREAD_API_EXTERNAL**
+**_LIBCUDACXX_HAS_THREAD_API_EXTERNAL**
   This macro is defined when libc++ should use the ``<__external_threading>``
   header to provide the internal threading API. This macro overrides
-  ``_LIBCPP_HAS_THREAD_API_PTHREAD``.
+  ``_LIBCUDACXX_HAS_THREAD_API_PTHREAD``.
 
-**_LIBCPP_HAS_THREAD_API_PTHREAD**
+**_LIBCUDACXX_HAS_THREAD_API_PTHREAD**
   This macro is defined when libc++ should use POSIX threads to implement the
   internal threading API.
 
-**_LIBCPP_HAS_THREAD_API_WIN32**
+**_LIBCUDACXX_HAS_THREAD_API_WIN32**
   This macro is defined when libc++ should use Win32 threads to implement the
   internal threading API.
 
-**_LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL**
+**_LIBCUDACXX_HAS_THREAD_LIBRARY_EXTERNAL**
   This macro is defined when libc++ expects the definitions of the internal
   threading API to be provided by an external library. When defined
   ``<__threading_support>`` will only provide the forward declarations and
   typedefs for the internal threading API.
 
-**_LIBCPP_BUILDING_THREAD_LIBRARY_EXTERNAL**
+**_LIBCUDACXX_BUILDING_THREAD_LIBRARY_EXTERNAL**
   This macro is used to build an external threading library using the
   ``<__threading_support>``. Specifically it exposes the threading API
   definitions in ``<__threading_support>`` as non-inline definitions meant to

diff  --git a/libcxx/docs/DesignDocs/UnspecifiedBehaviorRandomization.rst b/libcxx/docs/DesignDocs/UnspecifiedBehaviorRandomization.rst
index 7e92e27120b5..a279c1eb94cc 100644
--- a/libcxx/docs/DesignDocs/UnspecifiedBehaviorRandomization.rst
+++ b/libcxx/docs/DesignDocs/UnspecifiedBehaviorRandomization.rst
@@ -35,7 +35,7 @@ to gradually fix their tests while updating to new faster algorithms.
 Design
 ======
 
-* Introduce new macro ``_LIBCPP_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY`` which should
+* Introduce new macro ``_LIBCUDACXX_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY`` which should
   be a part of the libcxx config.
 * This macro randomizes the unspecified behavior of algorithms and containers.
   For example, for sorting algorithm the input range is shuffled and then
@@ -50,7 +50,7 @@ Design
   runs, for example, for tests become flaky and eventually be seen as broken.
   For platforms which do not support ASLR, the seed is fixed during build.
 * The users can fix the seed of the random number generator by providing
-  ``_LIBCPP_RANDOMIZE_UNSPECIFIED_STABILITY_SEED=seed`` definition.
+  ``_LIBCUDACXX_RANDOMIZE_UNSPECIFIED_STABILITY_SEED=seed`` definition.
 
 This comes with some side effects if any of the flags is on:
 

diff  --git a/libcxx/docs/DesignDocs/VisibilityMacros.rst b/libcxx/docs/DesignDocs/VisibilityMacros.rst
index d1c162682b66..e7b1df4f983a 100644
--- a/libcxx/docs/DesignDocs/VisibilityMacros.rst
+++ b/libcxx/docs/DesignDocs/VisibilityMacros.rst
@@ -17,22 +17,22 @@ visibility and inlining characteristics of the symbols they are applied to.
 Visibility Macros
 =================
 
-**_LIBCPP_HIDDEN**
+**_LIBCUDACXX_HIDDEN**
   Mark a symbol as hidden so it will not be exported from shared libraries.
 
-**_LIBCPP_FUNC_VIS**
+**_LIBCUDACXX_FUNC_VIS**
   Mark a symbol as being exported by the libc++ library. This attribute must
   be applied to the declaration of all functions exported by the libc++ dylib.
 
-**_LIBCPP_EXPORTED_FROM_ABI**
+**_LIBCUDACXX_EXPORTED_FROM_ABI**
   Mark a symbol as being exported by the libc++ library. This attribute may
   only be applied to objects defined in the libc++ runtime library. On Windows,
   this macro applies `dllimport`/`dllexport` to the symbol, and on other
   platforms it gives the symbol default visibility.
 
-**_LIBCPP_OVERRIDABLE_FUNC_VIS**
+**_LIBCUDACXX_OVERRIDABLE_FUNC_VIS**
   Mark a symbol as being exported by the libc++ library, but allow it to be
-  overridden locally. On non-Windows, this is equivalent to `_LIBCPP_FUNC_VIS`.
+  overridden locally. On non-Windows, this is equivalent to `_LIBCUDACXX_FUNC_VIS`.
   This macro is applied to all `operator new` and `operator delete` overloads.
 
   **Windows Behavior**: Any symbol marked `dllimport` cannot be overridden
@@ -42,16 +42,16 @@ Visibility Macros
   this macro therefore expands to `__declspec(dllexport)` when building the
   library and has an empty definition otherwise.
 
-**_LIBCPP_HIDE_FROM_ABI**
+**_LIBCUDACXX_HIDE_FROM_ABI**
   Mark a function as not being part of the ABI of any final linked image that
   uses it.
 
-**_LIBCPP_INLINE_VISIBILITY**
-  Historical predecessor of ``_LIBCPP_HIDE_FROM_ABI`` -- please use
-  ``_LIBCPP_HIDE_FROM_ABI`` instead.
+**_LIBCUDACXX_INLINE_VISIBILITY**
+  Historical predecessor of ``_LIBCUDACXX_HIDE_FROM_ABI`` -- please use
+  ``_LIBCUDACXX_HIDE_FROM_ABI`` instead.
 
-**_LIBCPP_HIDE_FROM_ABI_AFTER_V1**
-  Mark a function as being hidden from the ABI (per `_LIBCPP_HIDE_FROM_ABI`)
+**_LIBCUDACXX_HIDE_FROM_ABI_AFTER_V1**
+  Mark a function as being hidden from the ABI (per `_LIBCUDACXX_HIDE_FROM_ABI`)
   when libc++ is built with an ABI version after ABI v1. This macro is used to
   maintain ABI compatibility for symbols that have been historically exported
   by libc++ in v1 of the ABI, but that we don't want to export in the future.
@@ -62,14 +62,14 @@ Visibility Macros
   building libc++), the macro always marks symbols as internal so that programs
   built using new libc++ headers stop relying on symbols that are removed from
   the ABI in a future version. Each time we release a new stable version of the
-  ABI, we should create a new _LIBCPP_HIDE_FROM_ABI_AFTER_XXX macro, and we can
+  ABI, we should create a new _LIBCUDACXX_HIDE_FROM_ABI_AFTER_XXX macro, and we can
   use it to start removing symbols from the ABI after that stable version.
 
-**_LIBCPP_TYPE_VIS**
+**_LIBCUDACXX_TYPE_VIS**
   Mark a type's typeinfo, vtable and members as having default visibility.
   This attribute cannot be used on class templates.
 
-**_LIBCPP_TEMPLATE_VIS**
+**_LIBCUDACXX_TEMPLATE_VIS**
   Mark a type's typeinfo and vtable as having default visibility.
   This macro has no effect on the visibility of the type's member functions.
 
@@ -81,7 +81,7 @@ Visibility Macros
   The macro has an empty definition on this platform.
 
 
-**_LIBCPP_ENUM_VIS**
+**_LIBCUDACXX_ENUM_VIS**
   Mark the typeinfo of an enum as having default visibility. This attribute
   should be applied to all enum declarations.
 
@@ -93,12 +93,12 @@ Visibility Macros
   attribute to an enum class results in a warning. The macro has an empty
   definition with GCC.
 
-**_LIBCPP_EXTERN_TEMPLATE_TYPE_VIS**
+**_LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS**
   Mark the member functions, typeinfo, and vtable of the type named in
   an extern template declaration as being exported by the libc++ library.
   This attribute must be specified on all extern class template declarations.
 
-  This macro is used to override the `_LIBCPP_TEMPLATE_VIS` attribute
+  This macro is used to override the `_LIBCUDACXX_TEMPLATE_VIS` attribute
   specified on the primary template and to export the member functions produced
   by the explicit instantiation in the dylib.
 
@@ -111,10 +111,10 @@ Visibility Macros
   explicit instantiations themselves are marked as exported. Note that this
   applies *only* to extern *class* templates. Extern *function* templates obey
   regular import/export semantics, and applying `dllexport` directly to the
-  extern template declaration (i.e. using `_LIBCPP_FUNC_VIS`) is the correct
+  extern template declaration (i.e. using `_LIBCUDACXX_FUNC_VIS`) is the correct
   thing to do for them.
 
-**_LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS**
+**_LIBCUDACXX_CLASS_TEMPLATE_INSTANTIATION_VIS**
   Mark the member functions, typeinfo, and vtable of an explicit instantiation
   of a class template as being exported by the libc++ library. This attribute
   must be specified on all class template explicit instantiations.
@@ -123,22 +123,22 @@ Visibility Macros
   the extern template declaration) as exported on Windows, as discussed above.
   On all other platforms, this macro has an empty definition.
 
-**_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS**
+**_LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS**
   Mark a symbol as hidden so it will not be exported from shared libraries. This
   is intended specifically for method templates of either classes marked with
-  `_LIBCPP_TYPE_VIS` or classes with an extern template instantiation
-  declaration marked with `_LIBCPP_EXTERN_TEMPLATE_TYPE_VIS`.
+  `_LIBCUDACXX_TYPE_VIS` or classes with an extern template instantiation
+  declaration marked with `_LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS`.
 
   When building libc++ with hidden visibility, we want explicit template
   instantiations to export members, which is consistent with existing Windows
-  behavior. We also want classes annotated with `_LIBCPP_TYPE_VIS` to export
+  behavior. We also want classes annotated with `_LIBCUDACXX_TYPE_VIS` to export
   their members, which is again consistent with existing Windows behavior.
   Both these changes are necessary for clients to be able to link against a
   libc++ DSO built with hidden visibility without encountering missing symbols.
 
   An unfortunate side effect, however, is that method templates of classes
-  either marked `_LIBCPP_TYPE_VIS` or with extern template instantiation
-  declarations marked with `_LIBCPP_EXTERN_TEMPLATE_TYPE_VIS` also get default
+  either marked `_LIBCUDACXX_TYPE_VIS` or with extern template instantiation
+  declarations marked with `_LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS` also get default
   visibility when instantiated. These methods are often implicitly instantiated
   inside other libraries which use the libc++ headers, and will therefore end up
   being exported from those libraries, since those implicit instantiations will
@@ -149,10 +149,10 @@ Visibility Macros
   either hidden (via this macro) or inline, so that they don't leak into client
   libraries. The problematic methods were found by running
   `bad-visibility-finder <https://github.com/smeenai/bad-visibility-finder>`_
-  against the libc++ headers after making `_LIBCPP_TYPE_VIS` and
-  `_LIBCPP_EXTERN_TEMPLATE_TYPE_VIS` expand to default visibility.
+  against the libc++ headers after making `_LIBCUDACXX_TYPE_VIS` and
+  `_LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS` expand to default visibility.
 
-**_LIBCPP_EXCEPTION_ABI**
+**_LIBCUDACXX_EXCEPTION_ABI**
   Mark the member functions, typeinfo, and vtable of the type as being exported
   by the libc++ library. This macro must be applied to all *exception types*.
   Exception types should be defined directly in namespace `std` and not the

diff  --git a/libcxx/docs/ReleaseNotes.rst b/libcxx/docs/ReleaseNotes.rst
index 76a227b5c6d0..5c1a20176019 100644
--- a/libcxx/docs/ReleaseNotes.rst
+++ b/libcxx/docs/ReleaseNotes.rst
@@ -112,9 +112,9 @@ Improvements and New Features
   argument for the formatting functions. This change causes bit fields to become
   invalid arguments for the formatting functions.
 
-- The ``_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_VOID_SPECIALIZATION`` macro has been added to allow
+- The ``_LIBCUDACXX_ENABLE_CXX20_REMOVED_ALLOCATOR_VOID_SPECIALIZATION`` macro has been added to allow
   re-enabling the ``allocator<void>`` specialization. When used in conjunction with
-  ``_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS``, this ensures that the members of
+  ``_LIBCUDACXX_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS``, this ensures that the members of
   ``allocator<void>`` removed in C++20 can be accessed.
 
 - ``boyer_moore_searcher`` and ``boyer_moore_horspool_searcher`` have been implemented.
@@ -128,37 +128,37 @@ Deprecations and Removals
 
 - The header ``<experimental/filesystem>`` has been removed. Instead, use
   ``<filesystem>`` header. The associated macro
-  ``_LIBCPP_DEPRECATED_EXPERIMENTAL_FILESYSTEM`` has been removed too.
+  ``_LIBCUDACXX_DEPRECATED_EXPERIMENTAL_FILESYSTEM`` has been removed too.
 
 - The C++14 function ``std::quoted(const char*)`` is no longer supported in
   C++03 or C++11 modes.
 
-- Setting a custom debug handler with ``std::__libcpp_debug_function`` is not
+- Setting a custom debug handler with ``std::__LIBCUDACXX_debug_function`` is not
   supported anymore. Please migrate to using the new support for
   :ref:`assertions <assertions-mode>` instead.
 
 - ``std::function`` has been removed in C++03. If you are using it, please remove usages
   or upgrade to C++11 or later. It is possible to re-enable ``std::function`` in C++03 by defining
-  ``_LIBCPP_ENABLE_CXX03_FUNCTION``. This option will be removed in LLVM 16.
+  ``_LIBCUDACXX_ENABLE_CXX03_FUNCTION``. This option will be removed in LLVM 16.
 
 - ``unary_function`` and ``binary_function`` are no longer available in C++17 and C++20.
-  They can be re-enabled by defining ``_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION``.
+  They can be re-enabled by defining ``_LIBCUDACXX_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION``.
   They are also marked as ``[[deprecated]]`` in C++11 and later. To disable deprecation warnings
-  you have to define ``_LIBCPP_DISABLE_DEPRECATION_WARNINGS``. Note that this disables
+  you have to define ``_LIBCUDACXX_DISABLE_DEPRECATION_WARNINGS``. Note that this disables
   all deprecation warnings.
 
 - The contents of ``<codecvt>``, ``wstring_convert`` and ``wbuffer_convert`` have been marked as deprecated.
-  To disable deprecation warnings you have to define ``_LIBCPP_DISABLE_DEPRECATION_WARNINGS``. Note that this
+  To disable deprecation warnings you have to define ``_LIBCUDACXX_DISABLE_DEPRECATION_WARNINGS``. Note that this
   disables all deprecation warnings.
 
-- The ``_LIBCPP_DISABLE_EXTERN_TEMPLATE`` macro is not honored anymore when defined by
+- The ``_LIBCUDACXX_DISABLE_EXTERN_TEMPLATE`` macro is not honored anymore when defined by
   users of libc++. Instead, users not wishing to take a dependency on libc++ should link
   against the static version of libc++, which will result in no dependency being
   taken against the shared library.
 
-- The ``_LIBCPP_ABI_UNSTABLE`` macro has been removed in favour of setting
-  ``_LIBCPP_ABI_VERSION=2``. This should not have any impact on users because
-  they were not supposed to set ``_LIBCPP_ABI_UNSTABLE`` manually, however we
+- The ``_LIBCUDACXX_ABI_UNSTABLE`` macro has been removed in favour of setting
+  ``_LIBCUDACXX_ABI_VERSION=2``. This should not have any impact on users because
+  they were not supposed to set ``_LIBCUDACXX_ABI_UNSTABLE`` manually, however we
   still feel that it is worth mentioning in the release notes in case some users
   had been doing it.
 
@@ -174,30 +174,30 @@ Deprecations and Removals
 Upcoming Deprecations and Removals
 ----------------------------------
 
-- The ``_LIBCPP_DEBUG`` macro is not supported anymore. It will be honoured until
+- The ``_LIBCUDACXX_DEBUG`` macro is not supported anymore. It will be honoured until
   LLVM 16, and then it will be an error to define that macro. To enable basic
-  assertions (previously ``_LIBCPP_DEBUG=0``), please use ``_LIBCPP_ENABLE_ASSERTIONS=1``.
-  To enable the debug mode (previously ``_LIBCPP_DEBUG=1|2``), please ensure that
+  assertions (previously ``_LIBCUDACXX_DEBUG=0``), please use ``_LIBCUDACXX_ENABLE_ASSERTIONS=1``.
+  To enable the debug mode (previously ``_LIBCUDACXX_DEBUG=1|2``), please ensure that
   the library has been built with support for the debug mode, and it will be
-  enabled automatically (no need to define ``_LIBCPP_DEBUG``).
+  enabled automatically (no need to define ``_LIBCUDACXX_DEBUG``).
 
 - The experimental versions of ``boyer_moore_searcher`` and ``boyer_moore_horspool_searcher``
   will be removed in LLVM 17. You can disable the deprecation warnings by defining
-  ``_LIBCPP_NO_EXPERIMENTAL_DEPRECATION_WARNING_SEARCHERS``.
+  ``_LIBCUDACXX_NO_EXPERIMENTAL_DEPRECATION_WARNING_SEARCHERS``.
 
 - The implementation of the Coroutines TS in ``std::experimental`` will be removed in LLVM 16.
 
 - Libc++ is getting ready to remove unnecessary transitive inclusions. This may
   break your code in the future. To future-proof your code to these removals,
-  please compile your code with ``_LIBCPP_REMOVE_TRANSITIVE_INCLUDES`` defined
+  please compile your code with ``_LIBCUDACXX_REMOVE_TRANSITIVE_INCLUDES`` defined
   and fix any compilation error resulting from missing includes.
 
 ABI Affecting Changes
 ---------------------
 
-- The ``_LIBCPP_ABI_USE_CXX03_NULLPTR_EMULATION`` macro controlling whether we use an
+- The ``_LIBCUDACXX_ABI_USE_CXX03_NULLPTR_EMULATION`` macro controlling whether we use an
   emulation for ``std::nullptr_t`` in C++03 mode has been removed. After this change,
-  ``_LIBCPP_ABI_USE_CXX03_NULLPTR_EMULATION`` will not be honoured anymore and there
+  ``_LIBCUDACXX_ABI_USE_CXX03_NULLPTR_EMULATION`` will not be honoured anymore and there
   will be no way to opt back into the C++03 emulation of ``std::nullptr_t``.
 
 - On FreeBSD, NetBSD, DragonFlyBSD and Solaris, ``std::random_device`` is now implemented on

diff  --git a/libcxx/docs/UsingLibcxx.rst b/libcxx/docs/UsingLibcxx.rst
index b3f1bf96c968..c869d8182008 100644
--- a/libcxx/docs/UsingLibcxx.rst
+++ b/libcxx/docs/UsingLibcxx.rst
@@ -54,7 +54,7 @@ are disabled by default because they are neither API nor ABI stable. However, th
 
 .. note::
   On compilers that do not support the ``-fexperimental-library`` flag, users can
-  define the ``_LIBCPP_ENABLE_EXPERIMENTAL`` macro and manually link against the
+  define the ``_LIBCUDACXX_ENABLE_EXPERIMENTAL`` macro and manually link against the
   appropriate static library (usually shipped as ``libc++experimental.a``) to get
   access to experimental library features.
 
@@ -143,14 +143,14 @@ assertions and the default when building user code will be to have assertions di
 As a user, you can consult your vendor to know whether assertions are enabled by default.
 
 Furthermore, independently of any vendor-selected default, users can always control whether
-assertions are enabled in their code by defining ``_LIBCPP_ENABLE_ASSERTIONS=0|1`` before
-including any libc++ header (we recommend passing ``-D_LIBCPP_ENABLE_ASSERTIONS=X`` to the
+assertions are enabled in their code by defining ``_LIBCUDACXX_ENABLE_ASSERTIONS=0|1`` before
+including any libc++ header (we recommend passing ``-D_LIBCUDACXX_ENABLE_ASSERTIONS=X`` to the
 compiler). Note that if the compiled library was built by the vendor without assertions,
 functions compiled inside the static or shared library won't have assertions enabled even
-if the user defines ``_LIBCPP_ENABLE_ASSERTIONS=1`` (the same is true for the inverse case
+if the user defines ``_LIBCUDACXX_ENABLE_ASSERTIONS=1`` (the same is true for the inverse case
 where the static or shared library was compiled **with** assertions but the user tries to
 disable them). However, most of the code in libc++ is in the headers, so the user-selected
-value for ``_LIBCPP_ENABLE_ASSERTIONS`` (if any) will usually be respected.
+value for ``_LIBCUDACXX_ENABLE_ASSERTIONS`` (if any) will usually be respected.
 
 When an assertion fails, the program is aborted through a special verbose termination function. The
 library provides a default function that prints an error message and calls ``std::abort()``. Note
@@ -161,12 +161,12 @@ However, users can also override that function with their own, which can be usef
 custom behavior or when deploying to an older platform where the default function isn't available.
 
 Replacing the default verbose termination function is done by defining the
-``_LIBCPP_AVAILABILITY_CUSTOM_VERBOSE_ABORT_PROVIDED`` macro in all translation units of your program
+``_LIBCUDACXX_AVAILABILITY_CUSTOM_VERBOSE_ABORT_PROVIDED`` macro in all translation units of your program
 and defining the following function in exactly one translation unit:
 
 .. code-block:: cpp
 
-  void __libcpp_verbose_abort(char const* format, ...)
+  void __LIBCUDACXX_verbose_abort(char const* format, ...)
 
 This mechanism is similar to how one can replace the default definition of ``operator new``
 and ``operator delete``. For example:
@@ -176,7 +176,7 @@ and ``operator delete``. For example:
   // In HelloWorldHandler.cpp
   #include <version> // must include any libc++ header before defining the function (C compatibility headers excluded)
 
-  void std::__libcpp_verbose_abort(char const* format, ...) {
+  void std::__LIBCUDACXX_verbose_abort(char const* format, ...) {
     va_list list;
     va_start(list, format);
     std::vfprintf(stderr, format, list);
@@ -190,7 +190,7 @@ and ``operator delete``. For example:
 
   int main() {
     std::vector<int> v;
-    int& x = v[0]; // Your termination function will be called here if _LIBCPP_ENABLE_ASSERTIONS=1
+    int& x = v[0]; // Your termination function will be called here if _LIBCUDACXX_ENABLE_ASSERTIONS=1
   }
 
 Also note that the verbose termination function should never return. Since assertions in libc++
@@ -208,18 +208,18 @@ Libc++ provides a number of configuration macros which can be used to enable
 or disable extended libc++ behavior, including enabling "debug mode" or
 thread safety annotations.
 
-**_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS**:
+**_LIBCUDACXX_ENABLE_THREAD_SAFETY_ANNOTATIONS**:
   This macro is used to enable -Wthread-safety annotations on libc++'s
   ``std::mutex`` and ``std::lock_guard``. By default, these annotations are
   disabled and must be manually enabled by the user.
 
-**_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS**:
+**_LIBCUDACXX_DISABLE_VISIBILITY_ANNOTATIONS**:
   This macro is used to disable all visibility annotations inside libc++.
   Defining this macro and then building libc++ with hidden visibility gives a
   build of libc++ which does not export any symbols, which can be useful when
   building statically for inclusion into another library.
 
-**_LIBCPP_DISABLE_ADDITIONAL_DIAGNOSTICS**:
+**_LIBCUDACXX_DISABLE_ADDITIONAL_DIAGNOSTICS**:
   This macro disables the additional diagnostics generated by libc++ using the
   `diagnose_if` attribute. These additional diagnostics include checks for:
 
@@ -228,7 +228,7 @@ thread safety annotations.
     * Giving an unordered associative container a hasher that is not const
       callable.
 
-**_LIBCPP_NO_VCRUNTIME**:
+**_LIBCUDACXX_NO_VCRUNTIME**:
   Microsoft's C and C++ headers are fairly entangled, and some of their C++
   headers are fairly hard to avoid. In particular, `vcruntime_new.h` gets pulled
   in from a lot of other headers and provides definitions which clash with
@@ -239,7 +239,7 @@ thread safety annotations.
   By default, libc++ solves this problem by deferring to Microsoft's vcruntime
   headers where needed. However, it may be undesirable to depend on vcruntime
   headers, since they may not always be available in cross-compilation setups,
-  or they may clash with other headers. The `_LIBCPP_NO_VCRUNTIME` macro
+  or they may clash with other headers. The `_LIBCUDACXX_NO_VCRUNTIME` macro
   prevents libc++ from depending on vcruntime headers. Consequently, it also
   prevents libc++ headers from being interoperable with vcruntime headers (from
   the aforementioned clashes), so users of this macro are promising to not
@@ -248,7 +248,7 @@ thread safety annotations.
   replacement scenarios from working, e.g. replacing `operator new` and
   expecting a non-replaced `operator new[]` to call the replaced `operator new`.
 
-**_LIBCPP_ENABLE_NODISCARD**:
+**_LIBCUDACXX_ENABLE_NODISCARD**:
   Allow the library to add ``[[nodiscard]]`` attributes to entities not specified
   as ``[[nodiscard]]`` by the current language dialect. This includes
   backporting applications of ``[[nodiscard]]`` from newer dialects and
@@ -257,12 +257,12 @@ thread safety annotations.
   See :ref:`Extended Applications of [[nodiscard]] <nodiscard extension>` for
   more information.
 
-**_LIBCPP_DISABLE_NODISCARD_EXT**:
+**_LIBCUDACXX_DISABLE_NODISCARD_EXT**:
   This macro prevents the library from applying ``[[nodiscard]]`` to entities
   purely as an extension. See :ref:`Extended Applications of [[nodiscard]] <nodiscard extension>`
   for more information.
 
-**_LIBCPP_DISABLE_DEPRECATION_WARNINGS**:
+**_LIBCUDACXX_DISABLE_DEPRECATION_WARNINGS**:
   This macro disables warnings when using deprecated components. For example,
   using `std::auto_ptr` when compiling in C++11 mode will normally trigger a
   warning saying that `std::auto_ptr` is deprecated. If the macro is defined,
@@ -270,14 +270,14 @@ thread safety annotations.
 
 C++17 Specific Configuration Macros
 -----------------------------------
-**_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES**:
+**_LIBCUDACXX_ENABLE_CXX17_REMOVED_FEATURES**:
   This macro is used to re-enable all the features removed in C++17. The effect
   is equivalent to manually defining each macro listed below.
 
-**_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR**:
+**_LIBCUDACXX_ENABLE_CXX17_REMOVED_AUTO_PTR**:
   This macro is used to re-enable `auto_ptr`.
 
-**_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS**:
+**_LIBCUDACXX_ENABLE_CXX17_REMOVED_BINDERS**:
   This macro is used to re-enable the `binder1st`, `binder2nd`,
   `pointer_to_unary_function`, `pointer_to_binary_function`, `mem_fun_t`,
   `mem_fun1_t`, `mem_fun_ref_t`, `mem_fun1_ref_t`, `const_mem_fun_t`,
@@ -285,48 +285,48 @@ C++17 Specific Configuration Macros
   class templates, and the `bind1st`, `bind2nd`, `mem_fun`, `mem_fun_ref`,
   and `ptr_fun` functions.
 
-**_LIBCPP_ENABLE_CXX17_REMOVED_RANDOM_SHUFFLE**:
+**_LIBCUDACXX_ENABLE_CXX17_REMOVED_RANDOM_SHUFFLE**:
   This macro is used to re-enable the `random_shuffle` algorithm.
 
-**_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS**:
+**_LIBCUDACXX_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS**:
   This macro is used to re-enable `set_unexpected`, `get_unexpected`, and
   `unexpected`.
 
 C++20 Specific Configuration Macros
 -----------------------------------
-**_LIBCPP_DISABLE_NODISCARD_AFTER_CXX17**:
+**_LIBCUDACXX_DISABLE_NODISCARD_AFTER_CXX17**:
   This macro can be used to disable diagnostics emitted from functions marked
   ``[[nodiscard]]`` in dialects after C++17.  See :ref:`Extended Applications of [[nodiscard]] <nodiscard extension>`
   for more information.
 
-**_LIBCPP_ENABLE_CXX20_REMOVED_FEATURES**:
+**_LIBCUDACXX_ENABLE_CXX20_REMOVED_FEATURES**:
   This macro is used to re-enable all the features removed in C++20. The effect
   is equivalent to manually defining each macro listed below.
 
-**_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS**:
+**_LIBCUDACXX_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS**:
   This macro is used to re-enable redundant members of `allocator<T>`,
   including `pointer`, `reference`, `rebind`, `address`, `max_size`,
   `construct`, `destroy`, and the two-argument overload of `allocate`.
 
-**_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_VOID_SPECIALIZATION**:
+**_LIBCUDACXX_ENABLE_CXX20_REMOVED_ALLOCATOR_VOID_SPECIALIZATION**:
   This macro is used to re-enable the library-provided specializations of
   `allocator<void>` and `allocator<const void>`.
-  Use it in conjunction with `_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS`
+  Use it in conjunction with `_LIBCUDACXX_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS`
   to ensure that removed members of `allocator<void>` can be accessed.
 
-**_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS**:
+**_LIBCUDACXX_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS**:
   This macro is used to re-enable the `argument_type`, `result_type`,
   `first_argument_type`, and `second_argument_type` members of class
   templates such as `plus`, `logical_not`, `hash`, and `owner_less`.
 
-**_LIBCPP_ENABLE_CXX20_REMOVED_NEGATORS**:
+**_LIBCUDACXX_ENABLE_CXX20_REMOVED_NEGATORS**:
   This macro is used to re-enable `not1`, `not2`, `unary_negate`,
   and `binary_negate`.
 
-**_LIBCPP_ENABLE_CXX20_REMOVED_RAW_STORAGE_ITERATOR**:
+**_LIBCUDACXX_ENABLE_CXX20_REMOVED_RAW_STORAGE_ITERATOR**:
   This macro is used to re-enable `raw_storage_iterator`.
 
-**_LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS**:
+**_LIBCUDACXX_ENABLE_CXX20_REMOVED_TYPE_TRAITS**:
   This macro is used to re-enable `is_literal_type`, `is_literal_type_v`,
   `result_of` and `result_of_t`.
 
@@ -350,7 +350,7 @@ Users who want help diagnosing misuses of STL functions may desire a more
 liberal application of ``[[nodiscard]]``.
 
 For this reason libc++ provides an extension that does just that! The
-extension must be enabled by defining ``_LIBCPP_ENABLE_NODISCARD``. The extended
+extension must be enabled by defining ``_LIBCUDACXX_ENABLE_NODISCARD``. The extended
 applications of ``[[nodiscard]]`` takes two forms:
 
 1. Backporting ``[[nodiscard]]`` to entities declared as such by the
@@ -364,13 +364,13 @@ additional macros.
 
 Applications of the first form, which backport ``[[nodiscard]]`` from a newer
 dialect, may be disabled using macros specific to the dialect in which it was
-added. For example, ``_LIBCPP_DISABLE_NODISCARD_AFTER_CXX17``.
+added. For example, ``_LIBCUDACXX_DISABLE_NODISCARD_AFTER_CXX17``.
 
 Applications of the second form, which are pure extensions, may be disabled
-by defining ``_LIBCPP_DISABLE_NODISCARD_EXT``.
+by defining ``_LIBCUDACXX_DISABLE_NODISCARD_EXT``.
 
 
-Entities declared with ``_LIBCPP_NODISCARD_EXT``
+Entities declared with ``_LIBCUDACXX_NODISCARD_EXT``
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 This section lists all extended applications of ``[[nodiscard]]`` to entities

diff  --git a/libcxx/include/__algorithm/adjacent_find.h b/libcxx/include/__algorithm/adjacent_find.h
index 1089bb20d5b2..d6c60dfd49ac 100644
--- a/libcxx/include/__algorithm/adjacent_find.h
+++ b/libcxx/include/__algorithm/adjacent_find.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_ADJACENT_FIND_H
-#define _LIBCPP___ALGORITHM_ADJACENT_FIND_H
+#ifndef _LIBCUDACXX___ALGORITHM_ADJACENT_FIND_H
+#define _LIBCUDACXX___ALGORITHM_ADJACENT_FIND_H
 
 #include <__algorithm/comp.h>
 #include <__algorithm/iterator_operations.h>
@@ -16,14 +16,14 @@
 #include <__iterator/iterator_traits.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Iter, class _Sent, class _BinaryPredicate>
-_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _Iter
+_LIBCUDACXX_NODISCARD_EXT _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _Iter
 __adjacent_find(_Iter __first, _Sent __last, _BinaryPredicate&& __pred) {
   if (__first == __last)
     return __first;
@@ -37,18 +37,18 @@ __adjacent_find(_Iter __first, _Sent __last, _BinaryPredicate&& __pred) {
 }
 
 template <class _ForwardIterator, class _BinaryPredicate>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
+_LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _ForwardIterator
 adjacent_find(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred) {
   return std::__adjacent_find(std::move(__first), std::move(__last), __pred);
 }
 
 template <class _ForwardIterator>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
+_LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _ForwardIterator
 adjacent_find(_ForwardIterator __first, _ForwardIterator __last) {
   typedef typename iterator_traits<_ForwardIterator>::value_type __v;
   return std::adjacent_find(std::move(__first), std::move(__last), __equal_to<__v>());
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_ADJACENT_FIND_H
+#endif // _LIBCUDACXX___ALGORITHM_ADJACENT_FIND_H

diff  --git a/libcxx/include/__algorithm/all_of.h b/libcxx/include/__algorithm/all_of.h
index 3af32a577504..f37540040f33 100644
--- a/libcxx/include/__algorithm/all_of.h
+++ b/libcxx/include/__algorithm/all_of.h
@@ -7,19 +7,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_ALL_OF_H
-#define _LIBCPP___ALGORITHM_ALL_OF_H
+#ifndef _LIBCUDACXX___ALGORITHM_ALL_OF_H
+#define _LIBCUDACXX___ALGORITHM_ALL_OF_H
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _InputIterator, class _Predicate>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool
+_LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 bool
 all_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) {
   for (; __first != __last; ++__first)
     if (!__pred(*__first))
@@ -27,6 +27,6 @@ all_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) {
   return true;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_ALL_OF_H
+#endif // _LIBCUDACXX___ALGORITHM_ALL_OF_H

diff  --git a/libcxx/include/__algorithm/any_of.h b/libcxx/include/__algorithm/any_of.h
index 6fe6a0b6b3c4..fc5ad6642301 100644
--- a/libcxx/include/__algorithm/any_of.h
+++ b/libcxx/include/__algorithm/any_of.h
@@ -7,19 +7,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_ANY_OF_H
-#define _LIBCPP___ALGORITHM_ANY_OF_H
+#ifndef _LIBCUDACXX___ALGORITHM_ANY_OF_H
+#define _LIBCUDACXX___ALGORITHM_ANY_OF_H
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _InputIterator, class _Predicate>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool
+_LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 bool
 any_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) {
   for (; __first != __last; ++__first)
     if (__pred(*__first))
@@ -27,6 +27,6 @@ any_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) {
   return false;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_ANY_OF_H
+#endif // _LIBCUDACXX___ALGORITHM_ANY_OF_H

diff  --git a/libcxx/include/__algorithm/binary_search.h b/libcxx/include/__algorithm/binary_search.h
index a44007237850..cf486e7eb7f9 100644
--- a/libcxx/include/__algorithm/binary_search.h
+++ b/libcxx/include/__algorithm/binary_search.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_BINARY_SEARCH_H
-#define _LIBCPP___ALGORITHM_BINARY_SEARCH_H
+#ifndef _LIBCUDACXX___ALGORITHM_BINARY_SEARCH_H
+#define _LIBCUDACXX___ALGORITHM_BINARY_SEARCH_H
 
 #include <__algorithm/comp.h>
 #include <__algorithm/comp_ref_type.h>
@@ -15,15 +15,15 @@
 #include <__config>
 #include <__iterator/iterator_traits.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _ForwardIterator, class _Tp, class _Compare>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_NODISCARD_EXT inline
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 bool
 binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value, _Compare __comp)
 {
@@ -33,8 +33,8 @@ binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __va
 }
 
 template <class _ForwardIterator, class _Tp>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_NODISCARD_EXT inline
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 bool
 binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value)
 {
@@ -42,6 +42,6 @@ binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __va
                               __less<typename iterator_traits<_ForwardIterator>::value_type, _Tp>());
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_BINARY_SEARCH_H
+#endif // _LIBCUDACXX___ALGORITHM_BINARY_SEARCH_H

diff  --git a/libcxx/include/__algorithm/clamp.h b/libcxx/include/__algorithm/clamp.h
index 30ddbdce64a9..e63400cfa498 100644
--- a/libcxx/include/__algorithm/clamp.h
+++ b/libcxx/include/__algorithm/clamp.h
@@ -6,41 +6,41 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_CLAMP_H
-#define _LIBCPP___ALGORITHM_CLAMP_H
+#ifndef _LIBCUDACXX___ALGORITHM_CLAMP_H
+#define _LIBCUDACXX___ALGORITHM_CLAMP_H
 
 #include <__algorithm/comp.h>
 #include <__assert>
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template<class _Tp, class _Compare>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY constexpr
+_LIBCUDACXX_NODISCARD_EXT inline
+_LIBCUDACXX_INLINE_VISIBILITY constexpr
 const _Tp&
 clamp(const _Tp& __v, const _Tp& __lo, const _Tp& __hi, _Compare __comp)
 {
-    _LIBCPP_ASSERT(!__comp(__hi, __lo), "Bad bounds passed to std::clamp");
+    _LIBCUDACXX_ASSERT(!__comp(__hi, __lo), "Bad bounds passed to std::clamp");
     return __comp(__v, __lo) ? __lo : __comp(__hi, __v) ? __hi : __v;
 
 }
 
 template<class _Tp>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY constexpr
+_LIBCUDACXX_NODISCARD_EXT inline
+_LIBCUDACXX_INLINE_VISIBILITY constexpr
 const _Tp&
 clamp(const _Tp& __v, const _Tp& __lo, const _Tp& __hi)
 {
-    return _VSTD::clamp(__v, __lo, __hi, __less<_Tp>());
+    return _CUDA_VSTD::clamp(__v, __lo, __hi, __less<_Tp>());
 }
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_CLAMP_H
+#endif // _LIBCUDACXX___ALGORITHM_CLAMP_H

diff  --git a/libcxx/include/__algorithm/comp.h b/libcxx/include/__algorithm/comp.h
index 62c06ae57f23..b6eaf9e56280 100644
--- a/libcxx/include/__algorithm/comp.h
+++ b/libcxx/include/__algorithm/comp.h
@@ -6,87 +6,87 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_COMP_H
-#define _LIBCPP___ALGORITHM_COMP_H
+#ifndef _LIBCUDACXX___ALGORITHM_COMP_H
+#define _LIBCUDACXX___ALGORITHM_COMP_H
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-// I'd like to replace these with _VSTD::equal_to<void>, but can't because:
+// I'd like to replace these with _CUDA_VSTD::equal_to<void>, but can't because:
 //   * That only works with C++14 and later, and
 //   * We haven't included <functional> here.
 template <class _T1, class _T2 = _T1>
 struct __equal_to
 {
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 bool operator()(const _T1& __x, const _T1& __y) const {return __x == __y;}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 bool operator()(const _T1& __x, const _T2& __y) const {return __x == __y;}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 bool operator()(const _T2& __x, const _T1& __y) const {return __x == __y;}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 bool operator()(const _T2& __x, const _T2& __y) const {return __x == __y;}
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 bool operator()(const _T1& __x, const _T1& __y) const {return __x == __y;}
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 bool operator()(const _T1& __x, const _T2& __y) const {return __x == __y;}
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 bool operator()(const _T2& __x, const _T1& __y) const {return __x == __y;}
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 bool operator()(const _T2& __x, const _T2& __y) const {return __x == __y;}
 };
 
 template <class _T1>
 struct __equal_to<_T1, _T1>
 {
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
     bool operator()(const _T1& __x, const _T1& __y) const {return __x == __y;}
 };
 
 template <class _T1>
 struct __equal_to<const _T1, _T1>
 {
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
     bool operator()(const _T1& __x, const _T1& __y) const {return __x == __y;}
 };
 
 template <class _T1>
 struct __equal_to<_T1, const _T1>
 {
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
     bool operator()(const _T1& __x, const _T1& __y) const {return __x == __y;}
 };
 
 template <class _T1, class _T2 = _T1>
 struct __less
 {
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
     bool operator()(const _T1& __x, const _T1& __y) const {return __x < __y;}
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
     bool operator()(const _T1& __x, const _T2& __y) const {return __x < __y;}
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
     bool operator()(const _T2& __x, const _T1& __y) const {return __x < __y;}
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
     bool operator()(const _T2& __x, const _T2& __y) const {return __x < __y;}
 };
 
 template <class _T1>
 struct __less<_T1, _T1>
 {
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
     bool operator()(const _T1& __x, const _T1& __y) const {return __x < __y;}
 };
 
 template <class _T1>
 struct __less<const _T1, _T1>
 {
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
     bool operator()(const _T1& __x, const _T1& __y) const {return __x < __y;}
 };
 
 template <class _T1>
 struct __less<_T1, const _T1>
 {
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
     bool operator()(const _T1& __x, const _T1& __y) const {return __x < __y;}
 };
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_COMP_H
+#endif // _LIBCUDACXX___ALGORITHM_COMP_H

diff  --git a/libcxx/include/__algorithm/comp_ref_type.h b/libcxx/include/__algorithm/comp_ref_type.h
index 4719871461cf..32a689aaf9a3 100644
--- a/libcxx/include/__algorithm/comp_ref_type.h
+++ b/libcxx/include/__algorithm/comp_ref_type.h
@@ -6,28 +6,28 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_COMP_REF_TYPE_H
-#define _LIBCPP___ALGORITHM_COMP_REF_TYPE_H
+#ifndef _LIBCUDACXX___ALGORITHM_COMP_REF_TYPE_H
+#define _LIBCUDACXX___ALGORITHM_COMP_REF_TYPE_H
 
 #include <__config>
 #include <__debug>
 #include <__utility/declval.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Compare>
 struct __debug_less
 {
     _Compare &__comp_;
-    _LIBCPP_CONSTEXPR_AFTER_CXX11
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
     __debug_less(_Compare& __c) : __comp_(__c) {}
 
     template <class _Tp, class _Up>
-    _LIBCPP_CONSTEXPR_AFTER_CXX11
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
     bool operator()(const _Tp& __x,  const _Up& __y)
     {
         bool __r = __comp_(__x, __y);
@@ -37,7 +37,7 @@ struct __debug_less
     }
 
     template <class _Tp, class _Up>
-    _LIBCPP_CONSTEXPR_AFTER_CXX11
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
     bool operator()(_Tp& __x,  _Up& __y)
     {
         bool __r = __comp_(__x, __y);
@@ -47,20 +47,20 @@ struct __debug_less
     }
 
     template <class _LHS, class _RHS>
-    _LIBCPP_CONSTEXPR_AFTER_CXX11
-    inline _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
+    inline _LIBCUDACXX_INLINE_VISIBILITY
     decltype((void)declval<_Compare&>()(
         declval<_LHS &>(), declval<_RHS &>()))
     __do_compare_assert(int, _LHS & __l, _RHS & __r) {
-        _LIBCPP_DEBUG_ASSERT(!__comp_(__l, __r),
+        _LIBCUDACXX_DEBUG_ASSERT(!__comp_(__l, __r),
             "Comparator does not induce a strict weak ordering");
         (void)__l;
         (void)__r;
     }
 
     template <class _LHS, class _RHS>
-    _LIBCPP_CONSTEXPR_AFTER_CXX11
-    inline _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
+    inline _LIBCUDACXX_INLINE_VISIBILITY
     void __do_compare_assert(long, _LHS &, _RHS &) {}
 };
 
@@ -68,13 +68,13 @@ template <class _Comp>
 struct __comp_ref_type {
   // Pass the comparator by lvalue reference. Or in debug mode, using a
   // debugging wrapper that stores a reference.
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
+#ifdef _LIBCUDACXX_ENABLE_DEBUG_MODE
   typedef __debug_less<_Comp> type;
 #else
   typedef _Comp& type;
 #endif
 };
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_COMP_REF_TYPE_H
+#endif // _LIBCUDACXX___ALGORITHM_COMP_REF_TYPE_H

diff  --git a/libcxx/include/__algorithm/copy.h b/libcxx/include/__algorithm/copy.h
index f7535a81547a..7982d3134405 100644
--- a/libcxx/include/__algorithm/copy.h
+++ b/libcxx/include/__algorithm/copy.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_COPY_H
-#define _LIBCPP___ALGORITHM_COPY_H
+#ifndef _LIBCUDACXX___ALGORITHM_COPY_H
+#define _LIBCUDACXX___ALGORITHM_COPY_H
 
 #include <__algorithm/unwrap_iter.h>
 #include <__algorithm/unwrap_range.h>
@@ -19,16 +19,16 @@
 #include <cstring>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 // copy
 
 template <class _InIter, class _Sent, class _OutIter>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 pair<_InIter, _OutIter> __copy_impl(_InIter __first, _Sent __last, _OutIter __result) {
   while (__first != __last) {
     *__result = *__first;
@@ -42,11 +42,11 @@ template <class _InValueT,
           class _OutValueT,
           class = __enable_if_t<is_same<typename remove_const<_InValueT>::type, _OutValueT>::value
                              && is_trivially_copy_assignable<_OutValueT>::value> >
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 pair<_InValueT*, _OutValueT*> __copy_impl(_InValueT* __first, _InValueT* __last, _OutValueT* __result) {
-  if (__libcpp_is_constant_evaluated()
+  if (__LIBCUDACXX_is_constant_evaluated()
 // TODO: Remove this once GCC supports __builtin_memmove during constant evaluation
-#ifndef _LIBCPP_COMPILER_GCC
+#ifndef _LIBCUDACXX_COMPILER_GCC
       && !is_trivially_copyable<_InValueT>::value
 #endif
      )
@@ -64,7 +64,7 @@ template <class _InIter, class _OutIter,
                       && is_trivially_copy_assignable<__iter_value_type<_OutIter> >::value
                       && __is_reverse_iterator<_InIter>::value
                       && __is_reverse_iterator<_OutIter>::value, int> = 0>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 pair<_InIter, _OutIter>
 __copy_impl(_InIter __first, _InIter __last, _OutIter __result) {
   auto __first_base = std::__unwrap_iter(__first.base());
@@ -79,7 +79,7 @@ template <class _InIter, class _Sent, class _OutIter,
           __enable_if_t<!(is_copy_constructible<_InIter>::value
                        && is_copy_constructible<_Sent>::value
                        && is_copy_constructible<_OutIter>::value), int> = 0 >
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 pair<_InIter, _OutIter> __copy(_InIter __first, _Sent __last, _OutIter __result) {
   return std::__copy_impl(std::move(__first), std::move(__last), std::move(__result));
 }
@@ -88,7 +88,7 @@ template <class _InIter, class _Sent, class _OutIter,
           __enable_if_t<is_copy_constructible<_InIter>::value
                      && is_copy_constructible<_Sent>::value
                      && is_copy_constructible<_OutIter>::value, int> = 0>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 pair<_InIter, _OutIter> __copy(_InIter __first, _Sent __last, _OutIter __result) {
   auto __range = std::__unwrap_range(__first, __last);
   auto __ret   = std::__copy_impl(std::move(__range.first), std::move(__range.second), std::__unwrap_iter(__result));
@@ -97,12 +97,12 @@ pair<_InIter, _OutIter> __copy(_InIter __first, _Sent __last, _OutIter __result)
 }
 
 template <class _InputIterator, class _OutputIterator>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 _OutputIterator
 copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result) {
   return std::__copy(__first, __last, __result).second;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_COPY_H
+#endif // _LIBCUDACXX___ALGORITHM_COPY_H

diff  --git a/libcxx/include/__algorithm/copy_backward.h b/libcxx/include/__algorithm/copy_backward.h
index c5fa64bc8d75..143009a11897 100644
--- a/libcxx/include/__algorithm/copy_backward.h
+++ b/libcxx/include/__algorithm/copy_backward.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_COPY_BACKWARD_H
-#define _LIBCPP___ALGORITHM_COPY_BACKWARD_H
+#ifndef _LIBCUDACXX___ALGORITHM_COPY_BACKWARD_H
+#define _LIBCUDACXX___ALGORITHM_COPY_BACKWARD_H
 
 #include <__algorithm/copy.h>
 #include <__algorithm/iterator_operations.h>
@@ -22,15 +22,15 @@
 #include <__utility/pair.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _AlgPolicy, class _InputIterator, class _OutputIterator,
           __enable_if_t<is_same<_AlgPolicy, _ClassicAlgPolicy>::value, int> = 0>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 pair<_InputIterator, _OutputIterator>
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 pair<_InputIterator, _OutputIterator>
 __copy_backward(_InputIterator __first, _InputIterator __last, _OutputIterator __result) {
   auto __ret = std::__copy(
       __unconstrained_reverse_iterator<_InputIterator>(__last),
@@ -39,23 +39,23 @@ __copy_backward(_InputIterator __first, _InputIterator __last, _OutputIterator _
   return pair<_InputIterator, _OutputIterator>(__ret.first.base(), __ret.second.base());
 }
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 template <class _AlgPolicy, class _Iter1, class _Sent1, class _Iter2,
           __enable_if_t<is_same<_AlgPolicy, _RangeAlgPolicy>::value, int> = 0>
-_LIBCPP_HIDE_FROM_ABI constexpr pair<_Iter1, _Iter2> __copy_backward(_Iter1 __first, _Sent1 __last, _Iter2 __result) {
+_LIBCUDACXX_HIDE_FROM_ABI constexpr pair<_Iter1, _Iter2> __copy_backward(_Iter1 __first, _Sent1 __last, _Iter2 __result) {
   auto __last_iter     = _IterOps<_AlgPolicy>::next(__first, std::move(__last));
   auto __reverse_range = std::__reverse_range(std::ranges::subrange(std::move(__first), __last_iter));
   auto __ret           = ranges::copy(std::move(__reverse_range), std::make_reverse_iterator(__result));
   return std::make_pair(__last_iter, __ret.out.base());
 }
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
 template <class _BidirectionalIterator1, class _BidirectionalIterator2>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _BidirectionalIterator2
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _BidirectionalIterator2
 copy_backward(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last, _BidirectionalIterator2 __result) {
   return std::__copy_backward<_ClassicAlgPolicy>(__first, __last, __result).second;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_COPY_BACKWARD_H
+#endif // _LIBCUDACXX___ALGORITHM_COPY_BACKWARD_H

diff  --git a/libcxx/include/__algorithm/copy_if.h b/libcxx/include/__algorithm/copy_if.h
index 9c3cd29e2413..955fe2bbb0c2 100644
--- a/libcxx/include/__algorithm/copy_if.h
+++ b/libcxx/include/__algorithm/copy_if.h
@@ -6,19 +6,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_COPY_IF_H
-#define _LIBCPP___ALGORITHM_COPY_IF_H
+#ifndef _LIBCUDACXX___ALGORITHM_COPY_IF_H
+#define _LIBCUDACXX___ALGORITHM_COPY_IF_H
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template<class _InputIterator, class _OutputIterator, class _Predicate>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 _OutputIterator
 copy_if(_InputIterator __first, _InputIterator __last,
         _OutputIterator __result, _Predicate __pred)
@@ -34,6 +34,6 @@ copy_if(_InputIterator __first, _InputIterator __last,
     return __result;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_COPY_IF_H
+#endif // _LIBCUDACXX___ALGORITHM_COPY_IF_H

diff  --git a/libcxx/include/__algorithm/copy_n.h b/libcxx/include/__algorithm/copy_n.h
index 8b915af63c0d..e5c530fd4434 100644
--- a/libcxx/include/__algorithm/copy_n.h
+++ b/libcxx/include/__algorithm/copy_n.h
@@ -6,22 +6,22 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_COPY_N_H
-#define _LIBCPP___ALGORITHM_COPY_N_H
+#ifndef _LIBCUDACXX___ALGORITHM_COPY_N_H
+#define _LIBCUDACXX___ALGORITHM_COPY_N_H
 
 #include <__algorithm/copy.h>
 #include <__config>
 #include <__iterator/iterator_traits.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template<class _InputIterator, class _Size, class _OutputIterator>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 typename enable_if
 <
     __is_cpp17_input_iterator<_InputIterator>::value &&
@@ -30,7 +30,7 @@ typename enable_if
 >::type
 copy_n(_InputIterator __first, _Size __orig_n, _OutputIterator __result)
 {
-    typedef decltype(_VSTD::__convert_to_integral(__orig_n)) _IntegralSize;
+    typedef decltype(_CUDA_VSTD::__convert_to_integral(__orig_n)) _IntegralSize;
     _IntegralSize __n = __orig_n;
     if (__n > 0)
     {
@@ -47,7 +47,7 @@ copy_n(_InputIterator __first, _Size __orig_n, _OutputIterator __result)
 }
 
 template<class _InputIterator, class _Size, class _OutputIterator>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 typename enable_if
 <
     __is_cpp17_random_access_iterator<_InputIterator>::value,
@@ -56,11 +56,11 @@ typename enable_if
 copy_n(_InputIterator __first, _Size __orig_n, _OutputIterator __result)
 {
     typedef typename iterator_traits<_InputIterator>::
diff erence_type 
diff erence_type;
-    typedef decltype(_VSTD::__convert_to_integral(__orig_n)) _IntegralSize;
+    typedef decltype(_CUDA_VSTD::__convert_to_integral(__orig_n)) _IntegralSize;
     _IntegralSize __n = __orig_n;
-    return _VSTD::copy(__first, __first + 
diff erence_type(__n), __result);
+    return _CUDA_VSTD::copy(__first, __first + 
diff erence_type(__n), __result);
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_COPY_N_H
+#endif // _LIBCUDACXX___ALGORITHM_COPY_N_H

diff  --git a/libcxx/include/__algorithm/count.h b/libcxx/include/__algorithm/count.h
index 5b546934038d..fc29c5a96eb9 100644
--- a/libcxx/include/__algorithm/count.h
+++ b/libcxx/include/__algorithm/count.h
@@ -7,20 +7,20 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_COUNT_H
-#define _LIBCPP___ALGORITHM_COUNT_H
+#ifndef _LIBCUDACXX___ALGORITHM_COUNT_H
+#define _LIBCUDACXX___ALGORITHM_COUNT_H
 
 #include <__config>
 #include <__iterator/iterator_traits.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _InputIterator, class _Tp>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     typename iterator_traits<_InputIterator>::
diff erence_type
     count(_InputIterator __first, _InputIterator __last, const _Tp& __value) {
   typename iterator_traits<_InputIterator>::
diff erence_type __r(0);
@@ -30,6 +30,6 @@ _LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_C
   return __r;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_COUNT_H
+#endif // _LIBCUDACXX___ALGORITHM_COUNT_H

diff  --git a/libcxx/include/__algorithm/count_if.h b/libcxx/include/__algorithm/count_if.h
index 1ec2d83394e1..a6b75419fd8d 100644
--- a/libcxx/include/__algorithm/count_if.h
+++ b/libcxx/include/__algorithm/count_if.h
@@ -7,20 +7,20 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_COUNT_IF_H
-#define _LIBCPP___ALGORITHM_COUNT_IF_H
+#ifndef _LIBCUDACXX___ALGORITHM_COUNT_IF_H
+#define _LIBCUDACXX___ALGORITHM_COUNT_IF_H
 
 #include <__config>
 #include <__iterator/iterator_traits.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _InputIterator, class _Predicate>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     typename iterator_traits<_InputIterator>::
diff erence_type
     count_if(_InputIterator __first, _InputIterator __last, _Predicate __pred) {
   typename iterator_traits<_InputIterator>::
diff erence_type __r(0);
@@ -30,6 +30,6 @@ _LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_C
   return __r;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_COUNT_IF_H
+#endif // _LIBCUDACXX___ALGORITHM_COUNT_IF_H

diff  --git a/libcxx/include/__algorithm/equal.h b/libcxx/include/__algorithm/equal.h
index ca1bc6bc5665..770ebad2636e 100644
--- a/libcxx/include/__algorithm/equal.h
+++ b/libcxx/include/__algorithm/equal.h
@@ -7,22 +7,22 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_EQUAL_H
-#define _LIBCPP___ALGORITHM_EQUAL_H
+#ifndef _LIBCUDACXX___ALGORITHM_EQUAL_H
+#define _LIBCUDACXX___ALGORITHM_EQUAL_H
 
 #include <__algorithm/comp.h>
 #include <__config>
 #include <__iterator/distance.h>
 #include <__iterator/iterator_traits.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool
+_LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 bool
 equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _BinaryPredicate __pred) {
   for (; __first1 != __last1; ++__first1, (void)++__first2)
     if (!__pred(*__first1, *__first2))
@@ -31,16 +31,16 @@ equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first
 }
 
 template <class _InputIterator1, class _InputIterator2>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool
+_LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 bool
 equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2) {
   typedef typename iterator_traits<_InputIterator1>::value_type __v1;
   typedef typename iterator_traits<_InputIterator2>::value_type __v2;
-  return _VSTD::equal(__first1, __last1, __first2, __equal_to<__v1, __v2>());
+  return _CUDA_VSTD::equal(__first1, __last1, __first2, __equal_to<__v1, __v2>());
 }
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <class _BinaryPredicate, class _InputIterator1, class _InputIterator2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 bool
 __equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2,
         _BinaryPredicate __pred, input_iterator_tag, input_iterator_tag) {
   for (; __first1 != __last1 && __first2 != __last2; ++__first1, (void)++__first2)
@@ -50,36 +50,36 @@ __equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __fir
 }
 
 template <class _BinaryPredicate, class _RandomAccessIterator1, class _RandomAccessIterator2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 bool
 __equal(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1, _RandomAccessIterator2 __first2,
         _RandomAccessIterator2 __last2, _BinaryPredicate __pred, random_access_iterator_tag,
         random_access_iterator_tag) {
-  if (_VSTD::distance(__first1, __last1) != _VSTD::distance(__first2, __last2))
+  if (_CUDA_VSTD::distance(__first1, __last1) != _CUDA_VSTD::distance(__first2, __last2))
     return false;
-  return _VSTD::equal<_RandomAccessIterator1, _RandomAccessIterator2,
+  return _CUDA_VSTD::equal<_RandomAccessIterator1, _RandomAccessIterator2,
                       _BinaryPredicate&>(__first1, __last1, __first2, __pred);
 }
 
 template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool
+_LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 bool
 equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2,
       _BinaryPredicate __pred) {
-  return _VSTD::__equal<_BinaryPredicate&>(
+  return _CUDA_VSTD::__equal<_BinaryPredicate&>(
       __first1, __last1, __first2, __last2, __pred, typename iterator_traits<_InputIterator1>::iterator_category(),
       typename iterator_traits<_InputIterator2>::iterator_category());
 }
 
 template <class _InputIterator1, class _InputIterator2>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool
+_LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 bool
 equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2) {
   typedef typename iterator_traits<_InputIterator1>::value_type __v1;
   typedef typename iterator_traits<_InputIterator2>::value_type __v2;
-  return _VSTD::__equal(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>(),
+  return _CUDA_VSTD::__equal(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>(),
                         typename iterator_traits<_InputIterator1>::iterator_category(),
                         typename iterator_traits<_InputIterator2>::iterator_category());
 }
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_EQUAL_H
+#endif // _LIBCUDACXX___ALGORITHM_EQUAL_H

diff  --git a/libcxx/include/__algorithm/equal_range.h b/libcxx/include/__algorithm/equal_range.h
index b11165baf384..f1140a8796d7 100644
--- a/libcxx/include/__algorithm/equal_range.h
+++ b/libcxx/include/__algorithm/equal_range.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_EQUAL_RANGE_H
-#define _LIBCPP___ALGORITHM_EQUAL_RANGE_H
+#ifndef _LIBCUDACXX___ALGORITHM_EQUAL_RANGE_H
+#define _LIBCUDACXX___ALGORITHM_EQUAL_RANGE_H
 
 #include <__algorithm/comp.h>
 #include <__algorithm/comp_ref_type.h>
@@ -27,14 +27,14 @@
 #include <__utility/move.h>
 #include <__utility/pair.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _AlgPolicy, class _Compare, class _Iter, class _Sent, class _Tp, class _Proj>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 pair<_Iter, _Iter>
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 pair<_Iter, _Iter>
 __equal_range(_Iter __first, _Sent __last, const _Tp& __value, _Compare&& __comp, _Proj&& __proj) {
   auto __len  = _IterOps<_AlgPolicy>::distance(__first, __last);
   _Iter __end = _IterOps<_AlgPolicy>::next(__first, __last);
@@ -58,7 +58,7 @@ __equal_range(_Iter __first, _Sent __last, const _Tp& __value, _Compare&& __comp
 }
 
 template <class _ForwardIterator, class _Tp, class _Compare>
-_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 pair<_ForwardIterator, _ForwardIterator>
+_LIBCUDACXX_NODISCARD_EXT _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 pair<_ForwardIterator, _ForwardIterator>
 equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value, _Compare __comp) {
   static_assert(__is_callable<_Compare, decltype(*__first), const _Tp&>::value,
                 "The comparator has to be callable");
@@ -70,7 +70,7 @@ equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __valu
 }
 
 template <class _ForwardIterator, class _Tp>
-_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 pair<_ForwardIterator, _ForwardIterator>
+_LIBCUDACXX_NODISCARD_EXT _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 pair<_ForwardIterator, _ForwardIterator>
 equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) {
   return std::equal_range(
       std::move(__first),
@@ -79,6 +79,6 @@ equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __valu
       __less<typename iterator_traits<_ForwardIterator>::value_type, _Tp>());
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_EQUAL_RANGE_H
+#endif // _LIBCUDACXX___ALGORITHM_EQUAL_RANGE_H

diff  --git a/libcxx/include/__algorithm/fill.h b/libcxx/include/__algorithm/fill.h
index 901ba4e68689..1339a725b5f9 100644
--- a/libcxx/include/__algorithm/fill.h
+++ b/libcxx/include/__algorithm/fill.h
@@ -6,24 +6,24 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_FILL_H
-#define _LIBCPP___ALGORITHM_FILL_H
+#ifndef _LIBCUDACXX___ALGORITHM_FILL_H
+#define _LIBCUDACXX___ALGORITHM_FILL_H
 
 #include <__algorithm/fill_n.h>
 #include <__config>
 #include <__iterator/iterator_traits.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 // fill isn't specialized for std::memset, because the compiler already optimizes the loop to a call to std::memset.
 
 template <class _ForwardIterator, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void
 __fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value, forward_iterator_tag)
 {
@@ -32,21 +32,21 @@ __fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value, fo
 }
 
 template <class _RandomAccessIterator, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void
 __fill(_RandomAccessIterator __first, _RandomAccessIterator __last, const _Tp& __value, random_access_iterator_tag)
 {
-    _VSTD::fill_n(__first, __last - __first, __value);
+    _CUDA_VSTD::fill_n(__first, __last - __first, __value);
 }
 
 template <class _ForwardIterator, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void
 fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value)
 {
-    _VSTD::__fill(__first, __last, __value, typename iterator_traits<_ForwardIterator>::iterator_category());
+    _CUDA_VSTD::__fill(__first, __last, __value, typename iterator_traits<_ForwardIterator>::iterator_category());
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_FILL_H
+#endif // _LIBCUDACXX___ALGORITHM_FILL_H

diff  --git a/libcxx/include/__algorithm/fill_n.h b/libcxx/include/__algorithm/fill_n.h
index 6c5e44efde9b..56103ad92219 100644
--- a/libcxx/include/__algorithm/fill_n.h
+++ b/libcxx/include/__algorithm/fill_n.h
@@ -6,23 +6,23 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_FILL_N_H
-#define _LIBCPP___ALGORITHM_FILL_N_H
+#ifndef _LIBCUDACXX___ALGORITHM_FILL_N_H
+#define _LIBCUDACXX___ALGORITHM_FILL_N_H
 
 #include <__config>
 #include <__iterator/iterator_traits.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 // fill_n isn't specialized for std::memset, because the compiler already optimizes the loop to a call to std::memset.
 
 template <class _OutputIterator, class _Size, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 _OutputIterator
 __fill_n(_OutputIterator __first, _Size __n, const _Tp& __value)
 {
@@ -32,13 +32,13 @@ __fill_n(_OutputIterator __first, _Size __n, const _Tp& __value)
 }
 
 template <class _OutputIterator, class _Size, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 _OutputIterator
 fill_n(_OutputIterator __first, _Size __n, const _Tp& __value)
 {
-   return _VSTD::__fill_n(__first, _VSTD::__convert_to_integral(__n), __value);
+   return _CUDA_VSTD::__fill_n(__first, _CUDA_VSTD::__convert_to_integral(__n), __value);
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_FILL_N_H
+#endif // _LIBCUDACXX___ALGORITHM_FILL_N_H

diff  --git a/libcxx/include/__algorithm/find.h b/libcxx/include/__algorithm/find.h
index ab37d81262f0..afb082ccd40d 100644
--- a/libcxx/include/__algorithm/find.h
+++ b/libcxx/include/__algorithm/find.h
@@ -7,19 +7,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_FIND_H
-#define _LIBCPP___ALGORITHM_FIND_H
+#ifndef _LIBCUDACXX___ALGORITHM_FIND_H
+#define _LIBCUDACXX___ALGORITHM_FIND_H
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _InputIterator, class _Tp>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _InputIterator
+_LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _InputIterator
 find(_InputIterator __first, _InputIterator __last, const _Tp& __value) {
   for (; __first != __last; ++__first)
     if (*__first == __value)
@@ -27,6 +27,6 @@ find(_InputIterator __first, _InputIterator __last, const _Tp& __value) {
   return __first;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_FIND_H
+#endif // _LIBCUDACXX___ALGORITHM_FIND_H

diff  --git a/libcxx/include/__algorithm/find_end.h b/libcxx/include/__algorithm/find_end.h
index 65e9f29b1c1f..b04484f69197 100644
--- a/libcxx/include/__algorithm/find_end.h
+++ b/libcxx/include/__algorithm/find_end.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_FIND_END_OF_H
-#define _LIBCPP___ALGORITHM_FIND_END_OF_H
+#ifndef _LIBCUDACXX___ALGORITHM_FIND_END_OF_H
+#define _LIBCUDACXX___ALGORITHM_FIND_END_OF_H
 
 #include <__algorithm/comp.h>
 #include <__algorithm/iterator_operations.h>
@@ -22,11 +22,11 @@
 #include <__utility/pair.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <
     class _AlgPolicy,
@@ -37,7 +37,7 @@ template <
     class _Pred,
     class _Proj1,
     class _Proj2>
-_LIBCPP_HIDE_FROM_ABI inline _LIBCPP_CONSTEXPR_AFTER_CXX11 pair<_Iter1, _Iter1> __find_end_impl(
+_LIBCUDACXX_HIDE_FROM_ABI inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 pair<_Iter1, _Iter1> __find_end_impl(
     _Iter1 __first1,
     _Sent1 __last1,
     _Iter2 __first2,
@@ -91,7 +91,7 @@ template <
     class _Sent2,
     class _Proj1,
     class _Proj2>
-_LIBCPP_CONSTEXPR_AFTER_CXX17 _Iter1 __find_end(
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _Iter1 __find_end(
     _Iter1 __first1,
     _Sent1 __sent1,
     _Iter2 __first2,
@@ -144,7 +144,7 @@ template <
     class _Sent2,
     class _Proj1,
     class _Proj2>
-_LIBCPP_CONSTEXPR_AFTER_CXX11 _Iter1 __find_end(
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _Iter1 __find_end(
     _Iter1 __first1,
     _Sent1 __sent1,
     _Iter2 __first2,
@@ -189,7 +189,7 @@ _LIBCPP_CONSTEXPR_AFTER_CXX11 _Iter1 __find_end(
 }
 
 template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
-_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
+_LIBCUDACXX_NODISCARD inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 _ForwardIterator1 __find_end_classic(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
                                      _ForwardIterator2 __first2, _ForwardIterator2 __last2,
                                      _BinaryPredicate& __pred) {
@@ -208,7 +208,7 @@ _ForwardIterator1 __find_end_classic(_ForwardIterator1 __first1, _ForwardIterato
 }
 
 template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 _ForwardIterator1 find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
                            _ForwardIterator2 __first2, _ForwardIterator2 __last2,
                            _BinaryPredicate __pred) {
@@ -216,7 +216,7 @@ _ForwardIterator1 find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1
 }
 
 template <class _ForwardIterator1, class _ForwardIterator2>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 _ForwardIterator1 find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
                            _ForwardIterator2 __first2, _ForwardIterator2 __last2) {
   using __v1 = typename iterator_traits<_ForwardIterator1>::value_type;
@@ -224,6 +224,6 @@ _ForwardIterator1 find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1
   return std::find_end(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>());
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_FIND_END_OF_H
+#endif // _LIBCUDACXX___ALGORITHM_FIND_END_OF_H

diff  --git a/libcxx/include/__algorithm/find_first_of.h b/libcxx/include/__algorithm/find_first_of.h
index 2096b0f0c9a5..0b211a8cedb3 100644
--- a/libcxx/include/__algorithm/find_first_of.h
+++ b/libcxx/include/__algorithm/find_first_of.h
@@ -7,21 +7,21 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_FIND_FIRST_OF_H
-#define _LIBCPP___ALGORITHM_FIND_FIRST_OF_H
+#ifndef _LIBCUDACXX___ALGORITHM_FIND_FIRST_OF_H
+#define _LIBCUDACXX___ALGORITHM_FIND_FIRST_OF_H
 
 #include <__algorithm/comp.h>
 #include <__config>
 #include <__iterator/iterator_traits.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
-_LIBCPP_CONSTEXPR_AFTER_CXX11 _ForwardIterator1 __find_first_of_ce(_ForwardIterator1 __first1,
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _ForwardIterator1 __find_first_of_ce(_ForwardIterator1 __first1,
                                                                    _ForwardIterator1 __last1,
                                                                    _ForwardIterator2 __first2,
                                                                    _ForwardIterator2 __last2,
@@ -34,20 +34,20 @@ _LIBCPP_CONSTEXPR_AFTER_CXX11 _ForwardIterator1 __find_first_of_ce(_ForwardItera
 }
 
 template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator1
+_LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _ForwardIterator1
 find_first_of(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
               _ForwardIterator2 __last2, _BinaryPredicate __pred) {
-  return _VSTD::__find_first_of_ce(__first1, __last1, __first2, __last2, __pred);
+  return _CUDA_VSTD::__find_first_of_ce(__first1, __last1, __first2, __last2, __pred);
 }
 
 template <class _ForwardIterator1, class _ForwardIterator2>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator1 find_first_of(
+_LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _ForwardIterator1 find_first_of(
     _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2) {
   typedef typename iterator_traits<_ForwardIterator1>::value_type __v1;
   typedef typename iterator_traits<_ForwardIterator2>::value_type __v2;
-  return _VSTD::__find_first_of_ce(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>());
+  return _CUDA_VSTD::__find_first_of_ce(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>());
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_FIND_FIRST_OF_H
+#endif // _LIBCUDACXX___ALGORITHM_FIND_FIRST_OF_H

diff  --git a/libcxx/include/__algorithm/find_if.h b/libcxx/include/__algorithm/find_if.h
index aa98171a1f61..50eb86dde679 100644
--- a/libcxx/include/__algorithm/find_if.h
+++ b/libcxx/include/__algorithm/find_if.h
@@ -7,19 +7,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_FIND_IF_H
-#define _LIBCPP___ALGORITHM_FIND_IF_H
+#ifndef _LIBCUDACXX___ALGORITHM_FIND_IF_H
+#define _LIBCUDACXX___ALGORITHM_FIND_IF_H
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _InputIterator, class _Predicate>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _InputIterator
+_LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _InputIterator
 find_if(_InputIterator __first, _InputIterator __last, _Predicate __pred) {
   for (; __first != __last; ++__first)
     if (__pred(*__first))
@@ -27,6 +27,6 @@ find_if(_InputIterator __first, _InputIterator __last, _Predicate __pred) {
   return __first;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_FIND_IF_H
+#endif // _LIBCUDACXX___ALGORITHM_FIND_IF_H

diff  --git a/libcxx/include/__algorithm/find_if_not.h b/libcxx/include/__algorithm/find_if_not.h
index 61ddab0b9805..8ebc582970c6 100644
--- a/libcxx/include/__algorithm/find_if_not.h
+++ b/libcxx/include/__algorithm/find_if_not.h
@@ -7,19 +7,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_FIND_IF_NOT_H
-#define _LIBCPP___ALGORITHM_FIND_IF_NOT_H
+#ifndef _LIBCUDACXX___ALGORITHM_FIND_IF_NOT_H
+#define _LIBCUDACXX___ALGORITHM_FIND_IF_NOT_H
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _InputIterator, class _Predicate>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _InputIterator
+_LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _InputIterator
 find_if_not(_InputIterator __first, _InputIterator __last, _Predicate __pred) {
   for (; __first != __last; ++__first)
     if (!__pred(*__first))
@@ -27,6 +27,6 @@ find_if_not(_InputIterator __first, _InputIterator __last, _Predicate __pred) {
   return __first;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_FIND_IF_NOT_H
+#endif // _LIBCUDACXX___ALGORITHM_FIND_IF_NOT_H

diff  --git a/libcxx/include/__algorithm/for_each.h b/libcxx/include/__algorithm/for_each.h
index bfbd37c3a3a4..df9a483c374a 100644
--- a/libcxx/include/__algorithm/for_each.h
+++ b/libcxx/include/__algorithm/for_each.h
@@ -7,19 +7,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_FOR_EACH_H
-#define _LIBCPP___ALGORITHM_FOR_EACH_H
+#ifndef _LIBCUDACXX___ALGORITHM_FOR_EACH_H
+#define _LIBCUDACXX___ALGORITHM_FOR_EACH_H
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _InputIterator, class _Function>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _Function for_each(_InputIterator __first,
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _Function for_each(_InputIterator __first,
                                                                                   _InputIterator __last,
                                                                                   _Function __f) {
   for (; __first != __last; ++__first)
@@ -27,6 +27,6 @@ inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _Function for_eac
   return __f;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_FOR_EACH_H
+#endif // _LIBCUDACXX___ALGORITHM_FOR_EACH_H

diff  --git a/libcxx/include/__algorithm/for_each_n.h b/libcxx/include/__algorithm/for_each_n.h
index 2552b40c2781..4c862ed784d3 100644
--- a/libcxx/include/__algorithm/for_each_n.h
+++ b/libcxx/include/__algorithm/for_each_n.h
@@ -7,25 +7,25 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_FOR_EACH_N_H
-#define _LIBCPP___ALGORITHM_FOR_EACH_N_H
+#ifndef _LIBCUDACXX___ALGORITHM_FOR_EACH_N_H
+#define _LIBCUDACXX___ALGORITHM_FOR_EACH_N_H
 
 #include <__config>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 
 template <class _InputIterator, class _Size, class _Function>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _InputIterator for_each_n(_InputIterator __first,
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _InputIterator for_each_n(_InputIterator __first,
                                                                                          _Size __orig_n,
                                                                                          _Function __f) {
-  typedef decltype(_VSTD::__convert_to_integral(__orig_n)) _IntegralSize;
+  typedef decltype(_CUDA_VSTD::__convert_to_integral(__orig_n)) _IntegralSize;
   _IntegralSize __n = __orig_n;
   while (__n > 0) {
     __f(*__first);
@@ -37,6 +37,6 @@ inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _InputIterator fo
 
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_FOR_EACH_N_H
+#endif // _LIBCUDACXX___ALGORITHM_FOR_EACH_N_H

diff  --git a/libcxx/include/__algorithm/generate.h b/libcxx/include/__algorithm/generate.h
index dacbd8c68195..869f12afba8e 100644
--- a/libcxx/include/__algorithm/generate.h
+++ b/libcxx/include/__algorithm/generate.h
@@ -6,19 +6,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_GENERATE_H
-#define _LIBCPP___ALGORITHM_GENERATE_H
+#ifndef _LIBCUDACXX___ALGORITHM_GENERATE_H
+#define _LIBCUDACXX___ALGORITHM_GENERATE_H
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _ForwardIterator, class _Generator>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void
 generate(_ForwardIterator __first, _ForwardIterator __last, _Generator __gen)
 {
@@ -26,6 +26,6 @@ generate(_ForwardIterator __first, _ForwardIterator __last, _Generator __gen)
         *__first = __gen();
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_GENERATE_H
+#endif // _LIBCUDACXX___ALGORITHM_GENERATE_H

diff  --git a/libcxx/include/__algorithm/generate_n.h b/libcxx/include/__algorithm/generate_n.h
index 2650e9e5d8b7..362a5716710d 100644
--- a/libcxx/include/__algorithm/generate_n.h
+++ b/libcxx/include/__algorithm/generate_n.h
@@ -6,30 +6,30 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_GENERATE_N_H
-#define _LIBCPP___ALGORITHM_GENERATE_N_H
+#ifndef _LIBCUDACXX___ALGORITHM_GENERATE_N_H
+#define _LIBCUDACXX___ALGORITHM_GENERATE_N_H
 
 #include <__config>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _OutputIterator, class _Size, class _Generator>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 _OutputIterator
 generate_n(_OutputIterator __first, _Size __orig_n, _Generator __gen)
 {
-    typedef decltype(_VSTD::__convert_to_integral(__orig_n)) _IntegralSize;
+    typedef decltype(_CUDA_VSTD::__convert_to_integral(__orig_n)) _IntegralSize;
     _IntegralSize __n = __orig_n;
     for (; __n > 0; ++__first, (void) --__n)
         *__first = __gen();
     return __first;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_GENERATE_N_H
+#endif // _LIBCUDACXX___ALGORITHM_GENERATE_N_H

diff  --git a/libcxx/include/__algorithm/half_positive.h b/libcxx/include/__algorithm/half_positive.h
index 7666ef1449c6..dfffcb126f81 100644
--- a/libcxx/include/__algorithm/half_positive.h
+++ b/libcxx/include/__algorithm/half_positive.h
@@ -6,22 +6,22 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_HALF_POSITIVE_H
-#define _LIBCPP___ALGORITHM_HALF_POSITIVE_H
+#ifndef _LIBCUDACXX___ALGORITHM_HALF_POSITIVE_H
+#define _LIBCUDACXX___ALGORITHM_HALF_POSITIVE_H
 
 #include <__config>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 // Perform division by two quickly for positive integers (llvm.org/PR39129)
 
 template <typename _Integral>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR
 typename enable_if
 <
     is_integral<_Integral>::value,
@@ -33,7 +33,7 @@ __half_positive(_Integral __value)
 }
 
 template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR
 typename enable_if
 <
     !is_integral<_Tp>::value,
@@ -44,6 +44,6 @@ __half_positive(_Tp __value)
     return __value / 2;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_HALF_POSITIVE_H
+#endif // _LIBCUDACXX___ALGORITHM_HALF_POSITIVE_H

diff  --git a/libcxx/include/__algorithm/in_found_result.h b/libcxx/include/__algorithm/in_found_result.h
index d43f45cd80ef..aa2ac6494071 100644
--- a/libcxx/include/__algorithm/in_found_result.h
+++ b/libcxx/include/__algorithm/in_found_result.h
@@ -7,43 +7,43 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_IN_FOUND_RESULT_H
-#define _LIBCPP___ALGORITHM_IN_FOUND_RESULT_H
+#ifndef _LIBCUDACXX___ALGORITHM_IN_FOUND_RESULT_H
+#define _LIBCUDACXX___ALGORITHM_IN_FOUND_RESULT_H
 
 #include <__concepts/convertible_to.h>
 #include <__config>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 template <class _InIter1>
 struct in_found_result {
-  _LIBCPP_NO_UNIQUE_ADDRESS _InIter1 in;
+  _LIBCUDACXX_NO_UNIQUE_ADDRESS _InIter1 in;
   bool found;
 
   template <class _InIter2>
     requires convertible_to<const _InIter1&, _InIter2>
-  _LIBCPP_HIDE_FROM_ABI constexpr operator in_found_result<_InIter2>() const & {
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr operator in_found_result<_InIter2>() const & {
     return {in, found};
   }
 
   template <class _InIter2>
     requires convertible_to<_InIter1, _InIter2>
-  _LIBCPP_HIDE_FROM_ABI constexpr operator in_found_result<_InIter2>() && {
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr operator in_found_result<_InIter2>() && {
     return {std::move(in), found};
   }
 };
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_IN_FOUND_RESULT_H
+#endif // _LIBCUDACXX___ALGORITHM_IN_FOUND_RESULT_H

diff  --git a/libcxx/include/__algorithm/in_fun_result.h b/libcxx/include/__algorithm/in_fun_result.h
index 21efa655063d..a59cb75b2c94 100644
--- a/libcxx/include/__algorithm/in_fun_result.h
+++ b/libcxx/include/__algorithm/in_fun_result.h
@@ -7,43 +7,43 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_IN_FUN_RESULT_H
-#define _LIBCPP___ALGORITHM_IN_FUN_RESULT_H
+#ifndef _LIBCUDACXX___ALGORITHM_IN_FUN_RESULT_H
+#define _LIBCUDACXX___ALGORITHM_IN_FUN_RESULT_H
 
 #include <__concepts/convertible_to.h>
 #include <__config>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
 namespace ranges {
 template <class _InIter1, class _Func1>
 struct in_fun_result {
-  _LIBCPP_NO_UNIQUE_ADDRESS _InIter1 in;
-  _LIBCPP_NO_UNIQUE_ADDRESS _Func1 fun;
+  _LIBCUDACXX_NO_UNIQUE_ADDRESS _InIter1 in;
+  _LIBCUDACXX_NO_UNIQUE_ADDRESS _Func1 fun;
 
   template <class _InIter2, class _Func2>
     requires convertible_to<const _InIter1&, _InIter2> && convertible_to<const _Func1&, _Func2>
-  _LIBCPP_HIDE_FROM_ABI constexpr operator in_fun_result<_InIter2, _Func2>() const & {
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr operator in_fun_result<_InIter2, _Func2>() const & {
     return {in, fun};
   }
 
   template <class _InIter2, class _Func2>
     requires convertible_to<_InIter1, _InIter2> && convertible_to<_Func1, _Func2>
-  _LIBCPP_HIDE_FROM_ABI constexpr operator in_fun_result<_InIter2, _Func2>() && {
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr operator in_fun_result<_InIter2, _Func2>() && {
     return {std::move(in), std::move(fun)};
   }
 };
 } // namespace ranges
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_IN_FUN_RESULT_H
+#endif // _LIBCUDACXX___ALGORITHM_IN_FUN_RESULT_H

diff  --git a/libcxx/include/__algorithm/in_in_out_result.h b/libcxx/include/__algorithm/in_in_out_result.h
index e45fef187e0d..570d62ad8ed3 100644
--- a/libcxx/include/__algorithm/in_in_out_result.h
+++ b/libcxx/include/__algorithm/in_in_out_result.h
@@ -7,33 +7,33 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_IN_IN_OUT_RESULT_H
-#define _LIBCPP___ALGORITHM_IN_IN_OUT_RESULT_H
+#ifndef _LIBCUDACXX___ALGORITHM_IN_IN_OUT_RESULT_H
+#define _LIBCUDACXX___ALGORITHM_IN_IN_OUT_RESULT_H
 
 #include <__concepts/convertible_to.h>
 #include <__config>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
 namespace ranges {
 
 template <class _InIter1, class _InIter2, class _OutIter1>
 struct in_in_out_result {
-  _LIBCPP_NO_UNIQUE_ADDRESS _InIter1 in1;
-  _LIBCPP_NO_UNIQUE_ADDRESS _InIter2 in2;
-  _LIBCPP_NO_UNIQUE_ADDRESS _OutIter1 out;
+  _LIBCUDACXX_NO_UNIQUE_ADDRESS _InIter1 in1;
+  _LIBCUDACXX_NO_UNIQUE_ADDRESS _InIter2 in2;
+  _LIBCUDACXX_NO_UNIQUE_ADDRESS _OutIter1 out;
 
   template <class _InIter3, class _InIter4, class _OutIter2>
     requires convertible_to<const _InIter1&, _InIter3>
           && convertible_to<const _InIter2&, _InIter4> && convertible_to<const _OutIter1&, _OutIter2>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   operator in_in_out_result<_InIter3, _InIter4, _OutIter2>() const& {
     return {in1, in2, out};
   }
@@ -41,7 +41,7 @@ struct in_in_out_result {
   template <class _InIter3, class _InIter4, class _OutIter2>
     requires convertible_to<_InIter1, _InIter3>
           && convertible_to<_InIter2, _InIter4> && convertible_to<_OutIter1, _OutIter2>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   operator in_in_out_result<_InIter3, _InIter4, _OutIter2>() && {
     return {std::move(in1), std::move(in2), std::move(out)};
   }
@@ -49,8 +49,8 @@ struct in_in_out_result {
 
 } // namespace ranges
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_IN_IN_OUT_RESULT_H
+#endif // _LIBCUDACXX___ALGORITHM_IN_IN_OUT_RESULT_H

diff  --git a/libcxx/include/__algorithm/in_in_result.h b/libcxx/include/__algorithm/in_in_result.h
index 39e64ced33b2..9121a7b208b6 100644
--- a/libcxx/include/__algorithm/in_in_result.h
+++ b/libcxx/include/__algorithm/in_in_result.h
@@ -7,38 +7,38 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_IN_IN_RESULT_H
-#define _LIBCPP___ALGORITHM_IN_IN_RESULT_H
+#ifndef _LIBCUDACXX___ALGORITHM_IN_IN_RESULT_H
+#define _LIBCUDACXX___ALGORITHM_IN_IN_RESULT_H
 
 #include <__concepts/convertible_to.h>
 #include <__config>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
 namespace ranges {
 
 template <class _InIter1, class _InIter2>
 struct in_in_result {
-  _LIBCPP_NO_UNIQUE_ADDRESS _InIter1 in1;
-  _LIBCPP_NO_UNIQUE_ADDRESS _InIter2 in2;
+  _LIBCUDACXX_NO_UNIQUE_ADDRESS _InIter1 in1;
+  _LIBCUDACXX_NO_UNIQUE_ADDRESS _InIter2 in2;
 
   template <class _InIter3, class _InIter4>
     requires convertible_to<const _InIter1&, _InIter3> && convertible_to<const _InIter2&, _InIter4>
-   _LIBCPP_HIDE_FROM_ABI constexpr
+   _LIBCUDACXX_HIDE_FROM_ABI constexpr
    operator in_in_result<_InIter3, _InIter4>() const & {
     return {in1, in2};
   }
 
   template <class _InIter3, class _InIter4>
     requires convertible_to<_InIter1, _InIter3> && convertible_to<_InIter2, _InIter4>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   operator in_in_result<_InIter3, _InIter4>() && {
     return {std::move(in1), std::move(in2)};
   }
@@ -46,8 +46,8 @@ struct in_in_result {
 
 } // namespace ranges
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_IN_IN_RESULT_H
+#endif // _LIBCUDACXX___ALGORITHM_IN_IN_RESULT_H

diff  --git a/libcxx/include/__algorithm/in_out_out_result.h b/libcxx/include/__algorithm/in_out_out_result.h
index 52a883b17627..98c77eb67e96 100644
--- a/libcxx/include/__algorithm/in_out_out_result.h
+++ b/libcxx/include/__algorithm/in_out_out_result.h
@@ -7,32 +7,32 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_IN_OUT_OUT_RESULT_H
-#define _LIBCPP___ALGORITHM_IN_OUT_OUT_RESULT_H
+#ifndef _LIBCUDACXX___ALGORITHM_IN_OUT_OUT_RESULT_H
+#define _LIBCUDACXX___ALGORITHM_IN_OUT_OUT_RESULT_H
 
 #include <__concepts/convertible_to.h>
 #include <__config>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
 namespace ranges {
 template <class _InIter1, class _OutIter1, class _OutIter2>
 struct in_out_out_result {
-  _LIBCPP_NO_UNIQUE_ADDRESS _InIter1 in;
-  _LIBCPP_NO_UNIQUE_ADDRESS _OutIter1 out1;
-  _LIBCPP_NO_UNIQUE_ADDRESS _OutIter2 out2;
+  _LIBCUDACXX_NO_UNIQUE_ADDRESS _InIter1 in;
+  _LIBCUDACXX_NO_UNIQUE_ADDRESS _OutIter1 out1;
+  _LIBCUDACXX_NO_UNIQUE_ADDRESS _OutIter2 out2;
 
   template <class _InIter2, class _OutIter3, class _OutIter4>
     requires convertible_to<const _InIter1&, _InIter2>
           && convertible_to<const _OutIter1&, _OutIter3> && convertible_to<const _OutIter2&, _OutIter4>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   operator in_out_out_result<_InIter2, _OutIter3, _OutIter4>() const& {
     return {in, out1, out2};
   }
@@ -40,15 +40,15 @@ struct in_out_out_result {
   template <class _InIter2, class _OutIter3, class _OutIter4>
     requires convertible_to<_InIter1, _InIter2>
           && convertible_to<_OutIter1, _OutIter3> && convertible_to<_OutIter2, _OutIter4>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   operator in_out_out_result<_InIter2, _OutIter3, _OutIter4>() && {
     return {std::move(in), std::move(out1), std::move(out2)};
   }
 };
 } // namespace ranges
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_IN_OUT_OUT_RESULT_H
+#endif // _LIBCUDACXX___ALGORITHM_IN_OUT_OUT_RESULT_H

diff  --git a/libcxx/include/__algorithm/in_out_result.h b/libcxx/include/__algorithm/in_out_result.h
index 47e6f3907943..61d47142b839 100644
--- a/libcxx/include/__algorithm/in_out_result.h
+++ b/libcxx/include/__algorithm/in_out_result.h
@@ -7,38 +7,38 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_IN_OUT_RESULT_H
-#define _LIBCPP___ALGORITHM_IN_OUT_RESULT_H
+#ifndef _LIBCUDACXX___ALGORITHM_IN_OUT_RESULT_H
+#define _LIBCUDACXX___ALGORITHM_IN_OUT_RESULT_H
 
 #include <__concepts/convertible_to.h>
 #include <__config>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
 namespace ranges {
 
 template<class _InIter1, class _OutIter1>
 struct in_out_result {
-  _LIBCPP_NO_UNIQUE_ADDRESS _InIter1 in;
-  _LIBCPP_NO_UNIQUE_ADDRESS _OutIter1 out;
+  _LIBCUDACXX_NO_UNIQUE_ADDRESS _InIter1 in;
+  _LIBCUDACXX_NO_UNIQUE_ADDRESS _OutIter1 out;
 
   template <class _InIter2, class _OutIter2>
     requires convertible_to<const _InIter1&, _InIter2> && convertible_to<const _OutIter1&, _OutIter2>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr operator in_out_result<_InIter2, _OutIter2>() const & {
     return {in, out};
   }
 
   template <class _InIter2, class _OutIter2>
     requires convertible_to<_InIter1, _InIter2> && convertible_to<_OutIter1, _OutIter2>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr operator in_out_result<_InIter2, _OutIter2>() && {
     return {std::move(in), std::move(out)};
   }
@@ -46,8 +46,8 @@ struct in_out_result {
 
 } // namespace ranges
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_IN_OUT_RESULT_H
+#endif // _LIBCUDACXX___ALGORITHM_IN_OUT_RESULT_H

diff  --git a/libcxx/include/__algorithm/includes.h b/libcxx/include/__algorithm/includes.h
index c64194a2c826..b82f85a040e4 100644
--- a/libcxx/include/__algorithm/includes.h
+++ b/libcxx/include/__algorithm/includes.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_INCLUDES_H
-#define _LIBCPP___ALGORITHM_INCLUDES_H
+#ifndef _LIBCUDACXX___ALGORITHM_INCLUDES_H
+#define _LIBCUDACXX___ALGORITHM_INCLUDES_H
 
 #include <__algorithm/comp.h>
 #include <__algorithm/comp_ref_type.h>
@@ -18,14 +18,14 @@
 #include <__type_traits/is_callable.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Iter1, class _Sent1, class _Iter2, class _Sent2, class _Comp, class _Proj1, class _Proj2>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 bool
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 bool
 __includes(_Iter1 __first1, _Sent1 __last1, _Iter2 __first2, _Sent2 __last2,
            _Comp&& __comp, _Proj1&& __proj1, _Proj2&& __proj2) {
   for (; __first2 != __last2; ++__first1) {
@@ -39,7 +39,7 @@ __includes(_Iter1 __first1, _Sent1 __last1, _Iter2 __first2, _Sent2 __last2,
 }
 
 template <class _InputIterator1, class _InputIterator2, class _Compare>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 bool includes(
+_LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 bool includes(
     _InputIterator1 __first1,
     _InputIterator1 __last1,
     _InputIterator2 __first2,
@@ -55,7 +55,7 @@ _LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
 }
 
 template <class _InputIterator1, class _InputIterator2>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 bool
+_LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 bool
 includes(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2) {
   return std::includes(
       std::move(__first1),
@@ -66,6 +66,6 @@ includes(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __fi
              typename iterator_traits<_InputIterator2>::value_type>());
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_INCLUDES_H
+#endif // _LIBCUDACXX___ALGORITHM_INCLUDES_H

diff  --git a/libcxx/include/__algorithm/inplace_merge.h b/libcxx/include/__algorithm/inplace_merge.h
index 0890639f4952..5a1a3b1d20f6 100644
--- a/libcxx/include/__algorithm/inplace_merge.h
+++ b/libcxx/include/__algorithm/inplace_merge.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_INPLACE_MERGE_H
-#define _LIBCPP___ALGORITHM_INPLACE_MERGE_H
+#ifndef _LIBCUDACXX___ALGORITHM_INPLACE_MERGE_H
+#define _LIBCUDACXX___ALGORITHM_INPLACE_MERGE_H
 
 #include <__algorithm/comp.h>
 #include <__algorithm/comp_ref_type.h>
@@ -25,14 +25,14 @@
 #include <__iterator/reverse_iterator.h>
 #include <memory>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Predicate>
 class __invert // invert the sense of a comparison
@@ -40,17 +40,17 @@ class __invert // invert the sense of a comparison
 private:
     _Predicate __p_;
 public:
-    _LIBCPP_INLINE_VISIBILITY __invert() {}
+    _LIBCUDACXX_INLINE_VISIBILITY __invert() {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __invert(_Predicate __p) : __p_(__p) {}
 
     template <class _T1>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool operator()(const _T1& __x) {return !__p_(__x);}
 
     template <class _T1, class _T2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool operator()(const _T1& __x, const _T2& __y) {return __p_(__y, __x);}
 };
 
@@ -209,7 +209,7 @@ void __inplace_merge(
 }
 
 template <class _AlgPolicy, class _BidirectionalIterator, class _Compare>
-_LIBCPP_HIDE_FROM_ABI
+_LIBCUDACXX_HIDE_FROM_ABI
 void
 __inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last,
               _Compare&& __comp)
@@ -218,18 +218,18 @@ __inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle,
     typedef typename iterator_traits<_BidirectionalIterator>::
diff erence_type 
diff erence_type;
     
diff erence_type __len1 = _IterOps<_AlgPolicy>::distance(__first, __middle);
     
diff erence_type __len2 = _IterOps<_AlgPolicy>::distance(__middle, __last);
-    
diff erence_type __buf_size = _VSTD::min(__len1, __len2);
+    
diff erence_type __buf_size = _CUDA_VSTD::min(__len1, __len2);
 // TODO: Remove the use of std::get_temporary_buffer
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
-    pair<value_type*, ptr
diff _t> __buf = _VSTD::get_temporary_buffer<value_type>(__buf_size);
-_LIBCPP_SUPPRESS_DEPRECATED_POP
+_LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
+    pair<value_type*, ptr
diff _t> __buf = _CUDA_VSTD::get_temporary_buffer<value_type>(__buf_size);
+_LIBCUDACXX_SUPPRESS_DEPRECATED_POP
     unique_ptr<value_type, __return_temporary_buffer> __h(__buf.first);
     return std::__inplace_merge<_AlgPolicy>(
         std::move(__first), std::move(__middle), std::move(__last), __comp, __len1, __len2, __buf.first, __buf.second);
 }
 
 template <class _BidirectionalIterator, class _Compare>
-inline _LIBCPP_HIDE_FROM_ABI void inplace_merge(
+inline _LIBCUDACXX_HIDE_FROM_ABI void inplace_merge(
     _BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last, _Compare __comp) {
   typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
   std::__inplace_merge<_ClassicAlgPolicy>(
@@ -237,7 +237,7 @@ inline _LIBCPP_HIDE_FROM_ABI void inplace_merge(
 }
 
 template <class _BidirectionalIterator>
-inline _LIBCPP_HIDE_FROM_ABI
+inline _LIBCUDACXX_HIDE_FROM_ABI
 void
 inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last)
 {
@@ -245,8 +245,8 @@ inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle, _
                         __less<typename iterator_traits<_BidirectionalIterator>::value_type>());
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___ALGORITHM_INPLACE_MERGE_H
+#endif // _LIBCUDACXX___ALGORITHM_INPLACE_MERGE_H

diff  --git a/libcxx/include/__algorithm/is_heap.h b/libcxx/include/__algorithm/is_heap.h
index 0d399a09b857..fde2e0192b09 100644
--- a/libcxx/include/__algorithm/is_heap.h
+++ b/libcxx/include/__algorithm/is_heap.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_IS_HEAP_H
-#define _LIBCPP___ALGORITHM_IS_HEAP_H
+#ifndef _LIBCUDACXX___ALGORITHM_IS_HEAP_H
+#define _LIBCUDACXX___ALGORITHM_IS_HEAP_H
 
 #include <__algorithm/comp.h>
 #include <__algorithm/comp_ref_type.h>
@@ -15,15 +15,15 @@
 #include <__config>
 #include <__iterator/iterator_traits.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _RandomAccessIterator, class _Compare>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_NODISCARD_EXT inline
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 bool
 is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
 {
@@ -32,14 +32,14 @@ is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __
 }
 
 template<class _RandomAccessIterator>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_NODISCARD_EXT inline
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 bool
 is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
 {
-    return _VSTD::is_heap(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
+    return _CUDA_VSTD::is_heap(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_IS_HEAP_H
+#endif // _LIBCUDACXX___ALGORITHM_IS_HEAP_H

diff  --git a/libcxx/include/__algorithm/is_heap_until.h b/libcxx/include/__algorithm/is_heap_until.h
index adb35af887fb..82ce8ae43632 100644
--- a/libcxx/include/__algorithm/is_heap_until.h
+++ b/libcxx/include/__algorithm/is_heap_until.h
@@ -6,22 +6,22 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_IS_HEAP_UNTIL_H
-#define _LIBCPP___ALGORITHM_IS_HEAP_UNTIL_H
+#ifndef _LIBCUDACXX___ALGORITHM_IS_HEAP_UNTIL_H
+#define _LIBCUDACXX___ALGORITHM_IS_HEAP_UNTIL_H
 
 #include <__algorithm/comp.h>
 #include <__algorithm/comp_ref_type.h>
 #include <__config>
 #include <__iterator/iterator_traits.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Compare, class _RandomAccessIterator>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _RandomAccessIterator
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _RandomAccessIterator
 __is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare&& __comp)
 {
     typedef typename iterator_traits<_RandomAccessIterator>::
diff erence_type 
diff erence_type;
@@ -48,7 +48,7 @@ __is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last, _Co
 }
 
 template <class _RandomAccessIterator, class _Compare>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _RandomAccessIterator
+_LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _RandomAccessIterator
 is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
 {
     typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
@@ -56,12 +56,12 @@ is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last, _Comp
 }
 
 template<class _RandomAccessIterator>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _RandomAccessIterator
+_LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _RandomAccessIterator
 is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last)
 {
-    return _VSTD::__is_heap_until(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
+    return _CUDA_VSTD::__is_heap_until(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_IS_HEAP_UNTIL_H
+#endif // _LIBCUDACXX___ALGORITHM_IS_HEAP_UNTIL_H

diff  --git a/libcxx/include/__algorithm/is_partitioned.h b/libcxx/include/__algorithm/is_partitioned.h
index b4f421cfc053..b27a3ce0fb44 100644
--- a/libcxx/include/__algorithm/is_partitioned.h
+++ b/libcxx/include/__algorithm/is_partitioned.h
@@ -6,19 +6,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_IS_PARTITIONED_H
-#define _LIBCPP___ALGORITHM_IS_PARTITIONED_H
+#ifndef _LIBCUDACXX___ALGORITHM_IS_PARTITIONED_H
+#define _LIBCUDACXX___ALGORITHM_IS_PARTITIONED_H
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _InputIterator, class _Predicate>
-_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX17 bool
+_LIBCUDACXX_NODISCARD_EXT _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 bool
 is_partitioned(_InputIterator __first, _InputIterator __last, _Predicate __pred)
 {
     for (; __first != __last; ++__first)
@@ -33,6 +33,6 @@ is_partitioned(_InputIterator __first, _InputIterator __last, _Predicate __pred)
     return true;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_IS_PARTITIONED_H
+#endif // _LIBCUDACXX___ALGORITHM_IS_PARTITIONED_H

diff  --git a/libcxx/include/__algorithm/is_permutation.h b/libcxx/include/__algorithm/is_permutation.h
index 06a4949e21b5..8866755c9b48 100644
--- a/libcxx/include/__algorithm/is_permutation.h
+++ b/libcxx/include/__algorithm/is_permutation.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_IS_PERMUTATION_H
-#define _LIBCPP___ALGORITHM_IS_PERMUTATION_H
+#ifndef _LIBCUDACXX___ALGORITHM_IS_PERMUTATION_H
+#define _LIBCUDACXX___ALGORITHM_IS_PERMUTATION_H
 
 #include <__algorithm/comp.h>
 #include <__algorithm/iterator_operations.h>
@@ -22,16 +22,16 @@
 #include <__utility/move.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Iter1, class _Sent1, class _Iter2, class _Sent2, class = void>
 struct _ConstTimeDistance : false_type {};
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 template <class _Iter1, class _Sent1, class _Iter2, class _Sent2>
 struct _ConstTimeDistance<_Iter1, _Sent1, _Iter2, _Sent2, __enable_if_t<
@@ -47,7 +47,7 @@ struct _ConstTimeDistance<_Iter1, _Iter1, _Iter2, _Iter2, __enable_if_t<
     is_same<typename iterator_traits<_Iter2>::iterator_category, random_access_iterator_tag>::value
 > > : true_type {};
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
 // Internal functions
 
@@ -55,7 +55,7 @@ struct _ConstTimeDistance<_Iter1, _Iter1, _Iter2, _Iter2, __enable_if_t<
 template <class _AlgPolicy,
           class _Iter1, class _Sent1, class _Iter2, class _Sent2,
           class _Proj1, class _Proj2, class _Pred>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 bool
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 bool
 __is_permutation_impl(_Iter1 __first1, _Sent1 __last1, _Iter2 __first2, _Sent2 __last2,
                       _Pred&& __pred, _Proj1&& __proj1, _Proj2&& __proj2) {
   using _D1 = __iter_
diff _t<_Iter1>;
@@ -94,7 +94,7 @@ __is_permutation_impl(_Iter1 __first1, _Sent1 __last1, _Iter2 __first2, _Sent2 _
 
 // 2+1 iterators, predicate. Not used by range algorithms.
 template <class _AlgPolicy, class _ForwardIterator1, class _Sentinel1, class _ForwardIterator2, class _BinaryPredicate>
-_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 bool
+_LIBCUDACXX_NODISCARD_EXT _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 bool
 __is_permutation(_ForwardIterator1 __first1, _Sentinel1 __last1, _ForwardIterator2 __first2,
                  _BinaryPredicate&& __pred) {
   // Shorten sequences as much as possible by lopping of any equal prefix.
@@ -122,7 +122,7 @@ __is_permutation(_ForwardIterator1 __first1, _Sentinel1 __last1, _ForwardIterato
 template <class _AlgPolicy,
           class _Iter1, class _Sent1, class _Iter2, class _Sent2,
           class _Proj1, class _Proj2, class _Pred>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 bool
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 bool
 __is_permutation(_Iter1 __first1, _Sent1 __last1, _Iter2 __first2, _Sent2 __last2,
                  _Pred&& __pred, _Proj1&& __proj1, _Proj2&& __proj2,
                  /*_ConstTimeDistance=*/false_type) {
@@ -156,7 +156,7 @@ __is_permutation(_Iter1 __first1, _Sent1 __last1, _Iter2 __first2, _Sent2 __last
 template <class _AlgPolicy,
           class _Iter1, class _Sent1, class _Iter2, class _Sent2,
           class _Proj1, class _Proj2, class _Pred>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 bool
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 bool
 __is_permutation(_Iter1 __first1, _Sent1 __last1, _Iter2 __first2, _Sent2 __last2,
                  _Pred&& __pred, _Proj1&& __proj1, _Proj2&& __proj2,
                  /*_ConstTimeDistance=*/true_type) {
@@ -172,7 +172,7 @@ __is_permutation(_Iter1 __first1, _Sent1 __last1, _Iter2 __first2, _Sent2 __last
 template <class _AlgPolicy,
           class _Iter1, class _Sent1, class _Iter2, class _Sent2,
           class _Proj1, class _Proj2, class _Pred>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 bool
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 bool
 __is_permutation(_Iter1 __first1, _Sent1 __last1, _Iter2 __first2, _Sent2 __last2,
                  _Pred&& __pred, _Proj1&& __proj1, _Proj2&& __proj2) {
   return std::__is_permutation<_AlgPolicy>(
@@ -185,7 +185,7 @@ __is_permutation(_Iter1 __first1, _Sent1 __last1, _Iter2 __first2, _Sent2 __last
 
 // 2+1 iterators, predicate
 template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
-_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 bool
+_LIBCUDACXX_NODISCARD_EXT _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 bool
 is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
                _BinaryPredicate __pred) {
   static_assert(__is_callable<_BinaryPredicate, decltype(*__first1), decltype(*__first2)>::value,
@@ -197,18 +197,18 @@ is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIt
 
 // 2+1 iterators
 template <class _ForwardIterator1, class _ForwardIterator2>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 bool
+_LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 bool
 is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2) {
   using __v1 = __iter_value_type<_ForwardIterator1>;
   using __v2 = __iter_value_type<_ForwardIterator2>;
   return std::is_permutation(__first1, __last1, __first2, __equal_to<__v1, __v2>());
 }
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 
 // 2+2 iterators
 template <class _ForwardIterator1, class _ForwardIterator2>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 bool
+_LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 bool
 is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
                _ForwardIterator2 __last2) {
   using __v1 = __iter_value_type<_ForwardIterator1>;
@@ -221,7 +221,7 @@ is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIt
 
 // 2+2 iterators, predicate
 template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 bool
+_LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 bool
 is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
                _ForwardIterator2 __last2, _BinaryPredicate __pred) {
   static_assert(__is_callable<_BinaryPredicate, decltype(*__first1), decltype(*__first2)>::value,
@@ -232,8 +232,8 @@ is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIt
       __pred, __identity(), __identity());
 }
 
-#endif // _LIBCPP_STD_VER > 11
+#endif // _LIBCUDACXX_STD_VER > 11
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_IS_PERMUTATION_H
+#endif // _LIBCUDACXX___ALGORITHM_IS_PERMUTATION_H

diff  --git a/libcxx/include/__algorithm/is_sorted.h b/libcxx/include/__algorithm/is_sorted.h
index 56de95bb31b7..56055be786e4 100644
--- a/libcxx/include/__algorithm/is_sorted.h
+++ b/libcxx/include/__algorithm/is_sorted.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_IS_SORTED_H
-#define _LIBCPP___ALGORITHM_IS_SORTED_H
+#ifndef _LIBCUDACXX___ALGORITHM_IS_SORTED_H
+#define _LIBCUDACXX___ALGORITHM_IS_SORTED_H
 
 #include <__algorithm/comp.h>
 #include <__algorithm/comp_ref_type.h>
@@ -15,31 +15,31 @@
 #include <__config>
 #include <__iterator/iterator_traits.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _ForwardIterator, class _Compare>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_NODISCARD_EXT inline
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 bool
 is_sorted(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp)
 {
     typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
-    return _VSTD::__is_sorted_until<_Comp_ref>(__first, __last, __comp) == __last;
+    return _CUDA_VSTD::__is_sorted_until<_Comp_ref>(__first, __last, __comp) == __last;
 }
 
 template<class _ForwardIterator>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_NODISCARD_EXT inline
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 bool
 is_sorted(_ForwardIterator __first, _ForwardIterator __last)
 {
-    return _VSTD::is_sorted(__first, __last, __less<typename iterator_traits<_ForwardIterator>::value_type>());
+    return _CUDA_VSTD::is_sorted(__first, __last, __less<typename iterator_traits<_ForwardIterator>::value_type>());
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_IS_SORTED_H
+#endif // _LIBCUDACXX___ALGORITHM_IS_SORTED_H

diff  --git a/libcxx/include/__algorithm/is_sorted_until.h b/libcxx/include/__algorithm/is_sorted_until.h
index 338d28508c17..f6c70b169100 100644
--- a/libcxx/include/__algorithm/is_sorted_until.h
+++ b/libcxx/include/__algorithm/is_sorted_until.h
@@ -6,22 +6,22 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_IS_SORTED_UNTIL_H
-#define _LIBCPP___ALGORITHM_IS_SORTED_UNTIL_H
+#ifndef _LIBCUDACXX___ALGORITHM_IS_SORTED_UNTIL_H
+#define _LIBCUDACXX___ALGORITHM_IS_SORTED_UNTIL_H
 
 #include <__algorithm/comp.h>
 #include <__algorithm/comp_ref_type.h>
 #include <__config>
 #include <__iterator/iterator_traits.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Compare, class _ForwardIterator>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _ForwardIterator
 __is_sorted_until(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp)
 {
     if (__first != __last)
@@ -38,20 +38,20 @@ __is_sorted_until(_ForwardIterator __first, _ForwardIterator __last, _Compare __
 }
 
 template <class _ForwardIterator, class _Compare>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
+_LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _ForwardIterator
 is_sorted_until(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp)
 {
     typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
-    return _VSTD::__is_sorted_until<_Comp_ref>(__first, __last, __comp);
+    return _CUDA_VSTD::__is_sorted_until<_Comp_ref>(__first, __last, __comp);
 }
 
 template<class _ForwardIterator>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
+_LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _ForwardIterator
 is_sorted_until(_ForwardIterator __first, _ForwardIterator __last)
 {
-    return _VSTD::is_sorted_until(__first, __last, __less<typename iterator_traits<_ForwardIterator>::value_type>());
+    return _CUDA_VSTD::is_sorted_until(__first, __last, __less<typename iterator_traits<_ForwardIterator>::value_type>());
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_IS_SORTED_UNTIL_H
+#endif // _LIBCUDACXX___ALGORITHM_IS_SORTED_UNTIL_H

diff  --git a/libcxx/include/__algorithm/iter_swap.h b/libcxx/include/__algorithm/iter_swap.h
index 038859e1361d..2b05955905f7 100644
--- a/libcxx/include/__algorithm/iter_swap.h
+++ b/libcxx/include/__algorithm/iter_swap.h
@@ -6,27 +6,27 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_ITER_SWAP_H
-#define _LIBCPP___ALGORITHM_ITER_SWAP_H
+#ifndef _LIBCUDACXX___ALGORITHM_ITER_SWAP_H
+#define _LIBCUDACXX___ALGORITHM_ITER_SWAP_H
 
 #include <__config>
 #include <__utility/declval.h>
 #include <__utility/swap.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _ForwardIterator1, class _ForwardIterator2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 void iter_swap(_ForwardIterator1 __a,
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 void iter_swap(_ForwardIterator1 __a,
                                                                               _ForwardIterator2 __b)
     //                                  _NOEXCEPT_(_NOEXCEPT_(swap(*__a, *__b)))
     _NOEXCEPT_(_NOEXCEPT_(swap(*declval<_ForwardIterator1>(), *declval<_ForwardIterator2>()))) {
   swap(*__a, *__b);
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_ITER_SWAP_H
+#endif // _LIBCUDACXX___ALGORITHM_ITER_SWAP_H

diff  --git a/libcxx/include/__algorithm/iterator_operations.h b/libcxx/include/__algorithm/iterator_operations.h
index af461878737f..a4589814a88f 100644
--- a/libcxx/include/__algorithm/iterator_operations.h
+++ b/libcxx/include/__algorithm/iterator_operations.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_ITERATOR_OPERATIONS_H
-#define _LIBCPP___ALGORITHM_ITERATOR_OPERATIONS_H
+#ifndef _LIBCUDACXX___ALGORITHM_ITERATOR_OPERATIONS_H
+#define _LIBCUDACXX___ALGORITHM_ITERATOR_OPERATIONS_H
 
 #include <__algorithm/iter_swap.h>
 #include <__algorithm/ranges_iterator_concept.h>
@@ -26,15 +26,15 @@
 #include <__utility/move.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _AlgPolicy> struct _IterOps;
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 struct _RangeAlgPolicy {};
 
 template <>
@@ -76,14 +76,14 @@ struct _IterOps<_ClassicAlgPolicy> {
 
   // advance
   template <class _Iter, class _Distance>
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
   static void advance(_Iter& __iter, _Distance __count) {
     std::advance(__iter, __count);
   }
 
   // distance
   template <class _Iter>
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
   static typename iterator_traits<_Iter>::
diff erence_type distance(_Iter __first, _Iter __last) {
     return std::distance(__first, __last);
   }
@@ -95,7 +95,7 @@ struct _IterOps<_ClassicAlgPolicy> {
   using __move_t = decltype(std::move(*std::declval<_Iter&>()));
 
   template <class _Iter>
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
   static void __validate_iter_reference() {
     static_assert(is_same<__deref_t<_Iter>, typename iterator_traits<__uncvref_t<_Iter> >::reference>::value,
         "It looks like your iterator's `iterator_traits<It>::reference` does not match the return type of "
@@ -105,7 +105,7 @@ struct _IterOps<_ClassicAlgPolicy> {
 
   // iter_move
   template <class _Iter>
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 static
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 static
   // If the result of dereferencing `_Iter` is a reference type, deduce the result of calling `std::move` on it. Note
   // that the C++03 mode doesn't support `decltype(auto)` as the return type.
   __enable_if_t<
@@ -118,7 +118,7 @@ struct _IterOps<_ClassicAlgPolicy> {
   }
 
   template <class _Iter>
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 static
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 static
   // If the result of dereferencing `_Iter` is a value type, deduce the return value of this function to also be a
   // value -- otherwise, after `operator*` returns a temporary, this function would return a dangling reference to that
   // temporary. Note that the C++03 mode doesn't support `auto` as the return type.
@@ -133,20 +133,20 @@ struct _IterOps<_ClassicAlgPolicy> {
 
   // iter_swap
   template <class _Iter1, class _Iter2>
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
   static void iter_swap(_Iter1&& __a, _Iter2&& __b) {
     std::iter_swap(std::forward<_Iter1>(__a), std::forward<_Iter2>(__b));
   }
 
   // next
   template <class _Iterator>
-  _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR_AFTER_CXX11
+  _LIBCUDACXX_HIDE_FROM_ABI static _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
   _Iterator next(_Iterator, _Iterator __last) {
     return __last;
   }
 
   template <class _Iter>
-  _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR_AFTER_CXX11
+  _LIBCUDACXX_HIDE_FROM_ABI static _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
   __uncvref_t<_Iter> next(_Iter&& __it,
                           typename iterator_traits<__uncvref_t<_Iter> >::
diff erence_type __n = 1) {
     return std::next(std::forward<_Iter>(__it), __n);
@@ -154,19 +154,19 @@ struct _IterOps<_ClassicAlgPolicy> {
 
   // prev
   template <class _Iter>
-  _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR_AFTER_CXX11
+  _LIBCUDACXX_HIDE_FROM_ABI static _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
   __uncvref_t<_Iter> prev(_Iter&& __iter,
                  typename iterator_traits<__uncvref_t<_Iter> >::
diff erence_type __n = 1) {
     return std::prev(std::forward<_Iter>(__iter), __n);
   }
 
   template <class _Iter>
-  _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR_AFTER_CXX11
+  _LIBCUDACXX_HIDE_FROM_ABI static _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
   void __advance_to(_Iter& __first, _Iter __last) {
     __first = __last;
   }
 };
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_ITERATOR_OPERATIONS_H
+#endif // _LIBCUDACXX___ALGORITHM_ITERATOR_OPERATIONS_H

diff  --git a/libcxx/include/__algorithm/lexicographical_compare.h b/libcxx/include/__algorithm/lexicographical_compare.h
index 30ddf2408120..c5cfbf4b8561 100644
--- a/libcxx/include/__algorithm/lexicographical_compare.h
+++ b/libcxx/include/__algorithm/lexicographical_compare.h
@@ -6,22 +6,22 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_LEXICOGRAPHICAL_COMPARE_H
-#define _LIBCPP___ALGORITHM_LEXICOGRAPHICAL_COMPARE_H
+#ifndef _LIBCUDACXX___ALGORITHM_LEXICOGRAPHICAL_COMPARE_H
+#define _LIBCUDACXX___ALGORITHM_LEXICOGRAPHICAL_COMPARE_H
 
 #include <__algorithm/comp.h>
 #include <__algorithm/comp_ref_type.h>
 #include <__config>
 #include <__iterator/iterator_traits.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Compare, class _InputIterator1, class _InputIterator2>
-_LIBCPP_CONSTEXPR_AFTER_CXX17 bool
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17 bool
 __lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1,
                           _InputIterator2 __first2, _InputIterator2 __last2, _Compare __comp)
 {
@@ -36,28 +36,28 @@ __lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1,
 }
 
 template <class _InputIterator1, class _InputIterator2, class _Compare>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_NODISCARD_EXT inline
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 bool
 lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1,
                         _InputIterator2 __first2, _InputIterator2 __last2, _Compare __comp)
 {
     typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
-    return _VSTD::__lexicographical_compare<_Comp_ref>(__first1, __last1, __first2, __last2, __comp);
+    return _CUDA_VSTD::__lexicographical_compare<_Comp_ref>(__first1, __last1, __first2, __last2, __comp);
 }
 
 template <class _InputIterator1, class _InputIterator2>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_NODISCARD_EXT inline
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 bool
 lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1,
                         _InputIterator2 __first2, _InputIterator2 __last2)
 {
-    return _VSTD::lexicographical_compare(__first1, __last1, __first2, __last2,
+    return _CUDA_VSTD::lexicographical_compare(__first1, __last1, __first2, __last2,
                                          __less<typename iterator_traits<_InputIterator1>::value_type,
                                                 typename iterator_traits<_InputIterator2>::value_type>());
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_LEXICOGRAPHICAL_COMPARE_H
+#endif // _LIBCUDACXX___ALGORITHM_LEXICOGRAPHICAL_COMPARE_H

diff  --git a/libcxx/include/__algorithm/lower_bound.h b/libcxx/include/__algorithm/lower_bound.h
index 2c92f715265a..85e5cffc89f3 100644
--- a/libcxx/include/__algorithm/lower_bound.h
+++ b/libcxx/include/__algorithm/lower_bound.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_LOWER_BOUND_H
-#define _LIBCPP___ALGORITHM_LOWER_BOUND_H
+#ifndef _LIBCUDACXX___ALGORITHM_LOWER_BOUND_H
+#define _LIBCUDACXX___ALGORITHM_LOWER_BOUND_H
 
 #include <__algorithm/comp.h>
 #include <__algorithm/half_positive.h>
@@ -22,14 +22,14 @@
 #include <__type_traits/remove_reference.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _AlgPolicy, class _Iter, class _Sent, class _Type, class _Proj, class _Comp>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 _Iter __lower_bound_impl(_Iter __first, _Sent __last, const _Type& __value, _Comp& __comp, _Proj& __proj) {
   auto __len = _IterOps<_AlgPolicy>::distance(__first, __last);
 
@@ -48,7 +48,7 @@ _Iter __lower_bound_impl(_Iter __first, _Sent __last, const _Type& __value, _Com
 }
 
 template <class _ForwardIterator, class _Tp, class _Compare>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 _ForwardIterator lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value, _Compare __comp) {
   static_assert(__is_callable<_Compare, decltype(*__first), const _Tp&>::value,
                 "The comparator has to be callable");
@@ -57,12 +57,12 @@ _ForwardIterator lower_bound(_ForwardIterator __first, _ForwardIterator __last,
 }
 
 template <class _ForwardIterator, class _Tp>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 _ForwardIterator lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) {
   return std::lower_bound(__first, __last, __value,
                           __less<typename iterator_traits<_ForwardIterator>::value_type, _Tp>());
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_LOWER_BOUND_H
+#endif // _LIBCUDACXX___ALGORITHM_LOWER_BOUND_H

diff  --git a/libcxx/include/__algorithm/make_heap.h b/libcxx/include/__algorithm/make_heap.h
index 0aa67d18ed0a..83140b93eb6d 100644
--- a/libcxx/include/__algorithm/make_heap.h
+++ b/libcxx/include/__algorithm/make_heap.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_MAKE_HEAP_H
-#define _LIBCPP___ALGORITHM_MAKE_HEAP_H
+#ifndef _LIBCUDACXX___ALGORITHM_MAKE_HEAP_H
+#define _LIBCUDACXX___ALGORITHM_MAKE_HEAP_H
 
 #include <__algorithm/comp.h>
 #include <__algorithm/comp_ref_type.h>
@@ -17,14 +17,14 @@
 #include <__iterator/iterator_traits.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _AlgPolicy, class _Compare, class _RandomAccessIterator>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 void __make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare&& __comp) {
   using _CompRef = typename __comp_ref_type<_Compare>::type;
   _CompRef __comp_ref = __comp;
@@ -40,18 +40,18 @@ void __make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _C
 }
 
 template <class _RandomAccessIterator, class _Compare>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) {
   std::__make_heap<_ClassicAlgPolicy>(std::move(__first), std::move(__last), __comp);
 }
 
 template <class _RandomAccessIterator>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) {
   std::make_heap(std::move(__first), std::move(__last),
       __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_MAKE_HEAP_H
+#endif // _LIBCUDACXX___ALGORITHM_MAKE_HEAP_H

diff  --git a/libcxx/include/__algorithm/make_projected.h b/libcxx/include/__algorithm/make_projected.h
index 6c1d15677667..81e6b52b9650 100644
--- a/libcxx/include/__algorithm/make_projected.h
+++ b/libcxx/include/__algorithm/make_projected.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_MAKE_PROJECTED_H
-#define _LIBCPP___ALGORITHM_MAKE_PROJECTED_H
+#ifndef _LIBCUDACXX___ALGORITHM_MAKE_PROJECTED_H
+#define _LIBCUDACXX___ALGORITHM_MAKE_PROJECTED_H
 
 #include <__concepts/same_as.h>
 #include <__config>
@@ -21,24 +21,24 @@
 #include <__utility/declval.h>
 #include <__utility/forward.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Pred, class _Proj>
 struct _ProjectedPred {
   _Pred& __pred; // Can be a unary or a binary predicate.
   _Proj& __proj;
 
-  _LIBCPP_CONSTEXPR _ProjectedPred(_Pred& __pred_arg, _Proj& __proj_arg) : __pred(__pred_arg), __proj(__proj_arg) {}
+  _LIBCUDACXX_CONSTEXPR _ProjectedPred(_Pred& __pred_arg, _Proj& __proj_arg) : __pred(__pred_arg), __proj(__proj_arg) {}
 
   template <class _Tp>
   typename __invoke_of<_Pred&,
                        decltype(std::__invoke(std::declval<_Proj&>(), std::declval<_Tp>()))
   >::type
-  _LIBCPP_CONSTEXPR operator()(_Tp&& __v) const {
+  _LIBCUDACXX_CONSTEXPR operator()(_Tp&& __v) const {
     return std::__invoke(__pred, std::__invoke(__proj, std::forward<_Tp>(__v)));
   }
 
@@ -47,7 +47,7 @@ struct _ProjectedPred {
                        decltype(std::__invoke(std::declval<_Proj&>(), std::declval<_T1>())),
                        decltype(std::__invoke(std::declval<_Proj&>(), std::declval<_T2>()))
   >::type
-  _LIBCPP_CONSTEXPR operator()(_T1&& __lhs, _T2&& __rhs) const {
+  _LIBCUDACXX_CONSTEXPR operator()(_T1&& __lhs, _T2&& __rhs) const {
     return std::__invoke(__pred,
                       std::__invoke(__proj, std::forward<_T1>(__lhs)),
                       std::__invoke(__proj, std::forward<_T2>(__rhs)));
@@ -61,7 +61,7 @@ struct __can_use_pristine_comp : false_type {};
 template <class _Pred, class _Proj>
 struct __can_use_pristine_comp<_Pred, _Proj, __enable_if_t<
     !is_member_pointer<typename decay<_Pred>::type>::value && (
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
       is_same<typename decay<_Proj>::type, identity>::value ||
 #endif
       is_same<typename decay<_Proj>::type, __identity>::value
@@ -69,7 +69,7 @@ struct __can_use_pristine_comp<_Pred, _Proj, __enable_if_t<
 > > : true_type {};
 
 template <class _Pred, class _Proj>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR static
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR static
 __enable_if_t<
     !__can_use_pristine_comp<_Pred, _Proj>::value,
     _ProjectedPred<_Pred, _Proj>
@@ -82,7 +82,7 @@ __make_projected(_Pred& __pred, _Proj& __proj) {
 // optimizations that rely on the type of the comparator. Additionally, this results in less layers of indirection in
 // the call stack when the comparator is invoked, even in an unoptimized build.
 template <class _Pred, class _Proj>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR static
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR static
 __enable_if_t<
     __can_use_pristine_comp<_Pred, _Proj>::value,
     _Pred&
@@ -91,16 +91,16 @@ __make_projected(_Pred& __pred, _Proj&) {
   return __pred;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 
 template <class _Comp, class _Proj1, class _Proj2>
-_LIBCPP_HIDE_FROM_ABI constexpr static
+_LIBCUDACXX_HIDE_FROM_ABI constexpr static
 decltype(auto) __make_projected_comp(_Comp& __comp, _Proj1& __proj1, _Proj2& __proj2) {
   if constexpr (same_as<decay_t<_Proj1>, identity> && same_as<decay_t<_Proj2>, identity> &&
                 !is_member_pointer_v<decay_t<_Comp>>) {
@@ -119,8 +119,8 @@ decltype(auto) __make_projected_comp(_Comp& __comp, _Proj1& __proj1, _Proj2& __p
 
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_MAKE_PROJECTED_H
+#endif // _LIBCUDACXX___ALGORITHM_MAKE_PROJECTED_H

diff  --git a/libcxx/include/__algorithm/max.h b/libcxx/include/__algorithm/max.h
index 345b235a2193..7170c49bbad4 100644
--- a/libcxx/include/__algorithm/max.h
+++ b/libcxx/include/__algorithm/max.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_MAX_H
-#define _LIBCPP___ALGORITHM_MAX_H
+#ifndef _LIBCUDACXX___ALGORITHM_MAX_H
+#define _LIBCUDACXX___ALGORITHM_MAX_H
 
 #include <__algorithm/comp.h>
 #include <__algorithm/comp_ref_type.h>
@@ -15,18 +15,18 @@
 #include <__config>
 #include <initializer_list>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Tp, class _Compare>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+_LIBCUDACXX_NODISCARD_EXT inline
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 const _Tp&
 max(const _Tp& __a, const _Tp& __b, _Compare __comp)
 {
@@ -34,39 +34,39 @@ max(const _Tp& __a, const _Tp& __b, _Compare __comp)
 }
 
 template <class _Tp>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+_LIBCUDACXX_NODISCARD_EXT inline
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 const _Tp&
 max(const _Tp& __a, const _Tp& __b)
 {
-    return _VSTD::max(__a, __b, __less<_Tp>());
+    return _CUDA_VSTD::max(__a, __b, __less<_Tp>());
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
 template<class _Tp, class _Compare>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+_LIBCUDACXX_NODISCARD_EXT inline
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 _Tp
 max(initializer_list<_Tp> __t, _Compare __comp)
 {
     typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
-    return *_VSTD::__max_element<_Comp_ref>(__t.begin(), __t.end(), __comp);
+    return *_CUDA_VSTD::__max_element<_Comp_ref>(__t.begin(), __t.end(), __comp);
 }
 
 template<class _Tp>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+_LIBCUDACXX_NODISCARD_EXT inline
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 _Tp
 max(initializer_list<_Tp> __t)
 {
-    return *_VSTD::max_element(__t.begin(), __t.end(), __less<_Tp>());
+    return *_CUDA_VSTD::max_element(__t.begin(), __t.end(), __less<_Tp>());
 }
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___ALGORITHM_MAX_H
+#endif // _LIBCUDACXX___ALGORITHM_MAX_H

diff  --git a/libcxx/include/__algorithm/max_element.h b/libcxx/include/__algorithm/max_element.h
index 795ec8e1ddc1..ef0edbcb5d29 100644
--- a/libcxx/include/__algorithm/max_element.h
+++ b/libcxx/include/__algorithm/max_element.h
@@ -6,22 +6,22 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_MAX_ELEMENT_H
-#define _LIBCPP___ALGORITHM_MAX_ELEMENT_H
+#ifndef _LIBCUDACXX___ALGORITHM_MAX_ELEMENT_H
+#define _LIBCUDACXX___ALGORITHM_MAX_ELEMENT_H
 
 #include <__algorithm/comp.h>
 #include <__algorithm/comp_ref_type.h>
 #include <__config>
 #include <__iterator/iterator_traits.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Compare, class _ForwardIterator>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 _ForwardIterator
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _ForwardIterator
 __max_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp)
 {
     static_assert(__is_cpp17_forward_iterator<_ForwardIterator>::value,
@@ -37,22 +37,22 @@ __max_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp
 }
 
 template <class _ForwardIterator, class _Compare>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 _ForwardIterator
+_LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _ForwardIterator
 max_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp)
 {
     typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
-    return _VSTD::__max_element<_Comp_ref>(__first, __last, __comp);
+    return _CUDA_VSTD::__max_element<_Comp_ref>(__first, __last, __comp);
 }
 
 
 template <class _ForwardIterator>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 _ForwardIterator
+_LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _ForwardIterator
 max_element(_ForwardIterator __first, _ForwardIterator __last)
 {
-    return _VSTD::max_element(__first, __last,
+    return _CUDA_VSTD::max_element(__first, __last,
               __less<typename iterator_traits<_ForwardIterator>::value_type>());
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_MAX_ELEMENT_H
+#endif // _LIBCUDACXX___ALGORITHM_MAX_ELEMENT_H

diff  --git a/libcxx/include/__algorithm/merge.h b/libcxx/include/__algorithm/merge.h
index 48360ed5b445..3655cb84d913 100644
--- a/libcxx/include/__algorithm/merge.h
+++ b/libcxx/include/__algorithm/merge.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_MERGE_H
-#define _LIBCPP___ALGORITHM_MERGE_H
+#ifndef _LIBCUDACXX___ALGORITHM_MERGE_H
+#define _LIBCUDACXX___ALGORITHM_MERGE_H
 
 #include <__algorithm/comp.h>
 #include <__algorithm/comp_ref_type.h>
@@ -15,14 +15,14 @@
 #include <__config>
 #include <__iterator/iterator_traits.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Compare, class _InputIterator1, class _InputIterator2, class _OutputIterator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 _OutputIterator
 __merge(_InputIterator1 __first1, _InputIterator1 __last1,
         _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)
@@ -30,7 +30,7 @@ __merge(_InputIterator1 __first1, _InputIterator1 __last1,
     for (; __first1 != __last1; ++__result)
     {
         if (__first2 == __last2)
-            return _VSTD::copy(__first1, __last1, __result);
+            return _CUDA_VSTD::copy(__first1, __last1, __result);
         if (__comp(*__first2, *__first1))
         {
             *__result = *__first2;
@@ -42,30 +42,30 @@ __merge(_InputIterator1 __first1, _InputIterator1 __last1,
             ++__first1;
         }
     }
-    return _VSTD::copy(__first2, __last2, __result);
+    return _CUDA_VSTD::copy(__first2, __last2, __result);
 }
 
 template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _Compare>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 _OutputIterator
 merge(_InputIterator1 __first1, _InputIterator1 __last1,
       _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)
 {
     typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
-    return _VSTD::__merge<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __comp);
+    return _CUDA_VSTD::__merge<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __comp);
 }
 
 template <class _InputIterator1, class _InputIterator2, class _OutputIterator>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 _OutputIterator
 merge(_InputIterator1 __first1, _InputIterator1 __last1,
       _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result)
 {
     typedef typename iterator_traits<_InputIterator1>::value_type __v1;
     typedef typename iterator_traits<_InputIterator2>::value_type __v2;
-    return _VSTD::merge(__first1, __last1, __first2, __last2, __result, __less<__v1, __v2>());
+    return _CUDA_VSTD::merge(__first1, __last1, __first2, __last2, __result, __less<__v1, __v2>());
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_MERGE_H
+#endif // _LIBCUDACXX___ALGORITHM_MERGE_H

diff  --git a/libcxx/include/__algorithm/min.h b/libcxx/include/__algorithm/min.h
index 3d8c73d78f11..9b4bc80430ee 100644
--- a/libcxx/include/__algorithm/min.h
+++ b/libcxx/include/__algorithm/min.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_MIN_H
-#define _LIBCPP___ALGORITHM_MIN_H
+#ifndef _LIBCUDACXX___ALGORITHM_MIN_H
+#define _LIBCUDACXX___ALGORITHM_MIN_H
 
 #include <__algorithm/comp.h>
 #include <__algorithm/comp_ref_type.h>
@@ -15,18 +15,18 @@
 #include <__config>
 #include <initializer_list>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Tp, class _Compare>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+_LIBCUDACXX_NODISCARD_EXT inline
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 const _Tp&
 min(const _Tp& __a, const _Tp& __b, _Compare __comp)
 {
@@ -34,39 +34,39 @@ min(const _Tp& __a, const _Tp& __b, _Compare __comp)
 }
 
 template <class _Tp>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+_LIBCUDACXX_NODISCARD_EXT inline
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 const _Tp&
 min(const _Tp& __a, const _Tp& __b)
 {
-    return _VSTD::min(__a, __b, __less<_Tp>());
+    return _CUDA_VSTD::min(__a, __b, __less<_Tp>());
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
 template<class _Tp, class _Compare>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+_LIBCUDACXX_NODISCARD_EXT inline
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 _Tp
 min(initializer_list<_Tp> __t, _Compare __comp)
 {
     typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
-    return *_VSTD::__min_element<_Comp_ref>(__t.begin(), __t.end(), __comp);
+    return *_CUDA_VSTD::__min_element<_Comp_ref>(__t.begin(), __t.end(), __comp);
 }
 
 template<class _Tp>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+_LIBCUDACXX_NODISCARD_EXT inline
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 _Tp
 min(initializer_list<_Tp> __t)
 {
-    return *_VSTD::min_element(__t.begin(), __t.end(), __less<_Tp>());
+    return *_CUDA_VSTD::min_element(__t.begin(), __t.end(), __less<_Tp>());
 }
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___ALGORITHM_MIN_H
+#endif // _LIBCUDACXX___ALGORITHM_MIN_H

diff  --git a/libcxx/include/__algorithm/min_element.h b/libcxx/include/__algorithm/min_element.h
index 17b242c341e6..552a4565bdfc 100644
--- a/libcxx/include/__algorithm/min_element.h
+++ b/libcxx/include/__algorithm/min_element.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_MIN_ELEMENT_H
-#define _LIBCPP___ALGORITHM_MIN_ELEMENT_H
+#ifndef _LIBCUDACXX___ALGORITHM_MIN_ELEMENT_H
+#define _LIBCUDACXX___ALGORITHM_MIN_ELEMENT_H
 
 #include <__algorithm/comp.h>
 #include <__algorithm/comp_ref_type.h>
@@ -18,14 +18,14 @@
 #include <__type_traits/is_callable.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Comp, class _Iter, class _Sent, class _Proj>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 _Iter __min_element(_Iter __first, _Sent __last, _Comp __comp, _Proj& __proj) {
   if (__first == __last)
     return __first;
@@ -39,14 +39,14 @@ _Iter __min_element(_Iter __first, _Sent __last, _Comp __comp, _Proj& __proj) {
 }
 
 template <class _Comp, class _Iter, class _Sent>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 _Iter __min_element(_Iter __first, _Sent __last, _Comp __comp) {
   auto __proj = __identity();
   return std::__min_element<_Comp>(std::move(__first), std::move(__last), __comp, __proj);
 }
 
 template <class _ForwardIterator, class _Compare>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 _ForwardIterator
+_LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _ForwardIterator
 min_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp)
 {
   static_assert(__is_cpp17_forward_iterator<_ForwardIterator>::value,
@@ -59,13 +59,13 @@ min_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp)
 }
 
 template <class _ForwardIterator>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 _ForwardIterator
+_LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _ForwardIterator
 min_element(_ForwardIterator __first, _ForwardIterator __last)
 {
-    return _VSTD::min_element(__first, __last,
+    return _CUDA_VSTD::min_element(__first, __last,
               __less<typename iterator_traits<_ForwardIterator>::value_type>());
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_MIN_ELEMENT_H
+#endif // _LIBCUDACXX___ALGORITHM_MIN_ELEMENT_H

diff  --git a/libcxx/include/__algorithm/min_max_result.h b/libcxx/include/__algorithm/min_max_result.h
index ca77dcc5725a..9dea9e170fa6 100644
--- a/libcxx/include/__algorithm/min_max_result.h
+++ b/libcxx/include/__algorithm/min_max_result.h
@@ -7,50 +7,50 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_MIN_MAX_RESULT_H
-#define _LIBCPP___ALGORITHM_MIN_MAX_RESULT_H
+#ifndef _LIBCUDACXX___ALGORITHM_MIN_MAX_RESULT_H
+#define _LIBCUDACXX___ALGORITHM_MIN_MAX_RESULT_H
 
 #include <__concepts/convertible_to.h>
 #include <__config>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
 namespace ranges {
 
 template <class _T1>
 struct min_max_result {
-  _LIBCPP_NO_UNIQUE_ADDRESS _T1 min;
-  _LIBCPP_NO_UNIQUE_ADDRESS _T1 max;
+  _LIBCUDACXX_NO_UNIQUE_ADDRESS _T1 min;
+  _LIBCUDACXX_NO_UNIQUE_ADDRESS _T1 max;
 
   template <class _T2>
     requires convertible_to<const _T1&, _T2>
-  _LIBCPP_HIDE_FROM_ABI constexpr operator min_max_result<_T2>() const & {
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr operator min_max_result<_T2>() const & {
     return {min, max};
   }
 
   template <class _T2>
     requires convertible_to<_T1, _T2>
-  _LIBCPP_HIDE_FROM_ABI constexpr operator min_max_result<_T2>() && {
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr operator min_max_result<_T2>() && {
     return {std::move(min), std::move(max)};
   }
 };
 
 } // namespace ranges
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___ALGORITHM_MIN_MAX_RESULT_H
+#endif // _LIBCUDACXX___ALGORITHM_MIN_MAX_RESULT_H

diff  --git a/libcxx/include/__algorithm/minmax.h b/libcxx/include/__algorithm/minmax.h
index 7e10b8b8350c..4ae73547c64d 100644
--- a/libcxx/include/__algorithm/minmax.h
+++ b/libcxx/include/__algorithm/minmax.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_MINMAX_H
-#define _LIBCPP___ALGORITHM_MINMAX_H
+#ifndef _LIBCUDACXX___ALGORITHM_MINMAX_H
+#define _LIBCUDACXX___ALGORITHM_MINMAX_H
 
 #include <__algorithm/comp.h>
 #include <__algorithm/minmax_element.h>
@@ -17,15 +17,15 @@
 #include <__utility/pair.h>
 #include <initializer_list>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template<class _Tp, class _Compare>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+_LIBCUDACXX_NODISCARD_EXT inline
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 pair<const _Tp&, const _Tp&>
 minmax(const _Tp& __a, const _Tp& __b, _Compare __comp)
 {
@@ -34,18 +34,18 @@ minmax(const _Tp& __a, const _Tp& __b, _Compare __comp)
 }
 
 template<class _Tp>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+_LIBCUDACXX_NODISCARD_EXT inline
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 pair<const _Tp&, const _Tp&>
 minmax(const _Tp& __a, const _Tp& __b)
 {
     return std::minmax(__a, __b, __less<_Tp>());
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
 template<class _Tp, class _Compare>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
+_LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 pair<_Tp, _Tp> minmax(initializer_list<_Tp> __t, _Compare __comp) {
     static_assert(__is_callable<_Compare, _Tp, _Tp>::value, "The comparator has to be callable");
     __identity __proj;
@@ -54,16 +54,16 @@ pair<_Tp, _Tp> minmax(initializer_list<_Tp> __t, _Compare __comp) {
 }
 
 template<class _Tp>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+_LIBCUDACXX_NODISCARD_EXT inline
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 pair<_Tp, _Tp>
 minmax(initializer_list<_Tp> __t)
 {
     return std::minmax(__t, __less<_Tp>());
 }
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_MINMAX_H
+#endif // _LIBCUDACXX___ALGORITHM_MINMAX_H

diff  --git a/libcxx/include/__algorithm/minmax_element.h b/libcxx/include/__algorithm/minmax_element.h
index cf67184e0b4c..0c14399dbf95 100644
--- a/libcxx/include/__algorithm/minmax_element.h
+++ b/libcxx/include/__algorithm/minmax_element.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_MINMAX_ELEMENT_H
-#define _LIBCPP___ALGORITHM_MINMAX_ELEMENT_H
+#ifndef _LIBCUDACXX___ALGORITHM_MINMAX_ELEMENT_H
+#define _LIBCUDACXX___ALGORITHM_MINMAX_ELEMENT_H
 
 #include <__algorithm/comp.h>
 #include <__config>
@@ -16,11 +16,11 @@
 #include <__utility/pair.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Comp, class _Proj>
 class _MinmaxElementLessFunc {
@@ -28,18 +28,18 @@ class _MinmaxElementLessFunc {
   _Proj& __proj_;
 
 public:
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR
   _MinmaxElementLessFunc(_Comp& __comp, _Proj& __proj) : __comp_(__comp), __proj_(__proj) {}
 
   template <class _Iter>
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
   bool operator()(_Iter& __it1, _Iter& __it2) {
     return std::__invoke(__comp_, std::__invoke(__proj_, *__it1), std::__invoke(__proj_, *__it2));
   }
 };
 
 template <class _Iter, class _Sent, class _Proj, class _Comp>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 pair<_Iter, _Iter> __minmax_element_impl(_Iter __first, _Sent __last, _Comp& __comp, _Proj& __proj) {
   auto __less = _MinmaxElementLessFunc<_Comp, _Proj>(__comp, __proj);
 
@@ -79,7 +79,7 @@ pair<_Iter, _Iter> __minmax_element_impl(_Iter __first, _Sent __last, _Comp& __c
 }
 
 template <class _ForwardIterator, class _Compare>
-_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX11
+_LIBCUDACXX_NODISCARD_EXT _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 pair<_ForwardIterator, _ForwardIterator>
 minmax_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) {
   static_assert(__is_cpp17_forward_iterator<_ForwardIterator>::value,
@@ -91,11 +91,11 @@ minmax_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __com
 }
 
 template <class _ForwardIterator>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
+_LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 pair<_ForwardIterator, _ForwardIterator> minmax_element(_ForwardIterator __first, _ForwardIterator __last) {
     return std::minmax_element(__first, __last, __less<typename iterator_traits<_ForwardIterator>::value_type>());
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_MINMAX_ELEMENT_H
+#endif // _LIBCUDACXX___ALGORITHM_MINMAX_ELEMENT_H

diff  --git a/libcxx/include/__algorithm/mismatch.h b/libcxx/include/__algorithm/mismatch.h
index f2011faf2f9a..309762d69306 100644
--- a/libcxx/include/__algorithm/mismatch.h
+++ b/libcxx/include/__algorithm/mismatch.h
@@ -7,23 +7,23 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_MISMATCH_H
-#define _LIBCPP___ALGORITHM_MISMATCH_H
+#ifndef _LIBCUDACXX___ALGORITHM_MISMATCH_H
+#define _LIBCUDACXX___ALGORITHM_MISMATCH_H
 
 #include <__algorithm/comp.h>
 #include <__config>
 #include <__iterator/iterator_traits.h>
 #include <__utility/pair.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 pair<_InputIterator1, _InputIterator2>
+_LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 pair<_InputIterator1, _InputIterator2>
     mismatch(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _BinaryPredicate __pred) {
   for (; __first1 != __last1; ++__first1, (void)++__first2)
     if (!__pred(*__first1, *__first2))
@@ -32,18 +32,18 @@ _LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY
 }
 
 template <class _InputIterator1, class _InputIterator2>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 pair<_InputIterator1, _InputIterator2>
+_LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 pair<_InputIterator1, _InputIterator2>
     mismatch(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2) {
   typedef typename iterator_traits<_InputIterator1>::value_type __v1;
   typedef typename iterator_traits<_InputIterator2>::value_type __v2;
-  return _VSTD::mismatch(__first1, __last1, __first2, __equal_to<__v1, __v2>());
+  return _CUDA_VSTD::mismatch(__first1, __last1, __first2, __equal_to<__v1, __v2>());
 }
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 pair<_InputIterator1, _InputIterator2>
+_LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 pair<_InputIterator1, _InputIterator2>
     mismatch(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2,
              _BinaryPredicate __pred) {
   for (; __first1 != __last1 && __first2 != __last2; ++__first1, (void)++__first2)
@@ -53,15 +53,15 @@ _LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY
 }
 
 template <class _InputIterator1, class _InputIterator2>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 pair<_InputIterator1, _InputIterator2>
+_LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 pair<_InputIterator1, _InputIterator2>
     mismatch(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2) {
   typedef typename iterator_traits<_InputIterator1>::value_type __v1;
   typedef typename iterator_traits<_InputIterator2>::value_type __v2;
-  return _VSTD::mismatch(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>());
+  return _CUDA_VSTD::mismatch(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>());
 }
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_MISMATCH_H
+#endif // _LIBCUDACXX___ALGORITHM_MISMATCH_H

diff  --git a/libcxx/include/__algorithm/move.h b/libcxx/include/__algorithm/move.h
index c090faf6b6dc..c9d456251fc8 100644
--- a/libcxx/include/__algorithm/move.h
+++ b/libcxx/include/__algorithm/move.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_MOVE_H
-#define _LIBCPP___ALGORITHM_MOVE_H
+#ifndef _LIBCUDACXX___ALGORITHM_MOVE_H
+#define _LIBCUDACXX___ALGORITHM_MOVE_H
 
 #include <__algorithm/iterator_operations.h>
 #include <__algorithm/unwrap_iter.h>
@@ -19,16 +19,16 @@
 #include <cstring>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 // move
 
 template <class _AlgPolicy, class _InIter, class _Sent, class _OutIter>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 pair<_InIter, _OutIter> __move_impl(_InIter __first, _Sent __last, _OutIter __result) {
   while (__first != __last) {
     *__result = _IterOps<_AlgPolicy>::__iter_move(__first);
@@ -43,11 +43,11 @@ template <class _AlgPolicy,
           class _OutType,
           class = __enable_if_t<is_same<typename remove_const<_InType>::type, _OutType>::value
                              && is_trivially_move_assignable<_OutType>::value> >
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 pair<_InType*, _OutType*> __move_impl(_InType* __first, _InType* __last, _OutType* __result) {
-  if (__libcpp_is_constant_evaluated()
+  if (__LIBCUDACXX_is_constant_evaluated()
 // TODO: Remove this once GCC supports __builtin_memmove during constant evaluation
-#ifndef _LIBCPP_COMPILER_GCC
+#ifndef _LIBCUDACXX_COMPILER_GCC
    && !is_trivially_copyable<_InType>::value
 #endif
      )
@@ -75,7 +75,7 @@ template <class _AlgPolicy,
                      && __is_cpp17_contiguous_iterator<_InIter>::value
                      && __is_cpp17_contiguous_iterator<_OutIter>::value
                      && is_trivially_move_assignable<__iter_value_type<_OutIter> >::value, int> = 0>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 pair<reverse_iterator<_InIter>, reverse_iterator<_OutIter> >
 __move_impl(reverse_iterator<_InIter> __first,
             reverse_iterator<_InIter> __last,
@@ -89,7 +89,7 @@ __move_impl(reverse_iterator<_InIter> __first,
 }
 
 template <class _AlgPolicy, class _InIter, class _Sent, class _OutIter>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 __enable_if_t<is_copy_constructible<_InIter>::value
            && is_copy_constructible<_Sent>::value
            && is_copy_constructible<_OutIter>::value, pair<_InIter, _OutIter> >
@@ -100,7 +100,7 @@ __move(_InIter __first, _Sent __last, _OutIter __result) {
 }
 
 template <class _AlgPolicy, class _InIter, class _Sent, class _OutIter>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 __enable_if_t<!is_copy_constructible<_InIter>::value
            || !is_copy_constructible<_Sent>::value
            || !is_copy_constructible<_OutIter>::value, pair<_InIter, _OutIter> >
@@ -109,11 +109,11 @@ __move(_InIter __first, _Sent __last, _OutIter __result) {
 }
 
 template <class _InputIterator, class _OutputIterator>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 _OutputIterator move(_InputIterator __first, _InputIterator __last, _OutputIterator __result) {
   return std::__move<_ClassicAlgPolicy>(__first, __last, __result).second;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_MOVE_H
+#endif // _LIBCUDACXX___ALGORITHM_MOVE_H

diff  --git a/libcxx/include/__algorithm/move_backward.h b/libcxx/include/__algorithm/move_backward.h
index 626e250b6d41..9c8bedb69e91 100644
--- a/libcxx/include/__algorithm/move_backward.h
+++ b/libcxx/include/__algorithm/move_backward.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_MOVE_BACKWARD_H
-#define _LIBCPP___ALGORITHM_MOVE_BACKWARD_H
+#ifndef _LIBCUDACXX___ALGORITHM_MOVE_BACKWARD_H
+#define _LIBCUDACXX___ALGORITHM_MOVE_BACKWARD_H
 
 #include <__algorithm/iterator_operations.h>
 #include <__algorithm/unwrap_iter.h>
@@ -16,14 +16,14 @@
 #include <cstring>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _AlgPolicy, class _InputIterator, class _OutputIterator>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 _OutputIterator
 __move_backward_constexpr(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
 {
@@ -33,15 +33,15 @@ __move_backward_constexpr(_InputIterator __first, _InputIterator __last, _Output
 }
 
 template <class _AlgPolicy, class _InputIterator, class _OutputIterator>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 _OutputIterator
 __move_backward_impl(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
 {
-    return _VSTD::__move_backward_constexpr<_AlgPolicy>(__first, __last, __result);
+    return _CUDA_VSTD::__move_backward_constexpr<_AlgPolicy>(__first, __last, __result);
 }
 
 template <class _AlgPolicy, class _Tp, class _Up>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 typename enable_if
 <
     is_same<typename remove_const<_Tp>::type, _Up>::value &&
@@ -54,29 +54,29 @@ __move_backward_impl(_Tp* __first, _Tp* __last, _Up* __result)
     if (__n > 0)
     {
         __result -= __n;
-        _VSTD::memmove(__result, __first, __n * sizeof(_Up));
+        _CUDA_VSTD::memmove(__result, __first, __n * sizeof(_Up));
     }
     return __result;
 }
 
 template <class _AlgPolicy, class _BidirectionalIterator1, class _BidirectionalIterator2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 _BidirectionalIterator2
 __move_backward(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last,
                 _BidirectionalIterator2 __result)
 {
-    if (__libcpp_is_constant_evaluated()) {
-        return _VSTD::__move_backward_constexpr<_AlgPolicy>(__first, __last, __result);
+    if (__LIBCUDACXX_is_constant_evaluated()) {
+        return _CUDA_VSTD::__move_backward_constexpr<_AlgPolicy>(__first, __last, __result);
     } else {
-        return _VSTD::__rewrap_iter(__result,
-            _VSTD::__move_backward_impl<_AlgPolicy>(_VSTD::__unwrap_iter(__first),
-                                                    _VSTD::__unwrap_iter(__last),
-                                                    _VSTD::__unwrap_iter(__result)));
+        return _CUDA_VSTD::__rewrap_iter(__result,
+            _CUDA_VSTD::__move_backward_impl<_AlgPolicy>(_CUDA_VSTD::__unwrap_iter(__first),
+                                                    _CUDA_VSTD::__unwrap_iter(__last),
+                                                    _CUDA_VSTD::__unwrap_iter(__result)));
     }
 }
 
 template <class _BidirectionalIterator1, class _BidirectionalIterator2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 _BidirectionalIterator2
 move_backward(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last,
               _BidirectionalIterator2 __result)
@@ -84,6 +84,6 @@ move_backward(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last,
   return std::__move_backward<_ClassicAlgPolicy>(std::move(__first), std::move(__last), std::move(__result));
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_MOVE_BACKWARD_H
+#endif // _LIBCUDACXX___ALGORITHM_MOVE_BACKWARD_H

diff  --git a/libcxx/include/__algorithm/next_permutation.h b/libcxx/include/__algorithm/next_permutation.h
index b58dcf4e1a91..26c4456a86bb 100644
--- a/libcxx/include/__algorithm/next_permutation.h
+++ b/libcxx/include/__algorithm/next_permutation.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_NEXT_PERMUTATION_H
-#define _LIBCPP___ALGORITHM_NEXT_PERMUTATION_H
+#ifndef _LIBCUDACXX___ALGORITHM_NEXT_PERMUTATION_H
+#define _LIBCUDACXX___ALGORITHM_NEXT_PERMUTATION_H
 
 #include <__algorithm/comp.h>
 #include <__algorithm/comp_ref_type.h>
@@ -18,14 +18,14 @@
 #include <__utility/move.h>
 #include <__utility/pair.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _AlgPolicy, class _Compare, class _BidirectionalIterator, class _Sentinel>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 pair<_BidirectionalIterator, bool>
 __next_permutation(_BidirectionalIterator __first, _Sentinel __last, _Compare&& __comp)
 {
@@ -57,7 +57,7 @@ __next_permutation(_BidirectionalIterator __first, _Sentinel __last, _Compare&&
 }
 
 template <class _BidirectionalIterator, class _Compare>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 bool
 next_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp)
 {
@@ -67,14 +67,14 @@ next_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last,
 }
 
 template <class _BidirectionalIterator>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 bool
 next_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last)
 {
-    return _VSTD::next_permutation(__first, __last,
+    return _CUDA_VSTD::next_permutation(__first, __last,
                                   __less<typename iterator_traits<_BidirectionalIterator>::value_type>());
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_NEXT_PERMUTATION_H
+#endif // _LIBCUDACXX___ALGORITHM_NEXT_PERMUTATION_H

diff  --git a/libcxx/include/__algorithm/none_of.h b/libcxx/include/__algorithm/none_of.h
index b34b1e00ddb8..71927a8f7abe 100644
--- a/libcxx/include/__algorithm/none_of.h
+++ b/libcxx/include/__algorithm/none_of.h
@@ -7,19 +7,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_NONE_OF_H
-#define _LIBCPP___ALGORITHM_NONE_OF_H
+#ifndef _LIBCUDACXX___ALGORITHM_NONE_OF_H
+#define _LIBCUDACXX___ALGORITHM_NONE_OF_H
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _InputIterator, class _Predicate>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool
+_LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 bool
 none_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) {
   for (; __first != __last; ++__first)
     if (__pred(*__first))
@@ -27,6 +27,6 @@ none_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) {
   return true;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_NONE_OF_H
+#endif // _LIBCUDACXX___ALGORITHM_NONE_OF_H

diff  --git a/libcxx/include/__algorithm/nth_element.h b/libcxx/include/__algorithm/nth_element.h
index 688398dee814..53f742f12b62 100644
--- a/libcxx/include/__algorithm/nth_element.h
+++ b/libcxx/include/__algorithm/nth_element.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_NTH_ELEMENT_H
-#define _LIBCPP___ALGORITHM_NTH_ELEMENT_H
+#ifndef _LIBCUDACXX___ALGORITHM_NTH_ELEMENT_H
+#define _LIBCUDACXX___ALGORITHM_NTH_ELEMENT_H
 
 #include <__algorithm/comp.h>
 #include <__algorithm/comp_ref_type.h>
@@ -19,14 +19,14 @@
 #include <__iterator/iterator_traits.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template<class _Compare, class _RandomAccessIterator>
-_LIBCPP_CONSTEXPR_AFTER_CXX11 bool
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX11 bool
 __nth_element_find_guard(_RandomAccessIterator& __i, _RandomAccessIterator& __j,
                          _RandomAccessIterator __m, _Compare __comp)
 {
@@ -42,7 +42,7 @@ __nth_element_find_guard(_RandomAccessIterator& __i, _RandomAccessIterator& __j,
 }
 
 template <class _AlgPolicy, class _Compare, class _RandomAccessIterator>
-_LIBCPP_CONSTEXPR_AFTER_CXX11 void
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX11 void
 __nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth, _RandomAccessIterator __last, _Compare __comp)
 {
     using _Ops = _IterOps<_AlgPolicy>;
@@ -91,7 +91,7 @@ __nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth, _Rando
         if (!__comp(*__i, *__m))  // if *__first == *__m
         {
             // *__first == *__m, *__first doesn't go in first part
-            if (_VSTD::__nth_element_find_guard<_Compare>(__i, __j, __m, __comp)) {
+            if (_CUDA_VSTD::__nth_element_find_guard<_Compare>(__i, __j, __m, __comp)) {
                 _Ops::iter_swap(__i, __j);
                 ++__n_swaps;
             } else {
@@ -133,7 +133,7 @@ __nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth, _Rando
                     return;
                 }
                 // __nth_element the second part
-                // _VSTD::__nth_element<_Compare>(__i, __nth, __last, __comp);
+                // _CUDA_VSTD::__nth_element<_Compare>(__i, __nth, __last, __comp);
                 __first = __i;
                 continue;
             }
@@ -211,19 +211,19 @@ __nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth, _Rando
         // __nth_element on range containing __nth
         if (__nth < __i)
         {
-            // _VSTD::__nth_element<_Compare>(__first, __nth, __i, __comp);
+            // _CUDA_VSTD::__nth_element<_Compare>(__first, __nth, __i, __comp);
             __last = __i;
         }
         else
         {
-            // _VSTD::__nth_element<_Compare>(__i+1, __nth, __last, __comp);
+            // _CUDA_VSTD::__nth_element<_Compare>(__i+1, __nth, __last, __comp);
             __first = ++__i;
         }
     }
 }
 
 template <class _AlgPolicy, class _RandomAccessIterator, class _Compare>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void __nth_element_impl(_RandomAccessIterator __first, _RandomAccessIterator __nth, _RandomAccessIterator __last,
                         _Compare& __comp) {
   if (__nth == __last)
@@ -241,19 +241,19 @@ void __nth_element_impl(_RandomAccessIterator __first, _RandomAccessIterator __n
 }
 
 template <class _RandomAccessIterator, class _Compare>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth, _RandomAccessIterator __last,
                  _Compare __comp) {
   std::__nth_element_impl<_ClassicAlgPolicy>(std::move(__first), std::move(__nth), std::move(__last), __comp);
 }
 
 template <class _RandomAccessIterator>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth, _RandomAccessIterator __last) {
   std::nth_element(std::move(__first), std::move(__nth), std::move(__last), __less<typename
       iterator_traits<_RandomAccessIterator>::value_type>());
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_NTH_ELEMENT_H
+#endif // _LIBCUDACXX___ALGORITHM_NTH_ELEMENT_H

diff  --git a/libcxx/include/__algorithm/partial_sort.h b/libcxx/include/__algorithm/partial_sort.h
index dff0cd01f35a..8609246c45aa 100644
--- a/libcxx/include/__algorithm/partial_sort.h
+++ b/libcxx/include/__algorithm/partial_sort.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_PARTIAL_SORT_H
-#define _LIBCPP___ALGORITHM_PARTIAL_SORT_H
+#ifndef _LIBCUDACXX___ALGORITHM_PARTIAL_SORT_H
+#define _LIBCUDACXX___ALGORITHM_PARTIAL_SORT_H
 
 #include <__algorithm/comp.h>
 #include <__algorithm/comp_ref_type.h>
@@ -22,14 +22,14 @@
 #include <__utility/move.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _AlgPolicy, class _Compare, class _RandomAccessIterator, class _Sentinel>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 _RandomAccessIterator __partial_sort_impl(
     _RandomAccessIterator __first, _RandomAccessIterator __middle, _Sentinel __last, _Compare&& __comp) {
   if (__first == __middle) {
@@ -55,7 +55,7 @@ _RandomAccessIterator __partial_sort_impl(
 }
 
 template <class _AlgPolicy, class _Compare, class _RandomAccessIterator, class _Sentinel>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 _RandomAccessIterator __partial_sort(_RandomAccessIterator __first, _RandomAccessIterator __middle, _Sentinel __last,
                                      _Compare& __comp) {
   if (__first == __middle)
@@ -72,7 +72,7 @@ _RandomAccessIterator __partial_sort(_RandomAccessIterator __first, _RandomAcces
 }
 
 template <class _RandomAccessIterator, class _Compare>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void
 partial_sort(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last,
              _Compare __comp)
@@ -84,14 +84,14 @@ partial_sort(_RandomAccessIterator __first, _RandomAccessIterator __middle, _Ran
 }
 
 template <class _RandomAccessIterator>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void
 partial_sort(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last)
 {
-    _VSTD::partial_sort(__first, __middle, __last,
+    _CUDA_VSTD::partial_sort(__first, __middle, __last,
                         __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_PARTIAL_SORT_H
+#endif // _LIBCUDACXX___ALGORITHM_PARTIAL_SORT_H

diff  --git a/libcxx/include/__algorithm/partial_sort_copy.h b/libcxx/include/__algorithm/partial_sort_copy.h
index 55edf31b0f92..3e650ede8277 100644
--- a/libcxx/include/__algorithm/partial_sort_copy.h
+++ b/libcxx/include/__algorithm/partial_sort_copy.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_PARTIAL_SORT_COPY_H
-#define _LIBCPP___ALGORITHM_PARTIAL_SORT_COPY_H
+#ifndef _LIBCUDACXX___ALGORITHM_PARTIAL_SORT_COPY_H
+#define _LIBCUDACXX___ALGORITHM_PARTIAL_SORT_COPY_H
 
 #include <__algorithm/comp.h>
 #include <__algorithm/comp_ref_type.h>
@@ -24,16 +24,16 @@
 #include <__utility/move.h>
 #include <__utility/pair.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _AlgPolicy, class _Compare,
           class _InputIterator, class _Sentinel1, class _RandomAccessIterator, class _Sentinel2,
           class _Proj1, class _Proj2>
-_LIBCPP_CONSTEXPR_AFTER_CXX17 pair<_InputIterator, _RandomAccessIterator>
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17 pair<_InputIterator, _RandomAccessIterator>
 __partial_sort_copy(_InputIterator __first, _Sentinel1 __last,
                     _RandomAccessIterator __result_first, _Sentinel2 __result_last,
                     _Compare&& __comp, _Proj1&& __proj1, _Proj2&& __proj2)
@@ -60,7 +60,7 @@ __partial_sort_copy(_InputIterator __first, _Sentinel1 __last,
 }
 
 template <class _InputIterator, class _RandomAccessIterator, class _Compare>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 _RandomAccessIterator
 partial_sort_copy(_InputIterator __first, _InputIterator __last,
                   _RandomAccessIterator __result_first, _RandomAccessIterator __result_last, _Compare __comp)
@@ -75,15 +75,15 @@ partial_sort_copy(_InputIterator __first, _InputIterator __last,
 }
 
 template <class _InputIterator, class _RandomAccessIterator>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 _RandomAccessIterator
 partial_sort_copy(_InputIterator __first, _InputIterator __last,
                   _RandomAccessIterator __result_first, _RandomAccessIterator __result_last)
 {
-    return _VSTD::partial_sort_copy(__first, __last, __result_first, __result_last,
+    return _CUDA_VSTD::partial_sort_copy(__first, __last, __result_first, __result_last,
                                    __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_PARTIAL_SORT_COPY_H
+#endif // _LIBCUDACXX___ALGORITHM_PARTIAL_SORT_COPY_H

diff  --git a/libcxx/include/__algorithm/partition.h b/libcxx/include/__algorithm/partition.h
index 60b4e290ebeb..880b63981430 100644
--- a/libcxx/include/__algorithm/partition.h
+++ b/libcxx/include/__algorithm/partition.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_PARTITION_H
-#define _LIBCPP___ALGORITHM_PARTITION_H
+#ifndef _LIBCUDACXX___ALGORITHM_PARTITION_H
+#define _LIBCUDACXX___ALGORITHM_PARTITION_H
 
 #include <__algorithm/iterator_operations.h>
 #include <__config>
@@ -16,14 +16,14 @@
 #include <__utility/pair.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Predicate, class _AlgPolicy, class _ForwardIterator, class _Sentinel>
-_LIBCPP_CONSTEXPR_AFTER_CXX17 pair<_ForwardIterator, _ForwardIterator>
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17 pair<_ForwardIterator, _ForwardIterator>
 __partition_impl(_ForwardIterator __first, _Sentinel __last, _Predicate __pred, forward_iterator_tag)
 {
     while (true)
@@ -48,7 +48,7 @@ __partition_impl(_ForwardIterator __first, _Sentinel __last, _Predicate __pred,
 }
 
 template <class _Predicate, class _AlgPolicy, class _BidirectionalIterator, class _Sentinel>
-_LIBCPP_CONSTEXPR_AFTER_CXX17 pair<_BidirectionalIterator, _BidirectionalIterator>
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17 pair<_BidirectionalIterator, _BidirectionalIterator>
 __partition_impl(_BidirectionalIterator __first, _Sentinel __sentinel, _Predicate __pred,
             bidirectional_iterator_tag)
 {
@@ -76,7 +76,7 @@ __partition_impl(_BidirectionalIterator __first, _Sentinel __sentinel, _Predicat
 }
 
 template <class _AlgPolicy, class _ForwardIterator, class _Sentinel, class _Predicate, class _IterCategory>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 pair<_ForwardIterator, _ForwardIterator> __partition(
     _ForwardIterator __first, _Sentinel __last, _Predicate&& __pred, _IterCategory __iter_category) {
   return std::__partition_impl<__uncvref_t<_Predicate>&, _AlgPolicy>(
@@ -84,7 +84,7 @@ pair<_ForwardIterator, _ForwardIterator> __partition(
 }
 
 template <class _ForwardIterator, class _Predicate>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 _ForwardIterator
 partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred)
 {
@@ -93,6 +93,6 @@ partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred)
   return __result.first;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_PARTITION_H
+#endif // _LIBCUDACXX___ALGORITHM_PARTITION_H

diff  --git a/libcxx/include/__algorithm/partition_copy.h b/libcxx/include/__algorithm/partition_copy.h
index cacde0bfd47b..46994d8e1d19 100644
--- a/libcxx/include/__algorithm/partition_copy.h
+++ b/libcxx/include/__algorithm/partition_copy.h
@@ -6,22 +6,22 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_PARTITION_COPY_H
-#define _LIBCPP___ALGORITHM_PARTITION_COPY_H
+#ifndef _LIBCUDACXX___ALGORITHM_PARTITION_COPY_H
+#define _LIBCUDACXX___ALGORITHM_PARTITION_COPY_H
 
 #include <__config>
 #include <__iterator/iterator_traits.h>
 #include <__utility/pair.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _InputIterator, class _OutputIterator1,
           class _OutputIterator2, class _Predicate>
-_LIBCPP_CONSTEXPR_AFTER_CXX17 pair<_OutputIterator1, _OutputIterator2>
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17 pair<_OutputIterator1, _OutputIterator2>
 partition_copy(_InputIterator __first, _InputIterator __last,
                _OutputIterator1 __out_true, _OutputIterator2 __out_false,
                _Predicate __pred)
@@ -42,6 +42,6 @@ partition_copy(_InputIterator __first, _InputIterator __last,
     return pair<_OutputIterator1, _OutputIterator2>(__out_true, __out_false);
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_PARTITION_COPY_H
+#endif // _LIBCUDACXX___ALGORITHM_PARTITION_COPY_H

diff  --git a/libcxx/include/__algorithm/partition_point.h b/libcxx/include/__algorithm/partition_point.h
index 1675534e60d5..4148076da456 100644
--- a/libcxx/include/__algorithm/partition_point.h
+++ b/libcxx/include/__algorithm/partition_point.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_PARTITION_POINT_H
-#define _LIBCPP___ALGORITHM_PARTITION_POINT_H
+#ifndef _LIBCUDACXX___ALGORITHM_PARTITION_POINT_H
+#define _LIBCUDACXX___ALGORITHM_PARTITION_POINT_H
 
 #include <__algorithm/half_positive.h>
 #include <__config>
@@ -15,23 +15,23 @@
 #include <__iterator/distance.h>
 #include <__iterator/iterator_traits.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template<class _ForwardIterator, class _Predicate>
-_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _ForwardIterator
 partition_point(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred)
 {
     typedef typename iterator_traits<_ForwardIterator>::
diff erence_type 
diff erence_type;
-    
diff erence_type __len = _VSTD::distance(__first, __last);
+    
diff erence_type __len = _CUDA_VSTD::distance(__first, __last);
     while (__len != 0)
     {
-        
diff erence_type __l2 = _VSTD::__half_positive(__len);
+        
diff erence_type __l2 = _CUDA_VSTD::__half_positive(__len);
         _ForwardIterator __m = __first;
-        _VSTD::advance(__m, __l2);
+        _CUDA_VSTD::advance(__m, __l2);
         if (__pred(*__m))
         {
             __first = ++__m;
@@ -43,6 +43,6 @@ partition_point(_ForwardIterator __first, _ForwardIterator __last, _Predicate __
     return __first;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_PARTITION_POINT_H
+#endif // _LIBCUDACXX___ALGORITHM_PARTITION_POINT_H

diff  --git a/libcxx/include/__algorithm/pop_heap.h b/libcxx/include/__algorithm/pop_heap.h
index 44d5d3972605..fdcc64783fad 100644
--- a/libcxx/include/__algorithm/pop_heap.h
+++ b/libcxx/include/__algorithm/pop_heap.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_POP_HEAP_H
-#define _LIBCPP___ALGORITHM_POP_HEAP_H
+#ifndef _LIBCUDACXX___ALGORITHM_POP_HEAP_H
+#define _LIBCUDACXX___ALGORITHM_POP_HEAP_H
 
 #include <__algorithm/comp.h>
 #include <__algorithm/comp_ref_type.h>
@@ -20,17 +20,17 @@
 #include <__utility/move.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _AlgPolicy, class _Compare, class _RandomAccessIterator>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 void __pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare& __comp,
     typename iterator_traits<_RandomAccessIterator>::
diff erence_type __len) {
-  _LIBCPP_ASSERT(__len > 0, "The heap given to pop_heap must be non-empty");
+  _LIBCUDACXX_ASSERT(__len > 0, "The heap given to pop_heap must be non-empty");
 
   using _CompRef = typename __comp_ref_type<_Compare>::type;
   _CompRef __comp_ref = __comp;
@@ -53,7 +53,7 @@ void __pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Co
 }
 
 template <class _RandomAccessIterator, class _Compare>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) {
   static_assert(std::is_copy_constructible<_RandomAccessIterator>::value, "Iterators must be copy constructible.");
   static_assert(std::is_copy_assignable<_RandomAccessIterator>::value, "Iterators must be copy assignable.");
@@ -63,12 +63,12 @@ void pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Comp
 }
 
 template <class _RandomAccessIterator>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) {
   std::pop_heap(std::move(__first), std::move(__last),
       __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_POP_HEAP_H
+#endif // _LIBCUDACXX___ALGORITHM_POP_HEAP_H

diff  --git a/libcxx/include/__algorithm/prev_permutation.h b/libcxx/include/__algorithm/prev_permutation.h
index 698506372b6f..b8273dca6850 100644
--- a/libcxx/include/__algorithm/prev_permutation.h
+++ b/libcxx/include/__algorithm/prev_permutation.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_PREV_PERMUTATION_H
-#define _LIBCPP___ALGORITHM_PREV_PERMUTATION_H
+#ifndef _LIBCUDACXX___ALGORITHM_PREV_PERMUTATION_H
+#define _LIBCUDACXX___ALGORITHM_PREV_PERMUTATION_H
 
 #include <__algorithm/comp.h>
 #include <__algorithm/comp_ref_type.h>
@@ -18,14 +18,14 @@
 #include <__utility/move.h>
 #include <__utility/pair.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _AlgPolicy, class _Compare, class _BidirectionalIterator, class _Sentinel>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 pair<_BidirectionalIterator, bool>
 __prev_permutation(_BidirectionalIterator __first, _Sentinel __last, _Compare&& __comp)
 {
@@ -57,7 +57,7 @@ __prev_permutation(_BidirectionalIterator __first, _Sentinel __last, _Compare&&
 }
 
 template <class _BidirectionalIterator, class _Compare>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 bool
 prev_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp)
 {
@@ -67,14 +67,14 @@ prev_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last,
 }
 
 template <class _BidirectionalIterator>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 bool
 prev_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last)
 {
-    return _VSTD::prev_permutation(__first, __last,
+    return _CUDA_VSTD::prev_permutation(__first, __last,
                                   __less<typename iterator_traits<_BidirectionalIterator>::value_type>());
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_PREV_PERMUTATION_H
+#endif // _LIBCUDACXX___ALGORITHM_PREV_PERMUTATION_H

diff  --git a/libcxx/include/__algorithm/push_heap.h b/libcxx/include/__algorithm/push_heap.h
index 72ad51e1a887..f9b6fbfd7d40 100644
--- a/libcxx/include/__algorithm/push_heap.h
+++ b/libcxx/include/__algorithm/push_heap.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_PUSH_HEAP_H
-#define _LIBCPP___ALGORITHM_PUSH_HEAP_H
+#ifndef _LIBCUDACXX___ALGORITHM_PUSH_HEAP_H
+#define _LIBCUDACXX___ALGORITHM_PUSH_HEAP_H
 
 #include <__algorithm/comp.h>
 #include <__algorithm/comp_ref_type.h>
@@ -17,14 +17,14 @@
 #include <__utility/move.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _AlgPolicy, class _Compare, class _RandomAccessIterator>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 void __sift_up(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare&& __comp,
         typename iterator_traits<_RandomAccessIterator>::
diff erence_type __len) {
   using value_type = typename iterator_traits<_RandomAccessIterator>::value_type;
@@ -50,7 +50,7 @@ void __sift_up(_RandomAccessIterator __first, _RandomAccessIterator __last, _Com
 }
 
 template <class _AlgPolicy, class _RandomAccessIterator, class _Compare>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 void __push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare& __comp) {
   using _CompRef = typename __comp_ref_type<_Compare>::type;
   typename iterator_traits<_RandomAccessIterator>::
diff erence_type __len = __last - __first;
@@ -58,7 +58,7 @@ void __push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _C
 }
 
 template <class _RandomAccessIterator, class _Compare>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) {
   static_assert(std::is_copy_constructible<_RandomAccessIterator>::value, "Iterators must be copy constructible.");
   static_assert(std::is_copy_assignable<_RandomAccessIterator>::value, "Iterators must be copy assignable.");
@@ -67,12 +67,12 @@ void push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Com
 }
 
 template <class _RandomAccessIterator>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) {
   std::push_heap(std::move(__first), std::move(__last),
       __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_PUSH_HEAP_H
+#endif // _LIBCUDACXX___ALGORITHM_PUSH_HEAP_H

diff  --git a/libcxx/include/__algorithm/ranges_adjacent_find.h b/libcxx/include/__algorithm/ranges_adjacent_find.h
index e798d568299d..dbf2bd54b9a1 100644
--- a/libcxx/include/__algorithm/ranges_adjacent_find.h
+++ b/libcxx/include/__algorithm/ranges_adjacent_find.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_ADJACENT_FIND_H
-#define _LIBCPP___ALGORITHM_RANGES_ADJACENT_FIND_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_ADJACENT_FIND_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_ADJACENT_FIND_H
 
 #include <__config>
 #include <__functional/identity.h>
@@ -20,20 +20,20 @@
 #include <__ranges/dangling.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 namespace __adjacent_find {
 struct __fn {
 
   template <class _Iter, class _Sent, class _Proj, class _Pred>
-  _LIBCPP_HIDE_FROM_ABI constexpr static
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr static
   _Iter __adjacent_find_impl(_Iter __first, _Sent __last, _Pred& __pred, _Proj& __proj) {
     if (__first == __last)
       return __first;
@@ -50,7 +50,7 @@ struct __fn {
   template <forward_iterator _Iter, sentinel_for<_Iter> _Sent,
             class _Proj = identity,
             indirect_binary_predicate<projected<_Iter, _Proj>, projected<_Iter, _Proj>> _Pred = ranges::equal_to>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   _Iter operator()(_Iter __first, _Sent __last, _Pred __pred = {}, _Proj __proj = {}) const {
     return __adjacent_find_impl(std::move(__first), std::move(__last), __pred, __proj);
   }
@@ -59,7 +59,7 @@ struct __fn {
             class _Proj = identity,
             indirect_binary_predicate<projected<iterator_t<_Range>, _Proj>,
                                       projected<iterator_t<_Range>, _Proj>> _Pred = ranges::equal_to>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   borrowed_iterator_t<_Range> operator()(_Range&& __range, _Pred __pred = {}, _Proj __proj = {}) const {
     return __adjacent_find_impl(ranges::begin(__range), ranges::end(__range), __pred, __proj);
   }
@@ -71,8 +71,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_ADJACENT_FIND_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_ADJACENT_FIND_H

diff  --git a/libcxx/include/__algorithm/ranges_all_of.h b/libcxx/include/__algorithm/ranges_all_of.h
index a146865652a7..d95ba40c3d99 100644
--- a/libcxx/include/__algorithm/ranges_all_of.h
+++ b/libcxx/include/__algorithm/ranges_all_of.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_ALL_OF_H
-#define _LIBCPP___ALGORITHM_RANGES_ALL_OF_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_ALL_OF_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_ALL_OF_H
 
 #include <__config>
 #include <__functional/identity.h>
@@ -18,20 +18,20 @@
 #include <__ranges/concepts.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 namespace __all_of {
 struct __fn {
 
   template <class _Iter, class _Sent, class _Proj, class _Pred>
-  _LIBCPP_HIDE_FROM_ABI constexpr static
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr static
   bool __all_of_impl(_Iter __first, _Sent __last, _Pred& __pred, _Proj& __proj) {
     for (; __first != __last; ++__first) {
       if (!std::invoke(__pred, std::invoke(__proj, *__first)))
@@ -42,14 +42,14 @@ struct __fn {
 
   template <input_iterator _Iter, sentinel_for<_Iter> _Sent, class _Proj = identity,
             indirect_unary_predicate<projected<_Iter, _Proj>> _Pred>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   bool operator()(_Iter __first, _Sent __last, _Pred __pred, _Proj __proj = {}) const {
     return __all_of_impl(std::move(__first), std::move(__last), __pred, __proj);
   }
 
   template <input_range _Range, class _Proj = identity,
             indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   bool operator()(_Range&& __range, _Pred __pred, _Proj __proj = {}) const {
     return __all_of_impl(ranges::begin(__range), ranges::end(__range), __pred, __proj);
   }
@@ -61,8 +61,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_ALL_OF_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_ALL_OF_H

diff  --git a/libcxx/include/__algorithm/ranges_any_of.h b/libcxx/include/__algorithm/ranges_any_of.h
index 11c52cbe21ea..de3759f46d40 100644
--- a/libcxx/include/__algorithm/ranges_any_of.h
+++ b/libcxx/include/__algorithm/ranges_any_of.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_ANY_OF_H
-#define _LIBCPP___ALGORITHM_RANGES_ANY_OF_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_ANY_OF_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_ANY_OF_H
 
 #include <__config>
 #include <__functional/identity.h>
@@ -18,20 +18,20 @@
 #include <__ranges/concepts.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 namespace __any_of {
 struct __fn {
 
   template <class _Iter, class _Sent, class _Proj, class _Pred>
-  _LIBCPP_HIDE_FROM_ABI constexpr static
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr static
   bool __any_of_impl(_Iter __first, _Sent __last, _Pred& __pred, _Proj& __proj) {
     for (; __first != __last; ++__first) {
       if (std::invoke(__pred, std::invoke(__proj, *__first)))
@@ -42,14 +42,14 @@ struct __fn {
 
   template <input_iterator _Iter, sentinel_for<_Iter> _Sent, class _Proj = identity,
             indirect_unary_predicate<projected<_Iter, _Proj>> _Pred>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   bool operator()(_Iter __first, _Sent __last, _Pred __pred = {}, _Proj __proj = {}) const {
     return __any_of_impl(std::move(__first), std::move(__last), __pred, __proj);
   }
 
   template <input_range _Range, class _Proj = identity,
             indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   bool operator()(_Range&& __range, _Pred __pred, _Proj __proj = {}) const {
     return __any_of_impl(ranges::begin(__range), ranges::end(__range), __pred, __proj);
   }
@@ -61,8 +61,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_ANY_OF_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_ANY_OF_H

diff  --git a/libcxx/include/__algorithm/ranges_binary_search.h b/libcxx/include/__algorithm/ranges_binary_search.h
index 6da68834aa3b..9a48a20491a5 100644
--- a/libcxx/include/__algorithm/ranges_binary_search.h
+++ b/libcxx/include/__algorithm/ranges_binary_search.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_BINARY_SEARCH_H
-#define _LIBCPP___ALGORITHM_RANGES_BINARY_SEARCH_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_BINARY_SEARCH_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_BINARY_SEARCH_H
 
 #include <__algorithm/iterator_operations.h>
 #include <__algorithm/lower_bound.h>
@@ -20,20 +20,20 @@
 #include <__ranges/access.h>
 #include <__ranges/concepts.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 namespace __binary_search {
 struct __fn {
   template <forward_iterator _Iter, sentinel_for<_Iter> _Sent, class _Type, class _Proj = identity,
             indirect_strict_weak_order<const _Type*, projected<_Iter, _Proj>> _Comp = ranges::less>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   bool operator()(_Iter __first, _Sent __last, const _Type& __value, _Comp __comp = {}, _Proj __proj = {}) const {
     auto __ret = std::__lower_bound_impl<_RangeAlgPolicy>(__first, __last, __value, __comp, __proj);
     return __ret != __last && !std::invoke(__comp, __value, std::invoke(__proj, *__first));
@@ -41,7 +41,7 @@ struct __fn {
 
   template <forward_range _Range, class _Type, class _Proj = identity,
             indirect_strict_weak_order<const _Type*, projected<iterator_t<_Range>, _Proj>> _Comp = ranges::less>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   bool operator()(_Range&& __r, const _Type& __value, _Comp __comp = {}, _Proj __proj = {}) const {
     auto __first = ranges::begin(__r);
     auto __last = ranges::end(__r);
@@ -56,8 +56,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_BINARY_SEARCH_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_BINARY_SEARCH_H

diff  --git a/libcxx/include/__algorithm/ranges_clamp.h b/libcxx/include/__algorithm/ranges_clamp.h
index bdde97e178a7..43e1e9c806cc 100644
--- a/libcxx/include/__algorithm/ranges_clamp.h
+++ b/libcxx/include/__algorithm/ranges_clamp.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_CLAMP_H
-#define _LIBCPP___ALGORITHM_RANGES_CLAMP_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_CLAMP_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_CLAMP_H
 
 #include <__assert>
 #include <__config>
@@ -18,13 +18,13 @@
 #include <__iterator/projected.h>
 #include <__utility/forward.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 namespace __clamp {
@@ -33,13 +33,13 @@ struct __fn {
   template <class _Type,
             class _Proj = identity,
             indirect_strict_weak_order<projected<const _Type*, _Proj>> _Comp = ranges::less>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   const _Type& operator()(const _Type& __value,
                           const _Type& __low,
                           const _Type& __high,
                           _Comp __comp = {},
                           _Proj __proj = {}) const {
-    _LIBCPP_ASSERT(!bool(std::invoke(__comp, std::invoke(__proj, __high), std::invoke(__proj, __low))),
+    _LIBCUDACXX_ASSERT(!bool(std::invoke(__comp, std::invoke(__proj, __high), std::invoke(__proj, __low))),
                    "Bad bounds passed to std::ranges::clamp");
 
     if (std::invoke(__comp, std::invoke(__proj, __value), std::invoke(__proj, __low)))
@@ -58,8 +58,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_CLAMP_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_CLAMP_H

diff  --git a/libcxx/include/__algorithm/ranges_copy.h b/libcxx/include/__algorithm/ranges_copy.h
index f5d6d5cd139a..0e6e29702086 100644
--- a/libcxx/include/__algorithm/ranges_copy.h
+++ b/libcxx/include/__algorithm/ranges_copy.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_COPY_H
-#define _LIBCPP___ALGORITHM_RANGES_COPY_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_COPY_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_COPY_H
 
 #include <__algorithm/copy.h>
 #include <__algorithm/in_out_result.h>
@@ -19,13 +19,13 @@
 #include <__ranges/dangling.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 
@@ -37,7 +37,7 @@ struct __fn {
 
   template <input_iterator _InIter, sentinel_for<_InIter> _Sent, weakly_incrementable _OutIter>
     requires indirectly_copyable<_InIter, _OutIter>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   copy_result<_InIter, _OutIter> operator()(_InIter __first, _Sent __last, _OutIter __result) const {
     auto __ret = std::__copy(std::move(__first), std::move(__last), std::move(__result));
     return {std::move(__ret.first), std::move(__ret.second)};
@@ -45,7 +45,7 @@ struct __fn {
 
   template <input_range _Range, weakly_incrementable _OutIter>
     requires indirectly_copyable<iterator_t<_Range>, _OutIter>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   copy_result<borrowed_iterator_t<_Range>, _OutIter> operator()(_Range&& __r, _OutIter __result) const {
     auto __ret = std::__copy(ranges::begin(__r), ranges::end(__r), std::move(__result));
     return {std::move(__ret.first), std::move(__ret.second)};
@@ -58,8 +58,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_COPY_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_COPY_H

diff  --git a/libcxx/include/__algorithm/ranges_copy_backward.h b/libcxx/include/__algorithm/ranges_copy_backward.h
index 673df8025fab..f584257ed549 100644
--- a/libcxx/include/__algorithm/ranges_copy_backward.h
+++ b/libcxx/include/__algorithm/ranges_copy_backward.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_COPY_BACKWARD_H
-#define _LIBCPP___ALGORITHM_RANGES_COPY_BACKWARD_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_COPY_BACKWARD_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_COPY_BACKWARD_H
 
 #include <__algorithm/copy_backward.h>
 #include <__algorithm/in_out_result.h>
@@ -20,13 +20,13 @@
 #include <__ranges/dangling.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 
@@ -38,7 +38,7 @@ struct __fn {
 
   template <bidirectional_iterator _InIter1, sentinel_for<_InIter1> _Sent1, bidirectional_iterator _InIter2>
     requires indirectly_copyable<_InIter1, _InIter2>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   copy_backward_result<_InIter1, _InIter2> operator()(_InIter1 __first, _Sent1 __last, _InIter2 __result) const {
     auto __ret = std::__copy_backward<_RangeAlgPolicy>(std::move(__first), std::move(__last), std::move(__result));
     return {std::move(__ret.first), std::move(__ret.second)};
@@ -46,7 +46,7 @@ struct __fn {
 
   template <bidirectional_range _Range, bidirectional_iterator _Iter>
     requires indirectly_copyable<iterator_t<_Range>, _Iter>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   copy_backward_result<borrowed_iterator_t<_Range>, _Iter> operator()(_Range&& __r, _Iter __result) const {
     auto __ret = std::__copy_backward<_RangeAlgPolicy>(ranges::begin(__r), ranges::end(__r), std::move(__result));
     return {std::move(__ret.first), std::move(__ret.second)};
@@ -59,8 +59,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_COPY_BACKWARD_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_COPY_BACKWARD_H

diff  --git a/libcxx/include/__algorithm/ranges_copy_if.h b/libcxx/include/__algorithm/ranges_copy_if.h
index 492104fbbfba..4e35fd3c6e88 100644
--- a/libcxx/include/__algorithm/ranges_copy_if.h
+++ b/libcxx/include/__algorithm/ranges_copy_if.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_COPY_IF_H
-#define _LIBCPP___ALGORITHM_RANGES_COPY_IF_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_COPY_IF_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_COPY_IF_H
 
 #include <__algorithm/in_out_result.h>
 #include <__config>
@@ -20,13 +20,13 @@
 #include <__ranges/dangling.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 
@@ -37,7 +37,7 @@ namespace __copy_if {
 struct __fn {
 
   template <class _InIter, class _Sent, class _OutIter, class _Proj, class _Pred>
-  _LIBCPP_HIDE_FROM_ABI static constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI static constexpr
   copy_if_result <_InIter, _OutIter>
   __copy_if_impl(_InIter __first, _Sent __last, _OutIter __result, _Pred& __pred, _Proj& __proj) {
     for (; __first != __last; ++__first) {
@@ -52,7 +52,7 @@ struct __fn {
   template <input_iterator _Iter, sentinel_for<_Iter> _Sent, weakly_incrementable _OutIter, class _Proj = identity,
             indirect_unary_predicate<projected<_Iter, _Proj>> _Pred>
     requires indirectly_copyable<_Iter, _OutIter>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   copy_if_result<_Iter, _OutIter>
   operator()(_Iter __first, _Sent __last, _OutIter __result, _Pred __pred, _Proj __proj = {}) const {
     return __copy_if_impl(std::move(__first), std::move(__last), std::move(__result), __pred, __proj);
@@ -61,7 +61,7 @@ struct __fn {
   template <input_range _Range, weakly_incrementable _OutIter, class _Proj = identity,
             indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred>
     requires indirectly_copyable<iterator_t<_Range>, _OutIter>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   copy_if_result<borrowed_iterator_t<_Range>, _OutIter>
   operator()(_Range&& __r, _OutIter __result, _Pred __pred, _Proj __proj = {}) const {
     return __copy_if_impl(ranges::begin(__r), ranges::end(__r), std::move(__result), __pred, __proj);
@@ -74,8 +74,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_COPY_IF_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_COPY_IF_H

diff  --git a/libcxx/include/__algorithm/ranges_copy_n.h b/libcxx/include/__algorithm/ranges_copy_n.h
index eaa05c954686..614342bfba47 100644
--- a/libcxx/include/__algorithm/ranges_copy_n.h
+++ b/libcxx/include/__algorithm/ranges_copy_n.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_COPY_N_H
-#define _LIBCPP___ALGORITHM_RANGES_COPY_N_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_COPY_N_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_COPY_N_H
 
 #include <__algorithm/copy.h>
 #include <__algorithm/in_out_result.h>
@@ -20,13 +20,13 @@
 #include <__iterator/wrap_iter.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
 namespace ranges {
 
@@ -37,7 +37,7 @@ namespace __copy_n {
 struct __fn {
 
   template <class _InIter, class _DiffType, class _OutIter>
-  _LIBCPP_HIDE_FROM_ABI constexpr static
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr static
   copy_n_result<_InIter, _OutIter> __go(_InIter __first, _DiffType __n, _OutIter __result) {
     while (__n != 0) {
       *__result = *__first;
@@ -49,7 +49,7 @@ struct __fn {
   }
 
   template <random_access_iterator _InIter, class _DiffType, random_access_iterator _OutIter>
-  _LIBCPP_HIDE_FROM_ABI constexpr static
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr static
   copy_n_result<_InIter, _OutIter> __go(_InIter __first, _DiffType __n, _OutIter __result) {
     auto __ret = std::__copy(__first, __first + __n, __result);
     return {__ret.first, __ret.second};
@@ -57,7 +57,7 @@ struct __fn {
 
   template <input_iterator _Ip, weakly_incrementable _Op>
     requires indirectly_copyable<_Ip, _Op>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   copy_n_result<_Ip, _Op> operator()(_Ip __first, iter_
diff erence_t<_Ip> __n, _Op __result) const {
     return __go(std::move(__first), __n, std::move(__result));
   }
@@ -69,8 +69,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_RANGES_COPY_N_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_COPY_N_H

diff  --git a/libcxx/include/__algorithm/ranges_count.h b/libcxx/include/__algorithm/ranges_count.h
index 670df26911d0..c0b2f0f61c1d 100644
--- a/libcxx/include/__algorithm/ranges_count.h
+++ b/libcxx/include/__algorithm/ranges_count.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_COUNT_H
-#define _LIBCPP___ALGORITHM_RANGES_COUNT_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_COUNT_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_COUNT_H
 
 #include <__algorithm/ranges_count_if.h>
 #include <__config>
@@ -21,20 +21,20 @@
 #include <__ranges/concepts.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 namespace __count {
 struct __fn {
   template <input_iterator _Iter, sentinel_for<_Iter> _Sent, class _Type, class _Proj = identity>
     requires indirect_binary_predicate<ranges::equal_to, projected<_Iter, _Proj>, const _Type*>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   iter_
diff erence_t<_Iter> operator()(_Iter __first, _Sent __last, const _Type& __value, _Proj __proj = {}) const {
     auto __pred = [&](auto&& __e) { return __e == __value; };
     return ranges::__count_if_impl(std::move(__first), std::move(__last), __pred, __proj);
@@ -42,7 +42,7 @@ struct __fn {
 
   template <input_range _Range, class _Type, class _Proj = identity>
     requires indirect_binary_predicate<ranges::equal_to, projected<iterator_t<_Range>, _Proj>, const _Type*>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   range_
diff erence_t<_Range> operator()(_Range&& __r, const _Type& __value, _Proj __proj = {}) const {
     auto __pred = [&](auto&& __e) { return __e == __value; };
     return ranges::__count_if_impl(ranges::begin(__r), ranges::end(__r), __pred, __proj);
@@ -55,8 +55,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_COUNT_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_COUNT_H

diff  --git a/libcxx/include/__algorithm/ranges_count_if.h b/libcxx/include/__algorithm/ranges_count_if.h
index 0f34ee9f2b1b..a069aaa5fca7 100644
--- a/libcxx/include/__algorithm/ranges_count_if.h
+++ b/libcxx/include/__algorithm/ranges_count_if.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_COUNT_IF_H
-#define _LIBCPP___ALGORITHM_RANGES_COUNT_IF_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_COUNT_IF_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_COUNT_IF_H
 
 #include <__config>
 #include <__functional/identity.h>
@@ -21,17 +21,17 @@
 #include <__ranges/concepts.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 template <class _Iter, class _Sent, class _Proj, class _Pred>
-_LIBCPP_HIDE_FROM_ABI constexpr
+_LIBCUDACXX_HIDE_FROM_ABI constexpr
 iter_
diff erence_t<_Iter> __count_if_impl(_Iter __first, _Sent __last,
                                              _Pred& __pred, _Proj& __proj) {
   iter_
diff erence_t<_Iter> __counter(0);
@@ -46,14 +46,14 @@ namespace __count_if {
 struct __fn {
   template <input_iterator _Iter, sentinel_for<_Iter> _Sent, class _Proj = identity,
             indirect_unary_predicate<projected<_Iter, _Proj>> _Predicate>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   iter_
diff erence_t<_Iter> operator()(_Iter __first, _Sent __last, _Predicate __pred, _Proj __proj = {}) const {
     return ranges::__count_if_impl(std::move(__first), std::move(__last), __pred, __proj);
   }
 
   template <input_range _Range, class _Proj = identity,
             indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Predicate>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   range_
diff erence_t<_Range> operator()(_Range&& __r, _Predicate __pred, _Proj __proj = {}) const {
     return ranges::__count_if_impl(ranges::begin(__r), ranges::end(__r), __pred, __proj);
   }
@@ -65,8 +65,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_COUNT_IF_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_COUNT_IF_H

diff  --git a/libcxx/include/__algorithm/ranges_equal.h b/libcxx/include/__algorithm/ranges_equal.h
index c5f2d2332216..75a304245b40 100644
--- a/libcxx/include/__algorithm/ranges_equal.h
+++ b/libcxx/include/__algorithm/ranges_equal.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_EQUAL_H
-#define _LIBCPP___ALGORITHM_RANGES_EQUAL_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_EQUAL_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_EQUAL_H
 
 #include <__config>
 #include <__functional/identity.h>
@@ -20,13 +20,13 @@
 #include <__ranges/concepts.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 namespace __equal {
@@ -37,7 +37,7 @@ struct __fn {
             class _Pred,
             class _Proj1,
             class _Proj2>
-  _LIBCPP_HIDE_FROM_ABI constexpr static
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr static
   bool __equal_impl(_Iter1 __first1, _Sent1 __last1,
                     _Iter2 __first2, _Sent2 __last2,
                     _Pred& __pred,
@@ -60,7 +60,7 @@ struct __fn {
             class _Proj1 = identity,
             class _Proj2 = identity>
     requires indirectly_comparable<_Iter1, _Iter2, _Pred, _Proj1, _Proj2>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   bool operator()(_Iter1 __first1, _Sent1 __last1,
                   _Iter2 __first2, _Sent2 __last2,
                   _Pred __pred = {},
@@ -83,7 +83,7 @@ struct __fn {
             class _Proj1 = identity,
             class _Proj2 = identity>
     requires indirectly_comparable<iterator_t<_Range1>, iterator_t<_Range2>, _Pred, _Proj1, _Proj2>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   bool operator()(_Range1&& __range1,
                   _Range2&& __range2,
                   _Pred __pred = {},
@@ -108,8 +108,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_EQUAL_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_EQUAL_H

diff  --git a/libcxx/include/__algorithm/ranges_equal_range.h b/libcxx/include/__algorithm/ranges_equal_range.h
index dd4b377df1a1..173c054f1b29 100644
--- a/libcxx/include/__algorithm/ranges_equal_range.h
+++ b/libcxx/include/__algorithm/ranges_equal_range.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_EQUAL_RANGE_H
-#define _LIBCPP___ALGORITHM_RANGES_EQUAL_RANGE_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_EQUAL_RANGE_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_EQUAL_RANGE_H
 
 #include <__algorithm/equal_range.h>
 #include <__algorithm/iterator_operations.h>
@@ -25,13 +25,13 @@
 #include <__utility/forward.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 namespace __equal_range {
@@ -43,7 +43,7 @@ struct __fn {
       class _Tp,
       class _Proj                                                           = identity,
       indirect_strict_weak_order<const _Tp*, projected<_Iter, _Proj>> _Comp = ranges::less>
-  _LIBCPP_HIDE_FROM_ABI constexpr subrange<_Iter>
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr subrange<_Iter>
   operator()(_Iter __first, _Sent __last, const _Tp& __value, _Comp __comp = {}, _Proj __proj = {}) const {
     auto __ret = std::__equal_range<_RangeAlgPolicy>(
         std::move(__first), std::move(__last), __value, __comp, __proj);
@@ -55,7 +55,7 @@ struct __fn {
       class _Tp,
       class _Proj                                                                        = identity,
       indirect_strict_weak_order<const _Tp*, projected<iterator_t<_Range>, _Proj>> _Comp = ranges::less>
-  _LIBCPP_HIDE_FROM_ABI constexpr borrowed_subrange_t<_Range>
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr borrowed_subrange_t<_Range>
   operator()(_Range&& __range, const _Tp& __value, _Comp __comp = {}, _Proj __proj = {}) const {
     auto __ret = std::__equal_range<_RangeAlgPolicy>(
         ranges::begin(__range), ranges::end(__range), __value, __comp, __proj);
@@ -70,8 +70,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_EQUAL_RANGE_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_EQUAL_RANGE_H

diff  --git a/libcxx/include/__algorithm/ranges_fill.h b/libcxx/include/__algorithm/ranges_fill.h
index 7ce4a76ba9e9..c30936e52e73 100644
--- a/libcxx/include/__algorithm/ranges_fill.h
+++ b/libcxx/include/__algorithm/ranges_fill.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_FILL_H
-#define _LIBCPP___ALGORITHM_RANGES_FILL_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_FILL_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_FILL_H
 
 #include <__algorithm/ranges_fill_n.h>
 #include <__config>
@@ -16,19 +16,19 @@
 #include <__ranges/concepts.h>
 #include <__ranges/dangling.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 namespace __fill {
 struct __fn {
   template <class _Type, output_iterator<const _Type&> _Iter, sentinel_for<_Iter> _Sent>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   _Iter operator()(_Iter __first, _Sent __last, const _Type& __value) const {
     if constexpr(random_access_iterator<_Iter> && sized_sentinel_for<_Sent, _Iter>) {
       return ranges::fill_n(__first, __last - __first, __value);
@@ -40,7 +40,7 @@ struct __fn {
   }
 
   template <class _Type, output_range<const _Type&> _Range>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   borrowed_iterator_t<_Range> operator()(_Range&& __range, const _Type& __value) const {
     return (*this)(ranges::begin(__range), ranges::end(__range), __value);
   }
@@ -52,8 +52,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_FILL_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_FILL_H

diff  --git a/libcxx/include/__algorithm/ranges_fill_n.h b/libcxx/include/__algorithm/ranges_fill_n.h
index d93c573406ec..24f2a4e6092a 100644
--- a/libcxx/include/__algorithm/ranges_fill_n.h
+++ b/libcxx/include/__algorithm/ranges_fill_n.h
@@ -6,26 +6,26 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_FILL_N_H
-#define _LIBCPP___ALGORITHM_RANGES_FILL_N_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_FILL_N_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_FILL_N_H
 
 #include <__config>
 #include <__iterator/concepts.h>
 #include <__iterator/incrementable_traits.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 namespace __fill_n {
 struct __fn {
   template <class _Type, output_iterator<const _Type&> _Iter>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   _Iter operator()(_Iter __first, iter_
diff erence_t<_Iter> __n, const _Type& __value) const {
     for (; __n != 0; --__n) {
       *__first = __value;
@@ -41,8 +41,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_FILL_N_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_FILL_N_H

diff  --git a/libcxx/include/__algorithm/ranges_find.h b/libcxx/include/__algorithm/ranges_find.h
index ca6d2f438295..ee323c94a47a 100644
--- a/libcxx/include/__algorithm/ranges_find.h
+++ b/libcxx/include/__algorithm/ranges_find.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_FIND_H
-#define _LIBCPP___ALGORITHM_RANGES_FIND_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_FIND_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_FIND_H
 
 #include <__algorithm/ranges_find_if.h>
 #include <__config>
@@ -22,20 +22,20 @@
 #include <__utility/forward.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 namespace __find {
 struct __fn {
   template <input_iterator _Ip, sentinel_for<_Ip> _Sp, class _Tp, class _Proj = identity>
     requires indirect_binary_predicate<ranges::equal_to, projected<_Ip, _Proj>, const _Tp*>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   _Ip operator()(_Ip __first, _Sp __last, const _Tp& __value, _Proj __proj = {}) const {
     auto __pred = [&](auto&& __e) { return std::forward<decltype(__e)>(__e) == __value; };
     return ranges::__find_if_impl(std::move(__first), std::move(__last), __pred, __proj);
@@ -43,7 +43,7 @@ struct __fn {
 
   template <input_range _Rp, class _Tp, class _Proj = identity>
     requires indirect_binary_predicate<ranges::equal_to, projected<iterator_t<_Rp>, _Proj>, const _Tp*>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   borrowed_iterator_t<_Rp> operator()(_Rp&& __r, const _Tp& __value, _Proj __proj = {}) const {
     auto __pred = [&](auto&& __e) { return std::forward<decltype(__e)>(__e) == __value; };
     return ranges::__find_if_impl(ranges::begin(__r), ranges::end(__r), __pred, __proj);
@@ -56,8 +56,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_FIND_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_FIND_H

diff  --git a/libcxx/include/__algorithm/ranges_find_end.h b/libcxx/include/__algorithm/ranges_find_end.h
index 270b00649848..584f9ae314bb 100644
--- a/libcxx/include/__algorithm/ranges_find_end.h
+++ b/libcxx/include/__algorithm/ranges_find_end.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_FIND_END_H
-#define _LIBCPP___ALGORITHM_RANGES_FIND_END_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_FIND_END_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_FIND_END_H
 
 #include <__algorithm/find_end.h>
 #include <__algorithm/iterator_operations.h>
@@ -22,13 +22,13 @@
 #include <__ranges/concepts.h>
 #include <__ranges/subrange.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 namespace __find_end {
@@ -39,7 +39,7 @@ struct __fn {
             class _Proj1 = identity,
             class _Proj2 = identity>
     requires indirectly_comparable<_Iter1, _Iter2, _Pred, _Proj1, _Proj2>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   subrange<_Iter1> operator()(_Iter1 __first1, _Sent1 __last1,
                               _Iter2 __first2, _Sent2 __last2,
                               _Pred __pred = {},
@@ -64,7 +64,7 @@ struct __fn {
             class _Proj1 = identity,
             class _Proj2 = identity>
     requires indirectly_comparable<iterator_t<_Range1>, iterator_t<_Range2>, _Pred, _Proj1, _Proj2>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   borrowed_subrange_t<_Range1> operator()(_Range1&& __range1,
                                           _Range2&& __range2,
                                           _Pred __pred = {},
@@ -90,8 +90,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_FIND_END_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_FIND_END_H

diff  --git a/libcxx/include/__algorithm/ranges_find_first_of.h b/libcxx/include/__algorithm/ranges_find_first_of.h
index ae31d38e6a95..cc206015c467 100644
--- a/libcxx/include/__algorithm/ranges_find_first_of.h
+++ b/libcxx/include/__algorithm/ranges_find_first_of.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_FIND_FIRST_OF_H
-#define _LIBCPP___ALGORITHM_RANGES_FIND_FIRST_OF_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_FIND_FIRST_OF_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_FIND_FIRST_OF_H
 
 #include <__config>
 #include <__functional/identity.h>
@@ -20,20 +20,20 @@
 #include <__ranges/dangling.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 namespace __find_first_of {
 struct __fn {
 
   template <class _Iter1, class _Sent1, class _Iter2, class _Sent2, class _Pred, class _Proj1, class _Proj2>
-  _LIBCPP_HIDE_FROM_ABI constexpr static
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr static
   _Iter1 __find_first_of_impl(_Iter1 __first1, _Sent1 __last1,
                               _Iter2 __first2, _Sent2 __last2,
                               _Pred& __pred,
@@ -54,7 +54,7 @@ struct __fn {
             class _Proj1 = identity,
             class _Proj2 = identity>
     requires indirectly_comparable<_Iter1, _Iter2, _Pred, _Proj1, _Proj2>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   _Iter1 operator()(_Iter1 __first1, _Sent1 __last1,
                     _Iter2 __first2, _Sent2 __last2,
                     _Pred __pred = {},
@@ -73,7 +73,7 @@ struct __fn {
             class _Proj1 = identity,
             class _Proj2 = identity>
     requires indirectly_comparable<iterator_t<_Range1>, iterator_t<_Range2>, _Pred, _Proj1, _Proj2>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   borrowed_iterator_t<_Range1> operator()(_Range1&& __range1,
                                           _Range2&& __range2,
                                           _Pred __pred = {},
@@ -94,8 +94,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_FIND_FIRST_OF_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_FIND_FIRST_OF_H

diff  --git a/libcxx/include/__algorithm/ranges_find_if.h b/libcxx/include/__algorithm/ranges_find_if.h
index 65ac122f6677..644b421a716a 100644
--- a/libcxx/include/__algorithm/ranges_find_if.h
+++ b/libcxx/include/__algorithm/ranges_find_if.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_FIND_IF_H
-#define _LIBCPP___ALGORITHM_RANGES_FIND_IF_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_FIND_IF_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_FIND_IF_H
 
 #include <__config>
 #include <__functional/identity.h>
@@ -20,18 +20,18 @@
 #include <__ranges/dangling.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 
 template <class _Ip, class _Sp, class _Pred, class _Proj>
-_LIBCPP_HIDE_FROM_ABI static constexpr
+_LIBCUDACXX_HIDE_FROM_ABI static constexpr
 _Ip __find_if_impl(_Ip __first, _Sp __last, _Pred& __pred, _Proj& __proj) {
   for (; __first != __last; ++__first) {
     if (std::invoke(__pred, std::invoke(__proj, *__first)))
@@ -45,14 +45,14 @@ struct __fn {
 
   template <input_iterator _Ip, sentinel_for<_Ip> _Sp, class _Proj = identity,
             indirect_unary_predicate<projected<_Ip, _Proj>> _Pred>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   _Ip operator()(_Ip __first, _Sp __last, _Pred __pred, _Proj __proj = {}) const {
     return ranges::__find_if_impl(std::move(__first), std::move(__last), __pred, __proj);
   }
 
   template <input_range _Rp, class _Proj = identity,
             indirect_unary_predicate<projected<iterator_t<_Rp>, _Proj>> _Pred>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   borrowed_iterator_t<_Rp> operator()(_Rp&& __r, _Pred __pred, _Proj __proj = {}) const {
     return ranges::__find_if_impl(ranges::begin(__r), ranges::end(__r), __pred, __proj);
   }
@@ -64,8 +64,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_FIND_IF_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_FIND_IF_H

diff  --git a/libcxx/include/__algorithm/ranges_find_if_not.h b/libcxx/include/__algorithm/ranges_find_if_not.h
index 9a1adf71fc58..d470efbc8122 100644
--- a/libcxx/include/__algorithm/ranges_find_if_not.h
+++ b/libcxx/include/__algorithm/ranges_find_if_not.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_FIND_IF_NOT_H
-#define _LIBCPP___ALGORITHM_RANGES_FIND_IF_NOT_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_FIND_IF_NOT_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_FIND_IF_NOT_H
 
 #include <__algorithm/ranges_find_if.h>
 #include <__config>
@@ -22,20 +22,20 @@
 #include <__utility/forward.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 namespace __find_if_not {
 struct __fn {
   template <input_iterator _Ip, sentinel_for<_Ip> _Sp, class _Proj = identity,
             indirect_unary_predicate<projected<_Ip, _Proj>> _Pred>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   _Ip operator()(_Ip __first, _Sp __last, _Pred __pred, _Proj __proj = {}) const {
     auto __pred2 = [&](auto&& __e) { return !std::invoke(__pred, std::forward<decltype(__e)>(__e)); };
     return ranges::__find_if_impl(std::move(__first), std::move(__last), __pred2, __proj);
@@ -43,7 +43,7 @@ struct __fn {
 
   template <input_range _Rp, class _Proj = identity,
             indirect_unary_predicate<projected<iterator_t<_Rp>, _Proj>> _Pred>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   borrowed_iterator_t<_Rp> operator()(_Rp&& __r, _Pred __pred, _Proj __proj = {}) const {
     auto __pred2 = [&](auto&& __e) { return !std::invoke(__pred, std::forward<decltype(__e)>(__e)); };
     return ranges::__find_if_impl(ranges::begin(__r), ranges::end(__r), __pred2, __proj);
@@ -56,8 +56,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_FIND_IF_NOT_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_FIND_IF_NOT_H

diff  --git a/libcxx/include/__algorithm/ranges_for_each.h b/libcxx/include/__algorithm/ranges_for_each.h
index f284c0ee3ad4..e85092914eca 100644
--- a/libcxx/include/__algorithm/ranges_for_each.h
+++ b/libcxx/include/__algorithm/ranges_for_each.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_FOR_EACH_H
-#define _LIBCPP___ALGORITHM_RANGES_FOR_EACH_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_FOR_EACH_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_FOR_EACH_H
 
 #include <__algorithm/in_fun_result.h>
 #include <__config>
@@ -20,13 +20,13 @@
 #include <__ranges/dangling.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 
@@ -37,7 +37,7 @@ namespace __for_each {
 struct __fn {
 private:
   template <class _Iter, class _Sent, class _Proj, class _Func>
-  _LIBCPP_HIDE_FROM_ABI constexpr static
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr static
   for_each_result<_Iter, _Func> __for_each_impl(_Iter __first, _Sent __last, _Func& __func, _Proj& __proj) {
     for (; __first != __last; ++__first)
       std::invoke(__func, std::invoke(__proj, *__first));
@@ -48,7 +48,7 @@ struct __fn {
   template <input_iterator _Iter, sentinel_for<_Iter> _Sent,
             class _Proj = identity,
             indirectly_unary_invocable<projected<_Iter, _Proj>> _Func>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   for_each_result<_Iter, _Func> operator()(_Iter __first, _Sent __last, _Func __func, _Proj __proj = {}) const {
     return __for_each_impl(std::move(__first), std::move(__last), __func, __proj);
   }
@@ -56,7 +56,7 @@ struct __fn {
   template <input_range _Range,
             class _Proj = identity,
             indirectly_unary_invocable<projected<iterator_t<_Range>, _Proj>> _Func>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   for_each_result<borrowed_iterator_t<_Range>, _Func> operator()(_Range&& __range,
                                                                  _Func __func,
                                                                  _Proj __proj = {}) const {
@@ -71,8 +71,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_FOR_EACH_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_FOR_EACH_H

diff  --git a/libcxx/include/__algorithm/ranges_for_each_n.h b/libcxx/include/__algorithm/ranges_for_each_n.h
index 013afbd19389..39ee77a563a8 100644
--- a/libcxx/include/__algorithm/ranges_for_each_n.h
+++ b/libcxx/include/__algorithm/ranges_for_each_n.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_FOR_EACH_N_H
-#define _LIBCPP___ALGORITHM_RANGES_FOR_EACH_N_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_FOR_EACH_N_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_FOR_EACH_N_H
 
 #include <__algorithm/in_fun_result.h>
 #include <__config>
@@ -20,13 +20,13 @@
 #include <__ranges/concepts.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 
@@ -39,7 +39,7 @@ struct __fn {
   template <input_iterator _Iter,
             class _Proj = identity,
             indirectly_unary_invocable<projected<_Iter, _Proj>> _Func>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   for_each_n_result<_Iter, _Func> operator()(_Iter __first,
                                              iter_
diff erence_t<_Iter> __count,
                                              _Func __func,
@@ -59,8 +59,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_FOR_EACH_N_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_FOR_EACH_N_H

diff  --git a/libcxx/include/__algorithm/ranges_generate.h b/libcxx/include/__algorithm/ranges_generate.h
index 149296574d80..a356cb9a1877 100644
--- a/libcxx/include/__algorithm/ranges_generate.h
+++ b/libcxx/include/__algorithm/ranges_generate.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_GENERATE_H
-#define _LIBCPP___ALGORITHM_RANGES_GENERATE_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_GENERATE_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_GENERATE_H
 
 #include <__concepts/constructible.h>
 #include <__concepts/invocable.h>
@@ -20,13 +20,13 @@
 #include <__ranges/dangling.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 namespace __generate {
@@ -34,7 +34,7 @@ namespace __generate {
 struct __fn {
 
   template <class _OutIter, class _Sent, class _Func>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   static _OutIter __generate_fn_impl(_OutIter __first, _Sent __last, _Func& __gen) {
     for (; __first != __last; ++__first) {
       *__first = __gen();
@@ -45,14 +45,14 @@ struct __fn {
 
   template <input_or_output_iterator _OutIter, sentinel_for<_OutIter> _Sent, copy_constructible _Func>
   requires invocable<_Func&> && indirectly_writable<_OutIter, invoke_result_t<_Func&>>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   _OutIter operator()(_OutIter __first, _Sent __last, _Func __gen) const {
     return __generate_fn_impl(std::move(__first), std::move(__last), __gen);
   }
 
   template <class _Range, copy_constructible _Func>
   requires invocable<_Func&> && output_range<_Range, invoke_result_t<_Func&>>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   borrowed_iterator_t<_Range> operator()(_Range&& __range, _Func __gen) const {
     return __generate_fn_impl(ranges::begin(__range), ranges::end(__range), __gen);
   }
@@ -66,8 +66,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_GENERATE_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_GENERATE_H

diff  --git a/libcxx/include/__algorithm/ranges_generate_n.h b/libcxx/include/__algorithm/ranges_generate_n.h
index 63f466cecdd7..d40d5562084c 100644
--- a/libcxx/include/__algorithm/ranges_generate_n.h
+++ b/libcxx/include/__algorithm/ranges_generate_n.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_GENERATE_N_H
-#define _LIBCPP___ALGORITHM_RANGES_GENERATE_N_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_GENERATE_N_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_GENERATE_N_H
 
 #include <__concepts/constructible.h>
 #include <__concepts/invocable.h>
@@ -21,13 +21,13 @@
 #include <__ranges/concepts.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 namespace __generate_n {
@@ -36,7 +36,7 @@ struct __fn {
 
   template <input_or_output_iterator _OutIter, copy_constructible _Func>
   requires invocable<_Func&> && indirectly_writable<_OutIter, invoke_result_t<_Func&>>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   _OutIter operator()(_OutIter __first, iter_
diff erence_t<_OutIter> __n, _Func __gen) const {
     for (; __n > 0; --__n) {
       *__first = __gen();
@@ -55,8 +55,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_GENERATE_N_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_GENERATE_N_H

diff  --git a/libcxx/include/__algorithm/ranges_includes.h b/libcxx/include/__algorithm/ranges_includes.h
index 2c7581af68af..07564ec4e41d 100644
--- a/libcxx/include/__algorithm/ranges_includes.h
+++ b/libcxx/include/__algorithm/ranges_includes.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_INCLUDES_H
-#define _LIBCPP___ALGORITHM_RANGES_INCLUDES_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_INCLUDES_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_INCLUDES_H
 
 #include <__algorithm/includes.h>
 #include <__algorithm/make_projected.h>
@@ -23,13 +23,13 @@
 #include <__utility/forward.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 namespace __includes {
@@ -43,7 +43,7 @@ struct __fn {
       class _Proj1                                                                           = identity,
       class _Proj2                                                                           = identity,
       indirect_strict_weak_order<projected<_Iter1, _Proj1>, projected<_Iter2, _Proj2>> _Comp = ranges::less>
-  _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator()(
       _Iter1 __first1,
       _Sent1 __last1,
       _Iter2 __first2,
@@ -68,7 +68,7 @@ struct __fn {
       class _Proj2 = identity,
       indirect_strict_weak_order<projected<iterator_t<_Range1>, _Proj1>, projected<iterator_t<_Range2>, _Proj2>>
           _Comp = ranges::less>
-  _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator()(
       _Range1&& __range1, _Range2&& __range2, _Comp __comp = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const {
     return std::__includes(
         ranges::begin(__range1),
@@ -88,8 +88,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_INCLUDES_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_INCLUDES_H

diff  --git a/libcxx/include/__algorithm/ranges_inplace_merge.h b/libcxx/include/__algorithm/ranges_inplace_merge.h
index 12c90908c210..dc6d4f507587 100644
--- a/libcxx/include/__algorithm/ranges_inplace_merge.h
+++ b/libcxx/include/__algorithm/ranges_inplace_merge.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_INPLACE_MERGE_H
-#define _LIBCPP___ALGORITHM_RANGES_INPLACE_MERGE_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_INPLACE_MERGE_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_INPLACE_MERGE_H
 
 #include <__algorithm/inplace_merge.h>
 #include <__algorithm/iterator_operations.h>
@@ -27,20 +27,20 @@
 #include <__utility/forward.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 namespace __inplace_merge {
 
   struct __fn {
     template <class _Iter, class _Sent, class _Comp, class _Proj>
-    _LIBCPP_HIDE_FROM_ABI static constexpr auto
+    _LIBCUDACXX_HIDE_FROM_ABI static constexpr auto
     __inplace_merge_impl(_Iter __first, _Iter __middle, _Sent __last, _Comp&& __comp, _Proj&& __proj) {
       auto __last_iter = ranges::next(__middle, __last);
       std::__inplace_merge<_RangeAlgPolicy>(
@@ -54,7 +54,7 @@ namespace __inplace_merge {
         class _Comp = ranges::less,
         class _Proj = identity>
       requires sortable<_Iter, _Comp, _Proj>
-    _LIBCPP_HIDE_FROM_ABI _Iter
+    _LIBCUDACXX_HIDE_FROM_ABI _Iter
     operator()(_Iter __first, _Iter __middle, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const {
       return __inplace_merge_impl(
           std::move(__first), std::move(__middle), std::move(__last), std::move(__comp), std::move(__proj));
@@ -64,7 +64,7 @@ namespace __inplace_merge {
       requires sortable<
           iterator_t<_Range>,
           _Comp,
-          _Proj> _LIBCPP_HIDE_FROM_ABI borrowed_iterator_t<_Range>
+          _Proj> _LIBCUDACXX_HIDE_FROM_ABI borrowed_iterator_t<_Range>
       operator()(_Range&& __range, iterator_t<_Range> __middle, _Comp __comp = {}, _Proj __proj = {}) const {
       return __inplace_merge_impl(
           ranges::begin(__range), std::move(__middle), ranges::end(__range), std::move(__comp), std::move(__proj));
@@ -78,8 +78,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_INPLACE_MERGE_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_INPLACE_MERGE_H

diff  --git a/libcxx/include/__algorithm/ranges_is_heap.h b/libcxx/include/__algorithm/ranges_is_heap.h
index 0bb1dcda0e34..9e8cd4cff423 100644
--- a/libcxx/include/__algorithm/ranges_is_heap.h
+++ b/libcxx/include/__algorithm/ranges_is_heap.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_IS_HEAP_H
-#define _LIBCPP___ALGORITHM_RANGES_IS_HEAP_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_IS_HEAP_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_IS_HEAP_H
 
 #include <__algorithm/is_heap_until.h>
 #include <__algorithm/make_projected.h>
@@ -22,13 +22,13 @@
 #include <__ranges/concepts.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 namespace __is_heap {
@@ -36,7 +36,7 @@ namespace __is_heap {
 struct __fn {
 
   template <class _Iter, class _Sent, class _Proj, class _Comp>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   static bool __is_heap_fn_impl(_Iter __first, _Sent __last, _Comp& __comp, _Proj& __proj) {
     auto __last_iter = ranges::next(__first, __last);
     auto&& __projected_comp = std::__make_projected(__comp, __proj);
@@ -47,14 +47,14 @@ struct __fn {
 
   template <random_access_iterator _Iter, sentinel_for<_Iter> _Sent, class _Proj = identity,
             indirect_strict_weak_order<projected<_Iter, _Proj>> _Comp = ranges::less>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   bool operator()(_Iter __first, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const {
     return __is_heap_fn_impl(std::move(__first), std::move(__last), __comp, __proj);
   }
 
   template <random_access_range _Range, class _Proj = identity,
             indirect_strict_weak_order<projected<iterator_t<_Range>, _Proj>> _Comp = ranges::less>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   bool operator()(_Range&& __range, _Comp __comp = {}, _Proj __proj = {}) const {
     return __is_heap_fn_impl(ranges::begin(__range), ranges::end(__range), __comp, __proj);
   }
@@ -67,8 +67,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_IS_HEAP_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_IS_HEAP_H

diff  --git a/libcxx/include/__algorithm/ranges_is_heap_until.h b/libcxx/include/__algorithm/ranges_is_heap_until.h
index 8a751fcc5130..b2f3b47afeb5 100644
--- a/libcxx/include/__algorithm/ranges_is_heap_until.h
+++ b/libcxx/include/__algorithm/ranges_is_heap_until.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_IS_HEAP_UNTIL_H
-#define _LIBCPP___ALGORITHM_RANGES_IS_HEAP_UNTIL_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_IS_HEAP_UNTIL_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_IS_HEAP_UNTIL_H
 
 #include <__algorithm/is_heap_until.h>
 #include <__algorithm/make_projected.h>
@@ -23,13 +23,13 @@
 #include <__ranges/dangling.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 namespace __is_heap_until {
@@ -37,7 +37,7 @@ namespace __is_heap_until {
 struct __fn {
 
   template <class _Iter, class _Sent, class _Proj, class _Comp>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   static _Iter __is_heap_until_fn_impl(_Iter __first, _Sent __last, _Comp& __comp, _Proj& __proj) {
     auto __last_iter = ranges::next(__first, __last);
     auto&& __projected_comp = std::__make_projected(__comp, __proj);
@@ -47,14 +47,14 @@ struct __fn {
 
   template <random_access_iterator _Iter, sentinel_for<_Iter> _Sent, class _Proj = identity,
             indirect_strict_weak_order<projected<_Iter, _Proj>> _Comp = ranges::less>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   _Iter operator()(_Iter __first, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const {
     return __is_heap_until_fn_impl(std::move(__first), std::move(__last), __comp, __proj);
   }
 
   template <random_access_range _Range, class _Proj = identity,
             indirect_strict_weak_order<projected<iterator_t<_Range>, _Proj>> _Comp = ranges::less>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   borrowed_iterator_t<_Range> operator()(_Range&& __range, _Comp __comp = {}, _Proj __proj = {}) const {
     return __is_heap_until_fn_impl(ranges::begin(__range), ranges::end(__range), __comp, __proj);
   }
@@ -68,8 +68,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_IS_HEAP_UNTIL_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_IS_HEAP_UNTIL_H

diff  --git a/libcxx/include/__algorithm/ranges_is_partitioned.h b/libcxx/include/__algorithm/ranges_is_partitioned.h
index 3d572895ebe1..1afc587c3681 100644
--- a/libcxx/include/__algorithm/ranges_is_partitioned.h
+++ b/libcxx/include/__algorithm/ranges_is_partitioned.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_IS_PARTITIONED_H
-#define _LIBCPP___ALGORITHM_RANGES_IS_PARTITIONED_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_IS_PARTITIONED_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_IS_PARTITIONED_H
 
 #include <__config>
 #include <__functional/identity.h>
@@ -19,20 +19,20 @@
 #include <__ranges/concepts.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 namespace __is_partitioned {
 struct __fn {
 
   template <class _Iter, class _Sent, class _Proj, class _Pred>
-  _LIBCPP_HIDE_FROM_ABI constexpr static
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr static
   bool __is_parititioned_impl(_Iter __first, _Sent __last, _Pred& __pred, _Proj& __proj) {
     for (; __first != __last; ++__first) {
       if (!std::invoke(__pred, std::invoke(__proj, *__first)))
@@ -54,7 +54,7 @@ struct __fn {
   template <input_iterator _Iter, sentinel_for<_Iter> _Sent,
             class _Proj = identity,
             indirect_unary_predicate<projected<_Iter, _Proj>> _Pred>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   bool operator()(_Iter __first, _Sent __last, _Pred __pred, _Proj __proj = {}) const {
     return __is_parititioned_impl(std::move(__first), std::move(__last), __pred, __proj);
   }
@@ -62,7 +62,7 @@ struct __fn {
   template <input_range _Range,
             class _Proj = identity,
             indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   bool operator()(_Range&& __range, _Pred __pred, _Proj __proj = {}) const {
     return __is_parititioned_impl(ranges::begin(__range), ranges::end(__range), __pred, __proj);
   }
@@ -74,8 +74,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_IS_PARTITIONED_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_IS_PARTITIONED_H

diff  --git a/libcxx/include/__algorithm/ranges_is_permutation.h b/libcxx/include/__algorithm/ranges_is_permutation.h
index 41e302fe99dc..c812c06343bd 100644
--- a/libcxx/include/__algorithm/ranges_is_permutation.h
+++ b/libcxx/include/__algorithm/ranges_is_permutation.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_IS_PERMUTATION_H
-#define _LIBCPP___ALGORITHM_RANGES_IS_PERMUTATION_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_IS_PERMUTATION_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_IS_PERMUTATION_H
 
 #include <__algorithm/is_permutation.h>
 #include <__algorithm/iterator_operations.h>
@@ -21,13 +21,13 @@
 #include <__ranges/concepts.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 namespace __is_permutation {
@@ -35,7 +35,7 @@ struct __fn {
 
   template <class _Iter1, class _Sent1, class _Iter2, class _Sent2,
             class _Proj1, class _Proj2, class _Pred>
-  _LIBCPP_HIDE_FROM_ABI constexpr static
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr static
   bool __is_permutation_func_impl(_Iter1 __first1, _Sent1 __last1, _Iter2 __first2, _Sent2 __last2,
                                   _Pred& __pred, _Proj1& __proj1, _Proj2& __proj2) {
     return std::__is_permutation<_RangeAlgPolicy>(
@@ -49,7 +49,7 @@ struct __fn {
             class _Proj2 = identity,
             indirect_equivalence_relation<projected<_Iter1, _Proj1>,
                                           projected<_Iter2, _Proj2>> _Pred = ranges::equal_to>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   bool operator()(_Iter1 __first1, _Sent1 __last1, _Iter2 __first2, _Sent2 __last2,
                   _Pred __pred = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const {
     return __is_permutation_func_impl(
@@ -62,7 +62,7 @@ struct __fn {
             class _Proj1 = identity,
             class _Proj2 = identity,
             indirect_equivalence_relation<projected<iterator_t<_Range1>, _Proj1>, projected<iterator_t<_Range2>, _Proj2>> _Pred = ranges::equal_to>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   bool operator()(_Range1&& __range1, _Range2&& __range2,
                   _Pred __pred = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const {
     if constexpr (sized_range<_Range1> && sized_range<_Range2>) {
@@ -82,8 +82,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_IS_PERMUTATION_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_IS_PERMUTATION_H

diff  --git a/libcxx/include/__algorithm/ranges_is_sorted.h b/libcxx/include/__algorithm/ranges_is_sorted.h
index 938e69afba8d..22d88924bcf0 100644
--- a/libcxx/include/__algorithm/ranges_is_sorted.h
+++ b/libcxx/include/__algorithm/ranges_is_sorted.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP__ALGORITHM_RANGES_IS_SORTED_H
-#define _LIBCPP__ALGORITHM_RANGES_IS_SORTED_H
+#ifndef _LIBCUDACXX__ALGORITHM_RANGES_IS_SORTED_H
+#define _LIBCUDACXX__ALGORITHM_RANGES_IS_SORTED_H
 
 #include <__algorithm/ranges_is_sorted_until.h>
 #include <__config>
@@ -19,13 +19,13 @@
 #include <__ranges/concepts.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 namespace __is_sorted {
@@ -33,7 +33,7 @@ struct __fn {
   template <forward_iterator _Iter, sentinel_for<_Iter> _Sent,
             class _Proj = identity,
             indirect_strict_weak_order<projected<_Iter, _Proj>> _Comp = ranges::less>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   bool operator()(_Iter __first, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const {
     return ranges::__is_sorted_until_impl(std::move(__first), __last, __comp, __proj) == __last;
   }
@@ -41,7 +41,7 @@ struct __fn {
   template <forward_range _Range,
             class _Proj = identity,
             indirect_strict_weak_order<projected<iterator_t<_Range>, _Proj>> _Comp = ranges::less>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   bool operator()(_Range&& __range, _Comp __comp = {}, _Proj __proj = {}) const {
     auto __last = ranges::end(__range);
     return ranges::__is_sorted_until_impl(ranges::begin(__range), __last, __comp, __proj) == __last;
@@ -54,8 +54,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP__ALGORITHM_RANGES_IS_SORTED_H
+#endif // _LIBCUDACXX__ALGORITHM_RANGES_IS_SORTED_H

diff  --git a/libcxx/include/__algorithm/ranges_is_sorted_until.h b/libcxx/include/__algorithm/ranges_is_sorted_until.h
index c8f0608e1255..2116473523bc 100644
--- a/libcxx/include/__algorithm/ranges_is_sorted_until.h
+++ b/libcxx/include/__algorithm/ranges_is_sorted_until.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP__ALGORITHM_RANGES_IS_SORTED_UNTIL_H
-#define _LIBCPP__ALGORITHM_RANGES_IS_SORTED_UNTIL_H
+#ifndef _LIBCUDACXX__ALGORITHM_RANGES_IS_SORTED_UNTIL_H
+#define _LIBCUDACXX__ALGORITHM_RANGES_IS_SORTED_UNTIL_H
 
 #include <__config>
 #include <__functional/identity.h>
@@ -20,18 +20,18 @@
 #include <__ranges/dangling.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 
 template <class _Iter, class _Sent, class _Proj, class _Comp>
-_LIBCPP_HIDE_FROM_ABI constexpr
+_LIBCUDACXX_HIDE_FROM_ABI constexpr
 _Iter __is_sorted_until_impl(_Iter __first, _Sent __last, _Comp& __comp, _Proj& __proj) {
   if (__first == __last)
     return __first;
@@ -49,7 +49,7 @@ struct __fn {
   template <forward_iterator _Iter, sentinel_for<_Iter> _Sent,
             class _Proj = identity,
             indirect_strict_weak_order<projected<_Iter, _Proj>> _Comp = ranges::less>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   _Iter operator()(_Iter __first, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const {
     return ranges::__is_sorted_until_impl(std::move(__first), std::move(__last), __comp, __proj);
   }
@@ -57,7 +57,7 @@ struct __fn {
   template <forward_range _Range,
             class _Proj = identity,
             indirect_strict_weak_order<projected<iterator_t<_Range>, _Proj>> _Comp = ranges::less>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   borrowed_iterator_t<_Range> operator()(_Range&& __range, _Comp __comp = {}, _Proj __proj = {}) const {
     return ranges::__is_sorted_until_impl(ranges::begin(__range), ranges::end(__range), __comp, __proj);
   }
@@ -69,8 +69,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP__ALGORITHM_RANGES_IS_SORTED_UNTIL_H
+#endif // _LIBCUDACXX__ALGORITHM_RANGES_IS_SORTED_UNTIL_H

diff  --git a/libcxx/include/__algorithm/ranges_iterator_concept.h b/libcxx/include/__algorithm/ranges_iterator_concept.h
index 3323119317ae..94619b0c3c73 100644
--- a/libcxx/include/__algorithm/ranges_iterator_concept.h
+++ b/libcxx/include/__algorithm/ranges_iterator_concept.h
@@ -6,21 +6,21 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_ITERATOR_CONCEPT_H
-#define _LIBCPP___ALGORITHM_RANGES_ITERATOR_CONCEPT_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_ITERATOR_CONCEPT_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_ITERATOR_CONCEPT_H
 
 #include <__config>
 #include <__iterator/concepts.h>
 #include <__iterator/iterator_traits.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 
@@ -44,8 +44,8 @@ template <class _Iter>
 using __iterator_concept = decltype(__get_iterator_concept<_Iter>());
 
 } // namespace ranges
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_ITERATOR_CONCEPT_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_ITERATOR_CONCEPT_H

diff  --git a/libcxx/include/__algorithm/ranges_lexicographical_compare.h b/libcxx/include/__algorithm/ranges_lexicographical_compare.h
index fe709f7a7f70..996d60045309 100644
--- a/libcxx/include/__algorithm/ranges_lexicographical_compare.h
+++ b/libcxx/include/__algorithm/ranges_lexicographical_compare.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_LEXICOGRAPHICAL_COMPARE_H
-#define _LIBCPP___ALGORITHM_RANGES_LEXICOGRAPHICAL_COMPARE_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_LEXICOGRAPHICAL_COMPARE_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_LEXICOGRAPHICAL_COMPARE_H
 
 #include <__config>
 #include <__functional/identity.h>
@@ -19,20 +19,20 @@
 #include <__ranges/concepts.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 namespace __lexicographical_compare {
 struct __fn {
 
   template <class _Iter1, class _Sent1, class _Iter2, class _Sent2, class _Proj1, class _Proj2, class _Comp>
-  _LIBCPP_HIDE_FROM_ABI constexpr static
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr static
   bool __lexicographical_compare_impl(_Iter1 __first1, _Sent1 __last1,
                                       _Iter2 __first2, _Sent2 __last2,
                                       _Comp& __comp,
@@ -55,7 +55,7 @@ struct __fn {
             class _Proj1 = identity,
             class _Proj2 = identity,
             indirect_strict_weak_order<projected<_Iter1, _Proj1>, projected<_Iter2, _Proj2>> _Comp = ranges::less>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   bool operator()(_Iter1 __first1, _Sent1 __last1,
                   _Iter2 __first2, _Sent2 __last2,
                   _Comp __comp = {},
@@ -74,7 +74,7 @@ struct __fn {
             class _Proj2 = identity,
             indirect_strict_weak_order<projected<iterator_t<_Range1>, _Proj1>,
                                        projected<iterator_t<_Range2>, _Proj2>> _Comp = ranges::less>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   bool operator()(_Range1&& __range1, _Range2&& __range2, _Comp __comp = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const {
     return __lexicographical_compare_impl(ranges::begin(__range1), ranges::end(__range1),
                                           ranges::begin(__range2), ranges::end(__range2),
@@ -91,8 +91,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_LEXICOGRAPHICAL_COMPARE_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_LEXICOGRAPHICAL_COMPARE_H

diff  --git a/libcxx/include/__algorithm/ranges_lower_bound.h b/libcxx/include/__algorithm/ranges_lower_bound.h
index 1a9ae204a1ee..f6a0e6aedf72 100644
--- a/libcxx/include/__algorithm/ranges_lower_bound.h
+++ b/libcxx/include/__algorithm/ranges_lower_bound.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_LOWER_BOUND_H
-#define _LIBCPP___ALGORITHM_RANGES_LOWER_BOUND_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_LOWER_BOUND_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_LOWER_BOUND_H
 
 #include <__algorithm/iterator_operations.h>
 #include <__algorithm/lower_bound.h>
@@ -23,13 +23,13 @@
 #include <__ranges/concepts.h>
 #include <__ranges/dangling.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 
@@ -37,14 +37,14 @@ namespace __lower_bound {
 struct __fn {
   template <forward_iterator _Iter, sentinel_for<_Iter> _Sent, class _Type, class _Proj = identity,
             indirect_strict_weak_order<const _Type*, projected<_Iter, _Proj>> _Comp = ranges::less>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   _Iter operator()(_Iter __first, _Sent __last, const _Type& __value, _Comp __comp = {}, _Proj __proj = {}) const {
     return std::__lower_bound_impl<_RangeAlgPolicy>(__first, __last, __value, __comp, __proj);
   }
 
   template <forward_range _Range, class _Type, class _Proj = identity,
             indirect_strict_weak_order<const _Type*, projected<iterator_t<_Range>, _Proj>> _Comp = ranges::less>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   borrowed_iterator_t<_Range> operator()(_Range&& __r,
                                          const _Type& __value,
                                          _Comp __comp = {},
@@ -59,8 +59,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_LOWER_BOUND_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_LOWER_BOUND_H

diff  --git a/libcxx/include/__algorithm/ranges_make_heap.h b/libcxx/include/__algorithm/ranges_make_heap.h
index b114286a85cc..c2eb0e62f4a5 100644
--- a/libcxx/include/__algorithm/ranges_make_heap.h
+++ b/libcxx/include/__algorithm/ranges_make_heap.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_MAKE_HEAP_H
-#define _LIBCPP___ALGORITHM_RANGES_MAKE_HEAP_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_MAKE_HEAP_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_MAKE_HEAP_H
 
 #include <__algorithm/iterator_operations.h>
 #include <__algorithm/make_heap.h>
@@ -28,20 +28,20 @@
 #include <__utility/forward.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 namespace __make_heap {
 
 struct __fn {
   template <class _Iter, class _Sent, class _Comp, class _Proj>
-  _LIBCPP_HIDE_FROM_ABI constexpr static
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr static
   _Iter __make_heap_fn_impl(_Iter __first, _Sent __last, _Comp& __comp, _Proj& __proj) {
     auto __last_iter = ranges::next(__first, __last);
 
@@ -53,14 +53,14 @@ struct __fn {
 
   template <random_access_iterator _Iter, sentinel_for<_Iter> _Sent, class _Comp = ranges::less, class _Proj = identity>
     requires sortable<_Iter, _Comp, _Proj>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   _Iter operator()(_Iter __first, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const {
     return __make_heap_fn_impl(std::move(__first), std::move(__last), __comp, __proj);
   }
 
   template <random_access_range _Range, class _Comp = ranges::less, class _Proj = identity>
     requires sortable<iterator_t<_Range>, _Comp, _Proj>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   borrowed_iterator_t<_Range> operator()(_Range&& __r, _Comp __comp = {}, _Proj __proj = {}) const {
     return __make_heap_fn_impl(ranges::begin(__r), ranges::end(__r), __comp, __proj);
   }
@@ -73,8 +73,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_MAKE_HEAP_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_MAKE_HEAP_H

diff  --git a/libcxx/include/__algorithm/ranges_max.h b/libcxx/include/__algorithm/ranges_max.h
index f48bc3ececa2..21edcf83d841 100644
--- a/libcxx/include/__algorithm/ranges_max.h
+++ b/libcxx/include/__algorithm/ranges_max.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_MAX_H
-#define _LIBCPP___ALGORITHM_RANGES_MAX_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_MAX_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_MAX_H
 
 #include <__algorithm/ranges_min_element.h>
 #include <__assert>
@@ -23,32 +23,32 @@
 #include <__utility/move.h>
 #include <initializer_list>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 namespace __max {
 struct __fn {
   template <class _Tp, class _Proj = identity,
             indirect_strict_weak_order<projected<const _Tp*, _Proj>> _Comp = ranges::less>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   const _Tp& operator()(const _Tp& __a, const _Tp& __b, _Comp __comp = {}, _Proj __proj = {}) const {
     return std::invoke(__comp, std::invoke(__proj, __a), std::invoke(__proj, __b)) ? __b : __a;
   }
 
   template <copyable _Tp, class _Proj = identity,
             indirect_strict_weak_order<projected<const _Tp*, _Proj>> _Comp = ranges::less>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   _Tp operator()(initializer_list<_Tp> __il, _Comp __comp = {}, _Proj __proj = {}) const {
-    _LIBCPP_ASSERT(__il.begin() != __il.end(), "initializer_list must contain at least one element");
+    _LIBCUDACXX_ASSERT(__il.begin() != __il.end(), "initializer_list must contain at least one element");
 
     auto __comp_lhs_rhs_swapped = [&](auto&& __lhs, auto&& __rhs) { return std::invoke(__comp, __rhs, __lhs); };
     return *ranges::__min_element_impl(__il.begin(), __il.end(), __comp_lhs_rhs_swapped, __proj);
@@ -57,12 +57,12 @@ struct __fn {
   template <input_range _Rp, class _Proj = identity,
             indirect_strict_weak_order<projected<iterator_t<_Rp>, _Proj>> _Comp = ranges::less>
     requires indirectly_copyable_storable<iterator_t<_Rp>, range_value_t<_Rp>*>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   range_value_t<_Rp> operator()(_Rp&& __r, _Comp __comp = {}, _Proj __proj = {}) const {
     auto __first = ranges::begin(__r);
     auto __last = ranges::end(__r);
 
-    _LIBCPP_ASSERT(__first != __last, "range must contain at least one element");
+    _LIBCUDACXX_ASSERT(__first != __last, "range must contain at least one element");
 
     if constexpr (forward_range<_Rp>) {
       auto __comp_lhs_rhs_swapped = [&](auto&& __lhs, auto&& __rhs) { return std::invoke(__comp, __rhs, __lhs); };
@@ -84,10 +84,10 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP_STD_VER > 17 && && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_MAX_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_MAX_H

diff  --git a/libcxx/include/__algorithm/ranges_max_element.h b/libcxx/include/__algorithm/ranges_max_element.h
index d8d7242e176b..2169679f2c8b 100644
--- a/libcxx/include/__algorithm/ranges_max_element.h
+++ b/libcxx/include/__algorithm/ranges_max_element.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_MAX_ELEMENT_H
-#define _LIBCPP___ALGORITHM_RANGES_MAX_ELEMENT_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_MAX_ELEMENT_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_MAX_ELEMENT_H
 
 #include <__algorithm/ranges_min_element.h>
 #include <__config>
@@ -20,20 +20,20 @@
 #include <__ranges/concepts.h>
 #include <__ranges/dangling.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 namespace __max_element {
 struct __fn {
   template <forward_iterator _Ip, sentinel_for<_Ip> _Sp, class _Proj = identity,
             indirect_strict_weak_order<projected<_Ip, _Proj>> _Comp = ranges::less>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   _Ip operator()(_Ip __first, _Sp __last, _Comp __comp = {}, _Proj __proj = {}) const {
     auto __comp_lhs_rhs_swapped = [&](auto&& __lhs, auto&& __rhs) { return std::invoke(__comp, __rhs, __lhs); };
     return ranges::__min_element_impl(__first, __last, __comp_lhs_rhs_swapped, __proj);
@@ -41,7 +41,7 @@ struct __fn {
 
   template <forward_range _Rp, class _Proj = identity,
             indirect_strict_weak_order<projected<iterator_t<_Rp>, _Proj>> _Comp = ranges::less>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   borrowed_iterator_t<_Rp> operator()(_Rp&& __r, _Comp __comp = {}, _Proj __proj = {}) const {
     auto __comp_lhs_rhs_swapped = [&](auto&& __lhs, auto&& __rhs) { return std::invoke(__comp, __rhs, __lhs); };
     return ranges::__min_element_impl(ranges::begin(__r), ranges::end(__r), __comp_lhs_rhs_swapped, __proj);
@@ -54,8 +54,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_MAX_ELEMENT_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_MAX_ELEMENT_H

diff  --git a/libcxx/include/__algorithm/ranges_merge.h b/libcxx/include/__algorithm/ranges_merge.h
index c73e09e94ccc..ecc32c1b4864 100644
--- a/libcxx/include/__algorithm/ranges_merge.h
+++ b/libcxx/include/__algorithm/ranges_merge.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_MERGE_H
-#define _LIBCPP___ALGORITHM_RANGES_MERGE_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_MERGE_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_MERGE_H
 
 #include <__algorithm/in_in_out_result.h>
 #include <__algorithm/ranges_copy.h>
@@ -23,13 +23,13 @@
 #include <__utility/move.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 
@@ -47,7 +47,7 @@ template <
     class _Comp,
     class _Proj1,
     class _Proj2>
-_LIBCPP_HIDE_FROM_ABI constexpr merge_result<__uncvref_t<_InIter1>, __uncvref_t<_InIter2>, __uncvref_t<_OutIter>>
+_LIBCUDACXX_HIDE_FROM_ABI constexpr merge_result<__uncvref_t<_InIter1>, __uncvref_t<_InIter2>, __uncvref_t<_OutIter>>
 __merge_impl(
     _InIter1&& __first1,
     _Sent1&& __last1,
@@ -82,7 +82,7 @@ struct __fn {
       class _Proj1 = identity,
       class _Proj2 = identity>
     requires mergeable<_InIter1, _InIter2, _OutIter, _Comp, _Proj1, _Proj2>
-  _LIBCPP_HIDE_FROM_ABI constexpr merge_result<_InIter1, _InIter2, _OutIter> operator()(
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr merge_result<_InIter1, _InIter2, _OutIter> operator()(
       _InIter1 __first1,
       _Sent1 __last1,
       _InIter2 __first2,
@@ -108,7 +108,7 @@ struct __fn {
         _Comp,
         _Proj1,
         _Proj2> 
-  _LIBCPP_HIDE_FROM_ABI constexpr merge_result<borrowed_iterator_t<_Range1>, borrowed_iterator_t<_Range2>, _OutIter>
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr merge_result<borrowed_iterator_t<_Range1>, borrowed_iterator_t<_Range2>, _OutIter>
         operator()(
             _Range1&& __range1,
             _Range2&& __range2,
@@ -135,8 +135,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_MERGE_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_MERGE_H

diff  --git a/libcxx/include/__algorithm/ranges_min.h b/libcxx/include/__algorithm/ranges_min.h
index 0bb1e72ac5ac..5e9fd6988e7d 100644
--- a/libcxx/include/__algorithm/ranges_min.h
+++ b/libcxx/include/__algorithm/ranges_min.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_MIN_H
-#define _LIBCPP___ALGORITHM_RANGES_MIN_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_MIN_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_MIN_H
 
 #include <__algorithm/ranges_min_element.h>
 #include <__assert>
@@ -22,44 +22,44 @@
 #include <__ranges/concepts.h>
 #include <initializer_list>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 namespace __min {
 struct __fn {
   template <class _Tp, class _Proj = identity,
             indirect_strict_weak_order<projected<const _Tp*, _Proj>> _Comp = ranges::less>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   const _Tp& operator()(const _Tp& __a, const _Tp& __b, _Comp __comp = {}, _Proj __proj = {}) const {
     return std::invoke(__comp, std::invoke(__proj, __b), std::invoke(__proj, __a)) ? __b : __a;
   }
 
   template <copyable _Tp, class _Proj = identity,
             indirect_strict_weak_order<projected<const _Tp*, _Proj>> _Comp = ranges::less>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   _Tp operator()(initializer_list<_Tp> __il, _Comp __comp = {}, _Proj __proj = {}) const {
-    _LIBCPP_ASSERT(__il.begin() != __il.end(), "initializer_list must contain at least one element");
+    _LIBCUDACXX_ASSERT(__il.begin() != __il.end(), "initializer_list must contain at least one element");
     return *ranges::__min_element_impl(__il.begin(), __il.end(), __comp, __proj);
   }
 
   template <input_range _Rp, class _Proj = identity,
             indirect_strict_weak_order<projected<iterator_t<_Rp>, _Proj>> _Comp = ranges::less>
     requires indirectly_copyable_storable<iterator_t<_Rp>, range_value_t<_Rp>*>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   range_value_t<_Rp> operator()(_Rp&& __r, _Comp __comp = {}, _Proj __proj = {}) const {
     auto __first = ranges::begin(__r);
     auto __last = ranges::end(__r);
 
-    _LIBCPP_ASSERT(__first != __last, "range must contain at least one element");
+    _LIBCUDACXX_ASSERT(__first != __last, "range must contain at least one element");
 
     if constexpr (forward_range<_Rp>) {
       return *ranges::__min_element_impl(__first, __last, __comp, __proj);
@@ -80,10 +80,10 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP_STD_VER > 17 && && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_MIN_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_MIN_H

diff  --git a/libcxx/include/__algorithm/ranges_min_element.h b/libcxx/include/__algorithm/ranges_min_element.h
index 26f95fe3a6d2..9f91f8990b4f 100644
--- a/libcxx/include/__algorithm/ranges_min_element.h
+++ b/libcxx/include/__algorithm/ranges_min_element.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_MIN_ELEMENT_H
-#define _LIBCPP___ALGORITHM_RANGES_MIN_ELEMENT_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_MIN_ELEMENT_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_MIN_ELEMENT_H
 
 #include <__config>
 #include <__functional/identity.h>
@@ -20,19 +20,19 @@
 #include <__ranges/dangling.h>
 #include <__utility/forward.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 
 // TODO(ranges): `ranges::min_element` can now simply delegate to `std::__min_element`.
 template <class _Ip, class _Sp, class _Proj, class _Comp>
-_LIBCPP_HIDE_FROM_ABI static constexpr
+_LIBCUDACXX_HIDE_FROM_ABI static constexpr
 _Ip __min_element_impl(_Ip __first, _Sp __last, _Comp& __comp, _Proj& __proj) {
   if (__first == __last)
     return __first;
@@ -48,14 +48,14 @@ namespace __min_element {
 struct __fn {
   template <forward_iterator _Ip, sentinel_for<_Ip> _Sp, class _Proj = identity,
             indirect_strict_weak_order<projected<_Ip, _Proj>> _Comp = ranges::less>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   _Ip operator()(_Ip __first, _Sp __last, _Comp __comp = {}, _Proj __proj = {}) const {
     return ranges::__min_element_impl(__first, __last, __comp, __proj);
   }
 
   template <forward_range _Rp, class _Proj = identity,
             indirect_strict_weak_order<projected<iterator_t<_Rp>, _Proj>> _Comp = ranges::less>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   borrowed_iterator_t<_Rp> operator()(_Rp&& __r, _Comp __comp = {}, _Proj __proj = {}) const {
     return ranges::__min_element_impl(ranges::begin(__r), ranges::end(__r), __comp, __proj);
   }
@@ -67,8 +67,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_MIN_ELEMENT_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_MIN_ELEMENT_H

diff  --git a/libcxx/include/__algorithm/ranges_minmax.h b/libcxx/include/__algorithm/ranges_minmax.h
index 2f4bba0e7cc0..35b496b5f4f0 100644
--- a/libcxx/include/__algorithm/ranges_minmax.h
+++ b/libcxx/include/__algorithm/ranges_minmax.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_MINMAX_H
-#define _LIBCPP___ALGORITHM_RANGES_MINMAX_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_MINMAX_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_MINMAX_H
 
 #include <__algorithm/min_max_result.h>
 #include <__algorithm/minmax_element.h>
@@ -25,16 +25,16 @@
 #include <__utility/move.h>
 #include <initializer_list>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 template <class _T1>
@@ -44,7 +44,7 @@ namespace __minmax {
 struct __fn {
   template <class _Type, class _Proj = identity,
             indirect_strict_weak_order<projected<const _Type*, _Proj>> _Comp = ranges::less>
-  _LIBCPP_HIDE_FROM_ABI constexpr ranges::minmax_result<const _Type&>
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr ranges::minmax_result<const _Type&>
   operator()(const _Type& __a, const _Type& __b, _Comp __comp = {}, _Proj __proj = {}) const {
     if (std::invoke(__comp, std::invoke(__proj, __b), std::invoke(__proj, __a)))
       return {__b, __a};
@@ -53,9 +53,9 @@ struct __fn {
 
   template <copyable _Type, class _Proj = identity,
             indirect_strict_weak_order<projected<const _Type*, _Proj>> _Comp = ranges::less>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   ranges::minmax_result<_Type> operator()(initializer_list<_Type> __il, _Comp __comp = {}, _Proj __proj = {}) const {
-    _LIBCPP_ASSERT(__il.begin() != __il.end(), "initializer_list has to contain at least one element");
+    _LIBCUDACXX_ASSERT(__il.begin() != __il.end(), "initializer_list has to contain at least one element");
     auto __iters = std::__minmax_element_impl(__il.begin(), __il.end(), __comp, __proj);
     return ranges::minmax_result<_Type> { *__iters.first, *__iters.second };
   }
@@ -63,13 +63,13 @@ struct __fn {
   template <input_range _Range, class _Proj = identity,
             indirect_strict_weak_order<projected<iterator_t<_Range>, _Proj>> _Comp = ranges::less>
     requires indirectly_copyable_storable<iterator_t<_Range>, range_value_t<_Range>*>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   ranges::minmax_result<range_value_t<_Range>> operator()(_Range&& __r, _Comp __comp = {}, _Proj __proj = {}) const {
     auto __first = ranges::begin(__r);
     auto __last = ranges::end(__r);
     using _ValueT = range_value_t<_Range>;
 
-    _LIBCPP_ASSERT(__first != __last, "range has to contain at least one element");
+    _LIBCUDACXX_ASSERT(__first != __last, "range has to contain at least one element");
 
     if constexpr (forward_range<_Range>) {
       auto __result = std::__minmax_element_impl(__first, __last, __comp, __proj);
@@ -124,10 +124,10 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_MINMAX_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_MINMAX_H

diff  --git a/libcxx/include/__algorithm/ranges_minmax_element.h b/libcxx/include/__algorithm/ranges_minmax_element.h
index b7bb26cefe95..34dd55c241ee 100644
--- a/libcxx/include/__algorithm/ranges_minmax_element.h
+++ b/libcxx/include/__algorithm/ranges_minmax_element.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_MINMAX_ELEMENT_H
-#define _LIBCPP___ALGORITHM_RANGES_MINMAX_ELEMENT_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_MINMAX_ELEMENT_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_MINMAX_ELEMENT_H
 
 #include <__algorithm/min_max_result.h>
 #include <__algorithm/minmax_element.h>
@@ -25,13 +25,13 @@
 #include <__utility/pair.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 
@@ -42,7 +42,7 @@ namespace __minmax_element {
 struct __fn {
   template <forward_iterator _Ip, sentinel_for<_Ip> _Sp, class _Proj = identity,
             indirect_strict_weak_order<projected<_Ip, _Proj>> _Comp = ranges::less>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   ranges::minmax_element_result<_Ip> operator()(_Ip __first, _Sp __last, _Comp __comp = {}, _Proj __proj = {}) const {
     auto __ret = std::__minmax_element_impl(std::move(__first), std::move(__last), __comp, __proj);
     return {__ret.first, __ret.second};
@@ -50,7 +50,7 @@ struct __fn {
 
   template <forward_range _Rp, class _Proj = identity,
             indirect_strict_weak_order<projected<iterator_t<_Rp>, _Proj>> _Comp = ranges::less>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   ranges::minmax_element_result<borrowed_iterator_t<_Rp>>
   operator()(_Rp&& __r, _Comp __comp = {}, _Proj __proj = {}) const {
     auto __ret = std::__minmax_element_impl(ranges::begin(__r), ranges::end(__r), __comp, __proj);
@@ -65,8 +65,8 @@ inline namespace __cpo {
 
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_MINMAX_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_MINMAX_H

diff  --git a/libcxx/include/__algorithm/ranges_mismatch.h b/libcxx/include/__algorithm/ranges_mismatch.h
index 4c1440b5da06..4af72a6d38d9 100644
--- a/libcxx/include/__algorithm/ranges_mismatch.h
+++ b/libcxx/include/__algorithm/ranges_mismatch.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_MISMATCH_H
-#define _LIBCPP___ALGORITHM_RANGES_MISMATCH_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_MISMATCH_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_MISMATCH_H
 
 #include <__algorithm/in_in_result.h>
 #include <__config>
@@ -21,13 +21,13 @@
 #include <__ranges/dangling.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
 namespace ranges {
 
@@ -38,7 +38,7 @@ namespace __mismatch {
 struct __fn {
   template <class _I1, class _S1, class _I2, class _S2,
             class _Pred, class _Proj1, class _Proj2>
-  static _LIBCPP_HIDE_FROM_ABI constexpr
+  static _LIBCUDACXX_HIDE_FROM_ABI constexpr
   mismatch_result<_I1, _I2>
   __go(_I1 __first1, _S1 __last1, _I2 __first2, _S2 __last2,
        _Pred& __pred, _Proj1& __proj1, _Proj2& __proj2) {
@@ -55,7 +55,7 @@ struct __fn {
             input_iterator _I2, sentinel_for<_I2> _S2,
             class _Pred = ranges::equal_to, class _Proj1 = identity, class _Proj2 = identity>
     requires indirectly_comparable<_I1, _I2, _Pred, _Proj1, _Proj2>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   mismatch_result<_I1, _I2> operator()(_I1 __first1, _S1 __last1, _I2 __first2, _S2 __last2,
                                        _Pred __pred = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const {
     return __go(std::move(__first1), __last1, std::move(__first2), __last2, __pred, __proj1, __proj2);
@@ -64,7 +64,7 @@ struct __fn {
   template <input_range _R1, input_range _R2,
             class _Pred = ranges::equal_to, class _Proj1 = identity, class _Proj2 = identity>
     requires indirectly_comparable<iterator_t<_R1>, iterator_t<_R2>, _Pred, _Proj1, _Proj2>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   mismatch_result<borrowed_iterator_t<_R1>, borrowed_iterator_t<_R2>>
   operator()(_R1&& __r1, _R2&& __r2, _Pred __pred = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const {
     return __go(ranges::begin(__r1), ranges::end(__r1), ranges::begin(__r2), ranges::end(__r2),
@@ -78,8 +78,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_RANGES_MISMATCH_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_MISMATCH_H

diff  --git a/libcxx/include/__algorithm/ranges_move.h b/libcxx/include/__algorithm/ranges_move.h
index 9e1d4c72fb58..016e9a632e50 100644
--- a/libcxx/include/__algorithm/ranges_move.h
+++ b/libcxx/include/__algorithm/ranges_move.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_MOVE_H
-#define _LIBCPP___ALGORITHM_RANGES_MOVE_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_MOVE_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_MOVE_H
 
 #include <__algorithm/in_out_result.h>
 #include <__algorithm/iterator_operations.h>
@@ -20,13 +20,13 @@
 #include <__ranges/dangling.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 
@@ -37,7 +37,7 @@ namespace __move {
 struct __fn {
 
   template <class _InIter, class _Sent, class _OutIter>
-  _LIBCPP_HIDE_FROM_ABI constexpr static
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr static
   move_result<_InIter, _OutIter> __move_impl(_InIter __first, _Sent __last, _OutIter __result) {
     auto __ret = std::__move<_RangeAlgPolicy>(std::move(__first), std::move(__last), std::move(__result));
     return {std::move(__ret.first), std::move(__ret.second)};
@@ -45,14 +45,14 @@ struct __fn {
 
   template <input_iterator _InIter, sentinel_for<_InIter> _Sent, weakly_incrementable _OutIter>
     requires indirectly_movable<_InIter, _OutIter>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   move_result<_InIter, _OutIter> operator()(_InIter __first, _Sent __last, _OutIter __result) const {
     return __move_impl(std::move(__first), std::move(__last), std::move(__result));
   }
 
   template <input_range _Range, weakly_incrementable _OutIter>
     requires indirectly_movable<iterator_t<_Range>, _OutIter>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   move_result<borrowed_iterator_t<_Range>, _OutIter> operator()(_Range&& __range, _OutIter __result) const {
     return __move_impl(ranges::begin(__range), ranges::end(__range), std::move(__result));
   }
@@ -65,8 +65,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_MOVE_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_MOVE_H

diff  --git a/libcxx/include/__algorithm/ranges_move_backward.h b/libcxx/include/__algorithm/ranges_move_backward.h
index 583a6bf29d51..365332888fe6 100644
--- a/libcxx/include/__algorithm/ranges_move_backward.h
+++ b/libcxx/include/__algorithm/ranges_move_backward.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_MOVE_BACKWARD_H
-#define _LIBCPP___ALGORITHM_RANGES_MOVE_BACKWARD_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_MOVE_BACKWARD_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_MOVE_BACKWARD_H
 
 #include <__algorithm/in_out_result.h>
 #include <__algorithm/ranges_move.h>
@@ -21,13 +21,13 @@
 #include <__ranges/dangling.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 
@@ -38,7 +38,7 @@ namespace __move_backward {
 struct __fn {
 
   template <class _InIter, class _Sent, class _OutIter>
-  _LIBCPP_HIDE_FROM_ABI constexpr static
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr static
   move_backward_result<_InIter, _OutIter> __move_backward_impl(_InIter __first, _Sent __last, _OutIter __result) {
     auto __last_iter = ranges::next(__first, std::move(__last));
     auto __ret = ranges::move(std::make_reverse_iterator(__last_iter),
@@ -49,14 +49,14 @@ struct __fn {
 
   template <bidirectional_iterator _InIter, sentinel_for<_InIter> _Sent, bidirectional_iterator _OutIter>
     requires indirectly_movable<_InIter, _OutIter>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   move_backward_result<_InIter, _OutIter> operator()(_InIter __first, _Sent __last, _OutIter __result) const {
     return __move_backward_impl(std::move(__first), std::move(__last), std::move(__result));
   }
 
   template <bidirectional_range _Range, bidirectional_iterator _Iter>
     requires indirectly_movable<iterator_t<_Range>, _Iter>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   move_backward_result<borrowed_iterator_t<_Range>, _Iter> operator()(_Range&& __range, _Iter __result) const {
     return __move_backward_impl(ranges::begin(__range), ranges::end(__range), std::move(__result));
   }
@@ -69,8 +69,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_MOVE_BACKWARD_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_MOVE_BACKWARD_H

diff  --git a/libcxx/include/__algorithm/ranges_next_permutation.h b/libcxx/include/__algorithm/ranges_next_permutation.h
index 34c5fee04050..8a4070d2ddd8 100644
--- a/libcxx/include/__algorithm/ranges_next_permutation.h
+++ b/libcxx/include/__algorithm/ranges_next_permutation.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_NEXT_PERMUTATION_H
-#define _LIBCPP___ALGORITHM_RANGES_NEXT_PERMUTATION_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_NEXT_PERMUTATION_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_NEXT_PERMUTATION_H
 
 #include <__algorithm/in_found_result.h>
 #include <__algorithm/iterator_operations.h>
@@ -23,13 +23,13 @@
 #include <__ranges/dangling.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 
@@ -41,7 +41,7 @@ namespace __next_permutation {
 struct __fn {
   template <bidirectional_iterator _Iter, sentinel_for<_Iter> _Sent, class _Comp = ranges::less, class _Proj = identity>
     requires sortable<_Iter, _Comp, _Proj>
-  _LIBCPP_HIDE_FROM_ABI constexpr next_permutation_result<_Iter>
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr next_permutation_result<_Iter>
   operator()(_Iter __first, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const {
     auto __result = std::__next_permutation<_RangeAlgPolicy>(
         std::move(__first), std::move(__last), std::__make_projected(__comp, __proj));
@@ -50,7 +50,7 @@ struct __fn {
 
   template <bidirectional_range _Range, class _Comp = ranges::less, class _Proj = identity>
     requires sortable<iterator_t<_Range>, _Comp, _Proj>
-  _LIBCPP_HIDE_FROM_ABI constexpr next_permutation_result<borrowed_iterator_t<_Range>>
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr next_permutation_result<borrowed_iterator_t<_Range>>
   operator()(_Range&& __range, _Comp __comp = {}, _Proj __proj = {}) const {
     auto __result = std::__next_permutation<_RangeAlgPolicy>(
         ranges::begin(__range), ranges::end(__range), std::__make_projected(__comp, __proj));
@@ -65,8 +65,8 @@ constexpr inline auto next_permutation = __next_permutation::__fn{};
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_NEXT_PERMUTATION_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_NEXT_PERMUTATION_H

diff  --git a/libcxx/include/__algorithm/ranges_none_of.h b/libcxx/include/__algorithm/ranges_none_of.h
index 706ff5cd741d..0e564644cb47 100644
--- a/libcxx/include/__algorithm/ranges_none_of.h
+++ b/libcxx/include/__algorithm/ranges_none_of.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_NONE_OF_H
-#define _LIBCPP___ALGORITHM_RANGES_NONE_OF_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_NONE_OF_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_NONE_OF_H
 
 #include <__config>
 #include <__functional/identity.h>
@@ -18,20 +18,20 @@
 #include <__ranges/concepts.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 namespace __none_of {
 struct __fn {
 
   template <class _Iter, class _Sent, class _Proj, class _Pred>
-  _LIBCPP_HIDE_FROM_ABI constexpr static
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr static
   bool __none_of_impl(_Iter __first, _Sent __last, _Pred& __pred, _Proj& __proj) {
     for (; __first != __last; ++__first) {
       if (std::invoke(__pred, std::invoke(__proj, *__first)))
@@ -42,14 +42,14 @@ struct __fn {
 
   template <input_iterator _Iter, sentinel_for<_Iter> _Sent, class _Proj = identity,
             indirect_unary_predicate<projected<_Iter, _Proj>> _Pred>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   bool operator()(_Iter __first, _Sent __last, _Pred __pred = {}, _Proj __proj = {}) const {
     return __none_of_impl(std::move(__first), std::move(__last), __pred, __proj);
   }
 
   template <input_range _Range, class _Proj = identity,
             indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   bool operator()(_Range&& __range, _Pred __pred, _Proj __proj = {}) const {
     return __none_of_impl(ranges::begin(__range), ranges::end(__range), __pred, __proj);
   }
@@ -61,8 +61,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_NONE_OF_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_NONE_OF_H

diff  --git a/libcxx/include/__algorithm/ranges_nth_element.h b/libcxx/include/__algorithm/ranges_nth_element.h
index ad63bd20fb47..cdbd9c2adac6 100644
--- a/libcxx/include/__algorithm/ranges_nth_element.h
+++ b/libcxx/include/__algorithm/ranges_nth_element.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_NTH_ELEMENT_H
-#define _LIBCPP___ALGORITHM_RANGES_NTH_ELEMENT_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_NTH_ELEMENT_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_NTH_ELEMENT_H
 
 #include <__algorithm/iterator_operations.h>
 #include <__algorithm/make_projected.h>
@@ -27,20 +27,20 @@
 #include <__utility/forward.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 namespace __nth_element {
 
 struct __fn {
   template <class _Iter, class _Sent, class _Comp, class _Proj>
-  _LIBCPP_HIDE_FROM_ABI constexpr static
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr static
   _Iter __nth_element_fn_impl(_Iter __first, _Iter __nth, _Sent __last, _Comp& __comp, _Proj& __proj) {
     auto __last_iter = ranges::next(__first, __last);
 
@@ -52,14 +52,14 @@ struct __fn {
 
   template <random_access_iterator _Iter, sentinel_for<_Iter> _Sent, class _Comp = ranges::less, class _Proj = identity>
     requires sortable<_Iter, _Comp, _Proj>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   _Iter operator()(_Iter __first, _Iter __nth, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const {
     return __nth_element_fn_impl(std::move(__first), std::move(__nth), std::move(__last), __comp, __proj);
   }
 
   template <random_access_range _Range, class _Comp = ranges::less, class _Proj = identity>
     requires sortable<iterator_t<_Range>, _Comp, _Proj>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   borrowed_iterator_t<_Range> operator()(_Range&& __r, iterator_t<_Range> __nth, _Comp __comp = {},
                                          _Proj __proj = {}) const {
     return __nth_element_fn_impl(ranges::begin(__r), std::move(__nth), ranges::end(__r), __comp, __proj);
@@ -73,8 +73,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_NTH_ELEMENT_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_NTH_ELEMENT_H

diff  --git a/libcxx/include/__algorithm/ranges_partial_sort.h b/libcxx/include/__algorithm/ranges_partial_sort.h
index 020e34925df7..adae30c4d4f8 100644
--- a/libcxx/include/__algorithm/ranges_partial_sort.h
+++ b/libcxx/include/__algorithm/ranges_partial_sort.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_PARTIAL_SORT_H
-#define _LIBCPP___ALGORITHM_RANGES_PARTIAL_SORT_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_PARTIAL_SORT_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_PARTIAL_SORT_H
 
 #include <__algorithm/iterator_operations.h>
 #include <__algorithm/make_projected.h>
@@ -28,20 +28,20 @@
 #include <__utility/forward.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 namespace __partial_sort {
 
 struct __fn {
   template <class _Iter, class _Sent, class _Comp, class _Proj>
-  _LIBCPP_HIDE_FROM_ABI constexpr static
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr static
   _Iter __partial_sort_fn_impl(_Iter __first, _Iter __middle, _Sent __last, _Comp& __comp, _Proj& __proj) {
     auto&& __projected_comp = std::__make_projected(__comp, __proj);
     return std::__partial_sort<_RangeAlgPolicy>(std::move(__first), std::move(__middle), __last, __projected_comp);
@@ -49,14 +49,14 @@ struct __fn {
 
   template <random_access_iterator _Iter, sentinel_for<_Iter> _Sent, class _Comp = ranges::less, class _Proj = identity>
     requires sortable<_Iter, _Comp, _Proj>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   _Iter operator()(_Iter __first, _Iter __middle, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const {
     return __partial_sort_fn_impl(std::move(__first), std::move(__middle), std::move(__last), __comp, __proj);
   }
 
   template <random_access_range _Range, class _Comp = ranges::less, class _Proj = identity>
     requires sortable<iterator_t<_Range>, _Comp, _Proj>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   borrowed_iterator_t<_Range> operator()(_Range&& __r, iterator_t<_Range> __middle, _Comp __comp = {},
                                          _Proj __proj = {}) const {
     return __partial_sort_fn_impl(ranges::begin(__r), std::move(__middle), ranges::end(__r), __comp, __proj);
@@ -70,8 +70,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_PARTIAL_SORT_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_PARTIAL_SORT_H

diff  --git a/libcxx/include/__algorithm/ranges_partial_sort_copy.h b/libcxx/include/__algorithm/ranges_partial_sort_copy.h
index 271c347b7aa2..e7f4d063606c 100644
--- a/libcxx/include/__algorithm/ranges_partial_sort_copy.h
+++ b/libcxx/include/__algorithm/ranges_partial_sort_copy.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_PARTIAL_SORT_COPY_H
-#define _LIBCPP___ALGORITHM_RANGES_PARTIAL_SORT_COPY_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_PARTIAL_SORT_COPY_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_PARTIAL_SORT_COPY_H
 
 #include <__algorithm/in_out_result.h>
 #include <__algorithm/iterator_operations.h>
@@ -25,13 +25,13 @@
 #include <__ranges/dangling.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 
@@ -47,7 +47,7 @@ struct __fn {
             class _Comp = ranges::less, class _Proj1 = identity, class _Proj2 = identity>
   requires indirectly_copyable<_Iter1, _Iter2> && sortable<_Iter2, _Comp, _Proj2> &&
            indirect_strict_weak_order<_Comp, projected<_Iter1, _Proj1>, projected<_Iter2, _Proj2>>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   partial_sort_copy_result<_Iter1, _Iter2>
   operator()(_Iter1 __first, _Sent1 __last, _Iter2 __result_first, _Sent2 __result_last,
              _Comp __comp = {}, _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const {
@@ -64,7 +64,7 @@ struct __fn {
            sortable<iterator_t<_Range2>, _Comp, _Proj2> &&
            indirect_strict_weak_order<_Comp, projected<iterator_t<_Range1>, _Proj1>,
                                       projected<iterator_t<_Range2>, _Proj2>>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   partial_sort_copy_result<borrowed_iterator_t<_Range1>, borrowed_iterator_t<_Range2>>
   operator()(_Range1&& __range, _Range2&& __result_range, _Comp __comp = {},
              _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const {
@@ -84,8 +84,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_PARTIAL_SORT_COPY_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_PARTIAL_SORT_COPY_H

diff  --git a/libcxx/include/__algorithm/ranges_partition.h b/libcxx/include/__algorithm/ranges_partition.h
index 6a53933f37aa..422cc8bd4a19 100644
--- a/libcxx/include/__algorithm/ranges_partition.h
+++ b/libcxx/include/__algorithm/ranges_partition.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_PARTITION_H
-#define _LIBCPP___ALGORITHM_RANGES_PARTITION_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_PARTITION_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_PARTITION_H
 
 #include <__algorithm/iterator_operations.h>
 #include <__algorithm/make_projected.h>
@@ -28,13 +28,13 @@
 #include <__utility/move.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 namespace __partition {
@@ -42,7 +42,7 @@ namespace __partition {
 struct __fn {
 
   template <class _Iter, class _Sent, class _Proj, class _Pred>
-  _LIBCPP_HIDE_FROM_ABI static constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI static constexpr
   subrange<__uncvref_t<_Iter>> __partition_fn_impl(_Iter&& __first, _Sent&& __last, _Pred&& __pred, _Proj&& __proj) {
     auto&& __projected_pred = std::__make_projected(__pred, __proj);
     auto __result = std::__partition<_RangeAlgPolicy>(
@@ -53,7 +53,7 @@ struct __fn {
 
   template <permutable _Iter, sentinel_for<_Iter> _Sent, class _Proj = identity,
             indirect_unary_predicate<projected<_Iter, _Proj>> _Pred>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   subrange<_Iter> operator()(_Iter __first, _Sent __last, _Pred __pred, _Proj __proj = {}) const {
     return __partition_fn_impl(__first, __last, __pred, __proj);
   }
@@ -61,7 +61,7 @@ struct __fn {
   template <forward_range _Range, class _Proj = identity,
             indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred>
   requires permutable<iterator_t<_Range>>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   borrowed_subrange_t<_Range> operator()(_Range&& __range, _Pred __pred, _Proj __proj = {}) const {
     return __partition_fn_impl(ranges::begin(__range), ranges::end(__range), __pred, __proj);
   }
@@ -75,8 +75,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_PARTITION_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_PARTITION_H

diff  --git a/libcxx/include/__algorithm/ranges_partition_copy.h b/libcxx/include/__algorithm/ranges_partition_copy.h
index 7201a8cbfe45..bb6f2f81bcea 100644
--- a/libcxx/include/__algorithm/ranges_partition_copy.h
+++ b/libcxx/include/__algorithm/ranges_partition_copy.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_PARTITION_COPY_H
-#define _LIBCPP___ALGORITHM_RANGES_PARTITION_COPY_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_PARTITION_COPY_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_PARTITION_COPY_H
 
 #include <__algorithm/in_out_out_result.h>
 #include <__config>
@@ -22,13 +22,13 @@
 #include <__utility/move.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 
@@ -41,7 +41,7 @@ struct __fn {
 
   // TODO(ranges): delegate to the classic algorithm.
   template <class _InIter, class _Sent, class _OutIter1, class _OutIter2, class _Proj, class _Pred>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   static partition_copy_result<
       __uncvref_t<_InIter>, __uncvref_t<_OutIter1>, __uncvref_t<_OutIter2>
   > __partition_copy_fn_impl( _InIter&& __first, _Sent&& __last, _OutIter1&& __out_true, _OutIter2&& __out_false,
@@ -64,7 +64,7 @@ struct __fn {
             weakly_incrementable _OutIter1, weakly_incrementable _OutIter2,
             class _Proj = identity, indirect_unary_predicate<projected<_InIter, _Proj>> _Pred>
   requires indirectly_copyable<_InIter, _OutIter1> && indirectly_copyable<_InIter, _OutIter2>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   partition_copy_result<_InIter, _OutIter1, _OutIter2>
   operator()(_InIter __first, _Sent __last, _OutIter1 __out_true, _OutIter2 __out_false,
              _Pred __pred, _Proj __proj = {}) const {
@@ -75,7 +75,7 @@ struct __fn {
   template <input_range _Range, weakly_incrementable _OutIter1, weakly_incrementable _OutIter2,
             class _Proj = identity, indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred>
   requires indirectly_copyable<iterator_t<_Range>, _OutIter1> && indirectly_copyable<iterator_t<_Range>, _OutIter2>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   partition_copy_result<borrowed_iterator_t<_Range>, _OutIter1, _OutIter2>
   operator()(_Range&& __range, _OutIter1 __out_true, _OutIter2 __out_false, _Pred __pred, _Proj __proj = {}) const {
     return __partition_copy_fn_impl(
@@ -91,8 +91,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_PARTITION_COPY_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_PARTITION_COPY_H

diff  --git a/libcxx/include/__algorithm/ranges_partition_point.h b/libcxx/include/__algorithm/ranges_partition_point.h
index 6614a0bb50fd..40c0460f81ee 100644
--- a/libcxx/include/__algorithm/ranges_partition_point.h
+++ b/libcxx/include/__algorithm/ranges_partition_point.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_PARTITION_POINT_H
-#define _LIBCPP___ALGORITHM_RANGES_PARTITION_POINT_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_PARTITION_POINT_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_PARTITION_POINT_H
 
 #include <__algorithm/half_positive.h>
 #include <__config>
@@ -23,13 +23,13 @@
 #include <__ranges/dangling.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 namespace __partition_point {
@@ -38,7 +38,7 @@ struct __fn {
 
   // TODO(ranges): delegate to the classic algorithm.
   template <class _Iter, class _Sent, class _Proj, class _Pred>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   static _Iter __partition_point_fn_impl(_Iter&& __first, _Sent&& __last, _Pred& __pred, _Proj& __proj) {
     auto __len = ranges::distance(__first, __last);
 
@@ -60,14 +60,14 @@ struct __fn {
 
   template <forward_iterator _Iter, sentinel_for<_Iter> _Sent, class _Proj = identity,
             indirect_unary_predicate<projected<_Iter, _Proj>> _Pred>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   _Iter operator()(_Iter __first, _Sent __last, _Pred __pred, _Proj __proj = {}) const {
     return __partition_point_fn_impl(std::move(__first), std::move(__last), __pred, __proj);
   }
 
   template <forward_range _Range, class _Proj = identity,
             indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   borrowed_iterator_t<_Range> operator()(_Range&& __range, _Pred __pred, _Proj __proj = {}) const {
     return __partition_point_fn_impl(ranges::begin(__range), ranges::end(__range), __pred, __proj);
   }
@@ -81,8 +81,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_PARTITION_POINT_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_PARTITION_POINT_H

diff  --git a/libcxx/include/__algorithm/ranges_pop_heap.h b/libcxx/include/__algorithm/ranges_pop_heap.h
index fc7554fb0733..148beac22c0a 100644
--- a/libcxx/include/__algorithm/ranges_pop_heap.h
+++ b/libcxx/include/__algorithm/ranges_pop_heap.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_POP_HEAP_H
-#define _LIBCPP___ALGORITHM_RANGES_POP_HEAP_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_POP_HEAP_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_POP_HEAP_H
 
 #include <__algorithm/iterator_operations.h>
 #include <__algorithm/make_projected.h>
@@ -28,20 +28,20 @@
 #include <__utility/forward.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 namespace __pop_heap {
 
 struct __fn {
   template <class _Iter, class _Sent, class _Comp, class _Proj>
-  _LIBCPP_HIDE_FROM_ABI constexpr static
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr static
   _Iter __pop_heap_fn_impl(_Iter __first, _Sent __last, _Comp& __comp, _Proj& __proj) {
     auto __last_iter = ranges::next(__first, __last);
     auto __len = __last_iter - __first;
@@ -54,14 +54,14 @@ struct __fn {
 
   template <random_access_iterator _Iter, sentinel_for<_Iter> _Sent, class _Comp = ranges::less, class _Proj = identity>
     requires sortable<_Iter, _Comp, _Proj>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   _Iter operator()(_Iter __first, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const {
     return __pop_heap_fn_impl(std::move(__first), std::move(__last), __comp, __proj);
   }
 
   template <random_access_range _Range, class _Comp = ranges::less, class _Proj = identity>
     requires sortable<iterator_t<_Range>, _Comp, _Proj>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   borrowed_iterator_t<_Range> operator()(_Range&& __r, _Comp __comp = {}, _Proj __proj = {}) const {
     return __pop_heap_fn_impl(ranges::begin(__r), ranges::end(__r), __comp, __proj);
   }
@@ -74,8 +74,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_POP_HEAP_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_POP_HEAP_H

diff  --git a/libcxx/include/__algorithm/ranges_prev_permutation.h b/libcxx/include/__algorithm/ranges_prev_permutation.h
index 58da606d07f7..952932b72b2d 100644
--- a/libcxx/include/__algorithm/ranges_prev_permutation.h
+++ b/libcxx/include/__algorithm/ranges_prev_permutation.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_PREV_PERMUTATION_H
-#define _LIBCPP___ALGORITHM_RANGES_PREV_PERMUTATION_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_PREV_PERMUTATION_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_PREV_PERMUTATION_H
 
 #include <__algorithm/in_found_result.h>
 #include <__algorithm/iterator_operations.h>
@@ -23,13 +23,13 @@
 #include <__ranges/dangling.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 
@@ -43,7 +43,7 @@ struct __fn {
   template <bidirectional_iterator _Iter, sentinel_for<_Iter> _Sent,
             class _Comp = ranges::less, class _Proj = identity>
     requires sortable<_Iter, _Comp, _Proj>
-  _LIBCPP_HIDE_FROM_ABI constexpr prev_permutation_result<_Iter>
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr prev_permutation_result<_Iter>
   operator()(_Iter __first, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const {
     auto __result = std::__prev_permutation<_RangeAlgPolicy>(
         std::move(__first), std::move(__last), std::__make_projected(__comp, __proj));
@@ -53,7 +53,7 @@ struct __fn {
   template <bidirectional_range _Range,
             class _Comp = ranges::less, class _Proj = identity>
     requires sortable<iterator_t<_Range>, _Comp, _Proj>
-  _LIBCPP_HIDE_FROM_ABI constexpr prev_permutation_result<borrowed_iterator_t<_Range>>
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr prev_permutation_result<borrowed_iterator_t<_Range>>
   operator()(_Range&& __range, _Comp __comp = {}, _Proj __proj = {}) const {
     auto __result = std::__prev_permutation<_RangeAlgPolicy>(
         ranges::begin(__range), ranges::end(__range), std::__make_projected(__comp, __proj));
@@ -69,8 +69,8 @@ constexpr inline auto prev_permutation = __prev_permutation::__fn{};
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_PREV_PERMUTATION_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_PREV_PERMUTATION_H

diff  --git a/libcxx/include/__algorithm/ranges_push_heap.h b/libcxx/include/__algorithm/ranges_push_heap.h
index 3436b39e12cc..e946c0970de4 100644
--- a/libcxx/include/__algorithm/ranges_push_heap.h
+++ b/libcxx/include/__algorithm/ranges_push_heap.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_PUSH_HEAP_H
-#define _LIBCPP___ALGORITHM_RANGES_PUSH_HEAP_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_PUSH_HEAP_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_PUSH_HEAP_H
 
 #include <__algorithm/iterator_operations.h>
 #include <__algorithm/make_projected.h>
@@ -28,20 +28,20 @@
 #include <__utility/forward.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 namespace __push_heap {
 
 struct __fn {
   template <class _Iter, class _Sent, class _Comp, class _Proj>
-  _LIBCPP_HIDE_FROM_ABI constexpr static
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr static
   _Iter __push_heap_fn_impl(_Iter __first, _Sent __last, _Comp& __comp, _Proj& __proj) {
     auto __last_iter = ranges::next(__first, __last);
 
@@ -53,14 +53,14 @@ struct __fn {
 
   template <random_access_iterator _Iter, sentinel_for<_Iter> _Sent, class _Comp = ranges::less, class _Proj = identity>
     requires sortable<_Iter, _Comp, _Proj>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   _Iter operator()(_Iter __first, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const {
     return __push_heap_fn_impl(std::move(__first), std::move(__last), __comp, __proj);
   }
 
   template <random_access_range _Range, class _Comp = ranges::less, class _Proj = identity>
     requires sortable<iterator_t<_Range>, _Comp, _Proj>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   borrowed_iterator_t<_Range> operator()(_Range&& __r, _Comp __comp = {}, _Proj __proj = {}) const {
     return __push_heap_fn_impl(ranges::begin(__r), ranges::end(__r), __comp, __proj);
   }
@@ -73,8 +73,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_PUSH_HEAP_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_PUSH_HEAP_H

diff  --git a/libcxx/include/__algorithm/ranges_remove.h b/libcxx/include/__algorithm/ranges_remove.h
index a6a1200763d2..fdfd41b03ca8 100644
--- a/libcxx/include/__algorithm/ranges_remove.h
+++ b/libcxx/include/__algorithm/ranges_remove.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_REMOVE_H
-#define _LIBCPP___ALGORITHM_RANGES_REMOVE_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_REMOVE_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_REMOVE_H
 #include <__config>
 
 #include <__algorithm/ranges_remove_if.h>
@@ -21,13 +21,13 @@
 #include <__ranges/subrange.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 namespace __remove {
@@ -35,7 +35,7 @@ struct __fn {
 
   template <permutable _Iter, sentinel_for<_Iter> _Sent, class _Type, class _Proj = identity>
     requires indirect_binary_predicate<ranges::equal_to, projected<_Iter, _Proj>, const _Type*>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   subrange<_Iter> operator()(_Iter __first, _Sent __last, const _Type& __value, _Proj __proj = {}) const {
     auto __pred = [&](auto&& __other) { return __value == __other; };
     return ranges::__remove_if_impl(std::move(__first), std::move(__last), __pred, __proj);
@@ -44,7 +44,7 @@ struct __fn {
   template <forward_range _Range, class _Type, class _Proj = identity>
     requires permutable<iterator_t<_Range>>
           && indirect_binary_predicate<ranges::equal_to, projected<iterator_t<_Range>, _Proj>, const _Type*>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   borrowed_subrange_t<_Range> operator()(_Range&& __range, const _Type& __value, _Proj __proj = {}) const {
     auto __pred = [&](auto&& __other) { return __value == __other; };
     return ranges::__remove_if_impl(ranges::begin(__range), ranges::end(__range), __pred, __proj);
@@ -57,8 +57,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_REMOVE_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_REMOVE_H

diff  --git a/libcxx/include/__algorithm/ranges_remove_copy.h b/libcxx/include/__algorithm/ranges_remove_copy.h
index a8144ce0ecbf..838f7ac2cd3f 100644
--- a/libcxx/include/__algorithm/ranges_remove_copy.h
+++ b/libcxx/include/__algorithm/ranges_remove_copy.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_REMOVE_COPY_H
-#define _LIBCPP___ALGORITHM_RANGES_REMOVE_COPY_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_REMOVE_COPY_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_REMOVE_COPY_H
 
 #include <__algorithm/in_out_result.h>
 #include <__algorithm/ranges_remove_copy_if.h>
@@ -22,13 +22,13 @@
 #include <__ranges/dangling.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 
@@ -45,7 +45,7 @@ namespace __remove_copy {
               class _Proj = identity>
       requires indirectly_copyable<_InIter, _OutIter> &&
                indirect_binary_predicate<ranges::equal_to, projected<_InIter, _Proj>, const _Type*>
-    _LIBCPP_HIDE_FROM_ABI constexpr remove_copy_result<_InIter, _OutIter>
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr remove_copy_result<_InIter, _OutIter>
     operator()(_InIter __first, _Sent __last, _OutIter __result, const _Type& __value, _Proj __proj = {}) const {
       auto __pred = [&](auto&& __val) { return __value == __val; };
       return ranges::__remove_copy_if_impl(std::move(__first), std::move(__last), std::move(__result), __pred, __proj);
@@ -54,7 +54,7 @@ namespace __remove_copy {
     template <input_range _Range, weakly_incrementable _OutIter, class _Type, class _Proj = identity>
       requires indirectly_copyable<iterator_t<_Range>, _OutIter> &&
                indirect_binary_predicate<ranges::equal_to, projected<iterator_t<_Range>, _Proj>, const _Type*>
-    _LIBCPP_HIDE_FROM_ABI constexpr remove_copy_result<borrowed_iterator_t<_Range>, _OutIter>
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr remove_copy_result<borrowed_iterator_t<_Range>, _OutIter>
     operator()(_Range&& __range, _OutIter __result, const _Type& __value, _Proj __proj = {}) const {
       auto __pred = [&](auto&& __val) { return __value == __val; };
       return ranges::__remove_copy_if_impl(
@@ -69,8 +69,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_REMOVE_COPY_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_REMOVE_COPY_H

diff  --git a/libcxx/include/__algorithm/ranges_remove_copy_if.h b/libcxx/include/__algorithm/ranges_remove_copy_if.h
index 3f56693fa1f2..c0a216061188 100644
--- a/libcxx/include/__algorithm/ranges_remove_copy_if.h
+++ b/libcxx/include/__algorithm/ranges_remove_copy_if.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_REMOVE_COPY_IF_H
-#define _LIBCPP___ALGORITHM_RANGES_REMOVE_COPY_IF_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_REMOVE_COPY_IF_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_REMOVE_COPY_IF_H
 
 #include <__algorithm/in_out_result.h>
 #include <__algorithm/make_projected.h>
@@ -25,13 +25,13 @@
 #include <__utility/forward.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 
@@ -39,7 +39,7 @@ template <class _InIter, class _OutIter>
 using remove_copy_if_result = in_out_result<_InIter, _OutIter>;
 
 template <class _InIter, class _Sent, class _OutIter, class _Proj, class _Pred>
-_LIBCPP_HIDE_FROM_ABI constexpr in_out_result<_InIter, _OutIter>
+_LIBCUDACXX_HIDE_FROM_ABI constexpr in_out_result<_InIter, _OutIter>
 __remove_copy_if_impl(_InIter __first, _Sent __last, _OutIter __result, _Pred& __pred, _Proj& __proj) {
   for (; __first != __last; ++__first) {
     if (!std::invoke(__pred, std::invoke(__proj, *__first))) {
@@ -59,7 +59,7 @@ namespace __remove_copy_if {
               class _Proj = identity,
               indirect_unary_predicate<projected<_InIter, _Proj>> _Pred>
       requires indirectly_copyable<_InIter, _OutIter>
-    _LIBCPP_HIDE_FROM_ABI constexpr remove_copy_if_result<_InIter, _OutIter>
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr remove_copy_if_result<_InIter, _OutIter>
     operator()(_InIter __first, _Sent __last, _OutIter __result, _Pred __pred, _Proj __proj = {}) const {
       return ranges::__remove_copy_if_impl(std::move(__first), std::move(__last), std::move(__result), __pred, __proj);
     }
@@ -69,7 +69,7 @@ namespace __remove_copy_if {
               class _Proj = identity,
               indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred>
       requires indirectly_copyable<iterator_t<_Range>, _OutIter>
-    _LIBCPP_HIDE_FROM_ABI constexpr remove_copy_if_result<borrowed_iterator_t<_Range>, _OutIter>
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr remove_copy_if_result<borrowed_iterator_t<_Range>, _OutIter>
     operator()(_Range&& __range, _OutIter __result, _Pred __pred, _Proj __proj = {}) const {
       return ranges::__remove_copy_if_impl(
           ranges::begin(__range), ranges::end(__range), std::move(__result), __pred, __proj);
@@ -83,8 +83,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_REMOVE_COPY_IF_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_REMOVE_COPY_IF_H

diff  --git a/libcxx/include/__algorithm/ranges_remove_if.h b/libcxx/include/__algorithm/ranges_remove_if.h
index d4e382e551c6..dac600a94772 100644
--- a/libcxx/include/__algorithm/ranges_remove_if.h
+++ b/libcxx/include/__algorithm/ranges_remove_if.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_REMOVE_IF_H
-#define _LIBCPP___ALGORITHM_RANGES_REMOVE_IF_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_REMOVE_IF_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_REMOVE_IF_H
 #include <__config>
 
 #include <__algorithm/ranges_find_if.h>
@@ -23,18 +23,18 @@
 #include <__ranges/subrange.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 
 template <class _Iter, class _Sent, class _Proj, class _Pred>
-_LIBCPP_HIDE_FROM_ABI constexpr
+_LIBCUDACXX_HIDE_FROM_ABI constexpr
 subrange<_Iter> __remove_if_impl(_Iter __first, _Sent __last, _Pred& __pred, _Proj& __proj) {
   auto __new_end = ranges::__find_if_impl(__first, __last, __pred, __proj);
   if (__new_end == __last)
@@ -56,7 +56,7 @@ struct __fn {
   template <permutable _Iter, sentinel_for<_Iter> _Sent,
             class _Proj = identity,
             indirect_unary_predicate<projected<_Iter, _Proj>> _Pred>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   subrange<_Iter> operator()(_Iter __first, _Sent __last, _Pred __pred, _Proj __proj = {}) const {
     return ranges::__remove_if_impl(std::move(__first), std::move(__last), __pred, __proj);
   }
@@ -65,7 +65,7 @@ struct __fn {
             class _Proj = identity,
             indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred>
     requires permutable<iterator_t<_Range>>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   borrowed_subrange_t<_Range> operator()(_Range&& __range, _Pred __pred, _Proj __proj = {}) const {
     return ranges::__remove_if_impl(ranges::begin(__range), ranges::end(__range), __pred, __proj);
   }
@@ -78,8 +78,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_REMOVE_IF_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_REMOVE_IF_H

diff  --git a/libcxx/include/__algorithm/ranges_replace.h b/libcxx/include/__algorithm/ranges_replace.h
index 5e74c3ff80cb..4f8c6ff4c21e 100644
--- a/libcxx/include/__algorithm/ranges_replace.h
+++ b/libcxx/include/__algorithm/ranges_replace.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_REPLACE_H
-#define _LIBCPP___ALGORITHM_RANGES_REPLACE_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_REPLACE_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_REPLACE_H
 
 #include <__algorithm/ranges_replace_if.h>
 #include <__config>
@@ -20,13 +20,13 @@
 #include <__ranges/dangling.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined (_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined (_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 namespace __replace {
@@ -38,7 +38,7 @@ struct __fn {
             class _Proj = identity>
     requires indirectly_writable<_Iter, const _Type2&>
           && indirect_binary_predicate<ranges::equal_to, projected<_Iter, _Proj>, const _Type1*>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   _Iter operator()(_Iter __first, _Sent __last,
                    const _Type1& __old_value,
                    const _Type2& __new_value,
@@ -53,7 +53,7 @@ struct __fn {
             class _Proj = identity>
     requires indirectly_writable<iterator_t<_Range>, const _Type2&>
           && indirect_binary_predicate<ranges::equal_to, projected<iterator_t<_Range>, _Proj>, const _Type1*>
-  _LIBCPP_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Range>
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Range>
   operator()(_Range&& __range, const _Type1& __old_value, const _Type2& __new_value, _Proj __proj = {}) const {
     auto __pred = [&](auto&& __val) { return __val == __old_value; };
     return ranges::__replace_if_impl(ranges::begin(__range), ranges::end(__range), __pred, __new_value, __proj);
@@ -67,8 +67,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined (_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined (_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_REPLACE_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_REPLACE_H

diff  --git a/libcxx/include/__algorithm/ranges_replace_copy.h b/libcxx/include/__algorithm/ranges_replace_copy.h
index 7d59dbe7dbed..630800253c4a 100644
--- a/libcxx/include/__algorithm/ranges_replace_copy.h
+++ b/libcxx/include/__algorithm/ranges_replace_copy.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_REPLACE_COPY_H
-#define _LIBCPP___ALGORITHM_RANGES_REPLACE_COPY_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_REPLACE_COPY_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_REPLACE_COPY_H
 
 #include <__algorithm/in_out_result.h>
 #include <__algorithm/ranges_replace_copy_if.h>
@@ -22,13 +22,13 @@
 #include <__ranges/dangling.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 
@@ -46,7 +46,7 @@ namespace __replace_copy {
               class _Proj = identity>
       requires indirectly_copyable<_InIter, _OutIter> &&
                indirect_binary_predicate<ranges::equal_to, projected<_InIter, _Proj>, const _OldType*>
-    _LIBCPP_HIDE_FROM_ABI constexpr replace_copy_result<_InIter, _OutIter>
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr replace_copy_result<_InIter, _OutIter>
     operator()(_InIter __first,
                _Sent __last,
                _OutIter __result,
@@ -65,7 +65,7 @@ namespace __replace_copy {
               class _Proj = identity>
       requires indirectly_copyable<iterator_t<_Range>, _OutIter> &&
                indirect_binary_predicate<ranges::equal_to, projected<iterator_t<_Range>, _Proj>, const _OldType*>
-    _LIBCPP_HIDE_FROM_ABI constexpr replace_copy_result<borrowed_iterator_t<_Range>, _OutIter>
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr replace_copy_result<borrowed_iterator_t<_Range>, _OutIter>
     operator()(_Range&& __range,
                _OutIter __result,
                const _OldType& __old_value,
@@ -84,8 +84,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_REPLACE_COPY_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_REPLACE_COPY_H

diff  --git a/libcxx/include/__algorithm/ranges_replace_copy_if.h b/libcxx/include/__algorithm/ranges_replace_copy_if.h
index 7602e8a14487..6532ff2fc30c 100644
--- a/libcxx/include/__algorithm/ranges_replace_copy_if.h
+++ b/libcxx/include/__algorithm/ranges_replace_copy_if.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_REPLACE_COPY_IF_H
-#define _LIBCPP___ALGORITHM_RANGES_REPLACE_COPY_IF_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_REPLACE_COPY_IF_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_REPLACE_COPY_IF_H
 
 #include <__algorithm/in_out_result.h>
 #include <__config>
@@ -20,13 +20,13 @@
 #include <__ranges/dangling.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 
@@ -34,7 +34,7 @@ template <class _InIter, class _OutIter>
 using replace_copy_if_result = in_out_result<_InIter, _OutIter>;
 
 template <class _InIter, class _Sent, class _OutIter, class _Pred, class _Type, class _Proj>
-_LIBCPP_HIDE_FROM_ABI constexpr replace_copy_if_result<_InIter, _OutIter> __replace_copy_if_impl(
+_LIBCUDACXX_HIDE_FROM_ABI constexpr replace_copy_if_result<_InIter, _OutIter> __replace_copy_if_impl(
     _InIter __first, _Sent __last, _OutIter __result, _Pred& __pred, const _Type& __new_value, _Proj& __proj) {
   while (__first != __last) {
     if (std::invoke(__pred, std::invoke(__proj, *__first)))
@@ -59,7 +59,7 @@ namespace __replace_copy_if {
               class _Proj = identity,
               indirect_unary_predicate<projected<_InIter, _Proj>> _Pred>
       requires indirectly_copyable<_InIter, _OutIter>
-    _LIBCPP_HIDE_FROM_ABI constexpr replace_copy_if_result<_InIter, _OutIter> operator()(
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr replace_copy_if_result<_InIter, _OutIter> operator()(
         _InIter __first, _Sent __last, _OutIter __result, _Pred __pred, const _Type& __new_value, _Proj __proj = {})
         const {
       return ranges::__replace_copy_if_impl(
@@ -72,7 +72,7 @@ namespace __replace_copy_if {
               class _Proj = identity,
               indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred>
       requires indirectly_copyable<iterator_t<_Range>, _OutIter>
-    _LIBCPP_HIDE_FROM_ABI constexpr replace_copy_if_result<borrowed_iterator_t<_Range>, _OutIter>
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr replace_copy_if_result<borrowed_iterator_t<_Range>, _OutIter>
     operator()(_Range&& __range, _OutIter __result, _Pred __pred, const _Type& __new_value, _Proj __proj = {}) const {
       return ranges::__replace_copy_if_impl(
           ranges::begin(__range), ranges::end(__range), std::move(__result), __pred, __new_value, __proj);
@@ -86,8 +86,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_REPLACE_COPY_IF_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_REPLACE_COPY_IF_H

diff  --git a/libcxx/include/__algorithm/ranges_replace_if.h b/libcxx/include/__algorithm/ranges_replace_if.h
index 0f9555fc35c2..a2f910383c31 100644
--- a/libcxx/include/__algorithm/ranges_replace_if.h
+++ b/libcxx/include/__algorithm/ranges_replace_if.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_REPLACE_IF_H
-#define _LIBCPP___ALGORITHM_RANGES_REPLACE_IF_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_REPLACE_IF_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_REPLACE_IF_H
 
 #include <__config>
 #include <__functional/identity.h>
@@ -19,18 +19,18 @@
 #include <__ranges/dangling.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined (_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined (_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 
 template <class _Iter, class _Sent, class _Type, class _Proj, class _Pred>
-_LIBCPP_HIDE_FROM_ABI constexpr
+_LIBCUDACXX_HIDE_FROM_ABI constexpr
 _Iter __replace_if_impl(_Iter __first, _Sent __last, _Pred& __pred, const _Type& __new_value, _Proj& __proj) {
   for (; __first != __last; ++__first) {
     if (std::invoke(__pred, std::invoke(__proj, *__first)))
@@ -47,7 +47,7 @@ struct __fn {
             class _Proj = identity,
             indirect_unary_predicate<projected<_Iter, _Proj>> _Pred>
     requires indirectly_writable<_Iter, const _Type&>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   _Iter operator()(_Iter __first, _Sent __last, _Pred __pred, const _Type& __new_value, _Proj __proj = {}) const {
     return ranges::__replace_if_impl(std::move(__first), std::move(__last), __pred, __new_value, __proj);
   }
@@ -57,7 +57,7 @@ struct __fn {
             class _Proj = identity,
             indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred>
     requires indirectly_writable<iterator_t<_Range>, const _Type&>
-  _LIBCPP_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Range>
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Range>
   operator()(_Range&& __range, _Pred __pred, const _Type& __new_value, _Proj __proj = {}) const {
     return ranges::__replace_if_impl(ranges::begin(__range), ranges::end(__range), __pred, __new_value, __proj);
   }
@@ -70,8 +70,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined (_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined (_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_REPLACE_IF_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_REPLACE_IF_H

diff  --git a/libcxx/include/__algorithm/ranges_reverse.h b/libcxx/include/__algorithm/ranges_reverse.h
index e7555d0f9acd..61ad15b99ef2 100644
--- a/libcxx/include/__algorithm/ranges_reverse.h
+++ b/libcxx/include/__algorithm/ranges_reverse.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_REVERSE_H
-#define _LIBCPP___ALGORITHM_RANGES_REVERSE_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_REVERSE_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_REVERSE_H
 
 #include <__config>
 #include <__iterator/concepts.h>
@@ -18,13 +18,13 @@
 #include <__ranges/concepts.h>
 #include <__ranges/dangling.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 namespace __reverse {
@@ -32,7 +32,7 @@ struct __fn {
 
   template <bidirectional_iterator _Iter, sentinel_for<_Iter> _Sent>
     requires permutable<_Iter>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   _Iter operator()(_Iter __first, _Sent __last) const {
     if constexpr (random_access_iterator<_Iter>) {
       if (__first == __last)
@@ -63,7 +63,7 @@ struct __fn {
 
   template <bidirectional_range _Range>
     requires permutable<iterator_t<_Range>>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   borrowed_iterator_t<_Range> operator()(_Range&& __range) const {
     return (*this)(ranges::begin(__range), ranges::end(__range));
   }
@@ -76,8 +76,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_REVERSE_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_REVERSE_H

diff  --git a/libcxx/include/__algorithm/ranges_reverse_copy.h b/libcxx/include/__algorithm/ranges_reverse_copy.h
index e2da9b484aaf..3459038043ab 100644
--- a/libcxx/include/__algorithm/ranges_reverse_copy.h
+++ b/libcxx/include/__algorithm/ranges_reverse_copy.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_REVERSE_COPY_H
-#define _LIBCPP___ALGORITHM_RANGES_REVERSE_COPY_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_REVERSE_COPY_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_REVERSE_COPY_H
 
 #include <__algorithm/in_out_result.h>
 #include <__algorithm/ranges_copy.h>
@@ -21,13 +21,13 @@
 #include <__ranges/subrange.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 
@@ -39,14 +39,14 @@ struct __fn {
 
   template <bidirectional_iterator _InIter, sentinel_for<_InIter> _Sent, weakly_incrementable _OutIter>
     requires indirectly_copyable<_InIter, _OutIter>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   reverse_copy_result<_InIter, _OutIter> operator()(_InIter __first, _Sent __last, _OutIter __result) const {
     return (*this)(subrange(std::move(__first), std::move(__last)), std::move(__result));
   }
 
   template <bidirectional_range _Range, weakly_incrementable _OutIter>
     requires indirectly_copyable<iterator_t<_Range>, _OutIter>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   reverse_copy_result<borrowed_iterator_t<_Range>, _OutIter> operator()(_Range&& __range, _OutIter __result) const {
     auto __ret = ranges::copy(std::__reverse_range(__range), std::move(__result));
     return {ranges::next(ranges::begin(__range), ranges::end(__range)), std::move(__ret.out)};
@@ -60,8 +60,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_REVERSE_COPY_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_REVERSE_COPY_H

diff  --git a/libcxx/include/__algorithm/ranges_rotate.h b/libcxx/include/__algorithm/ranges_rotate.h
index 1cd69a141fe3..18aefa15c120 100644
--- a/libcxx/include/__algorithm/ranges_rotate.h
+++ b/libcxx/include/__algorithm/ranges_rotate.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_ROTATE_H
-#define _LIBCPP___ALGORITHM_RANGES_ROTATE_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_ROTATE_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_ROTATE_H
 
 #include <__algorithm/iterator_operations.h>
 #include <__algorithm/ranges_iterator_concept.h>
@@ -21,13 +21,13 @@
 #include <__ranges/subrange.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 namespace __rotate {
@@ -35,7 +35,7 @@ namespace __rotate {
 struct __fn {
 
   template <class _Iter, class _Sent>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   static subrange<_Iter> __rotate_fn_impl(_Iter __first, _Iter __middle, _Sent __last) {
     auto __ret = std::__rotate<_RangeAlgPolicy>(
       std::move(__first), std::move(__middle), std::move(__last));
@@ -43,14 +43,14 @@ struct __fn {
   }
 
   template <permutable _Iter, sentinel_for<_Iter> _Sent>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   subrange<_Iter> operator()(_Iter __first, _Iter __middle, _Sent __last) const {
     return __rotate_fn_impl(std::move(__first), std::move(__middle), std::move(__last));
   }
 
   template <forward_range _Range>
   requires permutable<iterator_t<_Range>>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   borrowed_subrange_t<_Range> operator()(_Range&& __range, iterator_t<_Range> __middle) const {
     return __rotate_fn_impl(ranges::begin(__range), std::move(__middle), ranges::end(__range));
   }
@@ -64,8 +64,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_ROTATE_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_ROTATE_H

diff  --git a/libcxx/include/__algorithm/ranges_rotate_copy.h b/libcxx/include/__algorithm/ranges_rotate_copy.h
index d7a282c86750..7eb02c1b9dff 100644
--- a/libcxx/include/__algorithm/ranges_rotate_copy.h
+++ b/libcxx/include/__algorithm/ranges_rotate_copy.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_ROTATE_COPY_H
-#define _LIBCPP___ALGORITHM_RANGES_ROTATE_COPY_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_ROTATE_COPY_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_ROTATE_COPY_H
 
 #include <__algorithm/in_out_result.h>
 #include <__algorithm/ranges_copy.h>
@@ -19,13 +19,13 @@
 #include <__ranges/dangling.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 
@@ -37,7 +37,7 @@ struct __fn {
 
   template <bidirectional_iterator _InIter, sentinel_for<_InIter> _Sent, weakly_incrementable _OutIter>
     requires indirectly_copyable<_InIter, _OutIter>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   rotate_copy_result<_InIter, _OutIter>
   operator()(_InIter __first, _InIter __middle, _Sent __last, _OutIter __result) const {
     auto __res1 = ranges::copy(__middle, __last, std::move(__result));
@@ -47,7 +47,7 @@ struct __fn {
 
   template <bidirectional_range _Range, weakly_incrementable _OutIter>
     requires indirectly_copyable<iterator_t<_Range>, _OutIter>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   rotate_copy_result<borrowed_iterator_t<_Range>, _OutIter>
   operator()(_Range&& __range, iterator_t<_Range> __middle, _OutIter __result) const {
     return (*this)(ranges::begin(__range), std::move(__middle), ranges::end(__range), std::move(__result));
@@ -61,8 +61,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_ROTATE_COPY_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_ROTATE_COPY_H

diff  --git a/libcxx/include/__algorithm/ranges_sample.h b/libcxx/include/__algorithm/ranges_sample.h
index a8477f803788..5d1ea8350bf1 100644
--- a/libcxx/include/__algorithm/ranges_sample.h
+++ b/libcxx/include/__algorithm/ranges_sample.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_SAMPLE_H
-#define _LIBCPP___ALGORITHM_RANGES_SAMPLE_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_SAMPLE_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_SAMPLE_H
 
 #include <__algorithm/iterator_operations.h>
 #include <__algorithm/sample.h>
@@ -23,13 +23,13 @@
 #include <__utility/move.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 namespace __sample {
@@ -40,7 +40,7 @@ struct __fn {
   requires (forward_iterator<_Iter> || random_access_iterator<_OutIter>) &&
            indirectly_copyable<_Iter, _OutIter> &&
            uniform_random_bit_generator<remove_reference_t<_Gen>>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   _OutIter operator()(_Iter __first, _Sent __last,
                       _OutIter __out_first, iter_
diff erence_t<_Iter> __n, _Gen&& __gen) const {
     _ClassicGenAdaptor<_Gen> __adapted_gen(__gen);
@@ -52,7 +52,7 @@ struct __fn {
   requires (forward_range<_Range> || random_access_iterator<_OutIter>) &&
            indirectly_copyable<iterator_t<_Range>, _OutIter> &&
            uniform_random_bit_generator<remove_reference_t<_Gen>>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   _OutIter operator()(_Range&& __range, _OutIter __out_first, range_
diff erence_t<_Range> __n, _Gen&& __gen) const {
     return (*this)(ranges::begin(__range), ranges::end(__range),
                    std::move(__out_first), __n, std::forward<_Gen>(__gen));
@@ -67,8 +67,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_SAMPLE_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_SAMPLE_H

diff  --git a/libcxx/include/__algorithm/ranges_search.h b/libcxx/include/__algorithm/ranges_search.h
index 0564bbe1f8b3..f75a90f4d858 100644
--- a/libcxx/include/__algorithm/ranges_search.h
+++ b/libcxx/include/__algorithm/ranges_search.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_SEARCH_H
-#define _LIBCPP___ALGORITHM_RANGES_SEARCH_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_SEARCH_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_SEARCH_H
 
 #include <__algorithm/iterator_operations.h>
 #include <__algorithm/search.h>
@@ -23,19 +23,19 @@
 #include <__ranges/size.h>
 #include <__ranges/subrange.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 namespace __search {
 struct __fn {
   template <class _Iter1, class _Sent1, class _Iter2, class _Sent2, class _Pred, class _Proj1, class _Proj2>
-  _LIBCPP_HIDE_FROM_ABI static constexpr subrange<_Iter1> __ranges_search_impl(
+  _LIBCUDACXX_HIDE_FROM_ABI static constexpr subrange<_Iter1> __ranges_search_impl(
       _Iter1 __first1,
       _Sent1 __last1,
       _Iter2 __first2,
@@ -74,7 +74,7 @@ struct __fn {
             class _Proj1 = identity,
             class _Proj2 = identity>
     requires indirectly_comparable<_Iter1, _Iter2, _Pred, _Proj1, _Proj2>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   subrange<_Iter1> operator()(_Iter1 __first1, _Sent1 __last1,
                               _Iter2 __first2, _Sent2 __last2,
                               _Pred __pred = {},
@@ -89,7 +89,7 @@ struct __fn {
             class _Proj1 = identity,
             class _Proj2 = identity>
     requires indirectly_comparable<iterator_t<_Range1>, iterator_t<_Range2>, _Pred, _Proj1, _Proj2>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   borrowed_subrange_t<_Range1> operator()(_Range1&& __range1,
                                           _Range2&& __range2,
                                           _Pred __pred = {},
@@ -127,8 +127,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_SEARCH_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_SEARCH_H

diff  --git a/libcxx/include/__algorithm/ranges_search_n.h b/libcxx/include/__algorithm/ranges_search_n.h
index 29fdbfb1c725..b139184b2c1c 100644
--- a/libcxx/include/__algorithm/ranges_search_n.h
+++ b/libcxx/include/__algorithm/ranges_search_n.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_SEARCH_N_H
-#define _LIBCPP___ALGORITHM_RANGES_SEARCH_N_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_SEARCH_N_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_SEARCH_N_H
 
 #include <__algorithm/iterator_operations.h>
 #include <__algorithm/search_n.h>
@@ -26,20 +26,20 @@
 #include <__ranges/subrange.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 namespace __search_n {
 struct __fn {
 
   template <class _Iter1, class _Sent1, class _SizeT, class _Type, class _Pred, class _Proj>
-  _LIBCPP_HIDE_FROM_ABI static constexpr subrange<_Iter1> __ranges_search_n_impl(
+  _LIBCUDACXX_HIDE_FROM_ABI static constexpr subrange<_Iter1> __ranges_search_n_impl(
       _Iter1 __first, _Sent1 __last, _SizeT __count, const _Type& __value, _Pred& __pred, _Proj& __proj) {
     if (__count == 0)
       return {__first, __first};
@@ -75,7 +75,7 @@ struct __fn {
             class _Pred = ranges::equal_to,
             class _Proj = identity>
     requires indirectly_comparable<_Iter, const _Type*, _Pred, _Proj>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   subrange<_Iter> operator()(_Iter __first, _Sent __last,
                              iter_
diff erence_t<_Iter> __count,
                              const _Type& __value,
@@ -86,7 +86,7 @@ struct __fn {
 
   template <forward_range _Range, class _Type, class _Pred = ranges::equal_to, class _Proj = identity>
     requires indirectly_comparable<iterator_t<_Range>, const _Type*, _Pred, _Proj>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   borrowed_subrange_t<_Range> operator()(_Range&& __range,
                                          range_
diff erence_t<_Range> __count,
                                          const _Type& __value,
@@ -113,8 +113,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_SEARCH_N_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_SEARCH_N_H

diff  --git a/libcxx/include/__algorithm/ranges_set_
diff erence.h b/libcxx/include/__algorithm/ranges_set_
diff erence.h
index 4eb3efad3895..7a6c36a90714 100644
--- a/libcxx/include/__algorithm/ranges_set_
diff erence.h
+++ b/libcxx/include/__algorithm/ranges_set_
diff erence.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_SET_DIFFERENCE_H
-#define _LIBCPP___ALGORITHM_RANGES_SET_DIFFERENCE_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_SET_DIFFERENCE_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_SET_DIFFERENCE_H
 
 #include <__algorithm/in_out_result.h>
 #include <__algorithm/make_projected.h>
@@ -24,13 +24,13 @@
 #include <__type_traits/decay.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 
@@ -50,7 +50,7 @@ struct __fn {
       class _Proj1 = identity,
       class _Proj2 = identity>
     requires mergeable<_InIter1, _InIter2, _OutIter, _Comp, _Proj1, _Proj2>
-  _LIBCPP_HIDE_FROM_ABI constexpr set_
diff erence_result<_InIter1, _OutIter> operator()(
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr set_
diff erence_result<_InIter1, _OutIter> operator()(
       _InIter1 __first1,
       _Sent1 __last1,
       _InIter2 __first2,
@@ -72,7 +72,7 @@ struct __fn {
       class _Proj1 = identity,
       class _Proj2 = identity>
     requires mergeable<iterator_t<_Range1>, iterator_t<_Range2>, _OutIter, _Comp, _Proj1, _Proj2> 
-  _LIBCPP_HIDE_FROM_ABI constexpr set_
diff erence_result<borrowed_iterator_t<_Range1>, _OutIter>
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr set_
diff erence_result<borrowed_iterator_t<_Range1>, _OutIter>
     operator()(
         _Range1&& __range1,
         _Range2&& __range2,
@@ -98,7 +98,7 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
-#endif // _LIBCPP___ALGORITHM_RANGES_SET_DIFFERENCE_H
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_SET_DIFFERENCE_H

diff  --git a/libcxx/include/__algorithm/ranges_set_intersection.h b/libcxx/include/__algorithm/ranges_set_intersection.h
index 05af91ae29e5..8fb64dad4e23 100644
--- a/libcxx/include/__algorithm/ranges_set_intersection.h
+++ b/libcxx/include/__algorithm/ranges_set_intersection.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_SET_INTERSECTION_H
-#define _LIBCPP___ALGORITHM_RANGES_SET_INTERSECTION_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_SET_INTERSECTION_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_SET_INTERSECTION_H
 
 #include <__algorithm/in_in_out_result.h>
 #include <__algorithm/iterator_operations.h>
@@ -24,13 +24,13 @@
 #include <__ranges/dangling.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 
@@ -50,7 +50,7 @@ struct __fn {
       class _Proj1 = identity,
       class _Proj2 = identity>
     requires mergeable<_InIter1, _InIter2, _OutIter, _Comp, _Proj1, _Proj2>
-  _LIBCPP_HIDE_FROM_ABI constexpr set_intersection_result<_InIter1, _InIter2, _OutIter> operator()(
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr set_intersection_result<_InIter1, _InIter2, _OutIter> operator()(
       _InIter1 __first1,
       _Sent1 __last1,
       _InIter2 __first2,
@@ -83,7 +83,7 @@ struct __fn {
         _Comp,
         _Proj1,
         _Proj2> 
-    _LIBCPP_HIDE_FROM_ABI constexpr set_intersection_result<borrowed_iterator_t<_Range1>,
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr set_intersection_result<borrowed_iterator_t<_Range1>,
                                                             borrowed_iterator_t<_Range2>,
                                                             _OutIter>
     operator()(
@@ -111,7 +111,7 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
-#endif // _LIBCPP___ALGORITHM_RANGES_SET_INTERSECTION_H
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_SET_INTERSECTION_H

diff  --git a/libcxx/include/__algorithm/ranges_set_symmetric_
diff erence.h b/libcxx/include/__algorithm/ranges_set_symmetric_
diff erence.h
index c54cf3a65112..aca7c1d90ae9 100644
--- a/libcxx/include/__algorithm/ranges_set_symmetric_
diff erence.h
+++ b/libcxx/include/__algorithm/ranges_set_symmetric_
diff erence.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_SET_SYMMETRIC_DIFFERENCE_H
-#define _LIBCPP___ALGORITHM_RANGES_SET_SYMMETRIC_DIFFERENCE_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_SET_SYMMETRIC_DIFFERENCE_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_SET_SYMMETRIC_DIFFERENCE_H
 
 #include <__algorithm/in_in_out_result.h>
 #include <__algorithm/make_projected.h>
@@ -23,13 +23,13 @@
 #include <__ranges/dangling.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 
@@ -49,7 +49,7 @@ struct __fn {
       class _Proj1 = identity,
       class _Proj2 = identity>
     requires mergeable<_InIter1, _InIter2, _OutIter, _Comp, _Proj1, _Proj2>
-  _LIBCPP_HIDE_FROM_ABI constexpr set_symmetric_
diff erence_result<_InIter1, _InIter2, _OutIter> operator()(
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr set_symmetric_
diff erence_result<_InIter1, _InIter2, _OutIter> operator()(
       _InIter1 __first1,
       _Sent1 __last1,
       _InIter2 __first2,
@@ -82,7 +82,7 @@ struct __fn {
         _Comp,
         _Proj1,
         _Proj2> 
-  _LIBCPP_HIDE_FROM_ABI constexpr set_symmetric_
diff erence_result<borrowed_iterator_t<_Range1>,
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr set_symmetric_
diff erence_result<borrowed_iterator_t<_Range1>,
                                                                   borrowed_iterator_t<_Range2>,
                                                                   _OutIter>
     operator()(
@@ -110,7 +110,7 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
-#endif // _LIBCPP___ALGORITHM_RANGES_SET_SYMMETRIC_DIFFERENCE_H
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_SET_SYMMETRIC_DIFFERENCE_H

diff  --git a/libcxx/include/__algorithm/ranges_set_union.h b/libcxx/include/__algorithm/ranges_set_union.h
index 3826e55688f7..f0989cff7140 100644
--- a/libcxx/include/__algorithm/ranges_set_union.h
+++ b/libcxx/include/__algorithm/ranges_set_union.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_SET_UNION_H
-#define _LIBCPP___ALGORITHM_RANGES_SET_UNION_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_SET_UNION_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_SET_UNION_H
 
 #include <__algorithm/in_in_out_result.h>
 #include <__algorithm/make_projected.h>
@@ -26,13 +26,13 @@
 #include <__utility/forward.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 
@@ -52,7 +52,7 @@ struct __fn {
       class _Proj1 = identity,
       class _Proj2 = identity>
     requires mergeable<_InIter1, _InIter2, _OutIter, _Comp, _Proj1, _Proj2>
-  _LIBCPP_HIDE_FROM_ABI constexpr set_union_result<_InIter1, _InIter2, _OutIter> operator()(
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr set_union_result<_InIter1, _InIter2, _OutIter> operator()(
       _InIter1 __first1,
       _Sent1 __last1,
       _InIter2 __first2,
@@ -85,7 +85,7 @@ struct __fn {
         _Comp,
         _Proj1,
         _Proj2> 
-  _LIBCPP_HIDE_FROM_ABI constexpr set_union_result<borrowed_iterator_t<_Range1>,
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr set_union_result<borrowed_iterator_t<_Range1>,
                                                    borrowed_iterator_t<_Range2>,
                                                    _OutIter>
     operator()(
@@ -113,8 +113,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_SET_UNION_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_SET_UNION_H

diff  --git a/libcxx/include/__algorithm/ranges_shuffle.h b/libcxx/include/__algorithm/ranges_shuffle.h
index 9b7f81e489b3..9fe89d4dbdc8 100644
--- a/libcxx/include/__algorithm/ranges_shuffle.h
+++ b/libcxx/include/__algorithm/ranges_shuffle.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_SHUFFLE_H
-#define _LIBCPP___ALGORITHM_RANGES_SHUFFLE_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_SHUFFLE_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_SHUFFLE_H
 
 #include <__algorithm/iterator_operations.h>
 #include <__algorithm/shuffle.h>
@@ -27,13 +27,13 @@
 #include <__utility/move.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 namespace __shuffle {
@@ -42,7 +42,7 @@ struct __fn {
 
   template <random_access_iterator _Iter, sentinel_for<_Iter> _Sent, class _Gen>
   requires permutable<_Iter> && uniform_random_bit_generator<remove_reference_t<_Gen>>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   _Iter operator()(_Iter __first, _Sent __last, _Gen&& __gen) const {
     _ClassicGenAdaptor<_Gen> __adapted_gen(__gen);
     return std::__shuffle<_RangeAlgPolicy>(std::move(__first), std::move(__last), __adapted_gen);
@@ -50,7 +50,7 @@ struct __fn {
 
   template<random_access_range _Range, class _Gen>
   requires permutable<iterator_t<_Range>> && uniform_random_bit_generator<remove_reference_t<_Gen>>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   borrowed_iterator_t<_Range> operator()(_Range&& __range, _Gen&& __gen) const {
     return (*this)(ranges::begin(__range), ranges::end(__range), std::forward<_Gen>(__gen));
   }
@@ -64,8 +64,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_SHUFFLE_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_SHUFFLE_H

diff  --git a/libcxx/include/__algorithm/ranges_sort.h b/libcxx/include/__algorithm/ranges_sort.h
index c3f3cbff007c..6d0ec7279a50 100644
--- a/libcxx/include/__algorithm/ranges_sort.h
+++ b/libcxx/include/__algorithm/ranges_sort.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_SORT_H
-#define _LIBCPP___ALGORITHM_RANGES_SORT_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_SORT_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_SORT_H
 
 #include <__algorithm/iterator_operations.h>
 #include <__algorithm/make_projected.h>
@@ -27,20 +27,20 @@
 #include <__utility/forward.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 namespace __sort {
 
 struct __fn {
   template <class _Iter, class _Sent, class _Comp, class _Proj>
-  _LIBCPP_HIDE_FROM_ABI constexpr static
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr static
   _Iter __sort_fn_impl(_Iter __first, _Sent __last, _Comp& __comp, _Proj& __proj) {
     auto __last_iter = ranges::next(__first, __last);
 
@@ -52,14 +52,14 @@ struct __fn {
 
   template <random_access_iterator _Iter, sentinel_for<_Iter> _Sent, class _Comp = ranges::less, class _Proj = identity>
     requires sortable<_Iter, _Comp, _Proj>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   _Iter operator()(_Iter __first, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const {
     return __sort_fn_impl(std::move(__first), std::move(__last), __comp, __proj);
   }
 
   template <random_access_range _Range, class _Comp = ranges::less, class _Proj = identity>
     requires sortable<iterator_t<_Range>, _Comp, _Proj>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   borrowed_iterator_t<_Range> operator()(_Range&& __r, _Comp __comp = {}, _Proj __proj = {}) const {
     return __sort_fn_impl(ranges::begin(__r), ranges::end(__r), __comp, __proj);
   }
@@ -72,8 +72,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_SORT_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_SORT_H

diff  --git a/libcxx/include/__algorithm/ranges_sort_heap.h b/libcxx/include/__algorithm/ranges_sort_heap.h
index f6e4dcb43ddf..341448cf4c43 100644
--- a/libcxx/include/__algorithm/ranges_sort_heap.h
+++ b/libcxx/include/__algorithm/ranges_sort_heap.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_SORT_HEAP_H
-#define _LIBCPP___ALGORITHM_RANGES_SORT_HEAP_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_SORT_HEAP_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_SORT_HEAP_H
 
 #include <__algorithm/iterator_operations.h>
 #include <__algorithm/make_projected.h>
@@ -28,20 +28,20 @@
 #include <__utility/forward.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 namespace __sort_heap {
 
 struct __fn {
   template <class _Iter, class _Sent, class _Comp, class _Proj>
-  _LIBCPP_HIDE_FROM_ABI constexpr static
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr static
   _Iter __sort_heap_fn_impl(_Iter __first, _Sent __last, _Comp& __comp, _Proj& __proj) {
     auto __last_iter = ranges::next(__first, __last);
 
@@ -53,14 +53,14 @@ struct __fn {
 
   template <random_access_iterator _Iter, sentinel_for<_Iter> _Sent, class _Comp = ranges::less, class _Proj = identity>
     requires sortable<_Iter, _Comp, _Proj>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   _Iter operator()(_Iter __first, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const {
     return __sort_heap_fn_impl(std::move(__first), std::move(__last), __comp, __proj);
   }
 
   template <random_access_range _Range, class _Comp = ranges::less, class _Proj = identity>
     requires sortable<iterator_t<_Range>, _Comp, _Proj>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   borrowed_iterator_t<_Range> operator()(_Range&& __r, _Comp __comp = {}, _Proj __proj = {}) const {
     return __sort_heap_fn_impl(ranges::begin(__r), ranges::end(__r), __comp, __proj);
   }
@@ -73,8 +73,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_SORT_HEAP_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_SORT_HEAP_H

diff  --git a/libcxx/include/__algorithm/ranges_stable_partition.h b/libcxx/include/__algorithm/ranges_stable_partition.h
index b20dfa3a8bfc..ba44fa4cbe70 100644
--- a/libcxx/include/__algorithm/ranges_stable_partition.h
+++ b/libcxx/include/__algorithm/ranges_stable_partition.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_STABLE_PARTITION_H
-#define _LIBCPP___ALGORITHM_RANGES_STABLE_PARTITION_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_STABLE_PARTITION_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_STABLE_PARTITION_H
 
 #include <__algorithm/iterator_operations.h>
 #include <__algorithm/make_projected.h>
@@ -30,13 +30,13 @@
 #include <__utility/move.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 namespace __stable_partition {
@@ -44,7 +44,7 @@ namespace __stable_partition {
 struct __fn {
 
   template <class _Iter, class _Sent, class _Proj, class _Pred>
-  _LIBCPP_HIDE_FROM_ABI static
+  _LIBCUDACXX_HIDE_FROM_ABI static
   subrange<__uncvref_t<_Iter>> __stable_partition_fn_impl(
       _Iter&& __first, _Sent&& __last, _Pred&& __pred, _Proj&& __proj) {
     auto __last_iter = ranges::next(__first, __last);
@@ -59,7 +59,7 @@ struct __fn {
   template <bidirectional_iterator _Iter, sentinel_for<_Iter> _Sent, class _Proj = identity,
             indirect_unary_predicate<projected<_Iter, _Proj>> _Pred>
   requires permutable<_Iter>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   subrange<_Iter> operator()(_Iter __first, _Sent __last, _Pred __pred, _Proj __proj = {}) const {
     return __stable_partition_fn_impl(__first, __last, __pred, __proj);
   }
@@ -67,7 +67,7 @@ struct __fn {
   template <bidirectional_range _Range, class _Proj = identity,
             indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred>
   requires permutable<iterator_t<_Range>>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   borrowed_subrange_t<_Range> operator()(_Range&& __range, _Pred __pred, _Proj __proj = {}) const {
     return __stable_partition_fn_impl(ranges::begin(__range), ranges::end(__range), __pred, __proj);
   }
@@ -81,8 +81,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_STABLE_PARTITION_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_STABLE_PARTITION_H

diff  --git a/libcxx/include/__algorithm/ranges_stable_sort.h b/libcxx/include/__algorithm/ranges_stable_sort.h
index 7ecffefc19da..6300b235329f 100644
--- a/libcxx/include/__algorithm/ranges_stable_sort.h
+++ b/libcxx/include/__algorithm/ranges_stable_sort.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_STABLE_SORT_H
-#define _LIBCPP___ALGORITHM_RANGES_STABLE_SORT_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_STABLE_SORT_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_STABLE_SORT_H
 
 #include <__algorithm/iterator_operations.h>
 #include <__algorithm/make_projected.h>
@@ -27,20 +27,20 @@
 #include <__utility/forward.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 namespace __stable_sort {
 
 struct __fn {
   template <class _Iter, class _Sent, class _Comp, class _Proj>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   static _Iter __stable_sort_fn_impl(_Iter __first, _Sent __last, _Comp& __comp, _Proj& __proj) {
     auto __last_iter = ranges::next(__first, __last);
 
@@ -52,14 +52,14 @@ struct __fn {
 
   template <random_access_iterator _Iter, sentinel_for<_Iter> _Sent, class _Comp = ranges::less, class _Proj = identity>
     requires sortable<_Iter, _Comp, _Proj>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   _Iter operator()(_Iter __first, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const {
     return __stable_sort_fn_impl(std::move(__first), std::move(__last), __comp, __proj);
   }
 
   template <random_access_range _Range, class _Comp = ranges::less, class _Proj = identity>
     requires sortable<iterator_t<_Range>, _Comp, _Proj>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   borrowed_iterator_t<_Range> operator()(_Range&& __r, _Comp __comp = {}, _Proj __proj = {}) const {
     return __stable_sort_fn_impl(ranges::begin(__r), ranges::end(__r), __comp, __proj);
   }
@@ -72,8 +72,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_STABLE_SORT_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_STABLE_SORT_H

diff  --git a/libcxx/include/__algorithm/ranges_swap_ranges.h b/libcxx/include/__algorithm/ranges_swap_ranges.h
index d980fdec2c49..3d57f57132df 100644
--- a/libcxx/include/__algorithm/ranges_swap_ranges.h
+++ b/libcxx/include/__algorithm/ranges_swap_ranges.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_SWAP_RANGES_H
-#define _LIBCPP___ALGORITHM_RANGES_SWAP_RANGES_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_SWAP_RANGES_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_SWAP_RANGES_H
 
 #include <__algorithm/in_in_result.h>
 #include <__algorithm/iterator_operations.h>
@@ -20,13 +20,13 @@
 #include <__ranges/dangling.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 
@@ -38,7 +38,7 @@ struct __fn {
   template <input_iterator _I1, sentinel_for<_I1> _S1,
             input_iterator _I2, sentinel_for<_I2> _S2>
     requires indirectly_swappable<_I1, _I2>
-  _LIBCPP_HIDE_FROM_ABI constexpr swap_ranges_result<_I1, _I2>
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr swap_ranges_result<_I1, _I2>
   operator()(_I1 __first1, _S1 __last1, _I2 __first2, _S2 __last2) const {
     auto __ret = std::__swap_ranges<_RangeAlgPolicy>(
         std::move(__first1), std::move(__last1), std::move(__first2), std::move(__last2));
@@ -47,7 +47,7 @@ struct __fn {
 
   template <input_range _R1, input_range _R2>
     requires indirectly_swappable<iterator_t<_R1>, iterator_t<_R2>>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   swap_ranges_result<borrowed_iterator_t<_R1>, borrowed_iterator_t<_R2>>
   operator()(_R1&& __r1, _R2&& __r2) const {
     return operator()(ranges::begin(__r1), ranges::end(__r1),
@@ -61,8 +61,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_SWAP_RANGES_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_SWAP_RANGES_H

diff  --git a/libcxx/include/__algorithm/ranges_transform.h b/libcxx/include/__algorithm/ranges_transform.h
index 3c13b1b79ff3..3b6fe339a162 100644
--- a/libcxx/include/__algorithm/ranges_transform.h
+++ b/libcxx/include/__algorithm/ranges_transform.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_TRANSFORM_H
-#define _LIBCPP___ALGORITHM_RANGES_TRANSFORM_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_TRANSFORM_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_TRANSFORM_H
 
 #include <__algorithm/in_in_out_result.h>
 #include <__algorithm/in_out_result.h>
@@ -22,13 +22,13 @@
 #include <__ranges/dangling.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 
@@ -45,7 +45,7 @@ struct __fn {
             class _OutIter,
             class _Func,
             class _Proj>
-  _LIBCPP_HIDE_FROM_ABI static constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI static constexpr
   unary_transform_result<_InIter, _OutIter> __unary(_InIter __first, _Sent __last,
                                                     _OutIter __result,
                                                     _Func& __operation,
@@ -65,7 +65,7 @@ struct __fn {
             class _Func,
             class _Proj1,
             class _Proj2>
-  _LIBCPP_HIDE_FROM_ABI static constexpr binary_transform_result<_InIter1, _InIter2, _OutIter>
+  _LIBCUDACXX_HIDE_FROM_ABI static constexpr binary_transform_result<_InIter1, _InIter2, _OutIter>
   __binary(_InIter1 __first1, _Sent1 __last1,
            _InIter2 __first2, _Sent2 __last2,
            _OutIter __result,
@@ -87,7 +87,7 @@ struct __fn {
             copy_constructible _Func,
             class _Proj = identity>
     requires indirectly_writable<_OutIter, indirect_result_t<_Func&, projected<_InIter, _Proj>>>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   unary_transform_result<_InIter, _OutIter> operator()(_InIter __first, _Sent __last,
                                                        _OutIter __result,
                                                        _Func __operation,
@@ -100,7 +100,7 @@ struct __fn {
             copy_constructible _Func,
             class _Proj = identity>
     requires indirectly_writable<_OutIter, indirect_result_t<_Func, projected<iterator_t<_Range>, _Proj>>>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   unary_transform_result<borrowed_iterator_t<_Range>, _OutIter> operator()(_Range&& __range,
                                                                            _OutIter __result,
                                                                            _Func __operation,
@@ -116,7 +116,7 @@ struct __fn {
             class _Proj2 = identity>
     requires indirectly_writable<_OutIter, indirect_result_t<_Func&, projected<_InIter1, _Proj1>,
                                                                      projected<_InIter2, _Proj2>>>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   binary_transform_result<_InIter1, _InIter2, _OutIter> operator()(_InIter1 __first1, _Sent1 __last1,
                                                                    _InIter2 __first2, _Sent2 __last2,
                                                                    _OutIter __result,
@@ -139,7 +139,7 @@ struct __fn {
             class _Proj2 = identity>
     requires indirectly_writable<_OutIter, indirect_result_t<_Func&, projected<iterator_t<_Range1>, _Proj1>,
                                                                      projected<iterator_t<_Range2>, _Proj2>>>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   binary_transform_result<borrowed_iterator_t<_Range1>, borrowed_iterator_t<_Range2>, _OutIter>
   operator()(_Range1&& __range1,
              _Range2&& __range2,
@@ -163,8 +163,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_TRANSFORM_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_TRANSFORM_H

diff  --git a/libcxx/include/__algorithm/ranges_unique.h b/libcxx/include/__algorithm/ranges_unique.h
index 11370aeccd24..4d1c66096292 100644
--- a/libcxx/include/__algorithm/ranges_unique.h
+++ b/libcxx/include/__algorithm/ranges_unique.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_UNIQUE_H
-#define _LIBCPP___ALGORITHM_RANGES_UNIQUE_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_UNIQUE_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_UNIQUE_H
 
 #include <__algorithm/iterator_operations.h>
 #include <__algorithm/make_projected.h>
@@ -27,13 +27,13 @@
 #include <__utility/forward.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 namespace __unique {
@@ -44,7 +44,7 @@ namespace __unique {
         sentinel_for<_Iter> _Sent,
         class _Proj                                                  = identity,
         indirect_equivalence_relation<projected<_Iter, _Proj>> _Comp = ranges::equal_to>
-    _LIBCPP_HIDE_FROM_ABI constexpr subrange<_Iter>
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr subrange<_Iter>
     operator()(_Iter __first, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const {
       auto __ret = std::__unique<_RangeAlgPolicy>(
           std::move(__first), std::move(__last), std::__make_projected(__comp, __proj));
@@ -56,7 +56,7 @@ namespace __unique {
         class _Proj                                                               = identity,
         indirect_equivalence_relation<projected<iterator_t<_Range>, _Proj>> _Comp = ranges::equal_to>
       requires permutable<iterator_t<_Range>>
-    _LIBCPP_HIDE_FROM_ABI constexpr borrowed_subrange_t<_Range>
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr borrowed_subrange_t<_Range>
     operator()(_Range&& __range, _Comp __comp = {}, _Proj __proj = {}) const {
       auto __ret = std::__unique<_RangeAlgPolicy>(
           ranges::begin(__range), ranges::end(__range), std::__make_projected(__comp, __proj));
@@ -71,8 +71,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_UNIQUE_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_UNIQUE_H

diff  --git a/libcxx/include/__algorithm/ranges_unique_copy.h b/libcxx/include/__algorithm/ranges_unique_copy.h
index 8c0b970d043f..9b0160c5ed77 100644
--- a/libcxx/include/__algorithm/ranges_unique_copy.h
+++ b/libcxx/include/__algorithm/ranges_unique_copy.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_UNIQUE_COPY_H
-#define _LIBCPP___ALGORITHM_RANGES_UNIQUE_COPY_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_UNIQUE_COPY_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_UNIQUE_COPY_H
 
 #include <__algorithm/in_out_result.h>
 #include <__algorithm/iterator_operations.h>
@@ -28,13 +28,13 @@
 #include <__utility/forward.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 
@@ -70,7 +70,7 @@ struct __fn {
              (forward_iterator<_InIter> ||
               (input_iterator<_OutIter> && same_as<iter_value_t<_InIter>, iter_value_t<_OutIter>>) ||
               indirectly_copyable_storable<_InIter, _OutIter>)
-  _LIBCPP_HIDE_FROM_ABI constexpr unique_copy_result<_InIter, _OutIter>
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr unique_copy_result<_InIter, _OutIter>
   operator()(_InIter __first, _Sent __last, _OutIter __result, _Comp __comp = {}, _Proj __proj = {}) const {
     auto __ret = std::__unique_copy<_RangeAlgPolicy>(
         std::move(__first),
@@ -89,7 +89,7 @@ struct __fn {
       (forward_iterator<iterator_t<_Range>> ||
        (input_iterator<_OutIter> && same_as<range_value_t<_Range>, iter_value_t<_OutIter>>) ||
        indirectly_copyable_storable<iterator_t<_Range>, _OutIter>)
-  _LIBCPP_HIDE_FROM_ABI constexpr unique_copy_result<borrowed_iterator_t<_Range>, _OutIter>
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr unique_copy_result<borrowed_iterator_t<_Range>, _OutIter>
   operator()(_Range&& __range, _OutIter __result, _Comp __comp = {}, _Proj __proj = {}) const {
     auto __ret = std::__unique_copy<_RangeAlgPolicy>(
         ranges::begin(__range),
@@ -108,8 +108,8 @@ inline constexpr auto unique_copy = __unique_copy::__fn{};
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_UNIQUE_COPY_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_UNIQUE_COPY_H

diff  --git a/libcxx/include/__algorithm/ranges_upper_bound.h b/libcxx/include/__algorithm/ranges_upper_bound.h
index 3c63249248fa..15d5e164a3f7 100644
--- a/libcxx/include/__algorithm/ranges_upper_bound.h
+++ b/libcxx/include/__algorithm/ranges_upper_bound.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_UPPER_BOUND_H
-#define _LIBCPP___ALGORITHM_RANGES_UPPER_BOUND_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_UPPER_BOUND_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_UPPER_BOUND_H
 
 #include <__algorithm/iterator_operations.h>
 #include <__algorithm/lower_bound.h>
@@ -21,20 +21,20 @@
 #include <__ranges/concepts.h>
 #include <__ranges/dangling.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 namespace __upper_bound {
 struct __fn {
   template <forward_iterator _Iter, sentinel_for<_Iter> _Sent, class _Type, class _Proj = identity,
             indirect_strict_weak_order<const _Type*, projected<_Iter, _Proj>> _Comp = ranges::less>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   _Iter operator()(_Iter __first, _Sent __last, const _Type& __value, _Comp __comp = {}, _Proj __proj = {}) const {
     auto __comp_lhs_rhs_swapped = [&](const auto& __lhs, const auto& __rhs) {
       return !std::invoke(__comp, __rhs, __lhs);
@@ -45,7 +45,7 @@ struct __fn {
 
   template <forward_range _Range, class _Type, class _Proj = identity,
             indirect_strict_weak_order<const _Type*, projected<iterator_t<_Range>, _Proj>> _Comp = ranges::less>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   borrowed_iterator_t<_Range> operator()(_Range&& __r,
                                          const _Type& __value,
                                          _Comp __comp = {},
@@ -68,8 +68,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-#endif // _LIBCPP___ALGORITHM_RANGES_UPPER_BOUND_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_UPPER_BOUND_H

diff  --git a/libcxx/include/__algorithm/remove.h b/libcxx/include/__algorithm/remove.h
index 8a7e99ba09a1..f009572178b9 100644
--- a/libcxx/include/__algorithm/remove.h
+++ b/libcxx/include/__algorithm/remove.h
@@ -6,25 +6,25 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_REMOVE_H
-#define _LIBCPP___ALGORITHM_REMOVE_H
+#ifndef _LIBCUDACXX___ALGORITHM_REMOVE_H
+#define _LIBCUDACXX___ALGORITHM_REMOVE_H
 
 #include <__algorithm/find.h>
 #include <__algorithm/find_if.h>
 #include <__config>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _ForwardIterator, class _Tp>
-_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
+_LIBCUDACXX_NODISCARD_EXT _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _ForwardIterator
 remove(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value)
 {
-    __first = _VSTD::find(__first, __last, __value);
+    __first = _CUDA_VSTD::find(__first, __last, __value);
     if (__first != __last)
     {
         _ForwardIterator __i = __first;
@@ -32,7 +32,7 @@ remove(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value)
         {
             if (!(*__i == __value))
             {
-                *__first = _VSTD::move(*__i);
+                *__first = _CUDA_VSTD::move(*__i);
                 ++__first;
             }
         }
@@ -40,6 +40,6 @@ remove(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value)
     return __first;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_REMOVE_H
+#endif // _LIBCUDACXX___ALGORITHM_REMOVE_H

diff  --git a/libcxx/include/__algorithm/remove_copy.h b/libcxx/include/__algorithm/remove_copy.h
index 55fc1d90a1e7..ffdc083d122b 100644
--- a/libcxx/include/__algorithm/remove_copy.h
+++ b/libcxx/include/__algorithm/remove_copy.h
@@ -6,19 +6,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_REMOVE_COPY_H
-#define _LIBCPP___ALGORITHM_REMOVE_COPY_H
+#ifndef _LIBCUDACXX___ALGORITHM_REMOVE_COPY_H
+#define _LIBCUDACXX___ALGORITHM_REMOVE_COPY_H
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _InputIterator, class _OutputIterator, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 _OutputIterator
 remove_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result, const _Tp& __value)
 {
@@ -33,6 +33,6 @@ remove_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __res
     return __result;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_REMOVE_COPY_H
+#endif // _LIBCUDACXX___ALGORITHM_REMOVE_COPY_H

diff  --git a/libcxx/include/__algorithm/remove_copy_if.h b/libcxx/include/__algorithm/remove_copy_if.h
index 36ddba4883ab..fa611eecc7e5 100644
--- a/libcxx/include/__algorithm/remove_copy_if.h
+++ b/libcxx/include/__algorithm/remove_copy_if.h
@@ -6,19 +6,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_REMOVE_COPY_IF_H
-#define _LIBCPP___ALGORITHM_REMOVE_COPY_IF_H
+#ifndef _LIBCUDACXX___ALGORITHM_REMOVE_COPY_IF_H
+#define _LIBCUDACXX___ALGORITHM_REMOVE_COPY_IF_H
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _InputIterator, class _OutputIterator, class _Predicate>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 _OutputIterator
 remove_copy_if(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _Predicate __pred)
 {
@@ -33,6 +33,6 @@ remove_copy_if(_InputIterator __first, _InputIterator __last, _OutputIterator __
     return __result;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_REMOVE_COPY_IF_H
+#endif // _LIBCUDACXX___ALGORITHM_REMOVE_COPY_IF_H

diff  --git a/libcxx/include/__algorithm/remove_if.h b/libcxx/include/__algorithm/remove_if.h
index 0ae131498d22..111d694aeb82 100644
--- a/libcxx/include/__algorithm/remove_if.h
+++ b/libcxx/include/__algorithm/remove_if.h
@@ -6,24 +6,24 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_REMOVE_IF_H
-#define _LIBCPP___ALGORITHM_REMOVE_IF_H
+#ifndef _LIBCUDACXX___ALGORITHM_REMOVE_IF_H
+#define _LIBCUDACXX___ALGORITHM_REMOVE_IF_H
 
 #include <__algorithm/find_if.h>
 #include <__config>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _ForwardIterator, class _Predicate>
-_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
+_LIBCUDACXX_NODISCARD_EXT _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _ForwardIterator
 remove_if(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred)
 {
-    __first = _VSTD::find_if<_ForwardIterator, _Predicate&>(__first, __last, __pred);
+    __first = _CUDA_VSTD::find_if<_ForwardIterator, _Predicate&>(__first, __last, __pred);
     if (__first != __last)
     {
         _ForwardIterator __i = __first;
@@ -31,7 +31,7 @@ remove_if(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred)
         {
             if (!__pred(*__i))
             {
-                *__first = _VSTD::move(*__i);
+                *__first = _CUDA_VSTD::move(*__i);
                 ++__first;
             }
         }
@@ -39,6 +39,6 @@ remove_if(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred)
     return __first;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_REMOVE_IF_H
+#endif // _LIBCUDACXX___ALGORITHM_REMOVE_IF_H

diff  --git a/libcxx/include/__algorithm/replace.h b/libcxx/include/__algorithm/replace.h
index d0ae8f65d4a2..48e07c524852 100644
--- a/libcxx/include/__algorithm/replace.h
+++ b/libcxx/include/__algorithm/replace.h
@@ -6,19 +6,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_REPLACE_H
-#define _LIBCPP___ALGORITHM_REPLACE_H
+#ifndef _LIBCUDACXX___ALGORITHM_REPLACE_H
+#define _LIBCUDACXX___ALGORITHM_REPLACE_H
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _ForwardIterator, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void
 replace(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __old_value, const _Tp& __new_value)
 {
@@ -27,6 +27,6 @@ replace(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __old_valu
             *__first = __new_value;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_REPLACE_H
+#endif // _LIBCUDACXX___ALGORITHM_REPLACE_H

diff  --git a/libcxx/include/__algorithm/replace_copy.h b/libcxx/include/__algorithm/replace_copy.h
index 7c8a5a0b93cb..fcdb66dec6c0 100644
--- a/libcxx/include/__algorithm/replace_copy.h
+++ b/libcxx/include/__algorithm/replace_copy.h
@@ -6,19 +6,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_REPLACE_COPY_H
-#define _LIBCPP___ALGORITHM_REPLACE_COPY_H
+#ifndef _LIBCUDACXX___ALGORITHM_REPLACE_COPY_H
+#define _LIBCUDACXX___ALGORITHM_REPLACE_COPY_H
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _InputIterator, class _OutputIterator, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 _OutputIterator
 replace_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result,
              const _Tp& __old_value, const _Tp& __new_value)
@@ -31,6 +31,6 @@ replace_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __re
     return __result;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_REPLACE_COPY_H
+#endif // _LIBCUDACXX___ALGORITHM_REPLACE_COPY_H

diff  --git a/libcxx/include/__algorithm/replace_copy_if.h b/libcxx/include/__algorithm/replace_copy_if.h
index 9d8a68fdc0f3..0071f8a94213 100644
--- a/libcxx/include/__algorithm/replace_copy_if.h
+++ b/libcxx/include/__algorithm/replace_copy_if.h
@@ -6,19 +6,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_REPLACE_COPY_IF_H
-#define _LIBCPP___ALGORITHM_REPLACE_COPY_IF_H
+#ifndef _LIBCUDACXX___ALGORITHM_REPLACE_COPY_IF_H
+#define _LIBCUDACXX___ALGORITHM_REPLACE_COPY_IF_H
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _InputIterator, class _OutputIterator, class _Predicate, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 _OutputIterator
 replace_copy_if(_InputIterator __first, _InputIterator __last, _OutputIterator __result,
                 _Predicate __pred, const _Tp& __new_value)
@@ -31,6 +31,6 @@ replace_copy_if(_InputIterator __first, _InputIterator __last, _OutputIterator _
     return __result;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_REPLACE_COPY_IF_H
+#endif // _LIBCUDACXX___ALGORITHM_REPLACE_COPY_IF_H

diff  --git a/libcxx/include/__algorithm/replace_if.h b/libcxx/include/__algorithm/replace_if.h
index 37c719a34c84..4b33324f4adf 100644
--- a/libcxx/include/__algorithm/replace_if.h
+++ b/libcxx/include/__algorithm/replace_if.h
@@ -6,19 +6,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_REPLACE_IF_H
-#define _LIBCPP___ALGORITHM_REPLACE_IF_H
+#ifndef _LIBCUDACXX___ALGORITHM_REPLACE_IF_H
+#define _LIBCUDACXX___ALGORITHM_REPLACE_IF_H
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _ForwardIterator, class _Predicate, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void
 replace_if(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred, const _Tp& __new_value)
 {
@@ -27,6 +27,6 @@ replace_if(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred,
             *__first = __new_value;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_REPLACE_IF_H
+#endif // _LIBCUDACXX___ALGORITHM_REPLACE_IF_H

diff  --git a/libcxx/include/__algorithm/reverse.h b/libcxx/include/__algorithm/reverse.h
index 6484c73752ef..c9fbd755ee9a 100644
--- a/libcxx/include/__algorithm/reverse.h
+++ b/libcxx/include/__algorithm/reverse.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_REVERSE_H
-#define _LIBCPP___ALGORITHM_REVERSE_H
+#ifndef _LIBCUDACXX___ALGORITHM_REVERSE_H
+#define _LIBCUDACXX___ALGORITHM_REVERSE_H
 
 #include <__algorithm/iter_swap.h>
 #include <__algorithm/iterator_operations.h>
@@ -15,14 +15,14 @@
 #include <__iterator/iterator_traits.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _AlgPolicy, class _BidirectionalIterator>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void
 __reverse_impl(_BidirectionalIterator __first, _BidirectionalIterator __last, bidirectional_iterator_tag)
 {
@@ -36,7 +36,7 @@ __reverse_impl(_BidirectionalIterator __first, _BidirectionalIterator __last, bi
 }
 
 template <class _AlgPolicy, class _RandomAccessIterator>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void
 __reverse_impl(_RandomAccessIterator __first, _RandomAccessIterator __last, random_access_iterator_tag)
 {
@@ -46,20 +46,20 @@ __reverse_impl(_RandomAccessIterator __first, _RandomAccessIterator __last, rand
 }
 
 template <class _AlgPolicy, class _BidirectionalIterator, class _Sentinel>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void __reverse(_BidirectionalIterator __first, _Sentinel __last) {
   using _IterCategory = typename _IterOps<_AlgPolicy>::template __iterator_category<_BidirectionalIterator>;
   std::__reverse_impl<_AlgPolicy>(std::move(__first), std::move(__last), _IterCategory());
 }
 
 template <class _BidirectionalIterator>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void
 reverse(_BidirectionalIterator __first, _BidirectionalIterator __last)
 {
   std::__reverse<_ClassicAlgPolicy>(std::move(__first), std::move(__last));
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_REVERSE_H
+#endif // _LIBCUDACXX___ALGORITHM_REVERSE_H

diff  --git a/libcxx/include/__algorithm/reverse_copy.h b/libcxx/include/__algorithm/reverse_copy.h
index 158390707803..b311b4af5be7 100644
--- a/libcxx/include/__algorithm/reverse_copy.h
+++ b/libcxx/include/__algorithm/reverse_copy.h
@@ -6,19 +6,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_REVERSE_COPY_H
-#define _LIBCPP___ALGORITHM_REVERSE_COPY_H
+#ifndef _LIBCUDACXX___ALGORITHM_REVERSE_COPY_H
+#define _LIBCUDACXX___ALGORITHM_REVERSE_COPY_H
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _BidirectionalIterator, class _OutputIterator>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 _OutputIterator
 reverse_copy(_BidirectionalIterator __first, _BidirectionalIterator __last, _OutputIterator __result)
 {
@@ -27,6 +27,6 @@ reverse_copy(_BidirectionalIterator __first, _BidirectionalIterator __last, _Out
     return __result;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_REVERSE_COPY_H
+#endif // _LIBCUDACXX___ALGORITHM_REVERSE_COPY_H

diff  --git a/libcxx/include/__algorithm/rotate.h b/libcxx/include/__algorithm/rotate.h
index beb5409d5b88..5c44ce18e541 100644
--- a/libcxx/include/__algorithm/rotate.h
+++ b/libcxx/include/__algorithm/rotate.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_ROTATE_H
-#define _LIBCPP___ALGORITHM_ROTATE_H
+#ifndef _LIBCUDACXX___ALGORITHM_ROTATE_H
+#define _LIBCUDACXX___ALGORITHM_ROTATE_H
 
 #include <__algorithm/iterator_operations.h>
 #include <__algorithm/move.h>
@@ -19,14 +19,14 @@
 #include <__utility/pair.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _AlgPolicy, class _ForwardIterator>
-_LIBCPP_CONSTEXPR_AFTER_CXX11 _ForwardIterator
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _ForwardIterator
 __rotate_left(_ForwardIterator __first, _ForwardIterator __last)
 {
     typedef typename iterator_traits<_ForwardIterator>::value_type value_type;
@@ -35,12 +35,12 @@ __rotate_left(_ForwardIterator __first, _ForwardIterator __last)
     value_type __tmp = _Ops::__iter_move(__first);
     _ForwardIterator __lm1 = std::__move<_AlgPolicy>(
         _Ops::next(__first), __last, __first).second;
-    *__lm1 = _VSTD::move(__tmp);
+    *__lm1 = _CUDA_VSTD::move(__tmp);
     return __lm1;
 }
 
 template <class _AlgPolicy, class _BidirectionalIterator>
-_LIBCPP_CONSTEXPR_AFTER_CXX11 _BidirectionalIterator
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _BidirectionalIterator
 __rotate_right(_BidirectionalIterator __first, _BidirectionalIterator __last)
 {
     typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type;
@@ -49,12 +49,12 @@ __rotate_right(_BidirectionalIterator __first, _BidirectionalIterator __last)
     _BidirectionalIterator __lm1 = _Ops::prev(__last);
     value_type __tmp = _Ops::__iter_move(__lm1);
     _BidirectionalIterator __fp1 = std::__move_backward<_AlgPolicy>(__first, __lm1, std::move(__last));
-    *__first = _VSTD::move(__tmp);
+    *__first = _CUDA_VSTD::move(__tmp);
     return __fp1;
 }
 
 template <class _AlgPolicy, class _ForwardIterator>
-_LIBCPP_CONSTEXPR_AFTER_CXX14 _ForwardIterator
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX14 _ForwardIterator
 __rotate_forward(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last)
 {
     _ForwardIterator __i = __middle;
@@ -89,8 +89,8 @@ __rotate_forward(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIt
 }
 
 template<typename _Integral>
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR_AFTER_CXX14 _Integral
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX14 _Integral
 __algo_gcd(_Integral __x, _Integral __y)
 {
     do
@@ -103,7 +103,7 @@ __algo_gcd(_Integral __x, _Integral __y)
 }
 
 template <class _AlgPolicy, typename _RandomAccessIterator>
-_LIBCPP_CONSTEXPR_AFTER_CXX14 _RandomAccessIterator
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX14 _RandomAccessIterator
 __rotate_gcd(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last)
 {
     typedef typename iterator_traits<_RandomAccessIterator>::
diff erence_type 
diff erence_type;
@@ -117,7 +117,7 @@ __rotate_gcd(_RandomAccessIterator __first, _RandomAccessIterator __middle, _Ran
         std::__swap_ranges<_AlgPolicy>(__first, __middle, __middle, __last);
         return __middle;
     }
-    const 
diff erence_type __g = _VSTD::__algo_gcd(__m1, __m2);
+    const 
diff erence_type __g = _CUDA_VSTD::__algo_gcd(__m1, __m2);
     for (_RandomAccessIterator __p = __first + __g; __p != __first;)
     {
         value_type __t(_Ops::__iter_move(--__p));
@@ -133,16 +133,16 @@ __rotate_gcd(_RandomAccessIterator __first, _RandomAccessIterator __middle, _Ran
             else
                 __p2 = __first + (__m1 - __d);
         } while (__p2 != __p);
-        *__p1 = _VSTD::move(__t);
+        *__p1 = _CUDA_VSTD::move(__t);
     }
     return __first + __m2;
 }
 
 template <class _AlgPolicy, class _ForwardIterator>
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR_AFTER_CXX11 _ForwardIterator
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _ForwardIterator
 __rotate_impl(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last,
-         _VSTD::forward_iterator_tag)
+         _CUDA_VSTD::forward_iterator_tag)
 {
     typedef typename iterator_traits<_ForwardIterator>::value_type value_type;
     if (is_trivially_move_assignable<value_type>::value)
@@ -154,8 +154,8 @@ __rotate_impl(_ForwardIterator __first, _ForwardIterator __middle, _ForwardItera
 }
 
 template <class _AlgPolicy, class _BidirectionalIterator>
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR_AFTER_CXX11 _BidirectionalIterator
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _BidirectionalIterator
 __rotate_impl(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last,
          bidirectional_iterator_tag)
 {
@@ -171,8 +171,8 @@ __rotate_impl(_BidirectionalIterator __first, _BidirectionalIterator __middle, _
 }
 
 template <class _AlgPolicy, class _RandomAccessIterator>
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR_AFTER_CXX11 _RandomAccessIterator
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _RandomAccessIterator
 __rotate_impl(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last,
          random_access_iterator_tag)
 {
@@ -189,7 +189,7 @@ __rotate_impl(_RandomAccessIterator __first, _RandomAccessIterator __middle, _Ra
 }
 
 template <class _AlgPolicy, class _Iterator, class _Sentinel>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 pair<_Iterator, _Iterator>
 __rotate(_Iterator __first, _Iterator __middle, _Sentinel __last) {
   using _Ret = pair<_Iterator, _Iterator>;
@@ -208,14 +208,14 @@ __rotate(_Iterator __first, _Iterator __middle, _Sentinel __last) {
 }
 
 template <class _ForwardIterator>
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _ForwardIterator
 rotate(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last)
 {
   return std::__rotate<_ClassicAlgPolicy>(
       std::move(__first), std::move(__middle), std::move(__last)).first;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_ROTATE_H
+#endif // _LIBCUDACXX___ALGORITHM_ROTATE_H

diff  --git a/libcxx/include/__algorithm/rotate_copy.h b/libcxx/include/__algorithm/rotate_copy.h
index ab569ef7c6be..dfab8f2fdf5e 100644
--- a/libcxx/include/__algorithm/rotate_copy.h
+++ b/libcxx/include/__algorithm/rotate_copy.h
@@ -6,26 +6,26 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_ROTATE_COPY_H
-#define _LIBCPP___ALGORITHM_ROTATE_COPY_H
+#ifndef _LIBCUDACXX___ALGORITHM_ROTATE_COPY_H
+#define _LIBCUDACXX___ALGORITHM_ROTATE_COPY_H
 
 #include <__algorithm/copy.h>
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _ForwardIterator, class _OutputIterator>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 _OutputIterator
 rotate_copy(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last, _OutputIterator __result)
 {
-    return _VSTD::copy(__first, __middle, _VSTD::copy(__middle, __last, __result));
+    return _CUDA_VSTD::copy(__first, __middle, _CUDA_VSTD::copy(__middle, __last, __result));
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_ROTATE_COPY_H
+#endif // _LIBCUDACXX___ALGORITHM_ROTATE_COPY_H

diff  --git a/libcxx/include/__algorithm/sample.h b/libcxx/include/__algorithm/sample.h
index f403ba612580..00cf1049d53a 100644
--- a/libcxx/include/__algorithm/sample.h
+++ b/libcxx/include/__algorithm/sample.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_SAMPLE_H
-#define _LIBCPP___ALGORITHM_SAMPLE_H
+#ifndef _LIBCUDACXX___ALGORITHM_SAMPLE_H
+#define _LIBCUDACXX___ALGORITHM_SAMPLE_H
 
 #include <__algorithm/iterator_operations.h>
 #include <__algorithm/min.h>
@@ -19,19 +19,19 @@
 #include <__utility/move.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _AlgPolicy,
           class _PopulationIterator, class _PopulationSentinel, class _SampleIterator, class _Distance,
           class _UniformRandomNumberGenerator>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _SampleIterator __sample(_PopulationIterator __first,
                          _PopulationSentinel __last, _SampleIterator __output_iter,
                          _Distance __n,
@@ -47,20 +47,20 @@ _SampleIterator __sample(_PopulationIterator __first,
     if (__r < __sz)
       __output_iter[__r] = *__first;
   }
-  return __output_iter + _VSTD::min(__n, __k);
+  return __output_iter + _CUDA_VSTD::min(__n, __k);
 }
 
 template <class _AlgPolicy,
           class _PopulationIterator, class _PopulationSentinel, class _SampleIterator, class _Distance,
           class _UniformRandomNumberGenerator>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _SampleIterator __sample(_PopulationIterator __first,
                          _PopulationSentinel __last, _SampleIterator __output_iter,
                          _Distance __n,
                          _UniformRandomNumberGenerator& __g,
                          forward_iterator_tag) {
   _Distance __unsampled_sz = _IterOps<_AlgPolicy>::distance(__first, __last);
-  for (__n = _VSTD::min(__n, __unsampled_sz); __n != 0; ++__first) {
+  for (__n = _CUDA_VSTD::min(__n, __unsampled_sz); __n != 0; ++__first) {
     _Distance __r = uniform_int_distribution<_Distance>(0, --__unsampled_sz)(__g);
     if (__r < __n) {
       *__output_iter++ = *__first;
@@ -73,11 +73,11 @@ _SampleIterator __sample(_PopulationIterator __first,
 template <class _AlgPolicy,
           class _PopulationIterator, class _PopulationSentinel, class _SampleIterator, class _Distance,
           class _UniformRandomNumberGenerator>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _SampleIterator __sample(_PopulationIterator __first,
                          _PopulationSentinel __last, _SampleIterator __output_iter,
                          _Distance __n, _UniformRandomNumberGenerator& __g) {
-  _LIBCPP_ASSERT(__n >= 0, "N must be a positive number.");
+  _LIBCUDACXX_ASSERT(__n >= 0, "N must be a positive number.");
 
   using _PopIterCategory = typename _IterOps<_AlgPolicy>::template __iterator_category<_PopulationIterator>;
   using _Difference = typename _IterOps<_AlgPolicy>::template __
diff erence_type<_PopulationIterator>;
@@ -88,10 +88,10 @@ _SampleIterator __sample(_PopulationIterator __first,
       __g, _PopIterCategory());
 }
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _PopulationIterator, class _SampleIterator, class _Distance,
           class _UniformRandomNumberGenerator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 _SampleIterator sample(_PopulationIterator __first,
                        _PopulationIterator __last, _SampleIterator __output_iter,
                        _Distance __n, _UniformRandomNumberGenerator&& __g) {
@@ -103,10 +103,10 @@ _SampleIterator sample(_PopulationIterator __first,
       std::move(__first), std::move(__last), std::move(__output_iter), __n, __g);
 }
 
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCUDACXX_STD_VER > 14
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___ALGORITHM_SAMPLE_H
+#endif // _LIBCUDACXX___ALGORITHM_SAMPLE_H

diff  --git a/libcxx/include/__algorithm/search.h b/libcxx/include/__algorithm/search.h
index 4ead6cac82b7..7e18ec0dcea0 100644
--- a/libcxx/include/__algorithm/search.h
+++ b/libcxx/include/__algorithm/search.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_SEARCH_H
-#define _LIBCPP___ALGORITHM_SEARCH_H
+#ifndef _LIBCUDACXX___ALGORITHM_SEARCH_H
+#define _LIBCUDACXX___ALGORITHM_SEARCH_H
 
 #include <__algorithm/comp.h>
 #include <__algorithm/iterator_operations.h>
@@ -21,11 +21,11 @@
 #include <__utility/pair.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _AlgPolicy,
           class _Iter1, class _Sent1,
@@ -33,7 +33,7 @@ template <class _AlgPolicy,
           class _Pred,
           class _Proj1,
           class _Proj2>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 pair<_Iter1, _Iter1> __search_forward_impl(_Iter1 __first1, _Sent1 __last1,
                                            _Iter2 __first2, _Sent2 __last2,
                                            _Pred& __pred,
@@ -80,7 +80,7 @@ template <class _AlgPolicy,
           class _Proj2,
           class _DiffT1,
           class _DiffT2>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 pair<_Iter1, _Iter1> __search_random_access_impl(_Iter1 __first1, _Sent1 __last1,
                                                  _Iter2 __first2, _Sent2 __last2,
                                                  _Pred& __pred,
@@ -120,7 +120,7 @@ template <class _Iter1, class _Sent1,
           class _Pred,
           class _Proj1,
           class _Proj2>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 pair<_Iter1, _Iter1> __search_impl(_Iter1 __first1, _Sent1 __last1,
                                    _Iter2 __first2, _Sent2 __last2,
                                    _Pred& __pred,
@@ -152,7 +152,7 @@ template <class _Iter1, class _Sent1,
           class _Pred,
           class _Proj1,
           class _Proj2>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 pair<_Iter1, _Iter1> __search_impl(_Iter1 __first1, _Sent1 __last1,
                                    _Iter2 __first2, _Sent2 __last2,
                                    _Pred& __pred,
@@ -170,7 +170,7 @@ pair<_Iter1, _Iter1> __search_impl(_Iter1 __first1, _Sent1 __last1,
 }
 
 template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 _ForwardIterator1 search(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
                          _ForwardIterator2 __first2, _ForwardIterator2 __last2,
                          _BinaryPredicate __pred) {
@@ -181,7 +181,7 @@ _ForwardIterator1 search(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
 }
 
 template <class _ForwardIterator1, class _ForwardIterator2>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 _ForwardIterator1 search(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
                          _ForwardIterator2 __first2, _ForwardIterator2 __last2) {
   using __v1 = typename iterator_traits<_ForwardIterator1>::value_type;
@@ -189,15 +189,15 @@ _ForwardIterator1 search(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
   return std::search(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>());
 }
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _ForwardIterator, class _Searcher>
-_LIBCPP_NODISCARD_EXT _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
+_LIBCUDACXX_NODISCARD_EXT _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _ForwardIterator
 search(_ForwardIterator __f, _ForwardIterator __l, const _Searcher& __s) {
   return __s(__f, __l).first;
 }
 
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_SEARCH_H
+#endif // _LIBCUDACXX___ALGORITHM_SEARCH_H

diff  --git a/libcxx/include/__algorithm/search_n.h b/libcxx/include/__algorithm/search_n.h
index ccb8e845f5b1..8b70586d9c33 100644
--- a/libcxx/include/__algorithm/search_n.h
+++ b/libcxx/include/__algorithm/search_n.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_SEARCH_N_H
-#define _LIBCPP___ALGORITHM_SEARCH_N_H
+#ifndef _LIBCUDACXX___ALGORITHM_SEARCH_N_H
+#define _LIBCUDACXX___ALGORITHM_SEARCH_N_H
 
 #include <__algorithm/comp.h>
 #include <__algorithm/iterator_operations.h>
@@ -22,14 +22,14 @@
 #include <__utility/pair.h>
 #include <type_traits>  // __convert_to_integral
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _AlgPolicy, class _Pred, class _Iter, class _Sent, class _SizeT, class _Type, class _Proj>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 pair<_Iter, _Iter> __search_n_forward_impl(_Iter __first, _Sent __last,
                                            _SizeT __count,
                                            const _Type& __value,
@@ -71,7 +71,7 @@ pair<_Iter, _Iter> __search_n_forward_impl(_Iter __first, _Sent __last,
 }
 
 template <class _AlgPolicy, class _Pred, class _Iter, class _Sent, class _SizeT, class _Type, class _Proj, class _DiffT>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 std::pair<_Iter, _Iter> __search_n_random_access_impl(_Iter __first, _Sent __last,
                                                       _SizeT __count,
                                                       const _Type& __value,
@@ -122,7 +122,7 @@ template <class _Iter, class _Sent,
           class _Type,
           class _Pred,
           class _Proj>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 pair<_Iter, _Iter> __search_n_impl(_Iter __first, _Sent __last,
                                    _DiffT __count,
                                    const _Type& __value,
@@ -142,7 +142,7 @@ template <class _Iter1, class _Sent1,
           class _Type,
           class _Pred,
           class _Proj>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 pair<_Iter1, _Iter1> __search_n_impl(_Iter1 __first, _Sent1 __last,
                                      _DiffT __count,
                                      const _Type& __value,
@@ -158,7 +158,7 @@ pair<_Iter1, _Iter1> __search_n_impl(_Iter1 __first, _Sent1 __last,
 }
 
 template <class _ForwardIterator, class _Size, class _Tp, class _BinaryPredicate>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 _ForwardIterator search_n(_ForwardIterator __first, _ForwardIterator __last,
                           _Size __count,
                           const _Tp& __value,
@@ -170,12 +170,12 @@ _ForwardIterator search_n(_ForwardIterator __first, _ForwardIterator __last,
 }
 
 template <class _ForwardIterator, class _Size, class _Tp>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 _ForwardIterator search_n(_ForwardIterator __first, _ForwardIterator __last, _Size __count, const _Tp& __value) {
   typedef typename iterator_traits<_ForwardIterator>::value_type __v;
   return std::search_n(__first, __last, std::__convert_to_integral(__count), __value, __equal_to<__v, _Tp>());
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_SEARCH_N_H
+#endif // _LIBCUDACXX___ALGORITHM_SEARCH_N_H

diff  --git a/libcxx/include/__algorithm/set_
diff erence.h b/libcxx/include/__algorithm/set_
diff erence.h
index 4378bd5304d9..aa8a318bb638 100644
--- a/libcxx/include/__algorithm/set_
diff erence.h
+++ b/libcxx/include/__algorithm/set_
diff erence.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_SET_DIFFERENCE_H
-#define _LIBCPP___ALGORITHM_SET_DIFFERENCE_H
+#ifndef _LIBCUDACXX___ALGORITHM_SET_DIFFERENCE_H
+#define _LIBCUDACXX___ALGORITHM_SET_DIFFERENCE_H
 
 #include <__algorithm/comp.h>
 #include <__algorithm/comp_ref_type.h>
@@ -20,14 +20,14 @@
 #include <__utility/pair.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template < class _Comp, class _InIter1, class _Sent1, class _InIter2, class _Sent2, class _OutIter>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 pair<__uncvref_t<_InIter1>, __uncvref_t<_OutIter> >
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 pair<__uncvref_t<_InIter1>, __uncvref_t<_OutIter> >
 __set_
diff erence(
     _InIter1&& __first1, _Sent1&& __last1, _InIter2&& __first2, _Sent2&& __last2, _OutIter&& __result, _Comp&& __comp) {
   while (__first1 != __last1 && __first2 != __last2) {
@@ -46,7 +46,7 @@ __set_
diff erence(
 }
 
 template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _Compare>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator set_
diff erence(
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _OutputIterator set_
diff erence(
     _InputIterator1 __first1,
     _InputIterator1 __last1,
     _InputIterator2 __first2,
@@ -58,7 +58,7 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator set_d
 }
 
 template <class _InputIterator1, class _InputIterator2, class _OutputIterator>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator set_
diff erence(
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _OutputIterator set_
diff erence(
     _InputIterator1 __first1,
     _InputIterator1 __last1,
     _InputIterator2 __first2,
@@ -74,6 +74,6 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator set_d
              typename iterator_traits<_InputIterator2>::value_type>()).second;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_SET_DIFFERENCE_H
+#endif // _LIBCUDACXX___ALGORITHM_SET_DIFFERENCE_H

diff  --git a/libcxx/include/__algorithm/set_intersection.h b/libcxx/include/__algorithm/set_intersection.h
index 77cc83738d1f..8b75df0b6d05 100644
--- a/libcxx/include/__algorithm/set_intersection.h
+++ b/libcxx/include/__algorithm/set_intersection.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_SET_INTERSECTION_H
-#define _LIBCPP___ALGORITHM_SET_INTERSECTION_H
+#ifndef _LIBCUDACXX___ALGORITHM_SET_INTERSECTION_H
+#define _LIBCUDACXX___ALGORITHM_SET_INTERSECTION_H
 
 #include <__algorithm/comp.h>
 #include <__algorithm/comp_ref_type.h>
@@ -17,11 +17,11 @@
 #include <__iterator/next.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _InIter1, class _InIter2, class _OutIter>
 struct __set_intersection_result {
@@ -30,13 +30,13 @@ struct __set_intersection_result {
   _OutIter __out_;
 
   // need a constructor as C++03 aggregate init is hard
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
   __set_intersection_result(_InIter1&& __in_iter1, _InIter2&& __in_iter2, _OutIter&& __out_iter)
       : __in1_(std::move(__in_iter1)), __in2_(std::move(__in_iter2)), __out_(std::move(__out_iter)) {}
 };
 
 template <class _AlgPolicy, class _Compare, class _InIter1, class _Sent1, class _InIter2, class _Sent2, class _OutIter>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 __set_intersection_result<_InIter1, _InIter2, _OutIter>
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 __set_intersection_result<_InIter1, _InIter2, _OutIter>
 __set_intersection(
     _InIter1 __first1, _Sent1 __last1, _InIter2 __first2, _Sent2 __last2, _OutIter __result, _Compare&& __comp) {
   while (__first1 != __last1 && __first2 != __last2) {
@@ -59,7 +59,7 @@ __set_intersection(
 }
 
 template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _Compare>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator set_intersection(
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _OutputIterator set_intersection(
     _InputIterator1 __first1,
     _InputIterator1 __last1,
     _InputIterator2 __first2,
@@ -78,7 +78,7 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator set_i
 }
 
 template <class _InputIterator1, class _InputIterator2, class _OutputIterator>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator set_intersection(
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _OutputIterator set_intersection(
     _InputIterator1 __first1,
     _InputIterator1 __last1,
     _InputIterator2 __first2,
@@ -95,6 +95,6 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator set_i
       .__out_;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_SET_INTERSECTION_H
+#endif // _LIBCUDACXX___ALGORITHM_SET_INTERSECTION_H

diff  --git a/libcxx/include/__algorithm/set_symmetric_
diff erence.h b/libcxx/include/__algorithm/set_symmetric_
diff erence.h
index cd532ab5800d..c6d1542b28db 100644
--- a/libcxx/include/__algorithm/set_symmetric_
diff erence.h
+++ b/libcxx/include/__algorithm/set_symmetric_
diff erence.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_SET_SYMMETRIC_DIFFERENCE_H
-#define _LIBCPP___ALGORITHM_SET_SYMMETRIC_DIFFERENCE_H
+#ifndef _LIBCUDACXX___ALGORITHM_SET_SYMMETRIC_DIFFERENCE_H
+#define _LIBCUDACXX___ALGORITHM_SET_SYMMETRIC_DIFFERENCE_H
 
 #include <__algorithm/comp.h>
 #include <__algorithm/comp_ref_type.h>
@@ -16,11 +16,11 @@
 #include <__iterator/iterator_traits.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _InIter1, class _InIter2, class _OutIter>
 struct __set_symmetric_
diff erence_result {
@@ -29,13 +29,13 @@ struct __set_symmetric_
diff erence_result {
   _OutIter __out_;
 
   // need a constructor as C++03 aggregate init is hard
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
   __set_symmetric_
diff erence_result(_InIter1&& __in_iter1, _InIter2&& __in_iter2, _OutIter&& __out_iter)
       : __in1_(std::move(__in_iter1)), __in2_(std::move(__in_iter2)), __out_(std::move(__out_iter)) {}
 };
 
 template <class _Compare, class _InIter1, class _Sent1, class _InIter2, class _Sent2, class _OutIter>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 __set_symmetric_
diff erence_result<_InIter1, _InIter2, _OutIter>
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 __set_symmetric_
diff erence_result<_InIter1, _InIter2, _OutIter>
 __set_symmetric_
diff erence(
     _InIter1 __first1, _Sent1 __last1, _InIter2 __first2, _Sent2 __last2, _OutIter __result, _Compare&& __comp) {
   while (__first1 != __last1) {
@@ -64,7 +64,7 @@ __set_symmetric_
diff erence(
 }
 
 template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _Compare>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator set_symmetric_
diff erence(
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _OutputIterator set_symmetric_
diff erence(
     _InputIterator1 __first1,
     _InputIterator1 __last1,
     _InputIterator2 __first2,
@@ -83,7 +83,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator set_symmetri
 }
 
 template <class _InputIterator1, class _InputIterator2, class _OutputIterator>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator set_symmetric_
diff erence(
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _OutputIterator set_symmetric_
diff erence(
     _InputIterator1 __first1,
     _InputIterator1 __last1,
     _InputIterator2 __first2,
@@ -99,6 +99,6 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator set_symmetri
              typename iterator_traits<_InputIterator2>::value_type>());
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_SET_SYMMETRIC_DIFFERENCE_H
+#endif // _LIBCUDACXX___ALGORITHM_SET_SYMMETRIC_DIFFERENCE_H

diff  --git a/libcxx/include/__algorithm/set_union.h b/libcxx/include/__algorithm/set_union.h
index 3bd437980161..5b510de4919c 100644
--- a/libcxx/include/__algorithm/set_union.h
+++ b/libcxx/include/__algorithm/set_union.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_SET_UNION_H
-#define _LIBCPP___ALGORITHM_SET_UNION_H
+#ifndef _LIBCUDACXX___ALGORITHM_SET_UNION_H
+#define _LIBCUDACXX___ALGORITHM_SET_UNION_H
 
 #include <__algorithm/comp.h>
 #include <__algorithm/comp_ref_type.h>
@@ -16,11 +16,11 @@
 #include <__iterator/iterator_traits.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _InIter1, class _InIter2, class _OutIter>
 struct __set_union_result {
@@ -29,13 +29,13 @@ struct __set_union_result {
   _OutIter __out_;
 
   // need a constructor as C++03 aggregate init is hard
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
   __set_union_result(_InIter1&& __in_iter1, _InIter2&& __in_iter2, _OutIter&& __out_iter)
       : __in1_(std::move(__in_iter1)), __in2_(std::move(__in_iter2)), __out_(std::move(__out_iter)) {}
 };
 
 template <class _Compare, class _InIter1, class _Sent1, class _InIter2, class _Sent2, class _OutIter>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 __set_union_result<_InIter1, _InIter2, _OutIter> __set_union(
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 __set_union_result<_InIter1, _InIter2, _OutIter> __set_union(
     _InIter1 __first1, _Sent1 __last1, _InIter2 __first2, _Sent2 __last2, _OutIter __result, _Compare&& __comp) {
   for (; __first1 != __last1; ++__result) {
     if (__first2 == __last2) {
@@ -60,7 +60,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 __set_union_result<_InIter1,
 }
 
 template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _Compare>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator set_union(
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _OutputIterator set_union(
     _InputIterator1 __first1,
     _InputIterator1 __last1,
     _InputIterator2 __first2,
@@ -79,7 +79,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator set_union(
 }
 
 template <class _InputIterator1, class _InputIterator2, class _OutputIterator>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator set_union(
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _OutputIterator set_union(
     _InputIterator1 __first1,
     _InputIterator1 __last1,
     _InputIterator2 __first2,
@@ -95,6 +95,6 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator set_union(
              typename iterator_traits<_InputIterator2>::value_type>());
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_SET_UNION_H
+#endif // _LIBCUDACXX___ALGORITHM_SET_UNION_H

diff  --git a/libcxx/include/__algorithm/shift_left.h b/libcxx/include/__algorithm/shift_left.h
index 33f06d57e23a..f68b10b7059b 100644
--- a/libcxx/include/__algorithm/shift_left.h
+++ b/libcxx/include/__algorithm/shift_left.h
@@ -6,24 +6,24 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_SHIFT_LEFT_H
-#define _LIBCPP___ALGORITHM_SHIFT_LEFT_H
+#ifndef _LIBCUDACXX___ALGORITHM_SHIFT_LEFT_H
+#define _LIBCUDACXX___ALGORITHM_SHIFT_LEFT_H
 
 #include <__algorithm/move.h>
 #include <__config>
 #include <__iterator/iterator_traits.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 template <class _ForwardIterator>
-inline _LIBCPP_INLINE_VISIBILITY constexpr
+inline _LIBCUDACXX_INLINE_VISIBILITY constexpr
 _ForwardIterator
 shift_left(_ForwardIterator __first, _ForwardIterator __last,
            typename iterator_traits<_ForwardIterator>::
diff erence_type __n)
@@ -46,11 +46,11 @@ shift_left(_ForwardIterator __first, _ForwardIterator __last,
             ++__m;
         }
     }
-    return _VSTD::move(__m, __last, __first);
+    return _CUDA_VSTD::move(__m, __last, __first);
 }
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_SHIFT_LEFT_H
+#endif // _LIBCUDACXX___ALGORITHM_SHIFT_LEFT_H

diff  --git a/libcxx/include/__algorithm/shift_right.h b/libcxx/include/__algorithm/shift_right.h
index 14bc761598b2..444fbc26ff59 100644
--- a/libcxx/include/__algorithm/shift_right.h
+++ b/libcxx/include/__algorithm/shift_right.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_SHIFT_RIGHT_H
-#define _LIBCPP___ALGORITHM_SHIFT_RIGHT_H
+#ifndef _LIBCUDACXX___ALGORITHM_SHIFT_RIGHT_H
+#define _LIBCUDACXX___ALGORITHM_SHIFT_RIGHT_H
 
 #include <__algorithm/move.h>
 #include <__algorithm/move_backward.h>
@@ -17,16 +17,16 @@
 #include <__utility/swap.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 template <class _ForwardIterator>
-inline _LIBCPP_INLINE_VISIBILITY constexpr
+inline _LIBCUDACXX_INLINE_VISIBILITY constexpr
 _ForwardIterator
 shift_right(_ForwardIterator __first, _ForwardIterator __last,
             typename iterator_traits<_ForwardIterator>::
diff erence_type __n)
@@ -41,7 +41,7 @@ shift_right(_ForwardIterator __first, _ForwardIterator __last,
             return __last;
         }
         _ForwardIterator __m = __first + (__d - __n);
-        return _VSTD::move_backward(__first, __m, __last);
+        return _CUDA_VSTD::move_backward(__first, __m, __last);
     } else if constexpr (__is_cpp17_bidirectional_iterator<_ForwardIterator>::value) {
         _ForwardIterator __m = __last;
         for (; __n > 0; --__n) {
@@ -50,7 +50,7 @@ shift_right(_ForwardIterator __first, _ForwardIterator __last,
             }
             --__m;
         }
-        return _VSTD::move_backward(__first, __m, __last);
+        return _CUDA_VSTD::move_backward(__first, __m, __last);
     } else {
         _ForwardIterator __ret = __first;
         for (; __n > 0; --__n) {
@@ -70,7 +70,7 @@ shift_right(_ForwardIterator __first, _ForwardIterator __last,
         auto __lead = __ret;
         while (__trail != __ret) {
             if (__lead == __last) {
-                _VSTD::move(__first, __trail, __ret);
+                _CUDA_VSTD::move(__first, __trail, __ret);
                 return __ret;
             }
             ++__trail;
@@ -80,8 +80,8 @@ shift_right(_ForwardIterator __first, _ForwardIterator __last,
         _ForwardIterator __mid = __first;
         while (true) {
             if (__lead == __last) {
-                __trail = _VSTD::move(__mid, __ret, __trail);
-                _VSTD::move(__first, __mid, __trail);
+                __trail = _CUDA_VSTD::move(__mid, __ret, __trail);
+                _CUDA_VSTD::move(__first, __mid, __trail);
                 return __ret;
             }
             swap(*__mid, *__trail);
@@ -95,8 +95,8 @@ shift_right(_ForwardIterator __first, _ForwardIterator __last,
     }
 }
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_SHIFT_RIGHT_H
+#endif // _LIBCUDACXX___ALGORITHM_SHIFT_RIGHT_H

diff  --git a/libcxx/include/__algorithm/shuffle.h b/libcxx/include/__algorithm/shuffle.h
index e32c6a7608ba..2946977081a5 100644
--- a/libcxx/include/__algorithm/shuffle.h
+++ b/libcxx/include/__algorithm/shuffle.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_SHUFFLE_H
-#define _LIBCPP___ALGORITHM_SHUFFLE_H
+#ifndef _LIBCUDACXX___ALGORITHM_SHUFFLE_H
+#define _LIBCUDACXX___ALGORITHM_SHUFFLE_H
 
 #include <__algorithm/iterator_operations.h>
 #include <__config>
@@ -19,18 +19,18 @@
 #include <cstddef>
 #include <cstdint>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-class _LIBCPP_TYPE_VIS __libcpp_debug_randomizer {
+class _LIBCUDACXX_TYPE_VIS __LIBCUDACXX_debug_randomizer {
 public:
-  __libcpp_debug_randomizer() {
+  __LIBCUDACXX_debug_randomizer() {
     __state = __seed();
     __inc = __state + 0xda3e39cb94b95bdbULL;
     __inc = (__inc << 1) | 1;
@@ -40,21 +40,21 @@ class _LIBCPP_TYPE_VIS __libcpp_debug_randomizer {
   static const result_type _Min = 0;
   static const result_type _Max = 0xFFFFFFFF;
 
-  _LIBCPP_HIDE_FROM_ABI result_type operator()() {
+  _LIBCUDACXX_HIDE_FROM_ABI result_type operator()() {
     uint_fast64_t __oldstate = __state;
     __state = __oldstate * 6364136223846793005ULL + __inc;
     return __oldstate >> 32;
   }
 
-  static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR result_type min() { return _Min; }
-  static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR result_type max() { return _Max; }
+  static _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR result_type min() { return _Min; }
+  static _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR result_type max() { return _Max; }
 
 private:
   uint_fast64_t __state;
   uint_fast64_t __inc;
-  _LIBCPP_HIDE_FROM_ABI static uint_fast64_t __seed() {
-#ifdef _LIBCPP_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY_SEED
-    return _LIBCPP_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY_SEED;
+  _LIBCUDACXX_HIDE_FROM_ABI static uint_fast64_t __seed() {
+#ifdef _LIBCUDACXX_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY_SEED
+    return _LIBCUDACXX_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY_SEED;
 #else
     static char __x;
     return reinterpret_cast<uintptr_t>(&__x);
@@ -62,13 +62,13 @@ class _LIBCPP_TYPE_VIS __libcpp_debug_randomizer {
   }
 };
 
-#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_RANDOM_SHUFFLE) \
-  || defined(_LIBCPP_BUILDING_LIBRARY)
-class _LIBCPP_TYPE_VIS __rs_default;
+#if _LIBCUDACXX_STD_VER <= 14 || defined(_LIBCUDACXX_ENABLE_CXX17_REMOVED_RANDOM_SHUFFLE) \
+  || defined(_LIBCUDACXX_BUILDING_LIBRARY)
+class _LIBCUDACXX_TYPE_VIS __rs_default;
 
-_LIBCPP_FUNC_VIS __rs_default __rs_get();
+_LIBCUDACXX_FUNC_VIS __rs_default __rs_get();
 
-class _LIBCPP_TYPE_VIS __rs_default
+class _LIBCUDACXX_TYPE_VIS __rs_default
 {
     static unsigned __c_;
 
@@ -84,16 +84,16 @@ class _LIBCPP_TYPE_VIS __rs_default
 
     result_type operator()();
 
-    static _LIBCPP_CONSTEXPR result_type min() {return _Min;}
-    static _LIBCPP_CONSTEXPR result_type max() {return _Max;}
+    static _LIBCUDACXX_CONSTEXPR result_type min() {return _Min;}
+    static _LIBCUDACXX_CONSTEXPR result_type max() {return _Max;}
 
-    friend _LIBCPP_FUNC_VIS __rs_default __rs_get();
+    friend _LIBCUDACXX_FUNC_VIS __rs_default __rs_get();
 };
 
-_LIBCPP_FUNC_VIS __rs_default __rs_get();
+_LIBCUDACXX_FUNC_VIS __rs_default __rs_get();
 
 template <class _RandomAccessIterator>
-_LIBCPP_DEPRECATED_IN_CXX14 void
+_LIBCUDACXX_DEPRECATED_IN_CXX14 void
 random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last)
 {
     typedef typename iterator_traits<_RandomAccessIterator>::
diff erence_type 
diff erence_type;
@@ -114,9 +114,9 @@ random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last)
 }
 
 template <class _RandomAccessIterator, class _RandomNumberGenerator>
-_LIBCPP_DEPRECATED_IN_CXX14 void
+_LIBCUDACXX_DEPRECATED_IN_CXX14 void
 random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last,
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
                _RandomNumberGenerator&& __rand)
 #else
                _RandomNumberGenerator& __rand)
@@ -167,8 +167,8 @@ void shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last,
       std::move(__first), std::move(__last), std::forward<_UniformRandomNumberGenerator>(__g));
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___ALGORITHM_SHUFFLE_H
+#endif // _LIBCUDACXX___ALGORITHM_SHUFFLE_H

diff  --git a/libcxx/include/__algorithm/sift_down.h b/libcxx/include/__algorithm/sift_down.h
index 06811239f84f..72063b25ed93 100644
--- a/libcxx/include/__algorithm/sift_down.h
+++ b/libcxx/include/__algorithm/sift_down.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_SIFT_DOWN_H
-#define _LIBCPP___ALGORITHM_SIFT_DOWN_H
+#ifndef _LIBCUDACXX___ALGORITHM_SIFT_DOWN_H
+#define _LIBCUDACXX___ALGORITHM_SIFT_DOWN_H
 
 #include <__algorithm/iterator_operations.h>
 #include <__assert>
@@ -15,14 +15,14 @@
 #include <__iterator/iterator_traits.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _AlgPolicy, class _Compare, class _RandomAccessIterator>
-_LIBCPP_CONSTEXPR_AFTER_CXX11 void
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX11 void
 __sift_down(_RandomAccessIterator __first, _Compare&& __comp,
             typename iterator_traits<_RandomAccessIterator>::
diff erence_type __len,
             _RandomAccessIterator __start)
@@ -74,16 +74,16 @@ __sift_down(_RandomAccessIterator __first, _Compare&& __comp,
 
         // check if we are in heap-order
     } while (!__comp(*__child_i, __top));
-    *__start = _VSTD::move(__top);
+    *__start = _CUDA_VSTD::move(__top);
 }
 
 template <class _AlgPolicy, class _Compare, class _RandomAccessIterator>
-_LIBCPP_CONSTEXPR_AFTER_CXX11 _RandomAccessIterator
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _RandomAccessIterator
 __floyd_sift_down(_RandomAccessIterator __first, _Compare&& __comp,
                   typename iterator_traits<_RandomAccessIterator>::
diff erence_type __len)
 {
     using 
diff erence_type = typename iterator_traits<_RandomAccessIterator>::
diff erence_type;
-    _LIBCPP_ASSERT(__len >= 2, "shouldn't be called unless __len >= 2");
+    _LIBCUDACXX_ASSERT(__len >= 2, "shouldn't be called unless __len >= 2");
 
     _RandomAccessIterator __hole = __first;
     _RandomAccessIterator __child_i = __first;
@@ -109,6 +109,6 @@ __floyd_sift_down(_RandomAccessIterator __first, _Compare&& __comp,
     }
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_SIFT_DOWN_H
+#endif // _LIBCUDACXX___ALGORITHM_SIFT_DOWN_H

diff  --git a/libcxx/include/__algorithm/sort.h b/libcxx/include/__algorithm/sort.h
index 1ca2f1b81712..219fa41f6dc5 100644
--- a/libcxx/include/__algorithm/sort.h
+++ b/libcxx/include/__algorithm/sort.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_SORT_H
-#define _LIBCPP___ALGORITHM_SORT_H
+#ifndef _LIBCUDACXX___ALGORITHM_SORT_H
+#define _LIBCUDACXX___ALGORITHM_SORT_H
 
 #include <__algorithm/comp.h>
 #include <__algorithm/comp_ref_type.h>
@@ -25,11 +25,11 @@
 #include <climits>
 #include <memory>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 // Wraps an algorithm policy tag and a comparator in a single struct, used to pass the policy tag around without
 // changing the number of template arguments (to keep the ABI stable). This is only used for the "range" policy tag.
@@ -43,7 +43,7 @@ struct _WrapAlgPolicy {
   using _Comp = _CompT;
   _Comp& __comp;
 
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
   _WrapAlgPolicy(_Comp& __c) : __comp(__c) {}
 };
 
@@ -62,7 +62,7 @@ struct _UnwrapAlgPolicy {
   using _AlgPolicy = _ClassicAlgPolicy;
   using _Comp = _CompT;
 
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 static
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 static
   _Comp __get_comp(_Comp __comp) { return __comp; }
 };
 
@@ -73,14 +73,14 @@ struct _UnwrapAlgPolicy<_WrapAlgPolicy<_Ts...> > {
   using _AlgPolicy = typename _Wrapped::_AlgPolicy;
   using _Comp = typename _Wrapped::_Comp;
 
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 static
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 static
   _Comp __get_comp(_Wrapped& __w) { return __w.__comp; }
 };
 
 // stable, 2-3 compares, 0-2 swaps
 
 template <class _AlgPolicy, class _Compare, class _ForwardIterator>
-_LIBCPP_CONSTEXPR_AFTER_CXX11 unsigned __sort3(_ForwardIterator __x, _ForwardIterator __y, _ForwardIterator __z,
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX11 unsigned __sort3(_ForwardIterator __x, _ForwardIterator __y, _ForwardIterator __z,
                                                _Compare __c) {
   using _Ops = _IterOps<_AlgPolicy>;
 
@@ -141,7 +141,7 @@ unsigned __sort4(_ForwardIterator __x1, _ForwardIterator __x2, _ForwardIterator
 // stable, 4-10 compares, 0-9 swaps
 
 template <class _WrappedComp, class _ForwardIterator>
-_LIBCPP_HIDDEN unsigned __sort5(_ForwardIterator __x1, _ForwardIterator __x2, _ForwardIterator __x3,
+_LIBCUDACXX_HIDDEN unsigned __sort5(_ForwardIterator __x1, _ForwardIterator __x2, _ForwardIterator __x3,
                                 _ForwardIterator __x4, _ForwardIterator __x5, _WrappedComp __wrapped_comp) {
   using _Unwrap = _UnwrapAlgPolicy<_WrappedComp>;
   using _AlgPolicy = typename _Unwrap::_AlgPolicy;
@@ -171,7 +171,7 @@ _LIBCPP_HIDDEN unsigned __sort5(_ForwardIterator __x1, _ForwardIterator __x2, _F
 }
 
 template <class _AlgPolicy, class _Compare, class _ForwardIterator>
-_LIBCPP_HIDDEN unsigned __sort5_wrap_policy(
+_LIBCUDACXX_HIDDEN unsigned __sort5_wrap_policy(
     _ForwardIterator __x1, _ForwardIterator __x2, _ForwardIterator __x3, _ForwardIterator __x4, _ForwardIterator __x5,
     _Compare __c) {
   using _WrappedComp = typename _WrapAlgPolicy<_AlgPolicy, _Compare>::type;
@@ -189,7 +189,7 @@ template <class _Tp>
 struct __is_simple_comparator<less<_Tp>&> : true_type {};
 template <class _Tp>
 struct __is_simple_comparator<greater<_Tp>&> : true_type {};
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 template <>
 struct __is_simple_comparator<ranges::less&> : true_type {};
 template <>
@@ -203,7 +203,7 @@ using __use_branchless_sort =
 
 // Ensures that __c(*__x, *__y) is true by swapping *__x and *__y if necessary.
 template <class _Compare, class _RandomAccessIterator>
-inline _LIBCPP_HIDE_FROM_ABI void __cond_swap(_RandomAccessIterator __x, _RandomAccessIterator __y, _Compare __c) {
+inline _LIBCUDACXX_HIDE_FROM_ABI void __cond_swap(_RandomAccessIterator __x, _RandomAccessIterator __y, _Compare __c) {
   // Note: this function behaves correctly even with proxy iterators (because it relies on `value_type`).
   using value_type = typename iterator_traits<_RandomAccessIterator>::value_type;
   bool __r = __c(*__x, *__y);
@@ -215,7 +215,7 @@ inline _LIBCPP_HIDE_FROM_ABI void __cond_swap(_RandomAccessIterator __x, _Random
 // Ensures that *__x, *__y and *__z are ordered according to the comparator __c,
 // under the assumption that *__y and *__z are already ordered.
 template <class _Compare, class _RandomAccessIterator>
-inline _LIBCPP_HIDE_FROM_ABI void __partially_sorted_swap(_RandomAccessIterator __x, _RandomAccessIterator __y,
+inline _LIBCUDACXX_HIDE_FROM_ABI void __partially_sorted_swap(_RandomAccessIterator __x, _RandomAccessIterator __y,
                                                           _RandomAccessIterator __z, _Compare __c) {
   // Note: this function behaves correctly even with proxy iterators (because it relies on `value_type`).
   using value_type = typename iterator_traits<_RandomAccessIterator>::value_type;
@@ -228,52 +228,52 @@ inline _LIBCPP_HIDE_FROM_ABI void __partially_sorted_swap(_RandomAccessIterator
 }
 
 template <class, class _Compare, class _RandomAccessIterator>
-inline _LIBCPP_HIDE_FROM_ABI __enable_if_t<__use_branchless_sort<_Compare, _RandomAccessIterator>::value, void>
+inline _LIBCUDACXX_HIDE_FROM_ABI __enable_if_t<__use_branchless_sort<_Compare, _RandomAccessIterator>::value, void>
 __sort3_maybe_branchless(_RandomAccessIterator __x1, _RandomAccessIterator __x2, _RandomAccessIterator __x3,
                          _Compare __c) {
-  _VSTD::__cond_swap<_Compare>(__x2, __x3, __c);
-  _VSTD::__partially_sorted_swap<_Compare>(__x1, __x2, __x3, __c);
+  _CUDA_VSTD::__cond_swap<_Compare>(__x2, __x3, __c);
+  _CUDA_VSTD::__partially_sorted_swap<_Compare>(__x1, __x2, __x3, __c);
 }
 
 template <class _AlgPolicy, class _Compare, class _RandomAccessIterator>
-inline _LIBCPP_HIDE_FROM_ABI __enable_if_t<!__use_branchless_sort<_Compare, _RandomAccessIterator>::value, void>
+inline _LIBCUDACXX_HIDE_FROM_ABI __enable_if_t<!__use_branchless_sort<_Compare, _RandomAccessIterator>::value, void>
 __sort3_maybe_branchless(_RandomAccessIterator __x1, _RandomAccessIterator __x2, _RandomAccessIterator __x3,
                          _Compare __c) {
   std::__sort3<_AlgPolicy, _Compare>(__x1, __x2, __x3, __c);
 }
 
 template <class, class _Compare, class _RandomAccessIterator>
-inline _LIBCPP_HIDE_FROM_ABI __enable_if_t<__use_branchless_sort<_Compare, _RandomAccessIterator>::value, void>
+inline _LIBCUDACXX_HIDE_FROM_ABI __enable_if_t<__use_branchless_sort<_Compare, _RandomAccessIterator>::value, void>
 __sort4_maybe_branchless(_RandomAccessIterator __x1, _RandomAccessIterator __x2, _RandomAccessIterator __x3,
                          _RandomAccessIterator __x4, _Compare __c) {
-  _VSTD::__cond_swap<_Compare>(__x1, __x3, __c);
-  _VSTD::__cond_swap<_Compare>(__x2, __x4, __c);
-  _VSTD::__cond_swap<_Compare>(__x1, __x2, __c);
-  _VSTD::__cond_swap<_Compare>(__x3, __x4, __c);
-  _VSTD::__cond_swap<_Compare>(__x2, __x3, __c);
+  _CUDA_VSTD::__cond_swap<_Compare>(__x1, __x3, __c);
+  _CUDA_VSTD::__cond_swap<_Compare>(__x2, __x4, __c);
+  _CUDA_VSTD::__cond_swap<_Compare>(__x1, __x2, __c);
+  _CUDA_VSTD::__cond_swap<_Compare>(__x3, __x4, __c);
+  _CUDA_VSTD::__cond_swap<_Compare>(__x2, __x3, __c);
 }
 
 template <class _AlgPolicy, class _Compare, class _RandomAccessIterator>
-inline _LIBCPP_HIDE_FROM_ABI __enable_if_t<!__use_branchless_sort<_Compare, _RandomAccessIterator>::value, void>
+inline _LIBCUDACXX_HIDE_FROM_ABI __enable_if_t<!__use_branchless_sort<_Compare, _RandomAccessIterator>::value, void>
 __sort4_maybe_branchless(_RandomAccessIterator __x1, _RandomAccessIterator __x2, _RandomAccessIterator __x3,
                          _RandomAccessIterator __x4, _Compare __c) {
   std::__sort4<_AlgPolicy, _Compare>(__x1, __x2, __x3, __x4, __c);
 }
 
 template <class, class _Compare, class _RandomAccessIterator>
-inline _LIBCPP_HIDE_FROM_ABI __enable_if_t<__use_branchless_sort<_Compare, _RandomAccessIterator>::value, void>
+inline _LIBCUDACXX_HIDE_FROM_ABI __enable_if_t<__use_branchless_sort<_Compare, _RandomAccessIterator>::value, void>
 __sort5_maybe_branchless(_RandomAccessIterator __x1, _RandomAccessIterator __x2, _RandomAccessIterator __x3,
                          _RandomAccessIterator __x4, _RandomAccessIterator __x5, _Compare __c) {
-  _VSTD::__cond_swap<_Compare>(__x1, __x2, __c);
-  _VSTD::__cond_swap<_Compare>(__x4, __x5, __c);
-  _VSTD::__partially_sorted_swap<_Compare>(__x3, __x4, __x5, __c);
-  _VSTD::__cond_swap<_Compare>(__x2, __x5, __c);
-  _VSTD::__partially_sorted_swap<_Compare>(__x1, __x3, __x4, __c);
-  _VSTD::__partially_sorted_swap<_Compare>(__x2, __x3, __x4, __c);
+  _CUDA_VSTD::__cond_swap<_Compare>(__x1, __x2, __c);
+  _CUDA_VSTD::__cond_swap<_Compare>(__x4, __x5, __c);
+  _CUDA_VSTD::__partially_sorted_swap<_Compare>(__x3, __x4, __x5, __c);
+  _CUDA_VSTD::__cond_swap<_Compare>(__x2, __x5, __c);
+  _CUDA_VSTD::__partially_sorted_swap<_Compare>(__x1, __x3, __x4, __c);
+  _CUDA_VSTD::__partially_sorted_swap<_Compare>(__x2, __x3, __x4, __c);
 }
 
 template <class _AlgPolicy, class _Compare, class _RandomAccessIterator>
-inline _LIBCPP_HIDE_FROM_ABI __enable_if_t<!__use_branchless_sort<_Compare, _RandomAccessIterator>::value, void>
+inline _LIBCUDACXX_HIDE_FROM_ABI __enable_if_t<!__use_branchless_sort<_Compare, _RandomAccessIterator>::value, void>
 __sort5_maybe_branchless(_RandomAccessIterator __x1, _RandomAccessIterator __x2, _RandomAccessIterator __x3,
                          _RandomAccessIterator __x4, _RandomAccessIterator __x5, _Compare __c) {
   std::__sort5_wrap_policy<_AlgPolicy, _Compare>(__x1, __x2, __x3, __x4, __x5, __c);
@@ -281,7 +281,7 @@ __sort5_maybe_branchless(_RandomAccessIterator __x1, _RandomAccessIterator __x2,
 
 // Assumes size > 0
 template <class _AlgPolicy, class _Compare, class _BidirectionalIterator>
-_LIBCPP_CONSTEXPR_AFTER_CXX11 void __selection_sort(_BidirectionalIterator __first, _BidirectionalIterator __last,
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX11 void __selection_sort(_BidirectionalIterator __first, _BidirectionalIterator __last,
                                                     _Compare __comp) {
   _BidirectionalIterator __lm1 = __last;
   for (--__lm1; __first != __lm1; ++__first) {
@@ -303,7 +303,7 @@ void __insertion_sort(_BidirectionalIterator __first, _BidirectionalIterator __l
       value_type __t(_Ops::__iter_move(__j));
       for (_BidirectionalIterator __k = __i; __k != __first && __comp(__t, *--__k); --__j)
         *__j = _Ops::__iter_move(__k);
-      *__j = _VSTD::move(__t);
+      *__j = _CUDA_VSTD::move(__t);
     }
   }
 }
@@ -325,7 +325,7 @@ void __insertion_sort_3(_RandomAccessIterator __first, _RandomAccessIterator __l
         *__j = _Ops::__iter_move(__k);
         __j = __k;
       } while (__j != __first && __comp(__t, *--__k));
-      *__j = _VSTD::move(__t);
+      *__j = _CUDA_VSTD::move(__t);
     }
     __j = __i;
   }
@@ -377,7 +377,7 @@ bool __insertion_sort_incomplete(
         *__j = _Ops::__iter_move(__k);
         __j = __k;
       } while (__j != __first && __comp(__t, *--__k));
-      *__j = _VSTD::move(__t);
+      *__j = _CUDA_VSTD::move(__t);
       if (++__count == __limit)
         return ++__i == __last;
     }
@@ -526,7 +526,7 @@ void __introsort(_RandomAccessIterator __first, _RandomAccessIterator __last, _C
           }
           // [__first, __i) == *__first and *__first < [__i, __last)
           // The first part is sorted, sort the second part
-          // _VSTD::__sort<_Compare>(__i, __last, __comp);
+          // _CUDA_VSTD::__sort<_Compare>(__i, __last, __comp);
           __first = __i;
           goto __restart;
         }
@@ -597,15 +597,15 @@ void __introsort(_RandomAccessIterator __first, _RandomAccessIterator __last, _C
 }
 
 template <typename _Number>
-inline _LIBCPP_HIDE_FROM_ABI _Number __log2i(_Number __n) {
+inline _LIBCUDACXX_HIDE_FROM_ABI _Number __log2i(_Number __n) {
   if (__n == 0)
     return 0;
   if (sizeof(__n) <= sizeof(unsigned))
-    return sizeof(unsigned) * CHAR_BIT - 1 - __libcpp_clz(static_cast<unsigned>(__n));
+    return sizeof(unsigned) * CHAR_BIT - 1 - __LIBCUDACXX_clz(static_cast<unsigned>(__n));
   if (sizeof(__n) <= sizeof(unsigned long))
-    return sizeof(unsigned long) * CHAR_BIT - 1 - __libcpp_clz(static_cast<unsigned long>(__n));
+    return sizeof(unsigned long) * CHAR_BIT - 1 - __LIBCUDACXX_clz(static_cast<unsigned long>(__n));
   if (sizeof(__n) <= sizeof(unsigned long long))
-    return sizeof(unsigned long long) * CHAR_BIT - 1 - __libcpp_clz(static_cast<unsigned long long>(__n));
+    return sizeof(unsigned long long) * CHAR_BIT - 1 - __LIBCUDACXX_clz(static_cast<unsigned long long>(__n));
 
   _Number __log2 = 0;
   while (__n > 1) {
@@ -628,56 +628,56 @@ void __sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Wrappe
 }
 
 template <class _Compare, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY void __sort(_Tp** __first, _Tp** __last, __less<_Tp*>&) {
+inline _LIBCUDACXX_INLINE_VISIBILITY void __sort(_Tp** __first, _Tp** __last, __less<_Tp*>&) {
   __less<uintptr_t> __comp;
   std::__sort<__less<uintptr_t>&, uintptr_t*>((uintptr_t*)__first, (uintptr_t*)__last, __comp);
 }
 
-extern template _LIBCPP_FUNC_VIS void __sort<__less<char>&, char*>(char*, char*, __less<char>&);
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-extern template _LIBCPP_FUNC_VIS void __sort<__less<wchar_t>&, wchar_t*>(wchar_t*, wchar_t*, __less<wchar_t>&);
+extern template _LIBCUDACXX_FUNC_VIS void __sort<__less<char>&, char*>(char*, char*, __less<char>&);
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
+extern template _LIBCUDACXX_FUNC_VIS void __sort<__less<wchar_t>&, wchar_t*>(wchar_t*, wchar_t*, __less<wchar_t>&);
 #endif
-extern template _LIBCPP_FUNC_VIS void __sort<__less<signed char>&, signed char*>(signed char*, signed char*, __less<signed char>&);
-extern template _LIBCPP_FUNC_VIS void __sort<__less<unsigned char>&, unsigned char*>(unsigned char*, unsigned char*, __less<unsigned char>&);
-extern template _LIBCPP_FUNC_VIS void __sort<__less<short>&, short*>(short*, short*, __less<short>&);
-extern template _LIBCPP_FUNC_VIS void __sort<__less<unsigned short>&, unsigned short*>(unsigned short*, unsigned short*, __less<unsigned short>&);
-extern template _LIBCPP_FUNC_VIS void __sort<__less<int>&, int*>(int*, int*, __less<int>&);
-extern template _LIBCPP_FUNC_VIS void __sort<__less<unsigned>&, unsigned*>(unsigned*, unsigned*, __less<unsigned>&);
-extern template _LIBCPP_FUNC_VIS void __sort<__less<long>&, long*>(long*, long*, __less<long>&);
-extern template _LIBCPP_FUNC_VIS void __sort<__less<unsigned long>&, unsigned long*>(unsigned long*, unsigned long*, __less<unsigned long>&);
-extern template _LIBCPP_FUNC_VIS void __sort<__less<long long>&, long long*>(long long*, long long*, __less<long long>&);
-extern template _LIBCPP_FUNC_VIS void __sort<__less<unsigned long long>&, unsigned long long*>(unsigned long long*, unsigned long long*, __less<unsigned long long>&);
-extern template _LIBCPP_FUNC_VIS void __sort<__less<float>&, float*>(float*, float*, __less<float>&);
-extern template _LIBCPP_FUNC_VIS void __sort<__less<double>&, double*>(double*, double*, __less<double>&);
-extern template _LIBCPP_FUNC_VIS void __sort<__less<long double>&, long double*>(long double*, long double*, __less<long double>&);
-
-extern template _LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<char>&, char*>(char*, char*, __less<char>&);
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-extern template _LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<wchar_t>&, wchar_t*>(wchar_t*, wchar_t*, __less<wchar_t>&);
+extern template _LIBCUDACXX_FUNC_VIS void __sort<__less<signed char>&, signed char*>(signed char*, signed char*, __less<signed char>&);
+extern template _LIBCUDACXX_FUNC_VIS void __sort<__less<unsigned char>&, unsigned char*>(unsigned char*, unsigned char*, __less<unsigned char>&);
+extern template _LIBCUDACXX_FUNC_VIS void __sort<__less<short>&, short*>(short*, short*, __less<short>&);
+extern template _LIBCUDACXX_FUNC_VIS void __sort<__less<unsigned short>&, unsigned short*>(unsigned short*, unsigned short*, __less<unsigned short>&);
+extern template _LIBCUDACXX_FUNC_VIS void __sort<__less<int>&, int*>(int*, int*, __less<int>&);
+extern template _LIBCUDACXX_FUNC_VIS void __sort<__less<unsigned>&, unsigned*>(unsigned*, unsigned*, __less<unsigned>&);
+extern template _LIBCUDACXX_FUNC_VIS void __sort<__less<long>&, long*>(long*, long*, __less<long>&);
+extern template _LIBCUDACXX_FUNC_VIS void __sort<__less<unsigned long>&, unsigned long*>(unsigned long*, unsigned long*, __less<unsigned long>&);
+extern template _LIBCUDACXX_FUNC_VIS void __sort<__less<long long>&, long long*>(long long*, long long*, __less<long long>&);
+extern template _LIBCUDACXX_FUNC_VIS void __sort<__less<unsigned long long>&, unsigned long long*>(unsigned long long*, unsigned long long*, __less<unsigned long long>&);
+extern template _LIBCUDACXX_FUNC_VIS void __sort<__less<float>&, float*>(float*, float*, __less<float>&);
+extern template _LIBCUDACXX_FUNC_VIS void __sort<__less<double>&, double*>(double*, double*, __less<double>&);
+extern template _LIBCUDACXX_FUNC_VIS void __sort<__less<long double>&, long double*>(long double*, long double*, __less<long double>&);
+
+extern template _LIBCUDACXX_FUNC_VIS bool __insertion_sort_incomplete<__less<char>&, char*>(char*, char*, __less<char>&);
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
+extern template _LIBCUDACXX_FUNC_VIS bool __insertion_sort_incomplete<__less<wchar_t>&, wchar_t*>(wchar_t*, wchar_t*, __less<wchar_t>&);
 #endif
-extern template _LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<signed char>&, signed char*>(signed char*, signed char*, __less<signed char>&);
-extern template _LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<unsigned char>&, unsigned char*>(unsigned char*, unsigned char*, __less<unsigned char>&);
-extern template _LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<short>&, short*>(short*, short*, __less<short>&);
-extern template _LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<unsigned short>&, unsigned short*>(unsigned short*, unsigned short*, __less<unsigned short>&);
-extern template _LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<int>&, int*>(int*, int*, __less<int>&);
-extern template _LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<unsigned>&, unsigned*>(unsigned*, unsigned*, __less<unsigned>&);
-extern template _LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<long>&, long*>(long*, long*, __less<long>&);
-extern template _LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<unsigned long>&, unsigned long*>(unsigned long*, unsigned long*, __less<unsigned long>&);
-extern template _LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<long long>&, long long*>(long long*, long long*, __less<long long>&);
-extern template _LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<unsigned long long>&, unsigned long long*>(unsigned long long*, unsigned long long*, __less<unsigned long long>&);
-extern template _LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<float>&, float*>(float*, float*, __less<float>&);
-extern template _LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<double>&, double*>(double*, double*, __less<double>&);
-extern template _LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<long double>&, long double*>(long double*, long double*, __less<long double>&);
-
-extern template _LIBCPP_FUNC_VIS unsigned __sort5<__less<long double>&, long double*>(long double*, long double*, long double*, long double*, long double*, __less<long double>&);
+extern template _LIBCUDACXX_FUNC_VIS bool __insertion_sort_incomplete<__less<signed char>&, signed char*>(signed char*, signed char*, __less<signed char>&);
+extern template _LIBCUDACXX_FUNC_VIS bool __insertion_sort_incomplete<__less<unsigned char>&, unsigned char*>(unsigned char*, unsigned char*, __less<unsigned char>&);
+extern template _LIBCUDACXX_FUNC_VIS bool __insertion_sort_incomplete<__less<short>&, short*>(short*, short*, __less<short>&);
+extern template _LIBCUDACXX_FUNC_VIS bool __insertion_sort_incomplete<__less<unsigned short>&, unsigned short*>(unsigned short*, unsigned short*, __less<unsigned short>&);
+extern template _LIBCUDACXX_FUNC_VIS bool __insertion_sort_incomplete<__less<int>&, int*>(int*, int*, __less<int>&);
+extern template _LIBCUDACXX_FUNC_VIS bool __insertion_sort_incomplete<__less<unsigned>&, unsigned*>(unsigned*, unsigned*, __less<unsigned>&);
+extern template _LIBCUDACXX_FUNC_VIS bool __insertion_sort_incomplete<__less<long>&, long*>(long*, long*, __less<long>&);
+extern template _LIBCUDACXX_FUNC_VIS bool __insertion_sort_incomplete<__less<unsigned long>&, unsigned long*>(unsigned long*, unsigned long*, __less<unsigned long>&);
+extern template _LIBCUDACXX_FUNC_VIS bool __insertion_sort_incomplete<__less<long long>&, long long*>(long long*, long long*, __less<long long>&);
+extern template _LIBCUDACXX_FUNC_VIS bool __insertion_sort_incomplete<__less<unsigned long long>&, unsigned long long*>(unsigned long long*, unsigned long long*, __less<unsigned long long>&);
+extern template _LIBCUDACXX_FUNC_VIS bool __insertion_sort_incomplete<__less<float>&, float*>(float*, float*, __less<float>&);
+extern template _LIBCUDACXX_FUNC_VIS bool __insertion_sort_incomplete<__less<double>&, double*>(double*, double*, __less<double>&);
+extern template _LIBCUDACXX_FUNC_VIS bool __insertion_sort_incomplete<__less<long double>&, long double*>(long double*, long double*, __less<long double>&);
+
+extern template _LIBCUDACXX_FUNC_VIS unsigned __sort5<__less<long double>&, long double*>(long double*, long double*, long double*, long double*, long double*, __less<long double>&);
 
 template <class _AlgPolicy, class _RandomAccessIterator, class _Comp>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void __sort_impl(_RandomAccessIterator __first, _RandomAccessIterator __last, _Comp& __comp) {
   std::__debug_randomize_range<_AlgPolicy>(__first, __last);
 
   using _Comp_ref = typename __comp_ref_type<_Comp>::type;
-  if (__libcpp_is_constant_evaluated()) {
+  if (__LIBCUDACXX_is_constant_evaluated()) {
     std::__partial_sort<_AlgPolicy>(__first, __last, __last, __comp);
 
   } else {
@@ -689,17 +689,17 @@ void __sort_impl(_RandomAccessIterator __first, _RandomAccessIterator __last, _C
 }
 
 template <class _RandomAccessIterator, class _Comp>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Comp __comp) {
   std::__sort_impl<_ClassicAlgPolicy>(std::move(__first), std::move(__last), __comp);
 }
 
 template <class _RandomAccessIterator>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void sort(_RandomAccessIterator __first, _RandomAccessIterator __last) {
   std::sort(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_SORT_H
+#endif // _LIBCUDACXX___ALGORITHM_SORT_H

diff  --git a/libcxx/include/__algorithm/sort_heap.h b/libcxx/include/__algorithm/sort_heap.h
index 7713b766f913..0c927ed961c9 100644
--- a/libcxx/include/__algorithm/sort_heap.h
+++ b/libcxx/include/__algorithm/sort_heap.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_SORT_HEAP_H
-#define _LIBCPP___ALGORITHM_SORT_HEAP_H
+#ifndef _LIBCUDACXX___ALGORITHM_SORT_HEAP_H
+#define _LIBCUDACXX___ALGORITHM_SORT_HEAP_H
 
 #include <__algorithm/comp.h>
 #include <__algorithm/comp_ref_type.h>
@@ -18,14 +18,14 @@
 #include <__utility/move.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _AlgPolicy, class _Compare, class _RandomAccessIterator>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 void __sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare&& __comp) {
   using _CompRef = typename __comp_ref_type<_Compare>::type;
   _CompRef __comp_ref = __comp;
@@ -36,7 +36,7 @@ void __sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _C
 }
 
 template <class _RandomAccessIterator, class _Compare>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) {
   static_assert(std::is_copy_constructible<_RandomAccessIterator>::value, "Iterators must be copy constructible.");
   static_assert(std::is_copy_assignable<_RandomAccessIterator>::value, "Iterators must be copy assignable.");
@@ -45,12 +45,12 @@ void sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Com
 }
 
 template <class _RandomAccessIterator>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) {
   std::sort_heap(std::move(__first), std::move(__last),
       __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_SORT_HEAP_H
+#endif // _LIBCUDACXX___ALGORITHM_SORT_HEAP_H

diff  --git a/libcxx/include/__algorithm/stable_partition.h b/libcxx/include/__algorithm/stable_partition.h
index c7aa3f07a88c..04f45027623a 100644
--- a/libcxx/include/__algorithm/stable_partition.h
+++ b/libcxx/include/__algorithm/stable_partition.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_STABLE_PARTITION_H
-#define _LIBCPP___ALGORITHM_STABLE_PARTITION_H
+#ifndef _LIBCUDACXX___ALGORITHM_STABLE_PARTITION_H
+#define _LIBCUDACXX___ALGORITHM_STABLE_PARTITION_H
 
 #include <__algorithm/iterator_operations.h>
 #include <__algorithm/rotate.h>
@@ -18,11 +18,11 @@
 #include <memory>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _AlgPolicy, class _Predicate, class _ForwardIterator, class _Distance, class _Pair>
 _ForwardIterator
@@ -138,9 +138,9 @@ __stable_partition_impl(_ForwardIterator __first, _ForwardIterator __last, _Pred
     if (__len >= __alloc_limit)
     {
 // TODO: Remove the use of std::get_temporary_buffer
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
-        __p = _VSTD::get_temporary_buffer<value_type>(__len);
-_LIBCPP_SUPPRESS_DEPRECATED_POP
+_LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
+        __p = _CUDA_VSTD::get_temporary_buffer<value_type>(__len);
+_LIBCUDACXX_SUPPRESS_DEPRECATED_POP
         __h.reset(__p.first);
     }
     return std::__stable_partition_impl<_AlgPolicy, _Predicate&>(
@@ -292,9 +292,9 @@ __stable_partition_impl(_BidirectionalIterator __first, _BidirectionalIterator _
     if (__len >= __alloc_limit)
     {
 // TODO: Remove the use of std::get_temporary_buffer
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
-        __p = _VSTD::get_temporary_buffer<value_type>(__len);
-_LIBCPP_SUPPRESS_DEPRECATED_POP
+_LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
+        __p = _CUDA_VSTD::get_temporary_buffer<value_type>(__len);
+_LIBCUDACXX_SUPPRESS_DEPRECATED_POP
         __h.reset(__p.first);
     }
     return std::__stable_partition_impl<_AlgPolicy, _Predicate&>(
@@ -302,7 +302,7 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
 }
 
 template <class _AlgPolicy, class _Predicate, class _ForwardIterator, class _IterCategory>
-_LIBCPP_HIDE_FROM_ABI
+_LIBCUDACXX_HIDE_FROM_ABI
 _ForwardIterator __stable_partition(
     _ForwardIterator __first, _ForwardIterator __last, _Predicate&& __pred, _IterCategory __iter_category) {
   return std::__stable_partition_impl<_AlgPolicy, __uncvref_t<_Predicate>&>(
@@ -310,7 +310,7 @@ _ForwardIterator __stable_partition(
 }
 
 template <class _ForwardIterator, class _Predicate>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 _ForwardIterator
 stable_partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred)
 {
@@ -319,6 +319,6 @@ stable_partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate _
       std::move(__first), std::move(__last), __pred, _IterCategory());
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_STABLE_PARTITION_H
+#endif // _LIBCUDACXX___ALGORITHM_STABLE_PARTITION_H

diff  --git a/libcxx/include/__algorithm/stable_sort.h b/libcxx/include/__algorithm/stable_sort.h
index fb149eeb65dc..6b1adb4c2695 100644
--- a/libcxx/include/__algorithm/stable_sort.h
+++ b/libcxx/include/__algorithm/stable_sort.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_STABLE_SORT_H
-#define _LIBCPP___ALGORITHM_STABLE_SORT_H
+#ifndef _LIBCUDACXX___ALGORITHM_STABLE_SORT_H
+#define _LIBCUDACXX___ALGORITHM_STABLE_SORT_H
 
 #include <__algorithm/comp.h>
 #include <__algorithm/comp_ref_type.h>
@@ -20,11 +20,11 @@
 #include <memory>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _AlgPolicy, class _Compare, class _InputIterator1, class _InputIterator2>
 void
@@ -194,7 +194,7 @@ __stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Comp
         __d.__set(__len, (value_type*)nullptr);
         std::__merge_move_assign<_AlgPolicy, _Compare>(
             __buff, __buff + __l2, __buff + __l2, __buff + __len, __first, __comp);
-//         _VSTD::__merge<_Compare>(move_iterator<value_type*>(__buff),
+//         _CUDA_VSTD::__merge<_Compare>(move_iterator<value_type*>(__buff),
 //                                  move_iterator<value_type*>(__buff + __l2),
 //                                  move_iterator<_RandomAccessIterator>(__buff + __l2),
 //                                  move_iterator<_RandomAccessIterator>(__buff + __len),
@@ -207,7 +207,7 @@ __stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Comp
 }
 
 template <class _AlgPolicy, class _RandomAccessIterator, class _Compare>
-inline _LIBCPP_HIDE_FROM_ABI
+inline _LIBCUDACXX_HIDE_FROM_ABI
 void __stable_sort_impl(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare& __comp) {
   using value_type = typename iterator_traits<_RandomAccessIterator>::value_type;
   using 
diff erence_type = typename iterator_traits<_RandomAccessIterator>::
diff erence_type;
@@ -217,9 +217,9 @@ void __stable_sort_impl(_RandomAccessIterator __first, _RandomAccessIterator __l
   unique_ptr<value_type, __return_temporary_buffer> __h;
   if (__len > static_cast<
diff erence_type>(__stable_sort_switch<value_type>::value)) {
 // TODO: Remove the use of std::get_temporary_buffer
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+_LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
       __buf = std::get_temporary_buffer<value_type>(__len);
-_LIBCPP_SUPPRESS_DEPRECATED_POP
+_LIBCUDACXX_SUPPRESS_DEPRECATED_POP
       __h.reset(__buf.first);
   }
 
@@ -228,17 +228,17 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
 }
 
 template <class _RandomAccessIterator, class _Compare>
-inline _LIBCPP_HIDE_FROM_ABI
+inline _LIBCUDACXX_HIDE_FROM_ABI
 void stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) {
   std::__stable_sort_impl<_ClassicAlgPolicy>(std::move(__first), std::move(__last), __comp);
 }
 
 template <class _RandomAccessIterator>
-inline _LIBCPP_HIDE_FROM_ABI
+inline _LIBCUDACXX_HIDE_FROM_ABI
 void stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last) {
   std::stable_sort(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_STABLE_SORT_H
+#endif // _LIBCUDACXX___ALGORITHM_STABLE_SORT_H

diff  --git a/libcxx/include/__algorithm/swap_ranges.h b/libcxx/include/__algorithm/swap_ranges.h
index 0cff519a8da9..52346fe6d56c 100644
--- a/libcxx/include/__algorithm/swap_ranges.h
+++ b/libcxx/include/__algorithm/swap_ranges.h
@@ -6,23 +6,23 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_SWAP_RANGES_H
-#define _LIBCPP___ALGORITHM_SWAP_RANGES_H
+#ifndef _LIBCUDACXX___ALGORITHM_SWAP_RANGES_H
+#define _LIBCUDACXX___ALGORITHM_SWAP_RANGES_H
 
 #include <__algorithm/iterator_operations.h>
 #include <__config>
 #include <__utility/move.h>
 #include <__utility/pair.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 // 2+2 iterators: the shorter size will be used.
 template <class _AlgPolicy, class _ForwardIterator1, class _Sentinel1, class _ForwardIterator2, class _Sentinel2>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 pair<_ForwardIterator1, _ForwardIterator2>
 __swap_ranges(_ForwardIterator1 __first1, _Sentinel1 __last1, _ForwardIterator2 __first2, _Sentinel2 __last2) {
   while (__first1 != __last1 && __first2 != __last2) {
@@ -36,7 +36,7 @@ __swap_ranges(_ForwardIterator1 __first1, _Sentinel1 __last1, _ForwardIterator2
 
 // 2+1 iterators: size2 >= size1.
 template <class _AlgPolicy, class _ForwardIterator1, class _Sentinel1, class _ForwardIterator2>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 pair<_ForwardIterator1, _ForwardIterator2>
 __swap_ranges(_ForwardIterator1 __first1, _Sentinel1 __last1, _ForwardIterator2 __first2) {
   while (__first1 != __last1) {
@@ -49,12 +49,12 @@ __swap_ranges(_ForwardIterator1 __first1, _Sentinel1 __last1, _ForwardIterator2
 }
 
 template <class _ForwardIterator1, class _ForwardIterator2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator2
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _ForwardIterator2
 swap_ranges(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2) {
   return std::__swap_ranges<_ClassicAlgPolicy>(
       std::move(__first1), std::move(__last1), std::move(__first2)).second;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_SWAP_RANGES_H
+#endif // _LIBCUDACXX___ALGORITHM_SWAP_RANGES_H

diff  --git a/libcxx/include/__algorithm/transform.h b/libcxx/include/__algorithm/transform.h
index f9db806f5b94..93119322af3c 100644
--- a/libcxx/include/__algorithm/transform.h
+++ b/libcxx/include/__algorithm/transform.h
@@ -6,19 +6,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_TRANSFORM_H
-#define _LIBCPP___ALGORITHM_TRANSFORM_H
+#ifndef _LIBCUDACXX___ALGORITHM_TRANSFORM_H
+#define _LIBCUDACXX___ALGORITHM_TRANSFORM_H
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _InputIterator, class _OutputIterator, class _UnaryOperation>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 _OutputIterator
 transform(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _UnaryOperation __op)
 {
@@ -28,7 +28,7 @@ transform(_InputIterator __first, _InputIterator __last, _OutputIterator __resul
 }
 
 template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _BinaryOperation>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 _OutputIterator
 transform(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2,
           _OutputIterator __result, _BinaryOperation __binary_op)
@@ -38,6 +38,6 @@ transform(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __f
     return __result;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_TRANSFORM_H
+#endif // _LIBCUDACXX___ALGORITHM_TRANSFORM_H

diff  --git a/libcxx/include/__algorithm/uniform_random_bit_generator_adaptor.h b/libcxx/include/__algorithm/uniform_random_bit_generator_adaptor.h
index 04a67752dd0b..dfb3cac77239 100644
--- a/libcxx/include/__algorithm/uniform_random_bit_generator_adaptor.h
+++ b/libcxx/include/__algorithm/uniform_random_bit_generator_adaptor.h
@@ -6,23 +6,23 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_RANGES_UNIFORM_RANDOM_BIT_GENERATOR_ADAPTOR_H
-#define _LIBCPP___ALGORITHM_RANGES_UNIFORM_RANDOM_BIT_GENERATOR_ADAPTOR_H
+#ifndef _LIBCUDACXX___ALGORITHM_RANGES_UNIFORM_RANDOM_BIT_GENERATOR_ADAPTOR_H
+#define _LIBCUDACXX___ALGORITHM_RANGES_UNIFORM_RANDOM_BIT_GENERATOR_ADAPTOR_H
 
 #include <__config>
 #include <__functional/invoke.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 // Range versions of random algorithms (e.g. `std::shuffle`) are less constrained than their classic counterparts.
 // Range algorithms only require the given generator to satisfy the `std::uniform_random_bit_generator` concept.
@@ -41,22 +41,22 @@ class _ClassicGenAdaptor {
 public:
   using result_type = invoke_result_t<_Gen&>;
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   static constexpr auto min() { return __uncvref_t<_Gen>::min(); }
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   static constexpr auto max() { return __uncvref_t<_Gen>::max(); }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr explicit _ClassicGenAdaptor(_Gen& __g) : __gen(__g) {}
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto operator()() const { return __gen(); }
 };
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-#endif // _LIBCPP___ALGORITHM_RANGES_UNIFORM_RANDOM_BIT_GENERATOR_ADAPTOR_H
+#endif // _LIBCUDACXX___ALGORITHM_RANGES_UNIFORM_RANDOM_BIT_GENERATOR_ADAPTOR_H

diff  --git a/libcxx/include/__algorithm/unique.h b/libcxx/include/__algorithm/unique.h
index 1727225a91cd..0c8b00fbfbff 100644
--- a/libcxx/include/__algorithm/unique.h
+++ b/libcxx/include/__algorithm/unique.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_UNIQUE_H
-#define _LIBCPP___ALGORITHM_UNIQUE_H
+#ifndef _LIBCUDACXX___ALGORITHM_UNIQUE_H
+#define _LIBCUDACXX___ALGORITHM_UNIQUE_H
 
 #include <__algorithm/adjacent_find.h>
 #include <__algorithm/comp.h>
@@ -17,16 +17,16 @@
 #include <__utility/move.h>
 #include <__utility/pair.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 // unique
 
 template <class _AlgPolicy, class _Iter, class _Sent, class _BinaryPredicate>
-_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 std::pair<_Iter, _Iter>
+_LIBCUDACXX_NODISCARD_EXT _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 std::pair<_Iter, _Iter>
 __unique(_Iter __first, _Sent __last, _BinaryPredicate&& __pred) {
   __first = std::__adjacent_find(__first, __last, __pred);
   if (__first != __last) {
@@ -43,18 +43,18 @@ __unique(_Iter __first, _Sent __last, _BinaryPredicate&& __pred) {
 }
 
 template <class _ForwardIterator, class _BinaryPredicate>
-_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
+_LIBCUDACXX_NODISCARD_EXT _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _ForwardIterator
 unique(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred) {
   return std::__unique<_ClassicAlgPolicy>(std::move(__first), std::move(__last), __pred).first;
 }
 
 template <class _ForwardIterator>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
+_LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _ForwardIterator
 unique(_ForwardIterator __first, _ForwardIterator __last) {
   typedef typename iterator_traits<_ForwardIterator>::value_type __v;
   return std::unique(__first, __last, __equal_to<__v>());
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_UNIQUE_H
+#endif // _LIBCUDACXX___ALGORITHM_UNIQUE_H

diff  --git a/libcxx/include/__algorithm/unique_copy.h b/libcxx/include/__algorithm/unique_copy.h
index c7c8d8e9d8fd..804573352b81 100644
--- a/libcxx/include/__algorithm/unique_copy.h
+++ b/libcxx/include/__algorithm/unique_copy.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_UNIQUE_COPY_H
-#define _LIBCPP___ALGORITHM_UNIQUE_COPY_H
+#ifndef _LIBCUDACXX___ALGORITHM_UNIQUE_COPY_H
+#define _LIBCUDACXX___ALGORITHM_UNIQUE_COPY_H
 
 #include <__algorithm/comp.h>
 #include <__algorithm/iterator_operations.h>
@@ -19,11 +19,11 @@
 #include <__utility/move.h>
 #include <__utility/pair.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace __unique_copy_tags {
 
@@ -34,7 +34,7 @@ struct __read_from_tmp_value_tag {};
 } // namespace __unique_copy_tags
 
 template <class _AlgPolicy, class _BinaryPredicate, class _InputIterator, class _Sent, class _OutputIterator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI pair<_InputIterator, _OutputIterator>
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _LIBCUDACXX_HIDE_FROM_ABI pair<_InputIterator, _OutputIterator>
 __unique_copy(_InputIterator __first,
               _Sent __last,
               _OutputIterator __result,
@@ -56,7 +56,7 @@ __unique_copy(_InputIterator __first,
 }
 
 template <class _AlgPolicy, class _BinaryPredicate, class _ForwardIterator, class _Sent, class _OutputIterator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI pair<_ForwardIterator, _OutputIterator>
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _LIBCUDACXX_HIDE_FROM_ABI pair<_ForwardIterator, _OutputIterator>
 __unique_copy(_ForwardIterator __first,
               _Sent __last,
               _OutputIterator __result,
@@ -78,7 +78,7 @@ __unique_copy(_ForwardIterator __first,
 }
 
 template <class _AlgPolicy, class _BinaryPredicate, class _InputIterator, class _Sent, class _InputAndOutputIterator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI pair<_InputIterator, _InputAndOutputIterator>
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _LIBCUDACXX_HIDE_FROM_ABI pair<_InputIterator, _InputAndOutputIterator>
 __unique_copy(_InputIterator __first,
               _Sent __last,
               _InputAndOutputIterator __result,
@@ -95,7 +95,7 @@ __unique_copy(_InputIterator __first,
 }
 
 template <class _InputIterator, class _OutputIterator, class _BinaryPredicate>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _OutputIterator
 unique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _BinaryPredicate __pred) {
   using __algo_tag = typename conditional<
       is_base_of<forward_iterator_tag, typename iterator_traits<_InputIterator>::iterator_category>::value,
@@ -112,12 +112,12 @@ unique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __res
 }
 
 template <class _InputIterator, class _OutputIterator>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _OutputIterator
 unique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result) {
   typedef typename iterator_traits<_InputIterator>::value_type __v;
   return std::unique_copy(std::move(__first), std::move(__last), std::move(__result), __equal_to<__v>());
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_UNIQUE_COPY_H
+#endif // _LIBCUDACXX___ALGORITHM_UNIQUE_COPY_H

diff  --git a/libcxx/include/__algorithm/unwrap_iter.h b/libcxx/include/__algorithm/unwrap_iter.h
index fa9a8fbf2dde..93f5d8cd6ba2 100644
--- a/libcxx/include/__algorithm/unwrap_iter.h
+++ b/libcxx/include/__algorithm/unwrap_iter.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_UNWRAP_ITER_H
-#define _LIBCPP___ALGORITHM_UNWRAP_ITER_H
+#ifndef _LIBCUDACXX___ALGORITHM_UNWRAP_ITER_H
+#define _LIBCUDACXX___ALGORITHM_UNWRAP_ITER_H
 
 #include <__config>
 #include <__iterator/iterator_traits.h>
@@ -15,11 +15,11 @@
 #include <__utility/move.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 // TODO: Change the name of __unwrap_iter_impl to something more appropriate
 // The job of __unwrap_iter is to remove iterator wrappers (like reverse_iterator or __wrap_iter),
@@ -32,41 +32,41 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 // Default case - we can't unwrap anything
 template <class _Iter, bool = __is_cpp17_contiguous_iterator<_Iter>::value>
 struct __unwrap_iter_impl {
-  static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Iter __rewrap(_Iter, _Iter __iter) { return __iter; }
-  static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Iter __unwrap(_Iter __i) _NOEXCEPT { return __i; }
+  static _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR _Iter __rewrap(_Iter, _Iter __iter) { return __iter; }
+  static _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR _Iter __unwrap(_Iter __i) _NOEXCEPT { return __i; }
 };
 
-#ifndef _LIBCPP_ENABLE_DEBUG_MODE
+#ifndef _LIBCUDACXX_ENABLE_DEBUG_MODE
 
 // It's a contiguous iterator, so we can use a raw pointer instead
 template <class _Iter>
 struct __unwrap_iter_impl<_Iter, true> {
   using _ToAddressT = decltype(std::__to_address(std::declval<_Iter>()));
 
-  static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Iter __rewrap(_Iter __orig_iter, _ToAddressT __unwrapped_iter) {
+  static _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR _Iter __rewrap(_Iter __orig_iter, _ToAddressT __unwrapped_iter) {
     return __orig_iter + (__unwrapped_iter - std::__to_address(__orig_iter));
   }
 
-  static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _ToAddressT __unwrap(_Iter __i) _NOEXCEPT {
+  static _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR _ToAddressT __unwrap(_Iter __i) _NOEXCEPT {
     return std::__to_address(__i);
   }
 };
 
-#endif // !_LIBCPP_ENABLE_DEBUG_MODE
+#endif // !_LIBCUDACXX_ENABLE_DEBUG_MODE
 
 template<class _Iter,
          class _Impl = __unwrap_iter_impl<_Iter>,
          __enable_if_t<is_copy_constructible<_Iter>::value, int> = 0>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 decltype(_Impl::__unwrap(std::declval<_Iter>())) __unwrap_iter(_Iter __i) _NOEXCEPT {
   return _Impl::__unwrap(__i);
 }
 
 template <class _OrigIter, class _Iter, class _Impl = __unwrap_iter_impl<_OrigIter> >
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _OrigIter __rewrap_iter(_OrigIter __orig_iter, _Iter __iter) _NOEXCEPT {
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR _OrigIter __rewrap_iter(_OrigIter __orig_iter, _Iter __iter) _NOEXCEPT {
   return _Impl::__rewrap(std::move(__orig_iter), std::move(__iter));
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_UNWRAP_ITER_H
+#endif // _LIBCUDACXX___ALGORITHM_UNWRAP_ITER_H

diff  --git a/libcxx/include/__algorithm/unwrap_range.h b/libcxx/include/__algorithm/unwrap_range.h
index 745906a96e15..e8a07e5155c0 100644
--- a/libcxx/include/__algorithm/unwrap_range.h
+++ b/libcxx/include/__algorithm/unwrap_range.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_UNWRAP_RANGE_H
-#define _LIBCPP___ALGORITHM_UNWRAP_RANGE_H
+#ifndef _LIBCUDACXX___ALGORITHM_UNWRAP_RANGE_H
+#define _LIBCUDACXX___ALGORITHM_UNWRAP_RANGE_H
 
 #include <__algorithm/unwrap_iter.h>
 #include <__concepts/constructible.h>
@@ -18,38 +18,38 @@
 #include <__utility/move.h>
 #include <__utility/pair.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 // __unwrap_range and __rewrap_range are used to unwrap ranges which may have 
diff erent iterator and sentinel types.
 // __unwrap_iter and __rewrap_iter don't work for this, because they assume that the iterator and sentinel have
 // the same type. __unwrap_range tries to get two iterators and then forward to __unwrap_iter.
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 template <class _Iter, class _Sent>
 struct __unwrap_range_impl {
-  _LIBCPP_HIDE_FROM_ABI static constexpr auto __unwrap(_Iter __first, _Sent __sent)
+  _LIBCUDACXX_HIDE_FROM_ABI static constexpr auto __unwrap(_Iter __first, _Sent __sent)
     requires random_access_iterator<_Iter> && sized_sentinel_for<_Sent, _Iter>
   {
     auto __last = ranges::next(__first, __sent);
     return pair{std::__unwrap_iter(std::move(__first)), std::__unwrap_iter(std::move(__last))};
   }
 
-  _LIBCPP_HIDE_FROM_ABI static constexpr auto __unwrap(_Iter __first, _Sent __last) {
+  _LIBCUDACXX_HIDE_FROM_ABI static constexpr auto __unwrap(_Iter __first, _Sent __last) {
     return pair{std::move(__first), std::move(__last)};
   }
 
-  _LIBCPP_HIDE_FROM_ABI static constexpr auto
+  _LIBCUDACXX_HIDE_FROM_ABI static constexpr auto
   __rewrap(_Iter __orig_iter, decltype(std::__unwrap_iter(__orig_iter)) __iter)
     requires random_access_iterator<_Iter> && sized_sentinel_for<_Sent, _Iter>
   {
     return std::__rewrap_iter(std::move(__orig_iter), std::move(__iter));
   }
 
-  _LIBCPP_HIDE_FROM_ABI static constexpr auto __rewrap(const _Iter&, _Iter __iter)
+  _LIBCUDACXX_HIDE_FROM_ABI static constexpr auto __rewrap(const _Iter&, _Iter __iter)
     requires (!(random_access_iterator<_Iter> && sized_sentinel_for<_Sent, _Iter>))
   {
     return __iter;
@@ -58,18 +58,18 @@ struct __unwrap_range_impl {
 
 template <class _Iter>
 struct __unwrap_range_impl<_Iter, _Iter> {
-  _LIBCPP_HIDE_FROM_ABI static constexpr auto __unwrap(_Iter __first, _Iter __last) {
+  _LIBCUDACXX_HIDE_FROM_ABI static constexpr auto __unwrap(_Iter __first, _Iter __last) {
     return pair{std::__unwrap_iter(std::move(__first)), std::__unwrap_iter(std::move(__last))};
   }
 
-  _LIBCPP_HIDE_FROM_ABI static constexpr auto
+  _LIBCUDACXX_HIDE_FROM_ABI static constexpr auto
   __rewrap(_Iter __orig_iter, decltype(std::__unwrap_iter(__orig_iter)) __iter) {
     return std::__rewrap_iter(std::move(__orig_iter), std::move(__iter));
   }
 };
 
 template <class _Iter, class _Sent>
-_LIBCPP_HIDE_FROM_ABI constexpr auto __unwrap_range(_Iter __first, _Sent __last) {
+_LIBCUDACXX_HIDE_FROM_ABI constexpr auto __unwrap_range(_Iter __first, _Sent __last) {
   return __unwrap_range_impl<_Iter, _Sent>::__unwrap(std::move(__first), std::move(__last));
 }
 
@@ -77,21 +77,21 @@ template <
     class _Sent,
     class _Iter,
     class _Unwrapped = decltype(std::__unwrap_range(std::declval<_Iter>(), std::declval<_Sent>()))>
-_LIBCPP_HIDE_FROM_ABI constexpr _Iter __rewrap_range(_Iter __orig_iter, _Unwrapped __iter) {
+_LIBCUDACXX_HIDE_FROM_ABI constexpr _Iter __rewrap_range(_Iter __orig_iter, _Unwrapped __iter) {
   return __unwrap_range_impl<_Iter, _Sent>::__rewrap(std::move(__orig_iter), std::move(__iter));
 }
-#else  // _LIBCPP_STD_VER > 17
+#else  // _LIBCUDACXX_STD_VER > 17
 template <class _Iter, class _Unwrapped = decltype(std::__unwrap_iter(std::declval<_Iter>()))>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR pair<_Unwrapped, _Unwrapped> __unwrap_range(_Iter __first, _Iter __last) {
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR pair<_Unwrapped, _Unwrapped> __unwrap_range(_Iter __first, _Iter __last) {
   return std::make_pair(std::__unwrap_iter(std::move(__first)), std::__unwrap_iter(std::move(__last)));
 }
 
 template <class _Iter, class _Unwrapped = decltype(std::__unwrap_iter(std::declval<_Iter>()))>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Iter __rewrap_range(_Iter __orig_iter, _Unwrapped __iter) {
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR _Iter __rewrap_range(_Iter __orig_iter, _Unwrapped __iter) {
   return std::__rewrap_iter(std::move(__orig_iter), std::move(__iter));
 }
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_UNWRAP_RANGE_H
+#endif // _LIBCUDACXX___ALGORITHM_UNWRAP_RANGE_H

diff  --git a/libcxx/include/__algorithm/upper_bound.h b/libcxx/include/__algorithm/upper_bound.h
index 1045380bc84e..c7473f51d69f 100644
--- a/libcxx/include/__algorithm/upper_bound.h
+++ b/libcxx/include/__algorithm/upper_bound.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ALGORITHM_UPPER_BOUND_H
-#define _LIBCPP___ALGORITHM_UPPER_BOUND_H
+#ifndef _LIBCUDACXX___ALGORITHM_UPPER_BOUND_H
+#define _LIBCUDACXX___ALGORITHM_UPPER_BOUND_H
 
 #include <__algorithm/comp.h>
 #include <__algorithm/half_positive.h>
@@ -21,14 +21,14 @@
 #include <__type_traits/is_copy_constructible.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _AlgPolicy, class _Compare, class _Iter, class _Sent, class _Tp, class _Proj>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _Iter
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _Iter
 __upper_bound(_Iter __first, _Sent __last, const _Tp& __value, _Compare&& __comp, _Proj&& __proj) {
   auto __len = _IterOps<_AlgPolicy>::distance(__first, __last);
   while (__len != 0) {
@@ -45,7 +45,7 @@ __upper_bound(_Iter __first, _Sent __last, const _Tp& __value, _Compare&& __comp
 }
 
 template <class _ForwardIterator, class _Tp, class _Compare>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
+_LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _ForwardIterator
 upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value, _Compare __comp) {
   static_assert(is_copy_constructible<_ForwardIterator>::value,
                 "Iterator has to be copy constructible");
@@ -54,7 +54,7 @@ upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __valu
 }
 
 template <class _ForwardIterator, class _Tp>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
+_LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _ForwardIterator
 upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) {
   return std::upper_bound(
       std::move(__first),
@@ -63,6 +63,6 @@ upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __valu
       __less<_Tp, typename iterator_traits<_ForwardIterator>::value_type>());
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ALGORITHM_UPPER_BOUND_H
+#endif // _LIBCUDACXX___ALGORITHM_UPPER_BOUND_H

diff  --git a/libcxx/include/__assert b/libcxx/include/__assert
index 87556085eabb..337f9469f370 100644
--- a/libcxx/include/__assert
+++ b/libcxx/include/__assert
@@ -7,53 +7,53 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ASSERT
-#define _LIBCPP___ASSERT
+#ifndef _LIBCUDACXX___ASSERT
+#define _LIBCUDACXX___ASSERT
 
 #include <__config>
 #include <__verbose_abort>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
 // This is for backwards compatibility with code that might have been enabling
 // assertions through the Debug mode previously.
-// TODO: In LLVM 16, make it an error to define _LIBCPP_DEBUG
-#if defined(_LIBCPP_DEBUG)
-# ifndef _LIBCPP_ENABLE_ASSERTIONS
-#   define _LIBCPP_ENABLE_ASSERTIONS 1
+// TODO: In LLVM 16, make it an error to define _LIBCUDACXX_DEBUG
+#if defined(_LIBCUDACXX_DEBUG)
+# ifndef _LIBCUDACXX_ENABLE_ASSERTIONS
+#   define _LIBCUDACXX_ENABLE_ASSERTIONS 1
 # endif
 #endif
 
 // Automatically enable assertions when the debug mode is enabled.
-#if defined(_LIBCPP_ENABLE_DEBUG_MODE)
-# ifndef _LIBCPP_ENABLE_ASSERTIONS
-#   define _LIBCPP_ENABLE_ASSERTIONS 1
+#if defined(_LIBCUDACXX_ENABLE_DEBUG_MODE)
+# ifndef _LIBCUDACXX_ENABLE_ASSERTIONS
+#   define _LIBCUDACXX_ENABLE_ASSERTIONS 1
 # endif
 #endif
 
-#ifndef _LIBCPP_ENABLE_ASSERTIONS
-# define _LIBCPP_ENABLE_ASSERTIONS _LIBCPP_ENABLE_ASSERTIONS_DEFAULT
+#ifndef _LIBCUDACXX_ENABLE_ASSERTIONS
+# define _LIBCUDACXX_ENABLE_ASSERTIONS _LIBCUDACXX_ENABLE_ASSERTIONS_DEFAULT
 #endif
 
-#if _LIBCPP_ENABLE_ASSERTIONS != 0 && _LIBCPP_ENABLE_ASSERTIONS != 1
-# error "_LIBCPP_ENABLE_ASSERTIONS must be set to 0 or 1"
+#if _LIBCUDACXX_ENABLE_ASSERTIONS != 0 && _LIBCUDACXX_ENABLE_ASSERTIONS != 1
+# error "_LIBCUDACXX_ENABLE_ASSERTIONS must be set to 0 or 1"
 #endif
 
-#if _LIBCPP_ENABLE_ASSERTIONS
-# define _LIBCPP_ASSERT(expression, message)                                        \
+#if _LIBCUDACXX_ENABLE_ASSERTIONS
+# define _LIBCUDACXX_ASSERT(expression, message)                                        \
     (__builtin_expect(static_cast<bool>(expression), 1) ?                           \
       (void)0 :                                                                     \
-      ::std::__libcpp_verbose_abort("%s:%d: assertion %s failed: %s", __FILE__, __LINE__, #expression, message))
-#elif !defined(_LIBCPP_ASSERTIONS_DISABLE_ASSUME) && __has_builtin(__builtin_assume)
-# define _LIBCPP_ASSERT(expression, message)                                        \
-    (_LIBCPP_DIAGNOSTIC_PUSH                                                        \
-    _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wassume")                                    \
+      ::std::__LIBCUDACXX_verbose_abort("%s:%d: assertion %s failed: %s", __FILE__, __LINE__, #expression, message))
+#elif !defined(_LIBCUDACXX_ASSERTIONS_DISABLE_ASSUME) && __has_builtin(__builtin_assume)
+# define _LIBCUDACXX_ASSERT(expression, message)                                        \
+    (_LIBCUDACXX_DIAGNOSTIC_PUSH                                                        \
+    _LIBCUDACXX_CLANG_DIAGNOSTIC_IGNORED("-Wassume")                                    \
     __builtin_assume(static_cast<bool>(expression))                                 \
-    _LIBCPP_DIAGNOSTIC_POP)
+    _LIBCUDACXX_DIAGNOSTIC_POP)
 #else
-# define _LIBCPP_ASSERT(expression, message) ((void)0)
+# define _LIBCUDACXX_ASSERT(expression, message) ((void)0)
 #endif
 
-#endif // _LIBCPP___ASSERT
+#endif // _LIBCUDACXX___ASSERT

diff  --git a/libcxx/include/__availability b/libcxx/include/__availability
index 72ff663334d3..cfbc18699ada 100644
--- a/libcxx/include/__availability
+++ b/libcxx/include/__availability
@@ -7,12 +7,12 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___AVAILABILITY
-#define _LIBCPP___AVAILABILITY
+#ifndef _LIBCUDACXX___AVAILABILITY
+#define _LIBCUDACXX___AVAILABILITY
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
@@ -59,33 +59,33 @@
 // [1]: https://clang.llvm.org/docs/AttributeReference.html#availability
 
 
-// For backwards compatibility, allow users to define _LIBCPP_DISABLE_AVAILABILITY
+// For backwards compatibility, allow users to define _LIBCUDACXX_DISABLE_AVAILABILITY
 // for a while.
-#if defined(_LIBCPP_DISABLE_AVAILABILITY)
-#   if !defined(_LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS)
-#       define _LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS
+#if defined(_LIBCUDACXX_DISABLE_AVAILABILITY)
+#   if !defined(_LIBCUDACXX_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS)
+#       define _LIBCUDACXX_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS
 #   endif
 #endif
 
 // Availability markup is disabled when building the library, or when the compiler
 // doesn't support the proper attributes.
-#if defined(_LIBCPP_BUILDING_LIBRARY) ||                                        \
+#if defined(_LIBCUDACXX_BUILDING_LIBRARY) ||                                        \
     defined(_LIBCXXABI_BUILDING_LIBRARY) ||                                     \
     !__has_feature(attribute_availability_with_strict) ||                       \
     !__has_feature(attribute_availability_in_templates) ||                      \
     !__has_extension(pragma_clang_attribute_external_declaration)
-#   if !defined(_LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS)
-#       define _LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS
+#   if !defined(_LIBCUDACXX_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS)
+#       define _LIBCUDACXX_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS
 #   endif
 #endif
 
-#if defined(_LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS)
+#if defined(_LIBCUDACXX_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS)
 
     // This controls the availability of std::shared_mutex and std::shared_timed_mutex,
     // which were added to the dylib later.
-#   define _LIBCPP_AVAILABILITY_SHARED_MUTEX
-// #   define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_mutex
-// #   define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_timed_mutex
+#   define _LIBCUDACXX_AVAILABILITY_SHARED_MUTEX
+// #   define _LIBCUDACXX_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_mutex
+// #   define _LIBCUDACXX_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_timed_mutex
 
     // These macros control the availability of std::bad_optional_access and
     // other exception types. These were put in the shared library to prevent
@@ -95,66 +95,66 @@
     // Note that when exceptions are disabled, the methods that normally throw
     // these exceptions can be used even on older deployment targets, but those
     // methods will abort instead of throwing.
-#   define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
-#   define _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS
-#   define _LIBCPP_AVAILABILITY_BAD_ANY_CAST
+#   define _LIBCUDACXX_AVAILABILITY_BAD_OPTIONAL_ACCESS
+#   define _LIBCUDACXX_AVAILABILITY_BAD_VARIANT_ACCESS
+#   define _LIBCUDACXX_AVAILABILITY_BAD_ANY_CAST
 
     // This controls the availability of std::uncaught_exceptions().
-#   define _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS
+#   define _LIBCUDACXX_AVAILABILITY_UNCAUGHT_EXCEPTIONS
 
     // This controls the availability of the sized version of ::operator delete,
     // ::operator delete[], and their align_val_t variants, which were all added
     // in C++17, and hence not present in early dylibs.
-#   define _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE
+#   define _LIBCUDACXX_AVAILABILITY_SIZED_NEW_DELETE
 
     // This controls the availability of the std::future_error exception.
     //
     // Note that when exceptions are disabled, the methods that normally throw
     // std::future_error can be used even on older deployment targets, but those
     // methods will abort instead of throwing.
-#   define _LIBCPP_AVAILABILITY_FUTURE_ERROR
+#   define _LIBCUDACXX_AVAILABILITY_FUTURE_ERROR
 
     // This controls the availability of std::type_info's vtable.
     // I can't imagine how using std::type_info can work at all if
     // this isn't supported.
-#   define _LIBCPP_AVAILABILITY_TYPEINFO_VTABLE
+#   define _LIBCUDACXX_AVAILABILITY_TYPEINFO_VTABLE
 
     // This controls the availability of std::locale::category members
     // (e.g. std::locale::collate), which are defined in the dylib.
-#   define _LIBCPP_AVAILABILITY_LOCALE_CATEGORY
+#   define _LIBCUDACXX_AVAILABILITY_LOCALE_CATEGORY
 
     // This controls the availability of atomic operations on std::shared_ptr
     // (e.g. `std::atomic_store(std::shared_ptr)`), which require a shared
     // lock table located in the dylib.
-#   define _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
+#   define _LIBCUDACXX_AVAILABILITY_ATOMIC_SHARED_PTR
 
     // These macros control the availability of all parts of <filesystem> that
     // depend on something in the dylib.
-#   define _LIBCPP_AVAILABILITY_FILESYSTEM
-#   define _LIBCPP_AVAILABILITY_FILESYSTEM_PUSH
-#   define _LIBCPP_AVAILABILITY_FILESYSTEM_POP
-// #   define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_filesystem
+#   define _LIBCUDACXX_AVAILABILITY_FILESYSTEM
+#   define _LIBCUDACXX_AVAILABILITY_FILESYSTEM_PUSH
+#   define _LIBCUDACXX_AVAILABILITY_FILESYSTEM_POP
+// #   define _LIBCUDACXX_AVAILABILITY_DISABLE_FTM___cpp_lib_filesystem
 
     // This controls the availability of floating-point std::to_chars functions.
     // These overloads were added later than the integer overloads.
-#   define _LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT
+#   define _LIBCUDACXX_AVAILABILITY_TO_CHARS_FLOATING_POINT
 
     // This controls the availability of the C++20 synchronization library,
     // which requires shared library support for various operations
     // (see libcxx/src/atomic.cpp). This includes <barier>, <latch>,
     // <semaphore>, and notification functions on std::atomic.
-#   define _LIBCPP_AVAILABILITY_SYNC
-// #   define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_atomic_wait
-// #   define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_barrier
-// #   define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_latch
-// #   define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_semaphore
+#   define _LIBCUDACXX_AVAILABILITY_SYNC
+// #   define _LIBCUDACXX_AVAILABILITY_DISABLE_FTM___cpp_lib_atomic_wait
+// #   define _LIBCUDACXX_AVAILABILITY_DISABLE_FTM___cpp_lib_barrier
+// #   define _LIBCUDACXX_AVAILABILITY_DISABLE_FTM___cpp_lib_latch
+// #   define _LIBCUDACXX_AVAILABILITY_DISABLE_FTM___cpp_lib_semaphore
 
     // This controls the availability of the C++20 format library.
     // The library is in development and not ABI stable yet. P2216 is
     // retroactively accepted in C++20. This paper contains ABI breaking
     // changes.
-#   define _LIBCPP_AVAILABILITY_FORMAT
-// #   define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_format
+#   define _LIBCUDACXX_AVAILABILITY_FORMAT
+// #   define _LIBCUDACXX_AVAILABILITY_DISABLE_FTM___cpp_lib_format
 
     // This controls whether the default verbose termination function is
     // provided by the library.
@@ -165,16 +165,16 @@
     // (it will think that no function is provided, when in reality the
     // user has provided their own).
     //
-    // Users can pass -D_LIBCPP_AVAILABILITY_CUSTOM_VERBOSE_ABORT_PROVIDED
+    // Users can pass -D_LIBCUDACXX_AVAILABILITY_CUSTOM_VERBOSE_ABORT_PROVIDED
     // to the compiler to tell the library not to define its own verbose abort.
     // Note that defining this macro but failing to define a custom function
     // will lead to a load-time error on back-deployment targets, so it should
     // be avoided.
-// #   define _LIBCPP_HAS_NO_VERBOSE_ABORT_IN_LIBRARY
+// #   define _LIBCUDACXX_HAS_NO_VERBOSE_ABORT_IN_LIBRARY
 
 #elif defined(__APPLE__)
 
-#   define _LIBCPP_AVAILABILITY_SHARED_MUTEX                                    \
+#   define _LIBCUDACXX_AVAILABILITY_SHARED_MUTEX                                    \
         __attribute__((availability(macos,strict,introduced=10.12)))            \
         __attribute__((availability(ios,strict,introduced=10.0)))               \
         __attribute__((availability(tvos,strict,introduced=10.0)))              \
@@ -183,61 +183,61 @@
         (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 100000) || \
         (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 100000) ||         \
         (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 30000)
-#       define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_mutex
-#       define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_timed_mutex
+#       define _LIBCUDACXX_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_mutex
+#       define _LIBCUDACXX_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_timed_mutex
 #   endif
 
         // Note: bad_optional_access & friends were not introduced in the matching
         // macOS and iOS versions, so the version mismatch between macOS and others
         // is intended.
-#   define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS                             \
+#   define _LIBCUDACXX_AVAILABILITY_BAD_OPTIONAL_ACCESS                             \
         __attribute__((availability(macos,strict,introduced=10.13)))            \
         __attribute__((availability(ios,strict,introduced=12.0)))               \
         __attribute__((availability(tvos,strict,introduced=12.0)))              \
         __attribute__((availability(watchos,strict,introduced=5.0)))
-#   define _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS                              \
-        _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
-#   define _LIBCPP_AVAILABILITY_BAD_ANY_CAST                                    \
-        _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
+#   define _LIBCUDACXX_AVAILABILITY_BAD_VARIANT_ACCESS                              \
+        _LIBCUDACXX_AVAILABILITY_BAD_OPTIONAL_ACCESS
+#   define _LIBCUDACXX_AVAILABILITY_BAD_ANY_CAST                                    \
+        _LIBCUDACXX_AVAILABILITY_BAD_OPTIONAL_ACCESS
 
-#   define _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS                             \
+#   define _LIBCUDACXX_AVAILABILITY_UNCAUGHT_EXCEPTIONS                             \
         __attribute__((availability(macos,strict,introduced=10.12)))            \
         __attribute__((availability(ios,strict,introduced=10.0)))               \
         __attribute__((availability(tvos,strict,introduced=10.0)))              \
         __attribute__((availability(watchos,strict,introduced=3.0)))
 
-#   define _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE                                \
+#   define _LIBCUDACXX_AVAILABILITY_SIZED_NEW_DELETE                                \
         __attribute__((availability(macos,strict,introduced=10.12)))            \
         __attribute__((availability(ios,strict,introduced=10.0)))               \
         __attribute__((availability(tvos,strict,introduced=10.0)))              \
         __attribute__((availability(watchos,strict,introduced=3.0)))
 
-#   define _LIBCPP_AVAILABILITY_FUTURE_ERROR                                    \
+#   define _LIBCUDACXX_AVAILABILITY_FUTURE_ERROR                                    \
         __attribute__((availability(ios,strict,introduced=6.0)))
 
-#   define _LIBCPP_AVAILABILITY_TYPEINFO_VTABLE                                 \
+#   define _LIBCUDACXX_AVAILABILITY_TYPEINFO_VTABLE                                 \
         __attribute__((availability(macos,strict,introduced=10.9)))             \
         __attribute__((availability(ios,strict,introduced=7.0)))
 
-#   define _LIBCPP_AVAILABILITY_LOCALE_CATEGORY                                 \
+#   define _LIBCUDACXX_AVAILABILITY_LOCALE_CATEGORY                                 \
         __attribute__((availability(macos,strict,introduced=10.9)))             \
         __attribute__((availability(ios,strict,introduced=7.0)))
 
-#   define _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR                               \
+#   define _LIBCUDACXX_AVAILABILITY_ATOMIC_SHARED_PTR                               \
         __attribute__((availability(macos,strict,introduced=10.9)))             \
         __attribute__((availability(ios,strict,introduced=7.0)))
 
-#   define _LIBCPP_AVAILABILITY_FILESYSTEM                                      \
+#   define _LIBCUDACXX_AVAILABILITY_FILESYSTEM                                      \
         __attribute__((availability(macos,strict,introduced=10.15)))            \
         __attribute__((availability(ios,strict,introduced=13.0)))               \
         __attribute__((availability(tvos,strict,introduced=13.0)))              \
         __attribute__((availability(watchos,strict,introduced=6.0)))
-#   define _LIBCPP_AVAILABILITY_FILESYSTEM_PUSH                                 \
+#   define _LIBCUDACXX_AVAILABILITY_FILESYSTEM_PUSH                                 \
         _Pragma("clang attribute push(__attribute__((availability(macos,strict,introduced=10.15))), apply_to=any(function,record))") \
         _Pragma("clang attribute push(__attribute__((availability(ios,strict,introduced=13.0))), apply_to=any(function,record))")    \
         _Pragma("clang attribute push(__attribute__((availability(tvos,strict,introduced=13.0))), apply_to=any(function,record))")   \
         _Pragma("clang attribute push(__attribute__((availability(watchos,strict,introduced=6.0))), apply_to=any(function,record))")
-#   define _LIBCPP_AVAILABILITY_FILESYSTEM_POP                                  \
+#   define _LIBCUDACXX_AVAILABILITY_FILESYSTEM_POP                                  \
         _Pragma("clang attribute pop")                                          \
         _Pragma("clang attribute pop")                                          \
         _Pragma("clang attribute pop")                                          \
@@ -246,13 +246,13 @@
         (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 130000) || \
         (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 130000) ||         \
         (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 60000)
-#       define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_filesystem
+#       define _LIBCUDACXX_AVAILABILITY_DISABLE_FTM___cpp_lib_filesystem
 #   endif
 
-#   define _LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT                         \
+#   define _LIBCUDACXX_AVAILABILITY_TO_CHARS_FLOATING_POINT                         \
         __attribute__((unavailable))
 
-#   define _LIBCPP_AVAILABILITY_SYNC                                            \
+#   define _LIBCUDACXX_AVAILABILITY_SYNC                                            \
         __attribute__((availability(macos,strict,introduced=11.0)))             \
         __attribute__((availability(ios,strict,introduced=14.0)))               \
         __attribute__((availability(tvos,strict,introduced=14.0)))              \
@@ -261,17 +261,17 @@
         (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 140000) || \
         (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 140000) ||         \
         (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 70000)
-#       define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_atomic_wait
-#       define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_barrier
-#       define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_latch
-#       define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_semaphore
+#       define _LIBCUDACXX_AVAILABILITY_DISABLE_FTM___cpp_lib_atomic_wait
+#       define _LIBCUDACXX_AVAILABILITY_DISABLE_FTM___cpp_lib_barrier
+#       define _LIBCUDACXX_AVAILABILITY_DISABLE_FTM___cpp_lib_latch
+#       define _LIBCUDACXX_AVAILABILITY_DISABLE_FTM___cpp_lib_semaphore
 #   endif
 
-#   define _LIBCPP_AVAILABILITY_FORMAT                                          \
+#   define _LIBCUDACXX_AVAILABILITY_FORMAT                                          \
         __attribute__((unavailable))
-#   define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_format
+#   define _LIBCUDACXX_AVAILABILITY_DISABLE_FTM___cpp_lib_format
 
-#   define _LIBCPP_HAS_NO_VERBOSE_ABORT_IN_LIBRARY
+#   define _LIBCUDACXX_HAS_NO_VERBOSE_ABORT_IN_LIBRARY
 
 #else
 
@@ -281,19 +281,19 @@
 
 #endif
 
-// Define availability attributes that depend on _LIBCPP_NO_EXCEPTIONS.
+// Define availability attributes that depend on _LIBCUDACXX_NO_EXCEPTIONS.
 // Those are defined in terms of the availability attributes above, and
 // should not be vendor-specific.
-#if defined(_LIBCPP_NO_EXCEPTIONS)
-#   define _LIBCPP_AVAILABILITY_FUTURE
-#   define _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
-#   define _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
-#   define _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS
+#if defined(_LIBCUDACXX_NO_EXCEPTIONS)
+#   define _LIBCUDACXX_AVAILABILITY_FUTURE
+#   define _LIBCUDACXX_AVAILABILITY_THROW_BAD_ANY_CAST
+#   define _LIBCUDACXX_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
+#   define _LIBCUDACXX_AVAILABILITY_THROW_BAD_VARIANT_ACCESS
 #else
-#   define _LIBCPP_AVAILABILITY_FUTURE                    _LIBCPP_AVAILABILITY_FUTURE_ERROR
-#   define _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST        _LIBCPP_AVAILABILITY_BAD_ANY_CAST
-#   define _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
-#   define _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS  _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS
+#   define _LIBCUDACXX_AVAILABILITY_FUTURE                    _LIBCUDACXX_AVAILABILITY_FUTURE_ERROR
+#   define _LIBCUDACXX_AVAILABILITY_THROW_BAD_ANY_CAST        _LIBCUDACXX_AVAILABILITY_BAD_ANY_CAST
+#   define _LIBCUDACXX_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS _LIBCUDACXX_AVAILABILITY_BAD_OPTIONAL_ACCESS
+#   define _LIBCUDACXX_AVAILABILITY_THROW_BAD_VARIANT_ACCESS  _LIBCUDACXX_AVAILABILITY_BAD_VARIANT_ACCESS
 #endif
 
-#endif // _LIBCPP___AVAILABILITY
+#endif // _LIBCUDACXX___AVAILABILITY

diff  --git a/libcxx/include/__bit/bit_cast.h b/libcxx/include/__bit/bit_cast.h
index 831207671ec9..00afcd48ded4 100644
--- a/libcxx/include/__bit/bit_cast.h
+++ b/libcxx/include/__bit/bit_cast.h
@@ -7,30 +7,30 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___BIT_BIT_CAST_H
-#define _LIBCPP___BIT_BIT_CAST_H
+#ifndef _LIBCUDACXX___BIT_BIT_CAST_H
+#define _LIBCUDACXX___BIT_BIT_CAST_H
 
 #include <__config>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 template <class _ToType, class _FromType>
   requires(sizeof(_ToType) == sizeof(_FromType) &&
            is_trivially_copyable_v<_ToType> &&
            is_trivially_copyable_v<_FromType>)
-_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr _ToType bit_cast(const _FromType& __from) noexcept {
+_LIBCUDACXX_NODISCARD_EXT _LIBCUDACXX_HIDE_FROM_ABI constexpr _ToType bit_cast(const _FromType& __from) noexcept {
   return __builtin_bit_cast(_ToType, __from);
 }
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___BIT_BIT_CAST_H
+#endif // _LIBCUDACXX___BIT_BIT_CAST_H

diff  --git a/libcxx/include/__bit/byteswap.h b/libcxx/include/__bit/byteswap.h
index 6fa8d48bafa4..7beee0752b72 100644
--- a/libcxx/include/__bit/byteswap.h
+++ b/libcxx/include/__bit/byteswap.h
@@ -7,24 +7,24 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___BIT_BYTESWAP_H
-#define _LIBCPP___BIT_BYTESWAP_H
+#ifndef _LIBCUDACXX___BIT_BYTESWAP_H
+#define _LIBCUDACXX___BIT_BYTESWAP_H
 
 #include <__concepts/arithmetic.h>
 #include <__config>
 #include <cstdint>
 #include <cstdlib>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 20
+#if _LIBCUDACXX_STD_VER > 20
 
 template <integral _Tp>
-_LIBCPP_HIDE_FROM_ABI constexpr _Tp byteswap(_Tp __val) noexcept {
+_LIBCUDACXX_HIDE_FROM_ABI constexpr _Tp byteswap(_Tp __val) noexcept {
 
   if constexpr (sizeof(_Tp) == 1) {
     return __val;
@@ -34,7 +34,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr _Tp byteswap(_Tp __val) noexcept {
     return __builtin_bswap32(__val);
   } else if constexpr (sizeof(_Tp) == 8) {
     return __builtin_bswap64(__val);
-#ifndef _LIBCPP_HAS_NO_INT128
+#ifndef _LIBCUDACXX_HAS_NO_INT128
   } else if constexpr (sizeof(_Tp) == 16) {
 #if __has_builtin(__builtin_bswap128)
     return __builtin_bswap128(__val);
@@ -42,14 +42,14 @@ _LIBCPP_HIDE_FROM_ABI constexpr _Tp byteswap(_Tp __val) noexcept {
     return static_cast<_Tp>(byteswap(static_cast<uint64_t>(__val))) << 64 |
            static_cast<_Tp>(byteswap(static_cast<uint64_t>(__val >> 64)));
 #endif // __has_builtin(__builtin_bswap128)
-#endif // _LIBCPP_HAS_NO_INT128
+#endif // _LIBCUDACXX_HAS_NO_INT128
   } else {
     static_assert(sizeof(_Tp) == 0, "byteswap is unimplemented for integral types of this size");
   }
 }
 
-#endif // _LIBCPP_STD_VER > 20
+#endif // _LIBCUDACXX_STD_VER > 20
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___BIT_BYTESWAP_H
+#endif // _LIBCUDACXX___BIT_BYTESWAP_H

diff  --git a/libcxx/include/__bit_reference b/libcxx/include/__bit_reference
index 60f57d665a1c..106a884cec84 100644
--- a/libcxx/include/__bit_reference
+++ b/libcxx/include/__bit_reference
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___BIT_REFERENCE
-#define _LIBCPP___BIT_REFERENCE
+#ifndef _LIBCUDACXX___BIT_REFERENCE
+#define _LIBCUDACXX___BIT_REFERENCE
 
 #include <__algorithm/copy_n.h>
 #include <__algorithm/fill_n.h>
@@ -21,15 +21,15 @@
 #include <cstring>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Cp, bool _IsConst, typename _Cp::__storage_type = 0> class __bit_iterator;
 template <class _Cp> class __bit_const_reference;
@@ -54,15 +54,15 @@ class __bit_reference
     friend class __bit_const_reference<_Cp>;
     friend class __bit_iterator<_Cp, false>;
 public:
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     __bit_reference(const __bit_reference&) = default;
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 operator bool() const _NOEXCEPT
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 operator bool() const _NOEXCEPT
         {return static_cast<bool>(*__seg_ & __mask_);}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool operator ~() const _NOEXCEPT
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 bool operator ~() const _NOEXCEPT
         {return !static_cast<bool>(*this);}
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     __bit_reference& operator=(bool __x) _NOEXCEPT
     {
         if (__x)
@@ -72,8 +72,8 @@ public:
         return *this;
     }
 
-#if _LIBCPP_STD_VER > 20
-    _LIBCPP_HIDE_FROM_ABI constexpr const __bit_reference& operator=(bool __x) const noexcept {
+#if _LIBCUDACXX_STD_VER > 20
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr const __bit_reference& operator=(bool __x) const noexcept {
         if (__x)
             *__seg_ |= __mask_;
         else
@@ -82,15 +82,15 @@ public:
     }
 #endif
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     __bit_reference& operator=(const __bit_reference& __x) _NOEXCEPT
         {return operator=(static_cast<bool>(__x));}
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 void flip() _NOEXCEPT {*__seg_ ^= __mask_;}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 __bit_iterator<_Cp, false> operator&() const _NOEXCEPT
-        {return __bit_iterator<_Cp, false>(__seg_, static_cast<unsigned>(__libcpp_ctz(__mask_)));}
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 void flip() _NOEXCEPT {*__seg_ ^= __mask_;}
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 __bit_iterator<_Cp, false> operator&() const _NOEXCEPT
+        {return __bit_iterator<_Cp, false>(__seg_, static_cast<unsigned>(__LIBCUDACXX_ctz(__mask_)));}
 private:
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     explicit __bit_reference(__storage_pointer __s, __storage_type __m) _NOEXCEPT
         : __seg_(__s), __mask_(__m) {}
 };
@@ -101,7 +101,7 @@ class __bit_reference<_Cp, false>
 };
 
 template <class _Cp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void
 swap(__bit_reference<_Cp> __x, __bit_reference<_Cp> __y) _NOEXCEPT
 {
@@ -111,7 +111,7 @@ swap(__bit_reference<_Cp> __x, __bit_reference<_Cp> __y) _NOEXCEPT
 }
 
 template <class _Cp, class _Dp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void
 swap(__bit_reference<_Cp> __x, __bit_reference<_Dp> __y) _NOEXCEPT
 {
@@ -121,7 +121,7 @@ swap(__bit_reference<_Cp> __x, __bit_reference<_Dp> __y) _NOEXCEPT
 }
 
 template <class _Cp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void
 swap(__bit_reference<_Cp> __x, bool& __y) _NOEXCEPT
 {
@@ -131,7 +131,7 @@ swap(__bit_reference<_Cp> __x, bool& __y) _NOEXCEPT
 }
 
 template <class _Cp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void
 swap(bool& __x, __bit_reference<_Cp> __y) _NOEXCEPT
 {
@@ -152,21 +152,21 @@ class __bit_const_reference
     friend typename _Cp::__self;
     friend class __bit_iterator<_Cp, true>;
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __bit_const_reference(const __bit_const_reference&) = default;
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     __bit_const_reference(const __bit_reference<_Cp>& __x) _NOEXCEPT
         : __seg_(__x.__seg_), __mask_(__x.__mask_) {}
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR operator bool() const _NOEXCEPT
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR operator bool() const _NOEXCEPT
         {return static_cast<bool>(*__seg_ & __mask_);}
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 __bit_iterator<_Cp, true> operator&() const _NOEXCEPT
-        {return __bit_iterator<_Cp, true>(__seg_, static_cast<unsigned>(__libcpp_ctz(__mask_)));}
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 __bit_iterator<_Cp, true> operator&() const _NOEXCEPT
+        {return __bit_iterator<_Cp, true>(__seg_, static_cast<unsigned>(__LIBCUDACXX_ctz(__mask_)));}
 private:
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR
     explicit __bit_const_reference(__storage_pointer __s, __storage_type __m) _NOEXCEPT
         : __seg_(__s), __mask_(__m) {}
 
@@ -176,7 +176,7 @@ private:
 // find
 
 template <class _Cp, bool _IsConst>
-_LIBCPP_CONSTEXPR_AFTER_CXX17 __bit_iterator<_Cp, _IsConst>
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17 __bit_iterator<_Cp, _IsConst>
 __find_bool_true(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type __n)
 {
     typedef __bit_iterator<_Cp, _IsConst> _It;
@@ -186,11 +186,11 @@ __find_bool_true(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type
     if (__first.__ctz_ != 0)
     {
         __storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_);
-        __storage_type __dn = _VSTD::min(__clz_f, __n);
+        __storage_type __dn = _CUDA_VSTD::min(__clz_f, __n);
         __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
         __storage_type __b = *__first.__seg_ & __m;
         if (__b)
-            return _It(__first.__seg_, static_cast<unsigned>(_VSTD::__libcpp_ctz(__b)));
+            return _It(__first.__seg_, static_cast<unsigned>(_CUDA_VSTD::__LIBCUDACXX_ctz(__b)));
         if (__n == __dn)
             return __first + __n;
         __n -= __dn;
@@ -199,20 +199,20 @@ __find_bool_true(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type
     // do middle whole words
     for (; __n >= __bits_per_word; ++__first.__seg_, __n -= __bits_per_word)
         if (*__first.__seg_)
-            return _It(__first.__seg_, static_cast<unsigned>(_VSTD::__libcpp_ctz(*__first.__seg_)));
+            return _It(__first.__seg_, static_cast<unsigned>(_CUDA_VSTD::__LIBCUDACXX_ctz(*__first.__seg_)));
     // do last partial word
     if (__n > 0)
     {
         __storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n);
         __storage_type __b = *__first.__seg_ & __m;
         if (__b)
-            return _It(__first.__seg_, static_cast<unsigned>(_VSTD::__libcpp_ctz(__b)));
+            return _It(__first.__seg_, static_cast<unsigned>(_CUDA_VSTD::__LIBCUDACXX_ctz(__b)));
     }
     return _It(__first.__seg_, static_cast<unsigned>(__n));
 }
 
 template <class _Cp, bool _IsConst>
-_LIBCPP_CONSTEXPR_AFTER_CXX17 __bit_iterator<_Cp, _IsConst>
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17 __bit_iterator<_Cp, _IsConst>
 __find_bool_false(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type __n)
 {
     typedef __bit_iterator<_Cp, _IsConst> _It;
@@ -222,11 +222,11 @@ __find_bool_false(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type
     if (__first.__ctz_ != 0)
     {
         __storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_);
-        __storage_type __dn = _VSTD::min(__clz_f, __n);
+        __storage_type __dn = _CUDA_VSTD::min(__clz_f, __n);
         __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
         __storage_type __b = ~*__first.__seg_ & __m;
         if (__b)
-            return _It(__first.__seg_, static_cast<unsigned>(_VSTD::__libcpp_ctz(__b)));
+            return _It(__first.__seg_, static_cast<unsigned>(_CUDA_VSTD::__LIBCUDACXX_ctz(__b)));
         if (__n == __dn)
             return __first + __n;
         __n -= __dn;
@@ -237,7 +237,7 @@ __find_bool_false(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type
     {
         __storage_type __b = ~*__first.__seg_;
         if (__b)
-            return _It(__first.__seg_, static_cast<unsigned>(_VSTD::__libcpp_ctz(__b)));
+            return _It(__first.__seg_, static_cast<unsigned>(_CUDA_VSTD::__LIBCUDACXX_ctz(__b)));
     }
     // do last partial word
     if (__n > 0)
@@ -245,19 +245,19 @@ __find_bool_false(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type
         __storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n);
         __storage_type __b = ~*__first.__seg_ & __m;
         if (__b)
-            return _It(__first.__seg_, static_cast<unsigned>(_VSTD::__libcpp_ctz(__b)));
+            return _It(__first.__seg_, static_cast<unsigned>(_CUDA_VSTD::__LIBCUDACXX_ctz(__b)));
     }
     return _It(__first.__seg_, static_cast<unsigned>(__n));
 }
 
 template <class _Cp, bool _IsConst, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 __bit_iterator<_Cp, _IsConst>
 find(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, const _Tp& __value)
 {
     if (static_cast<bool>(__value))
-        return _VSTD::__find_bool_true(__first, static_cast<typename _Cp::size_type>(__last - __first));
-    return _VSTD::__find_bool_false(__first, static_cast<typename _Cp::size_type>(__last - __first));
+        return _CUDA_VSTD::__find_bool_true(__first, static_cast<typename _Cp::size_type>(__last - __first));
+    return _CUDA_VSTD::__find_bool_false(__first, static_cast<typename _Cp::size_type>(__last - __first));
 }
 
 // count
@@ -275,20 +275,20 @@ __count_bool_true(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type
     if (__first.__ctz_ != 0)
     {
         __storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_);
-        __storage_type __dn = _VSTD::min(__clz_f, __n);
+        __storage_type __dn = _CUDA_VSTD::min(__clz_f, __n);
         __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
-        __r = _VSTD::__libcpp_popcount(*__first.__seg_ & __m);
+        __r = _CUDA_VSTD::__LIBCUDACXX_popcount(*__first.__seg_ & __m);
         __n -= __dn;
         ++__first.__seg_;
     }
     // do middle whole words
     for (; __n >= __bits_per_word; ++__first.__seg_, __n -= __bits_per_word)
-        __r += _VSTD::__libcpp_popcount(*__first.__seg_);
+        __r += _CUDA_VSTD::__LIBCUDACXX_popcount(*__first.__seg_);
     // do last partial word
     if (__n > 0)
     {
         __storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n);
-        __r += _VSTD::__libcpp_popcount(*__first.__seg_ & __m);
+        __r += _CUDA_VSTD::__LIBCUDACXX_popcount(*__first.__seg_ & __m);
     }
     return __r;
 }
@@ -306,38 +306,38 @@ __count_bool_false(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_typ
     if (__first.__ctz_ != 0)
     {
         __storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_);
-        __storage_type __dn = _VSTD::min(__clz_f, __n);
+        __storage_type __dn = _CUDA_VSTD::min(__clz_f, __n);
         __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
-        __r = _VSTD::__libcpp_popcount(~*__first.__seg_ & __m);
+        __r = _CUDA_VSTD::__LIBCUDACXX_popcount(~*__first.__seg_ & __m);
         __n -= __dn;
         ++__first.__seg_;
     }
     // do middle whole words
     for (; __n >= __bits_per_word; ++__first.__seg_, __n -= __bits_per_word)
-        __r += _VSTD::__libcpp_popcount(~*__first.__seg_);
+        __r += _CUDA_VSTD::__LIBCUDACXX_popcount(~*__first.__seg_);
     // do last partial word
     if (__n > 0)
     {
         __storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n);
-        __r += _VSTD::__libcpp_popcount(~*__first.__seg_ & __m);
+        __r += _CUDA_VSTD::__LIBCUDACXX_popcount(~*__first.__seg_ & __m);
     }
     return __r;
 }
 
 template <class _Cp, bool _IsConst, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename __bit_iterator<_Cp, _IsConst>::
diff erence_type
 count(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, const _Tp& __value)
 {
     if (static_cast<bool>(__value))
-        return _VSTD::__count_bool_true(__first, static_cast<typename _Cp::size_type>(__last - __first));
-    return _VSTD::__count_bool_false(__first, static_cast<typename _Cp::size_type>(__last - __first));
+        return _CUDA_VSTD::__count_bool_true(__first, static_cast<typename _Cp::size_type>(__last - __first));
+    return _CUDA_VSTD::__count_bool_false(__first, static_cast<typename _Cp::size_type>(__last - __first));
 }
 
 // fill_n
 
 template <class _Cp>
-_LIBCPP_CONSTEXPR_AFTER_CXX17 void
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17 void
 __fill_n_false(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __n)
 {
     typedef __bit_iterator<_Cp, false> _It;
@@ -347,7 +347,7 @@ __fill_n_false(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __n)
     if (__first.__ctz_ != 0)
     {
         __storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_);
-        __storage_type __dn = _VSTD::min(__clz_f, __n);
+        __storage_type __dn = _CUDA_VSTD::min(__clz_f, __n);
         __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
         *__first.__seg_ &= ~__m;
         __n -= __dn;
@@ -367,7 +367,7 @@ __fill_n_false(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __n)
 }
 
 template <class _Cp>
-_LIBCPP_CONSTEXPR_AFTER_CXX17 void
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17 void
 __fill_n_true(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __n)
 {
     typedef __bit_iterator<_Cp, false> _It;
@@ -377,7 +377,7 @@ __fill_n_true(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __n)
     if (__first.__ctz_ != 0)
     {
         __storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_);
-        __storage_type __dn = _VSTD::min(__clz_f, __n);
+        __storage_type __dn = _CUDA_VSTD::min(__clz_f, __n);
         __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
         *__first.__seg_ |= __m;
         __n -= __dn;
@@ -398,33 +398,33 @@ __fill_n_true(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __n)
 }
 
 template <class _Cp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void
 fill_n(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __n, bool __value)
 {
     if (__n > 0)
     {
         if (__value)
-            _VSTD::__fill_n_true(__first, __n);
+            _CUDA_VSTD::__fill_n_true(__first, __n);
         else
-            _VSTD::__fill_n_false(__first, __n);
+            _CUDA_VSTD::__fill_n_false(__first, __n);
     }
 }
 
 // fill
 
 template <class _Cp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void
 fill(__bit_iterator<_Cp, false> __first, __bit_iterator<_Cp, false> __last, bool __value)
 {
-    _VSTD::fill_n(__first, static_cast<typename _Cp::size_type>(__last - __first), __value);
+    _CUDA_VSTD::fill_n(__first, static_cast<typename _Cp::size_type>(__last - __first), __value);
 }
 
 // copy
 
 template <class _Cp, bool _IsConst>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 __bit_iterator<_Cp, false>
 __copy_aligned(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last,
                                                      __bit_iterator<_Cp, false> __result)
@@ -440,7 +440,7 @@ __copy_aligned(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsCon
         if (__first.__ctz_ != 0)
         {
             unsigned __clz = __bits_per_word - __first.__ctz_;
-            
diff erence_type __dn = _VSTD::min(static_cast<
diff erence_type>(__clz), __n);
+            
diff erence_type __dn = _CUDA_VSTD::min(static_cast<
diff erence_type>(__clz), __n);
             __n -= __dn;
             __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz - __dn));
             __storage_type __b = *__first.__seg_ & __m;
@@ -472,7 +472,7 @@ __copy_aligned(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsCon
 }
 
 template <class _Cp, bool _IsConst>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 __bit_iterator<_Cp, false>
 __copy_unaligned(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last,
                                                        __bit_iterator<_Cp, false> __result)
@@ -488,12 +488,12 @@ __copy_unaligned(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsC
         if (__first.__ctz_ != 0)
         {
             unsigned __clz_f = __bits_per_word - __first.__ctz_;
-            
diff erence_type __dn = _VSTD::min(static_cast<
diff erence_type>(__clz_f), __n);
+            
diff erence_type __dn = _CUDA_VSTD::min(static_cast<
diff erence_type>(__clz_f), __n);
             __n -= __dn;
             __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
             __storage_type __b = *__first.__seg_ & __m;
             unsigned __clz_r = __bits_per_word - __result.__ctz_;
-            __storage_type __ddn = _VSTD::min<__storage_type>(__dn, __clz_r);
+            __storage_type __ddn = _CUDA_VSTD::min<__storage_type>(__dn, __clz_r);
             __m = (~__storage_type(0) << __result.__ctz_) & (~__storage_type(0) >> (__clz_r - __ddn));
             *__result.__seg_ &= ~__m;
             if (__result.__ctz_ > __first.__ctz_)
@@ -531,7 +531,7 @@ __copy_unaligned(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsC
         {
             __m = ~__storage_type(0) >> (__bits_per_word - __n);
             __storage_type __b = *__first.__seg_ & __m;
-            __storage_type __dn = _VSTD::min(__n, static_cast<
diff erence_type>(__clz_r));
+            __storage_type __dn = _CUDA_VSTD::min(__n, static_cast<
diff erence_type>(__clz_r));
             __m = (~__storage_type(0) << __result.__ctz_) & (~__storage_type(0) >> (__clz_r - __dn));
             *__result.__seg_ &= ~__m;
             *__result.__seg_ |= __b << __result.__ctz_;
@@ -551,19 +551,19 @@ __copy_unaligned(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsC
 }
 
 template <class _Cp, bool _IsConst>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 __bit_iterator<_Cp, false>
 copy(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, __bit_iterator<_Cp, false> __result)
 {
     if (__first.__ctz_ == __result.__ctz_)
-        return _VSTD::__copy_aligned(__first, __last, __result);
-    return _VSTD::__copy_unaligned(__first, __last, __result);
+        return _CUDA_VSTD::__copy_aligned(__first, __last, __result);
+    return _CUDA_VSTD::__copy_unaligned(__first, __last, __result);
 }
 
 // copy_backward
 
 template <class _Cp, bool _IsConst>
-_LIBCPP_CONSTEXPR_AFTER_CXX17 __bit_iterator<_Cp, false>
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17 __bit_iterator<_Cp, false>
 __copy_backward_aligned(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last,
                                                      __bit_iterator<_Cp, false> __result)
 {
@@ -577,7 +577,7 @@ __copy_backward_aligned(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_C
         // do first word
         if (__last.__ctz_ != 0)
         {
-            
diff erence_type __dn = _VSTD::min(static_cast<
diff erence_type>(__last.__ctz_), __n);
+            
diff erence_type __dn = _CUDA_VSTD::min(static_cast<
diff erence_type>(__last.__ctz_), __n);
             __n -= __dn;
             unsigned __clz = __bits_per_word - __last.__ctz_;
             __storage_type __m = (~__storage_type(0) << (__last.__ctz_ - __dn)) & (~__storage_type(0) >> __clz);
@@ -610,7 +610,7 @@ __copy_backward_aligned(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_C
 }
 
 template <class _Cp, bool _IsConst>
-_LIBCPP_CONSTEXPR_AFTER_CXX17 __bit_iterator<_Cp, false>
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17 __bit_iterator<_Cp, false>
 __copy_backward_unaligned(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last,
                                                        __bit_iterator<_Cp, false> __result)
 {
@@ -624,13 +624,13 @@ __copy_backward_unaligned(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<
         // do first word
         if (__last.__ctz_ != 0)
         {
-            
diff erence_type __dn = _VSTD::min(static_cast<
diff erence_type>(__last.__ctz_), __n);
+            
diff erence_type __dn = _CUDA_VSTD::min(static_cast<
diff erence_type>(__last.__ctz_), __n);
             __n -= __dn;
             unsigned __clz_l = __bits_per_word - __last.__ctz_;
             __storage_type __m = (~__storage_type(0) << (__last.__ctz_ - __dn)) & (~__storage_type(0) >> __clz_l);
             __storage_type __b = *__last.__seg_ & __m;
             unsigned __clz_r = __bits_per_word - __result.__ctz_;
-            __storage_type __ddn = _VSTD::min(__dn, static_cast<
diff erence_type>(__result.__ctz_));
+            __storage_type __ddn = _CUDA_VSTD::min(__dn, static_cast<
diff erence_type>(__result.__ctz_));
             if (__ddn > 0)
             {
                 __m = (~__storage_type(0) << (__result.__ctz_ - __ddn)) & (~__storage_type(0) >> __clz_r);
@@ -674,7 +674,7 @@ __copy_backward_unaligned(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<
             __m = ~__storage_type(0) << (__bits_per_word - __n);
             __storage_type __b = *--__last.__seg_ & __m;
             __clz_r = __bits_per_word - __result.__ctz_;
-            __storage_type __dn = _VSTD::min(__n, static_cast<
diff erence_type>(__result.__ctz_));
+            __storage_type __dn = _CUDA_VSTD::min(__n, static_cast<
diff erence_type>(__result.__ctz_));
             __m = (~__storage_type(0) << (__result.__ctz_ - __dn)) & (~__storage_type(0) >> __clz_r);
             *__result.__seg_ &= ~__m;
             *__result.__seg_ |= __b >> (__bits_per_word - __result.__ctz_);
@@ -696,33 +696,33 @@ __copy_backward_unaligned(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<
 }
 
 template <class _Cp, bool _IsConst>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 __bit_iterator<_Cp, false>
 copy_backward(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, __bit_iterator<_Cp, false> __result)
 {
     if (__last.__ctz_ == __result.__ctz_)
-        return _VSTD::__copy_backward_aligned(__first, __last, __result);
-    return _VSTD::__copy_backward_unaligned(__first, __last, __result);
+        return _CUDA_VSTD::__copy_backward_aligned(__first, __last, __result);
+    return _CUDA_VSTD::__copy_backward_unaligned(__first, __last, __result);
 }
 
 // move
 
 template <class _Cp, bool _IsConst>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 __bit_iterator<_Cp, false>
 move(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, __bit_iterator<_Cp, false> __result)
 {
-    return _VSTD::copy(__first, __last, __result);
+    return _CUDA_VSTD::copy(__first, __last, __result);
 }
 
 // move_backward
 
 template <class _Cp, bool _IsConst>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 __bit_iterator<_Cp, false>
 move_backward(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, __bit_iterator<_Cp, false> __result)
 {
-    return _VSTD::copy_backward(__first, __last, __result);
+    return _CUDA_VSTD::copy_backward(__first, __last, __result);
 }
 
 // swap_ranges
@@ -743,7 +743,7 @@ __swap_ranges_aligned(__bit_iterator<__C1, false> __first, __bit_iterator<__C1,
         if (__first.__ctz_ != 0)
         {
             unsigned __clz = __bits_per_word - __first.__ctz_;
-            
diff erence_type __dn = _VSTD::min(static_cast<
diff erence_type>(__clz), __n);
+            
diff erence_type __dn = _CUDA_VSTD::min(static_cast<
diff erence_type>(__clz), __n);
             __n -= __dn;
             __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz - __dn));
             __storage_type __b1 = *__first.__seg_ & __m;
@@ -793,13 +793,13 @@ __swap_ranges_unaligned(__bit_iterator<__C1, false> __first, __bit_iterator<__C1
         if (__first.__ctz_ != 0)
         {
             unsigned __clz_f = __bits_per_word - __first.__ctz_;
-            
diff erence_type __dn = _VSTD::min(static_cast<
diff erence_type>(__clz_f), __n);
+            
diff erence_type __dn = _CUDA_VSTD::min(static_cast<
diff erence_type>(__clz_f), __n);
             __n -= __dn;
             __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
             __storage_type __b1 = *__first.__seg_ & __m;
             *__first.__seg_ &= ~__m;
             unsigned __clz_r = __bits_per_word - __result.__ctz_;
-            __storage_type __ddn = _VSTD::min<__storage_type>(__dn, __clz_r);
+            __storage_type __ddn = _CUDA_VSTD::min<__storage_type>(__dn, __clz_r);
             __m = (~__storage_type(0) << __result.__ctz_) & (~__storage_type(0) >> (__clz_r - __ddn));
             __storage_type __b2 = *__result.__seg_ & __m;
             *__result.__seg_ &= ~__m;
@@ -854,7 +854,7 @@ __swap_ranges_unaligned(__bit_iterator<__C1, false> __first, __bit_iterator<__C1
             __m = ~__storage_type(0) >> (__bits_per_word - __n);
             __storage_type __b1 = *__first.__seg_ & __m;
             *__first.__seg_ &= ~__m;
-            __storage_type __dn = _VSTD::min<__storage_type>(__n, __clz_r);
+            __storage_type __dn = _CUDA_VSTD::min<__storage_type>(__n, __clz_r);
             __m = (~__storage_type(0) << __result.__ctz_) & (~__storage_type(0) >> (__clz_r - __dn));
             __storage_type __b2 = *__result.__seg_ & __m;
             *__result.__seg_ &= ~__m;
@@ -878,14 +878,14 @@ __swap_ranges_unaligned(__bit_iterator<__C1, false> __first, __bit_iterator<__C1
 }
 
 template <class __C1, class __C2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 __bit_iterator<__C2, false>
 swap_ranges(__bit_iterator<__C1, false> __first1, __bit_iterator<__C1, false> __last1,
             __bit_iterator<__C2, false> __first2)
 {
     if (__first1.__ctz_ == __first2.__ctz_)
-        return _VSTD::__swap_ranges_aligned(__first1, __last1, __first2);
-    return _VSTD::__swap_ranges_unaligned(__first1, __last1, __first2);
+        return _CUDA_VSTD::__swap_ranges_aligned(__first1, __last1, __first2);
+    return _CUDA_VSTD::__swap_ranges_unaligned(__first1, __last1, __first2);
 }
 
 // rotate
@@ -903,19 +903,19 @@ struct __bit_array
     
diff erence_type __size_;
     __storage_type __word_[_Np];
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 static 
diff erence_type capacity()
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 static 
diff erence_type capacity()
         {return static_cast<
diff erence_type>(_Np * __bits_per_word);}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 explicit __bit_array(
diff erence_type __s) : __size_(__s) {
-        if (__libcpp_is_constant_evaluated()) {
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 explicit __bit_array(
diff erence_type __s) : __size_(__s) {
+        if (__LIBCUDACXX_is_constant_evaluated()) {
             for (size_t __i = 0; __i != __bit_array<_Cp>::_Np; ++__i)
                 std::__construct_at(__word_ + __i, 0);
         }
     }
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 iterator begin()
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 iterator begin()
     {
         return iterator(pointer_traits<__storage_pointer>::pointer_to(__word_[0]), 0);
     }
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 iterator end()
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 iterator end()
     {
         return iterator(pointer_traits<__storage_pointer>::pointer_to(__word_[0]) + __size_ / __bits_per_word,
                                                   static_cast<unsigned>(__size_ % __bits_per_word));
@@ -923,7 +923,7 @@ struct __bit_array
 };
 
 template <class _Cp>
-_LIBCPP_CONSTEXPR_AFTER_CXX17 __bit_iterator<_Cp, false>
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17 __bit_iterator<_Cp, false>
 rotate(__bit_iterator<_Cp, false> __first, __bit_iterator<_Cp, false> __middle, __bit_iterator<_Cp, false> __last)
 {
     typedef __bit_iterator<_Cp, false> _I1;
@@ -938,13 +938,13 @@ rotate(__bit_iterator<_Cp, false> __first, __bit_iterator<_Cp, false> __middle,
             if (__d1 <= __bit_array<_Cp>::capacity())
             {
                 __bit_array<_Cp> __b(__d1);
-                _VSTD::copy(__first, __middle, __b.begin());
-                _VSTD::copy(__b.begin(), __b.end(), _VSTD::copy(__middle, __last, __first));
+                _CUDA_VSTD::copy(__first, __middle, __b.begin());
+                _CUDA_VSTD::copy(__b.begin(), __b.end(), _CUDA_VSTD::copy(__middle, __last, __first));
                 break;
             }
             else
             {
-                __bit_iterator<_Cp, false> __mp = _VSTD::swap_ranges(__first, __middle, __middle);
+                __bit_iterator<_Cp, false> __mp = _CUDA_VSTD::swap_ranges(__first, __middle, __middle);
                 __first = __middle;
                 __middle = __mp;
                 __d2 -= __d1;
@@ -955,14 +955,14 @@ rotate(__bit_iterator<_Cp, false> __first, __bit_iterator<_Cp, false> __middle,
             if (__d2 <= __bit_array<_Cp>::capacity())
             {
                 __bit_array<_Cp> __b(__d2);
-                _VSTD::copy(__middle, __last, __b.begin());
-                _VSTD::copy_backward(__b.begin(), __b.end(), _VSTD::copy_backward(__first, __middle, __last));
+                _CUDA_VSTD::copy(__middle, __last, __b.begin());
+                _CUDA_VSTD::copy_backward(__b.begin(), __b.end(), _CUDA_VSTD::copy_backward(__first, __middle, __last));
                 break;
             }
             else
             {
                 __bit_iterator<_Cp, false> __mp = __first + __d2;
-                _VSTD::swap_ranges(__first, __mp, __middle);
+                _CUDA_VSTD::swap_ranges(__first, __mp, __middle);
                 __first = __mp;
                 __d1 -= __d2;
             }
@@ -974,7 +974,7 @@ rotate(__bit_iterator<_Cp, false> __first, __bit_iterator<_Cp, false> __middle,
 // equal
 
 template <class _Cp, bool _IC1, bool _IC2>
-_LIBCPP_CONSTEXPR_AFTER_CXX17 bool
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17 bool
 __equal_unaligned(__bit_iterator<_Cp, _IC1> __first1, __bit_iterator<_Cp, _IC1> __last1,
                   __bit_iterator<_Cp, _IC2> __first2)
 {
@@ -989,12 +989,12 @@ __equal_unaligned(__bit_iterator<_Cp, _IC1> __first1, __bit_iterator<_Cp, _IC1>
         if (__first1.__ctz_ != 0)
         {
             unsigned __clz_f = __bits_per_word - __first1.__ctz_;
-            
diff erence_type __dn = _VSTD::min(static_cast<
diff erence_type>(__clz_f), __n);
+            
diff erence_type __dn = _CUDA_VSTD::min(static_cast<
diff erence_type>(__clz_f), __n);
             __n -= __dn;
             __storage_type __m = (~__storage_type(0) << __first1.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
             __storage_type __b = *__first1.__seg_ & __m;
             unsigned __clz_r = __bits_per_word - __first2.__ctz_;
-            __storage_type __ddn = _VSTD::min<__storage_type>(__dn, __clz_r);
+            __storage_type __ddn = _CUDA_VSTD::min<__storage_type>(__dn, __clz_r);
             __m = (~__storage_type(0) << __first2.__ctz_) & (~__storage_type(0) >> (__clz_r - __ddn));
             if (__first2.__ctz_ > __first1.__ctz_)
             {
@@ -1037,7 +1037,7 @@ __equal_unaligned(__bit_iterator<_Cp, _IC1> __first1, __bit_iterator<_Cp, _IC1>
         {
             __m = ~__storage_type(0) >> (__bits_per_word - __n);
             __storage_type __b = *__first1.__seg_ & __m;
-            __storage_type __dn = _VSTD::min(__n, static_cast<
diff erence_type>(__clz_r));
+            __storage_type __dn = _CUDA_VSTD::min(__n, static_cast<
diff erence_type>(__clz_r));
             __m = (~__storage_type(0) << __first2.__ctz_) & (~__storage_type(0) >> (__clz_r - __dn));
             if ((*__first2.__seg_ & __m) != (__b << __first2.__ctz_))
                 return false;
@@ -1056,7 +1056,7 @@ __equal_unaligned(__bit_iterator<_Cp, _IC1> __first1, __bit_iterator<_Cp, _IC1>
 }
 
 template <class _Cp, bool _IC1, bool _IC2>
-_LIBCPP_CONSTEXPR_AFTER_CXX17 bool
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17 bool
 __equal_aligned(__bit_iterator<_Cp, _IC1> __first1, __bit_iterator<_Cp, _IC1> __last1,
                 __bit_iterator<_Cp, _IC2> __first2)
 {
@@ -1071,7 +1071,7 @@ __equal_aligned(__bit_iterator<_Cp, _IC1> __first1, __bit_iterator<_Cp, _IC1> __
         if (__first1.__ctz_ != 0)
         {
             unsigned __clz = __bits_per_word - __first1.__ctz_;
-            
diff erence_type __dn = _VSTD::min(static_cast<
diff erence_type>(__clz), __n);
+            
diff erence_type __dn = _CUDA_VSTD::min(static_cast<
diff erence_type>(__clz), __n);
             __n -= __dn;
             __storage_type __m = (~__storage_type(0) << __first1.__ctz_) & (~__storage_type(0) >> (__clz - __dn));
             if ((*__first2.__seg_ & __m) != (*__first1.__seg_ & __m))
@@ -1099,13 +1099,13 @@ __equal_aligned(__bit_iterator<_Cp, _IC1> __first1, __bit_iterator<_Cp, _IC1> __
 }
 
 template <class _Cp, bool _IC1, bool _IC2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 bool
 equal(__bit_iterator<_Cp, _IC1> __first1, __bit_iterator<_Cp, _IC1> __last1, __bit_iterator<_Cp, _IC2> __first2)
 {
     if (__first1.__ctz_ == __first2.__ctz_)
-        return _VSTD::__equal_aligned(__first1, __last1, __first2);
-    return _VSTD::__equal_unaligned(__first1, __last1, __first2);
+        return _CUDA_VSTD::__equal_aligned(__first1, __last1, __first2);
+    return _CUDA_VSTD::__equal_unaligned(__first1, __last1, __first2);
 }
 
 template <class _Cp, bool _IsConst,
@@ -1116,7 +1116,7 @@ public:
     typedef typename _Cp::
diff erence_type                                                          
diff erence_type;
     typedef bool                                                                                  value_type;
     typedef __bit_iterator                                                                        pointer;
-#ifndef _LIBCPP_ABI_BITSET_VECTOR_BOOL_CONST_SUBSCRIPT_RETURN_BOOL
+#ifndef _LIBCUDACXX_ABI_BITSET_VECTOR_BOOL_CONST_SUBSCRIPT_RETURN_BOOL
     typedef typename conditional<_IsConst, __bit_const_reference<_Cp>, __bit_reference<_Cp> >::type reference;
 #else
     using reference = typename conditional<_IsConst, bool, __bit_reference<_Cp> >::type;
@@ -1133,8 +1133,8 @@ private:
     unsigned          __ctz_;
 
 public:
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 __bit_iterator() _NOEXCEPT
-#if _LIBCPP_STD_VER > 11
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 __bit_iterator() _NOEXCEPT
+#if _LIBCUDACXX_STD_VER > 11
     : __seg_(nullptr), __ctz_(0)
 #endif
     {}
@@ -1144,7 +1144,7 @@ public:
     // When _IsConst=true, this is a converting constructor;
     // the copy and move constructors are implicitly generated
     // and trivial.
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     __bit_iterator(const __bit_iterator<_Cp, false>& __it) _NOEXCEPT
         : __seg_(__it.__seg_), __ctz_(__it.__ctz_) {}
 
@@ -1153,19 +1153,19 @@ public:
     // the implicit generation of a defaulted one is deprecated.
     // When _IsConst=true, the assignment operators are
     // implicitly generated and trivial.
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     __bit_iterator& operator=(const _If<_IsConst, struct __private_nat, __bit_iterator>& __it) {
         __seg_ = __it.__seg_;
         __ctz_ = __it.__ctz_;
         return *this;
     }
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 reference operator*() const _NOEXCEPT {
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 reference operator*() const _NOEXCEPT {
         return typename conditional<_IsConst, __bit_const_reference<_Cp>, __bit_reference<_Cp> >
                 ::type(__seg_, __storage_type(1) << __ctz_);
     }
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 __bit_iterator& operator++()
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 __bit_iterator& operator++()
     {
         if (__ctz_ != __bits_per_word-1)
             ++__ctz_;
@@ -1177,14 +1177,14 @@ public:
         return *this;
     }
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 __bit_iterator operator++(int)
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 __bit_iterator operator++(int)
     {
         __bit_iterator __tmp = *this;
         ++(*this);
         return __tmp;
     }
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 __bit_iterator& operator--()
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 __bit_iterator& operator--()
     {
         if (__ctz_ != 0)
             --__ctz_;
@@ -1196,14 +1196,14 @@ public:
         return *this;
     }
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 __bit_iterator operator--(int)
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 __bit_iterator operator--(int)
     {
         __bit_iterator __tmp = *this;
         --(*this);
         return __tmp;
     }
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 __bit_iterator& operator+=(
diff erence_type __n)
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 __bit_iterator& operator+=(
diff erence_type __n)
     {
         if (__n >= 0)
             __seg_ += (__n + __ctz_) / __bits_per_word;
@@ -1215,54 +1215,54 @@ public:
         return *this;
     }
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 __bit_iterator& operator-=(
diff erence_type __n)
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 __bit_iterator& operator-=(
diff erence_type __n)
     {
         return *this += -__n;
     }
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 __bit_iterator operator+(
diff erence_type __n) const
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 __bit_iterator operator+(
diff erence_type __n) const
     {
         __bit_iterator __t(*this);
         __t += __n;
         return __t;
     }
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 __bit_iterator operator-(
diff erence_type __n) const
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 __bit_iterator operator-(
diff erence_type __n) const
     {
         __bit_iterator __t(*this);
         __t -= __n;
         return __t;
     }
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     friend __bit_iterator operator+(
diff erence_type __n, const __bit_iterator& __it) {return __it + __n;}
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     friend 
diff erence_type operator-(const __bit_iterator& __x, const __bit_iterator& __y)
         {return (__x.__seg_ - __y.__seg_) * __bits_per_word + __x.__ctz_ - __y.__ctz_;}
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 reference operator[](
diff erence_type __n) const {return *(*this + __n);}
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 reference operator[](
diff erence_type __n) const {return *(*this + __n);}
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 friend bool operator==(const __bit_iterator& __x, const __bit_iterator& __y)
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 friend bool operator==(const __bit_iterator& __x, const __bit_iterator& __y)
         {return __x.__seg_ == __y.__seg_ && __x.__ctz_ == __y.__ctz_;}
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 friend bool operator!=(const __bit_iterator& __x, const __bit_iterator& __y)
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 friend bool operator!=(const __bit_iterator& __x, const __bit_iterator& __y)
         {return !(__x == __y);}
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 friend bool operator<(const __bit_iterator& __x, const __bit_iterator& __y)
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 friend bool operator<(const __bit_iterator& __x, const __bit_iterator& __y)
         {return __x.__seg_ < __y.__seg_ || (__x.__seg_ == __y.__seg_ && __x.__ctz_ < __y.__ctz_);}
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 friend bool operator>(const __bit_iterator& __x, const __bit_iterator& __y)
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 friend bool operator>(const __bit_iterator& __x, const __bit_iterator& __y)
         {return __y < __x;}
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 friend bool operator<=(const __bit_iterator& __x, const __bit_iterator& __y)
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 friend bool operator<=(const __bit_iterator& __x, const __bit_iterator& __y)
         {return !(__y < __x);}
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 friend bool operator>=(const __bit_iterator& __x, const __bit_iterator& __y)
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 friend bool operator>=(const __bit_iterator& __x, const __bit_iterator& __y)
         {return !(__x < __y);}
 
 private:
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     explicit __bit_iterator(__storage_pointer __s, unsigned __ctz) _NOEXCEPT
         : __seg_(__s), __ctz_(__ctz) {}
 
@@ -1273,40 +1273,40 @@ private:
     friend class __bit_iterator<_Cp, true>;
     template <class _Dp> friend struct __bit_array;
     template <class _Dp>
-    _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     friend void __fill_n_false(__bit_iterator<_Dp, false> __first, typename _Dp::size_type __n);
 
     template <class _Dp>
-    _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     friend void __fill_n_true(__bit_iterator<_Dp, false> __first, typename _Dp::size_type __n);
 
     template <class _Dp, bool _IC>
-    _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     friend __bit_iterator<_Dp, false> __copy_aligned(__bit_iterator<_Dp, _IC> __first,
                                                      __bit_iterator<_Dp, _IC> __last,
                                                      __bit_iterator<_Dp, false> __result);
     template <class _Dp, bool _IC>
-    _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     friend __bit_iterator<_Dp, false> __copy_unaligned(__bit_iterator<_Dp, _IC> __first,
                                                        __bit_iterator<_Dp, _IC> __last,
                                                        __bit_iterator<_Dp, false> __result);
     template <class _Dp, bool _IC>
-    _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     friend __bit_iterator<_Dp, false> copy(__bit_iterator<_Dp, _IC> __first,
                                            __bit_iterator<_Dp, _IC> __last,
                                            __bit_iterator<_Dp, false> __result);
     template <class _Dp, bool _IC>
-    _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     friend __bit_iterator<_Dp, false> __copy_backward_aligned(__bit_iterator<_Dp, _IC> __first,
                                                               __bit_iterator<_Dp, _IC> __last,
                                                               __bit_iterator<_Dp, false> __result);
     template <class _Dp, bool _IC>
-    _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     friend __bit_iterator<_Dp, false> __copy_backward_unaligned(__bit_iterator<_Dp, _IC> __first,
                                                                 __bit_iterator<_Dp, _IC> __last,
                                                                 __bit_iterator<_Dp, false> __result);
     template <class _Dp, bool _IC>
-    _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     friend __bit_iterator<_Dp, false> copy_backward(__bit_iterator<_Dp, _IC> __first,
                                                     __bit_iterator<_Dp, _IC> __last,
                                                     __bit_iterator<_Dp, false> __result);
@@ -1320,30 +1320,30 @@ private:
                                                                                  __bit_iterator<__C1, false>,
                                                                                  __bit_iterator<__C2, false>);
     template <class _Dp>
-    _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     friend __bit_iterator<_Dp, false> rotate(__bit_iterator<_Dp, false>,
                                              __bit_iterator<_Dp, false>,
                                              __bit_iterator<_Dp, false>);
     template <class _Dp, bool _IC1, bool _IC2>
-    _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     friend bool __equal_aligned(__bit_iterator<_Dp, _IC1>,
                                 __bit_iterator<_Dp, _IC1>,
                                 __bit_iterator<_Dp, _IC2>);
     template <class _Dp, bool _IC1, bool _IC2>
-    _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     friend bool __equal_unaligned(__bit_iterator<_Dp, _IC1>,
                                   __bit_iterator<_Dp, _IC1>,
                                   __bit_iterator<_Dp, _IC2>);
     template <class _Dp, bool _IC1, bool _IC2>
-    _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     friend bool equal(__bit_iterator<_Dp, _IC1>,
                       __bit_iterator<_Dp, _IC1>,
                       __bit_iterator<_Dp, _IC2>);
     template <class _Dp, bool _IC>
-    _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     friend __bit_iterator<_Dp, _IC> __find_bool_true(__bit_iterator<_Dp, _IC>, typename _Dp::size_type);
     template <class _Dp, bool _IC>
-    _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     friend __bit_iterator<_Dp, _IC> __find_bool_false(__bit_iterator<_Dp, _IC>, typename _Dp::size_type);
     template <class _Dp, bool _IC> friend typename __bit_iterator<_Dp, _IC>::
diff erence_type
                    __count_bool_true(__bit_iterator<_Dp, _IC>, typename _Dp::size_type);
@@ -1351,8 +1351,8 @@ private:
                    __count_bool_false(__bit_iterator<_Dp, _IC>, typename _Dp::size_type);
 };
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___BIT_REFERENCE
+#endif // _LIBCUDACXX___BIT_REFERENCE

diff  --git a/libcxx/include/__bits b/libcxx/include/__bits
index 92ef5c0a7b49..d30cae2512d3 100644
--- a/libcxx/include/__bits
+++ b/libcxx/include/__bits
@@ -7,45 +7,45 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___BITS
-#define _LIBCPP___BITS
+#ifndef _LIBCUDACXX___BITS
+#define _LIBCUDACXX___BITS
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#ifndef _LIBCPP_COMPILER_MSVC
+#ifndef _LIBCUDACXX_COMPILER_MSVC
 
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
-int __libcpp_ctz(unsigned __x)           _NOEXCEPT { return __builtin_ctz(__x); }
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR
+int __LIBCUDACXX_ctz(unsigned __x)           _NOEXCEPT { return __builtin_ctz(__x); }
 
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
-int __libcpp_ctz(unsigned long __x)      _NOEXCEPT { return __builtin_ctzl(__x); }
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR
+int __LIBCUDACXX_ctz(unsigned long __x)      _NOEXCEPT { return __builtin_ctzl(__x); }
 
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
-int __libcpp_ctz(unsigned long long __x) _NOEXCEPT { return __builtin_ctzll(__x); }
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR
+int __LIBCUDACXX_ctz(unsigned long long __x) _NOEXCEPT { return __builtin_ctzll(__x); }
 
 
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
-int __libcpp_clz(unsigned __x)           _NOEXCEPT { return __builtin_clz(__x); }
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR
+int __LIBCUDACXX_clz(unsigned __x)           _NOEXCEPT { return __builtin_clz(__x); }
 
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
-int __libcpp_clz(unsigned long __x)      _NOEXCEPT { return __builtin_clzl(__x); }
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR
+int __LIBCUDACXX_clz(unsigned long __x)      _NOEXCEPT { return __builtin_clzl(__x); }
 
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
-int __libcpp_clz(unsigned long long __x) _NOEXCEPT { return __builtin_clzll(__x); }
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR
+int __LIBCUDACXX_clz(unsigned long long __x) _NOEXCEPT { return __builtin_clzll(__x); }
 
-#  ifndef _LIBCPP_HAS_NO_INT128
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
-int __libcpp_clz(__uint128_t __x) _NOEXCEPT {
+#  ifndef _LIBCUDACXX_HAS_NO_INT128
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR
+int __LIBCUDACXX_clz(__uint128_t __x) _NOEXCEPT {
   // The function is written in this form due to C++ constexpr limitations.
   // The algorithm:
   // - Test whether any bit in the high 64-bits is set
@@ -61,20 +61,20 @@ int __libcpp_clz(__uint128_t __x) _NOEXCEPT {
 }
 #  endif
 
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
-int __libcpp_popcount(unsigned __x)           _NOEXCEPT { return __builtin_popcount(__x); }
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR
+int __LIBCUDACXX_popcount(unsigned __x)           _NOEXCEPT { return __builtin_popcount(__x); }
 
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
-int __libcpp_popcount(unsigned long __x)      _NOEXCEPT { return __builtin_popcountl(__x); }
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR
+int __LIBCUDACXX_popcount(unsigned long __x)      _NOEXCEPT { return __builtin_popcountl(__x); }
 
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
-int __libcpp_popcount(unsigned long long __x) _NOEXCEPT { return __builtin_popcountll(__x); }
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR
+int __LIBCUDACXX_popcount(unsigned long long __x) _NOEXCEPT { return __builtin_popcountll(__x); }
 
-#else  // _LIBCPP_COMPILER_MSVC
+#else  // _LIBCUDACXX_COMPILER_MSVC
 
 // Precondition:  __x != 0
-inline _LIBCPP_INLINE_VISIBILITY
-int __libcpp_ctz(unsigned __x) {
+inline _LIBCUDACXX_INLINE_VISIBILITY
+int __LIBCUDACXX_ctz(unsigned __x) {
   static_assert(sizeof(unsigned) == sizeof(unsigned long), "");
   static_assert(sizeof(unsigned long) == 4, "");
   unsigned long __where;
@@ -83,16 +83,16 @@ int __libcpp_ctz(unsigned __x) {
   return 32;
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
-int __libcpp_ctz(unsigned long __x) {
+inline _LIBCUDACXX_INLINE_VISIBILITY
+int __LIBCUDACXX_ctz(unsigned long __x) {
     static_assert(sizeof(unsigned long) == sizeof(unsigned), "");
     return __ctz(static_cast<unsigned>(__x));
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
-int __libcpp_ctz(unsigned long long __x) {
+inline _LIBCUDACXX_INLINE_VISIBILITY
+int __LIBCUDACXX_ctz(unsigned long long __x) {
     unsigned long __where;
-#if defined(_LIBCPP_HAS_BITSCAN64)
+#if defined(_LIBCUDACXX_HAS_BITSCAN64)
   if (_BitScanForward64(&__where, __x))
     return static_cast<int>(__where);
 #else
@@ -106,8 +106,8 @@ int __libcpp_ctz(unsigned long long __x) {
 }
 
 // Precondition:  __x != 0
-inline _LIBCPP_INLINE_VISIBILITY
-int __libcpp_clz(unsigned __x) {
+inline _LIBCUDACXX_INLINE_VISIBILITY
+int __LIBCUDACXX_clz(unsigned __x) {
   static_assert(sizeof(unsigned) == sizeof(unsigned long), "");
   static_assert(sizeof(unsigned long) == 4, "");
   unsigned long __where;
@@ -116,16 +116,16 @@ int __libcpp_clz(unsigned __x) {
   return 32; // Undefined Behavior.
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
-int __libcpp_clz(unsigned long __x) {
+inline _LIBCUDACXX_INLINE_VISIBILITY
+int __LIBCUDACXX_clz(unsigned long __x) {
     static_assert(sizeof(unsigned) == sizeof(unsigned long), "");
-    return __libcpp_clz(static_cast<unsigned>(__x));
+    return __LIBCUDACXX_clz(static_cast<unsigned>(__x));
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
-int __libcpp_clz(unsigned long long __x) {
+inline _LIBCUDACXX_INLINE_VISIBILITY
+int __LIBCUDACXX_clz(unsigned long long __x) {
   unsigned long __where;
-#if defined(_LIBCPP_HAS_BITSCAN64)
+#if defined(_LIBCUDACXX_HAS_BITSCAN64)
   if (_BitScanReverse64(&__where, __x))
     return static_cast<int>(63 - __where);
 #else
@@ -138,25 +138,25 @@ int __libcpp_clz(unsigned long long __x) {
   return 64; // Undefined Behavior.
 }
 
-inline _LIBCPP_INLINE_VISIBILITY int __libcpp_popcount(unsigned __x) {
+inline _LIBCUDACXX_INLINE_VISIBILITY int __LIBCUDACXX_popcount(unsigned __x) {
   static_assert(sizeof(unsigned) == 4, "");
   return __popcnt(__x);
 }
 
-inline _LIBCPP_INLINE_VISIBILITY int __libcpp_popcount(unsigned long __x) {
+inline _LIBCUDACXX_INLINE_VISIBILITY int __LIBCUDACXX_popcount(unsigned long __x) {
   static_assert(sizeof(unsigned long) == 4, "");
   return __popcnt(__x);
 }
 
-inline _LIBCPP_INLINE_VISIBILITY int __libcpp_popcount(unsigned long long __x) {
+inline _LIBCUDACXX_INLINE_VISIBILITY int __LIBCUDACXX_popcount(unsigned long long __x) {
   static_assert(sizeof(unsigned long long) == 8, "");
   return __popcnt64(__x);
 }
 
-#endif // _LIBCPP_COMPILER_MSVC
+#endif // _LIBCUDACXX_COMPILER_MSVC
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___BITS
+#endif // _LIBCUDACXX___BITS

diff  --git a/libcxx/include/__bsd_locale_defaults.h b/libcxx/include/__bsd_locale_defaults.h
index 4d990482d4a3..ecd4f71e626e 100644
--- a/libcxx/include/__bsd_locale_defaults.h
+++ b/libcxx/include/__bsd_locale_defaults.h
@@ -11,26 +11,26 @@
 // we will define the mapping from an internal macro to the real BSD symbol.
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___BSD_LOCALE_DEFAULTS_H
-#define _LIBCPP___BSD_LOCALE_DEFAULTS_H
+#ifndef _LIBCUDACXX___BSD_LOCALE_DEFAULTS_H
+#define _LIBCUDACXX___BSD_LOCALE_DEFAULTS_H
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#define __libcpp_mb_cur_max_l(loc)                          MB_CUR_MAX_L(loc)
-#define __libcpp_btowc_l(ch, loc)                           btowc_l(ch, loc)
-#define __libcpp_wctob_l(wch, loc)                          wctob_l(wch, loc)
-#define __libcpp_wcsnrtombs_l(dst, src, nwc, len, ps, loc)  wcsnrtombs_l(dst, src, nwc, len, ps, loc)
-#define __libcpp_wcrtomb_l(src, wc, ps, loc)                wcrtomb_l(src, wc, ps, loc)
-#define __libcpp_mbsnrtowcs_l(dst, src, nms, len, ps, loc)  mbsnrtowcs_l(dst, src, nms, len, ps, loc)
-#define __libcpp_mbrtowc_l(pwc, s, n, ps, l)                mbrtowc_l(pwc, s, n, ps, l)
-#define __libcpp_mbtowc_l(pwc, pmb, max, l)                 mbtowc_l(pwc, pmb, max, l)
-#define __libcpp_mbrlen_l(s, n, ps, l)                      mbrlen_l(s, n, ps, l)
-#define __libcpp_localeconv_l(l)                            localeconv_l(l)
-#define __libcpp_mbsrtowcs_l(dest, src, len, ps, l)         mbsrtowcs_l(dest, src, len, ps, l)
-#define __libcpp_snprintf_l(...)                            snprintf_l(__VA_ARGS__)
-#define __libcpp_asprintf_l(...)                            asprintf_l(__VA_ARGS__)
-#define __libcpp_sscanf_l(...)                              sscanf_l(__VA_ARGS__)
+#define __LIBCUDACXX_mb_cur_max_l(loc)                          MB_CUR_MAX_L(loc)
+#define __LIBCUDACXX_btowc_l(ch, loc)                           btowc_l(ch, loc)
+#define __LIBCUDACXX_wctob_l(wch, loc)                          wctob_l(wch, loc)
+#define __LIBCUDACXX_wcsnrtombs_l(dst, src, nwc, len, ps, loc)  wcsnrtombs_l(dst, src, nwc, len, ps, loc)
+#define __LIBCUDACXX_wcrtomb_l(src, wc, ps, loc)                wcrtomb_l(src, wc, ps, loc)
+#define __LIBCUDACXX_mbsnrtowcs_l(dst, src, nms, len, ps, loc)  mbsnrtowcs_l(dst, src, nms, len, ps, loc)
+#define __LIBCUDACXX_mbrtowc_l(pwc, s, n, ps, l)                mbrtowc_l(pwc, s, n, ps, l)
+#define __LIBCUDACXX_mbtowc_l(pwc, pmb, max, l)                 mbtowc_l(pwc, pmb, max, l)
+#define __LIBCUDACXX_mbrlen_l(s, n, ps, l)                      mbrlen_l(s, n, ps, l)
+#define __LIBCUDACXX_localeconv_l(l)                            localeconv_l(l)
+#define __LIBCUDACXX_mbsrtowcs_l(dest, src, len, ps, l)         mbsrtowcs_l(dest, src, len, ps, l)
+#define __LIBCUDACXX_snprintf_l(...)                            snprintf_l(__VA_ARGS__)
+#define __LIBCUDACXX_asprintf_l(...)                            asprintf_l(__VA_ARGS__)
+#define __LIBCUDACXX_sscanf_l(...)                              sscanf_l(__VA_ARGS__)
 
-#endif // _LIBCPP___BSD_LOCALE_DEFAULTS_H
+#endif // _LIBCUDACXX___BSD_LOCALE_DEFAULTS_H

diff  --git a/libcxx/include/__bsd_locale_fallbacks.h b/libcxx/include/__bsd_locale_fallbacks.h
index 3d5b78574480..efabb8979ab3 100644
--- a/libcxx/include/__bsd_locale_fallbacks.h
+++ b/libcxx/include/__bsd_locale_fallbacks.h
@@ -10,134 +10,134 @@
 // of those functions for non-BSD platforms.
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___BSD_LOCALE_FALLBACKS_H
-#define _LIBCPP___BSD_LOCALE_FALLBACKS_H
+#ifndef _LIBCUDACXX___BSD_LOCALE_FALLBACKS_H
+#define _LIBCUDACXX___BSD_LOCALE_FALLBACKS_H
 
 #include <memory>
 #include <stdarg.h>
 #include <stdlib.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-inline _LIBCPP_INLINE_VISIBILITY
-decltype(MB_CUR_MAX) __libcpp_mb_cur_max_l(locale_t __l)
+inline _LIBCUDACXX_INLINE_VISIBILITY
+decltype(MB_CUR_MAX) __LIBCUDACXX_mb_cur_max_l(locale_t __l)
 {
-    __libcpp_locale_guard __current(__l);
+    __LIBCUDACXX_locale_guard __current(__l);
     return MB_CUR_MAX;
 }
 
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-inline _LIBCPP_INLINE_VISIBILITY
-wint_t __libcpp_btowc_l(int __c, locale_t __l)
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
+inline _LIBCUDACXX_INLINE_VISIBILITY
+wint_t __LIBCUDACXX_btowc_l(int __c, locale_t __l)
 {
-    __libcpp_locale_guard __current(__l);
+    __LIBCUDACXX_locale_guard __current(__l);
     return btowc(__c);
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
-int __libcpp_wctob_l(wint_t __c, locale_t __l)
+inline _LIBCUDACXX_INLINE_VISIBILITY
+int __LIBCUDACXX_wctob_l(wint_t __c, locale_t __l)
 {
-    __libcpp_locale_guard __current(__l);
+    __LIBCUDACXX_locale_guard __current(__l);
     return wctob(__c);
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
-size_t __libcpp_wcsnrtombs_l(char *__dest, const wchar_t **__src, size_t __nwc,
+inline _LIBCUDACXX_INLINE_VISIBILITY
+size_t __LIBCUDACXX_wcsnrtombs_l(char *__dest, const wchar_t **__src, size_t __nwc,
                          size_t __len, mbstate_t *__ps, locale_t __l)
 {
-    __libcpp_locale_guard __current(__l);
+    __LIBCUDACXX_locale_guard __current(__l);
     return wcsnrtombs(__dest, __src, __nwc, __len, __ps);
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
-size_t __libcpp_wcrtomb_l(char *__s, wchar_t __wc, mbstate_t *__ps, locale_t __l)
+inline _LIBCUDACXX_INLINE_VISIBILITY
+size_t __LIBCUDACXX_wcrtomb_l(char *__s, wchar_t __wc, mbstate_t *__ps, locale_t __l)
 {
-    __libcpp_locale_guard __current(__l);
+    __LIBCUDACXX_locale_guard __current(__l);
     return wcrtomb(__s, __wc, __ps);
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
-size_t __libcpp_mbsnrtowcs_l(wchar_t * __dest, const char **__src, size_t __nms,
+inline _LIBCUDACXX_INLINE_VISIBILITY
+size_t __LIBCUDACXX_mbsnrtowcs_l(wchar_t * __dest, const char **__src, size_t __nms,
                       size_t __len, mbstate_t *__ps, locale_t __l)
 {
-    __libcpp_locale_guard __current(__l);
+    __LIBCUDACXX_locale_guard __current(__l);
     return mbsnrtowcs(__dest, __src, __nms, __len, __ps);
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
-size_t __libcpp_mbrtowc_l(wchar_t *__pwc, const char *__s, size_t __n,
+inline _LIBCUDACXX_INLINE_VISIBILITY
+size_t __LIBCUDACXX_mbrtowc_l(wchar_t *__pwc, const char *__s, size_t __n,
                    mbstate_t *__ps, locale_t __l)
 {
-    __libcpp_locale_guard __current(__l);
+    __LIBCUDACXX_locale_guard __current(__l);
     return mbrtowc(__pwc, __s, __n, __ps);
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
-int __libcpp_mbtowc_l(wchar_t *__pwc, const char *__pmb, size_t __max, locale_t __l)
+inline _LIBCUDACXX_INLINE_VISIBILITY
+int __LIBCUDACXX_mbtowc_l(wchar_t *__pwc, const char *__pmb, size_t __max, locale_t __l)
 {
-    __libcpp_locale_guard __current(__l);
+    __LIBCUDACXX_locale_guard __current(__l);
     return mbtowc(__pwc, __pmb, __max);
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
-size_t __libcpp_mbrlen_l(const char *__s, size_t __n, mbstate_t *__ps, locale_t __l)
+inline _LIBCUDACXX_INLINE_VISIBILITY
+size_t __LIBCUDACXX_mbrlen_l(const char *__s, size_t __n, mbstate_t *__ps, locale_t __l)
 {
-    __libcpp_locale_guard __current(__l);
+    __LIBCUDACXX_locale_guard __current(__l);
     return mbrlen(__s, __n, __ps);
 }
-#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#endif // _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 
-inline _LIBCPP_INLINE_VISIBILITY
-lconv *__libcpp_localeconv_l(locale_t __l)
+inline _LIBCUDACXX_INLINE_VISIBILITY
+lconv *__LIBCUDACXX_localeconv_l(locale_t __l)
 {
-    __libcpp_locale_guard __current(__l);
+    __LIBCUDACXX_locale_guard __current(__l);
     return localeconv();
 }
 
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-inline _LIBCPP_INLINE_VISIBILITY
-size_t __libcpp_mbsrtowcs_l(wchar_t *__dest, const char **__src, size_t __len,
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
+inline _LIBCUDACXX_INLINE_VISIBILITY
+size_t __LIBCUDACXX_mbsrtowcs_l(wchar_t *__dest, const char **__src, size_t __len,
                      mbstate_t *__ps, locale_t __l)
 {
-    __libcpp_locale_guard __current(__l);
+    __LIBCUDACXX_locale_guard __current(__l);
     return mbsrtowcs(__dest, __src, __len, __ps);
 }
 #endif
 
-inline _LIBCPP_ATTRIBUTE_FORMAT(__printf__, 4, 5)
-int __libcpp_snprintf_l(char *__s, size_t __n, locale_t __l, const char *__format, ...) {
+inline _LIBCUDACXX_ATTRIBUTE_FORMAT(__printf__, 4, 5)
+int __LIBCUDACXX_snprintf_l(char *__s, size_t __n, locale_t __l, const char *__format, ...) {
     va_list __va;
     va_start(__va, __format);
-    __libcpp_locale_guard __current(__l);
+    __LIBCUDACXX_locale_guard __current(__l);
     int __res = vsnprintf(__s, __n, __format, __va);
     va_end(__va);
     return __res;
 }
 
-inline _LIBCPP_ATTRIBUTE_FORMAT(__printf__, 3, 4)
-int __libcpp_asprintf_l(char **__s, locale_t __l, const char *__format, ...) {
+inline _LIBCUDACXX_ATTRIBUTE_FORMAT(__printf__, 3, 4)
+int __LIBCUDACXX_asprintf_l(char **__s, locale_t __l, const char *__format, ...) {
     va_list __va;
     va_start(__va, __format);
-    __libcpp_locale_guard __current(__l);
+    __LIBCUDACXX_locale_guard __current(__l);
     int __res = vasprintf(__s, __format, __va);
     va_end(__va);
     return __res;
 }
 
-inline _LIBCPP_ATTRIBUTE_FORMAT(__scanf__, 3, 4)
-int __libcpp_sscanf_l(const char *__s, locale_t __l, const char *__format, ...) {
+inline _LIBCUDACXX_ATTRIBUTE_FORMAT(__scanf__, 3, 4)
+int __LIBCUDACXX_sscanf_l(const char *__s, locale_t __l, const char *__format, ...) {
     va_list __va;
     va_start(__va, __format);
-    __libcpp_locale_guard __current(__l);
+    __LIBCUDACXX_locale_guard __current(__l);
     int __res = vsscanf(__s, __format, __va);
     va_end(__va);
     return __res;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___BSD_LOCALE_FALLBACKS_H
+#endif // _LIBCUDACXX___BSD_LOCALE_FALLBACKS_H

diff  --git a/libcxx/include/__charconv/chars_format.h b/libcxx/include/__charconv/chars_format.h
index 0875079e6c7a..2fa6db54ed91 100644
--- a/libcxx/include/__charconv/chars_format.h
+++ b/libcxx/include/__charconv/chars_format.h
@@ -7,21 +7,21 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___CHARCONV_CHARS_FORMAT_H
-#define _LIBCPP___CHARCONV_CHARS_FORMAT_H
+#ifndef _LIBCUDACXX___CHARCONV_CHARS_FORMAT_H
+#define _LIBCUDACXX___CHARCONV_CHARS_FORMAT_H
 
 #include <__config>
 #include <__utility/to_underlying.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
-enum class _LIBCPP_ENUM_VIS chars_format
+enum class _LIBCUDACXX_ENUM_VIS chars_format
 {
     scientific = 0x1,
     fixed = 0x2,
@@ -29,49 +29,49 @@ enum class _LIBCPP_ENUM_VIS chars_format
     general = fixed | scientific
 };
 
-inline _LIBCPP_INLINE_VISIBILITY constexpr chars_format
+inline _LIBCUDACXX_INLINE_VISIBILITY constexpr chars_format
 operator~(chars_format __x) {
-  return chars_format(~_VSTD::__to_underlying(__x));
+  return chars_format(~_CUDA_VSTD::__to_underlying(__x));
 }
 
-inline _LIBCPP_INLINE_VISIBILITY constexpr chars_format
+inline _LIBCUDACXX_INLINE_VISIBILITY constexpr chars_format
 operator&(chars_format __x, chars_format __y) {
-  return chars_format(_VSTD::__to_underlying(__x) &
-                      _VSTD::__to_underlying(__y));
+  return chars_format(_CUDA_VSTD::__to_underlying(__x) &
+                      _CUDA_VSTD::__to_underlying(__y));
 }
 
-inline _LIBCPP_INLINE_VISIBILITY constexpr chars_format
+inline _LIBCUDACXX_INLINE_VISIBILITY constexpr chars_format
 operator|(chars_format __x, chars_format __y) {
-  return chars_format(_VSTD::__to_underlying(__x) |
-                      _VSTD::__to_underlying(__y));
+  return chars_format(_CUDA_VSTD::__to_underlying(__x) |
+                      _CUDA_VSTD::__to_underlying(__y));
 }
 
-inline _LIBCPP_INLINE_VISIBILITY constexpr chars_format
+inline _LIBCUDACXX_INLINE_VISIBILITY constexpr chars_format
 operator^(chars_format __x, chars_format __y) {
-  return chars_format(_VSTD::__to_underlying(__x) ^
-                      _VSTD::__to_underlying(__y));
+  return chars_format(_CUDA_VSTD::__to_underlying(__x) ^
+                      _CUDA_VSTD::__to_underlying(__y));
 }
 
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 chars_format&
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 chars_format&
 operator&=(chars_format& __x, chars_format __y) {
   __x = __x & __y;
   return __x;
 }
 
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 chars_format&
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 chars_format&
 operator|=(chars_format& __x, chars_format __y) {
   __x = __x | __y;
   return __x;
 }
 
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 chars_format&
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 chars_format&
 operator^=(chars_format& __x, chars_format __y) {
   __x = __x ^ __y;
   return __x;
 }
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___CHARCONV_CHARS_FORMAT_H
+#endif // _LIBCUDACXX___CHARCONV_CHARS_FORMAT_H

diff  --git a/libcxx/include/__charconv/from_chars_result.h b/libcxx/include/__charconv/from_chars_result.h
index 2cc3c11ef64f..9f0b412a0bed 100644
--- a/libcxx/include/__charconv/from_chars_result.h
+++ b/libcxx/include/__charconv/from_chars_result.h
@@ -7,31 +7,31 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___CHARCONV_FROM_CHARS_RESULT_H
-#define _LIBCPP___CHARCONV_FROM_CHARS_RESULT_H
+#ifndef _LIBCUDACXX___CHARCONV_FROM_CHARS_RESULT_H
+#define _LIBCUDACXX___CHARCONV_FROM_CHARS_RESULT_H
 
 #include <__config>
 #include <__errc>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
-struct _LIBCPP_TYPE_VIS from_chars_result
+struct _LIBCUDACXX_TYPE_VIS from_chars_result
 {
     const char* ptr;
     errc ec;
-#  if _LIBCPP_STD_VER > 17
-    _LIBCPP_HIDE_FROM_ABI friend bool operator==(const from_chars_result&, const from_chars_result&) = default;
+#  if _LIBCUDACXX_STD_VER > 17
+    _LIBCUDACXX_HIDE_FROM_ABI friend bool operator==(const from_chars_result&, const from_chars_result&) = default;
 #  endif
 };
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___CHARCONV_FROM_CHARS_RESULT_H
+#endif // _LIBCUDACXX___CHARCONV_FROM_CHARS_RESULT_H

diff  --git a/libcxx/include/__charconv/tables.h b/libcxx/include/__charconv/tables.h
index 83f39e6fd2ef..511fafd01530 100644
--- a/libcxx/include/__charconv/tables.h
+++ b/libcxx/include/__charconv/tables.h
@@ -7,19 +7,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___CHARCONV_TABLES
-#define _LIBCPP___CHARCONV_TABLES
+#ifndef _LIBCUDACXX___CHARCONV_TABLES
+#define _LIBCUDACXX___CHARCONV_TABLES
 
 #include <__config>
 #include <cstdint>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
 namespace __itoa {
 
@@ -35,7 +35,7 @@ struct __table {
 
   static const uint32_t __pow10_32[10];
   static const uint64_t __pow10_64[20];
-#  ifndef _LIBCPP_HAS_NO_INT128
+#  ifndef _LIBCUDACXX_HAS_NO_INT128
   // TODO FMT Reduce the number of entries in this table.
   static const __uint128_t __pow10_128[40];
   static const int __pow10_128_offset = 0;
@@ -111,7 +111,7 @@ const uint64_t __table<_Tp>::__pow10_64[20] = {UINT64_C(0),
                                                UINT64_C(1000000000000000000),
                                                UINT64_C(10000000000000000000)};
 
-#  ifndef _LIBCPP_HAS_NO_INT128
+#  ifndef _LIBCUDACXX_HAS_NO_INT128
 template <class _Tp>
 const __uint128_t __table<_Tp>::__pow10_128[40] = {
     UINT64_C(0),
@@ -173,8 +173,8 @@ const char __table<_Tp>::__digits_base_10[200] = {
 
 } // namespace __itoa
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___CHARCONV_TABLES
+#endif // _LIBCUDACXX___CHARCONV_TABLES

diff  --git a/libcxx/include/__charconv/to_chars_base_10.h b/libcxx/include/__charconv/to_chars_base_10.h
index d25deffc592f..5a8bf1412672 100644
--- a/libcxx/include/__charconv/to_chars_base_10.h
+++ b/libcxx/include/__charconv/to_chars_base_10.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___CHARCONV_TO_CHARS_BASE_10_H
-#define _LIBCPP___CHARCONV_TO_CHARS_BASE_10_H
+#ifndef _LIBCUDACXX___CHARCONV_TO_CHARS_BASE_10_H
+#define _LIBCUDACXX___CHARCONV_TO_CHARS_BASE_10_H
 
 #include <__algorithm/copy_n.h>
 #include <__charconv/tables.h>
@@ -16,63 +16,63 @@
 #include <cstdint>
 #include <limits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
 namespace __itoa {
 
-_LIBCPP_HIDE_FROM_ABI inline char* __append1(char* __first, uint32_t __value) noexcept {
+_LIBCUDACXX_HIDE_FROM_ABI inline char* __append1(char* __first, uint32_t __value) noexcept {
   *__first = '0' + static_cast<char>(__value);
   return __first + 1;
 }
 
-_LIBCPP_HIDE_FROM_ABI inline char* __append2(char* __first, uint32_t __value) noexcept {
+_LIBCUDACXX_HIDE_FROM_ABI inline char* __append2(char* __first, uint32_t __value) noexcept {
   return std::copy_n(&__table<>::__digits_base_10[__value * 2], 2, __first);
 }
 
-_LIBCPP_HIDE_FROM_ABI inline char* __append3(char* __first, uint32_t __value) noexcept {
+_LIBCUDACXX_HIDE_FROM_ABI inline char* __append3(char* __first, uint32_t __value) noexcept {
   return __itoa::__append2(__itoa::__append1(__first, __value / 100), __value % 100);
 }
 
-_LIBCPP_HIDE_FROM_ABI inline char* __append4(char* __first, uint32_t __value) noexcept {
+_LIBCUDACXX_HIDE_FROM_ABI inline char* __append4(char* __first, uint32_t __value) noexcept {
   return __itoa::__append2(__itoa::__append2(__first, __value / 100), __value % 100);
 }
 
-_LIBCPP_HIDE_FROM_ABI inline char* __append5(char* __first, uint32_t __value) noexcept {
+_LIBCUDACXX_HIDE_FROM_ABI inline char* __append5(char* __first, uint32_t __value) noexcept {
   return __itoa::__append4(__itoa::__append1(__first, __value / 10000), __value % 10000);
 }
 
-_LIBCPP_HIDE_FROM_ABI inline char* __append6(char* __first, uint32_t __value) noexcept {
+_LIBCUDACXX_HIDE_FROM_ABI inline char* __append6(char* __first, uint32_t __value) noexcept {
   return __itoa::__append4(__itoa::__append2(__first, __value / 10000), __value % 10000);
 }
 
-_LIBCPP_HIDE_FROM_ABI inline char* __append7(char* __first, uint32_t __value) noexcept {
+_LIBCUDACXX_HIDE_FROM_ABI inline char* __append7(char* __first, uint32_t __value) noexcept {
   return __itoa::__append6(__itoa::__append1(__first, __value / 1000000), __value % 1000000);
 }
 
-_LIBCPP_HIDE_FROM_ABI inline char* __append8(char* __first, uint32_t __value) noexcept {
+_LIBCUDACXX_HIDE_FROM_ABI inline char* __append8(char* __first, uint32_t __value) noexcept {
   return __itoa::__append6(__itoa::__append2(__first, __value / 1000000), __value % 1000000);
 }
 
-_LIBCPP_HIDE_FROM_ABI inline char* __append9(char* __first, uint32_t __value) noexcept {
+_LIBCUDACXX_HIDE_FROM_ABI inline char* __append9(char* __first, uint32_t __value) noexcept {
   return __itoa::__append8(__itoa::__append1(__first, __value / 100000000), __value % 100000000);
 }
 
 template <class _Tp>
-_LIBCPP_HIDE_FROM_ABI char* __append10(char* __first, _Tp __value) noexcept {
+_LIBCUDACXX_HIDE_FROM_ABI char* __append10(char* __first, _Tp __value) noexcept {
   return __itoa::__append8(__itoa::__append2(__first, static_cast<uint32_t>(__value / 100000000)),
                            static_cast<uint32_t>(__value % 100000000));
 }
 
-_LIBCPP_HIDE_FROM_ABI inline char* __base_10_u32(char* __first, uint32_t __value) noexcept {
+_LIBCUDACXX_HIDE_FROM_ABI inline char* __base_10_u32(char* __first, uint32_t __value) noexcept {
   if (__value < 1000000) {
     if (__value < 10000) {
       if (__value < 100) {
@@ -107,7 +107,7 @@ _LIBCPP_HIDE_FROM_ABI inline char* __base_10_u32(char* __first, uint32_t __value
   return __itoa::__append10(__first, __value);
 }
 
-_LIBCPP_HIDE_FROM_ABI inline char* __base_10_u64(char* __buffer, uint64_t __value) noexcept {
+_LIBCUDACXX_HIDE_FROM_ABI inline char* __base_10_u64(char* __buffer, uint64_t __value) noexcept {
   if (__value <= UINT32_MAX)
     return __itoa::__base_10_u32(__buffer, static_cast<uint32_t>(__value));
 
@@ -121,7 +121,7 @@ _LIBCPP_HIDE_FROM_ABI inline char* __base_10_u64(char* __buffer, uint64_t __valu
   return __itoa::__append10(__buffer, __value);
 }
 
-#  ifndef _LIBCPP_HAS_NO_INT128
+#  ifndef _LIBCUDACXX_HAS_NO_INT128
 /// \returns 10^\a exp
 ///
 /// \pre \a exp [19, 39]
@@ -129,13 +129,13 @@ _LIBCPP_HIDE_FROM_ABI inline char* __base_10_u64(char* __buffer, uint64_t __valu
 /// \note The lookup table contains a partial set of exponents limiting the
 /// range that can be used. However the range is sufficient for
 /// \ref __base_10_u128.
-_LIBCPP_HIDE_FROM_ABI inline __uint128_t __pow_10(int __exp) noexcept {
-  _LIBCPP_ASSERT(__exp >= __table<>::__pow10_128_offset, "Index out of bounds");
+_LIBCUDACXX_HIDE_FROM_ABI inline __uint128_t __pow_10(int __exp) noexcept {
+  _LIBCUDACXX_ASSERT(__exp >= __table<>::__pow10_128_offset, "Index out of bounds");
   return __table<>::__pow10_128[__exp - __table<>::__pow10_128_offset];
 }
 
-_LIBCPP_HIDE_FROM_ABI inline char* __base_10_u128(char* __buffer, __uint128_t __value) noexcept {
-  _LIBCPP_ASSERT(
+_LIBCUDACXX_HIDE_FROM_ABI inline char* __base_10_u128(char* __buffer, __uint128_t __value) noexcept {
+  _LIBCUDACXX_ASSERT(
       __value > numeric_limits<uint64_t>::max(), "The optimizations for this algorithm fail when this isn't true.");
 
   // Unlike the 64 to 32 bit case the 128 bit case the "upper half" can't be
@@ -176,10 +176,10 @@ _LIBCPP_HIDE_FROM_ABI inline char* __base_10_u128(char* __buffer, __uint128_t __
 #  endif
 } // namespace __itoa
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___CHARCONV_TO_CHARS_BASE_10_H
+#endif // _LIBCUDACXX___CHARCONV_TO_CHARS_BASE_10_H

diff  --git a/libcxx/include/__charconv/to_chars_result.h b/libcxx/include/__charconv/to_chars_result.h
index b4bc6ac2635b..e9531a2fb4aa 100644
--- a/libcxx/include/__charconv/to_chars_result.h
+++ b/libcxx/include/__charconv/to_chars_result.h
@@ -7,31 +7,31 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___CHARCONV_TO_CHARS_RESULT_H
-#define _LIBCPP___CHARCONV_TO_CHARS_RESULT_H
+#ifndef _LIBCUDACXX___CHARCONV_TO_CHARS_RESULT_H
+#define _LIBCUDACXX___CHARCONV_TO_CHARS_RESULT_H
 
 #include <__config>
 #include <__errc>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
-struct _LIBCPP_TYPE_VIS to_chars_result
+struct _LIBCUDACXX_TYPE_VIS to_chars_result
 {
     char* ptr;
     errc ec;
-#  if _LIBCPP_STD_VER > 17
-    _LIBCPP_HIDE_FROM_ABI friend bool operator==(const to_chars_result&, const to_chars_result&) = default;
+#  if _LIBCUDACXX_STD_VER > 17
+    _LIBCUDACXX_HIDE_FROM_ABI friend bool operator==(const to_chars_result&, const to_chars_result&) = default;
 #  endif
 };
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___CHARCONV_TO_CHARS_RESULT_H
+#endif // _LIBCUDACXX___CHARCONV_TO_CHARS_RESULT_H

diff  --git a/libcxx/include/__chrono/calendar.h b/libcxx/include/__chrono/calendar.h
index d3762a631c91..23b96ed1823a 100644
--- a/libcxx/include/__chrono/calendar.h
+++ b/libcxx/include/__chrono/calendar.h
@@ -7,20 +7,20 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___CHRONO_CALENDAR_H
-#define _LIBCPP___CHRONO_CALENDAR_H
+#ifndef _LIBCUDACXX___CHRONO_CALENDAR_H
+#define _LIBCUDACXX___CHRONO_CALENDAR_H
 
 #include <__chrono/duration.h>
 #include <__chrono/time_point.h>
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace chrono
 {
@@ -31,14 +31,14 @@ using local_time  = time_point<local_t, Duration>;
 using local_seconds = local_time<seconds>;
 using local_days    = local_time<days>;
 
-struct last_spec { _LIBCPP_HIDE_FROM_ABI explicit last_spec() = default; };
+struct last_spec { _LIBCUDACXX_HIDE_FROM_ABI explicit last_spec() = default; };
 inline constexpr last_spec last{};
 
 
 } // namespace chrono
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-#endif // _LIBCPP___CHRONO_CALENDAR_H
+#endif // _LIBCUDACXX___CHRONO_CALENDAR_H

diff  --git a/libcxx/include/__chrono/convert_to_timespec.h b/libcxx/include/__chrono/convert_to_timespec.h
index e8631d135fee..9b377e17d49f 100644
--- a/libcxx/include/__chrono/convert_to_timespec.h
+++ b/libcxx/include/__chrono/convert_to_timespec.h
@@ -6,26 +6,26 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-#ifndef _LIBCPP___CHRONO_CONVERT_TO_TIMESPEC_H
-#define _LIBCPP___CHRONO_CONVERT_TO_TIMESPEC_H
+#ifndef _LIBCUDACXX___CHRONO_CONVERT_TO_TIMESPEC_H
+#define _LIBCUDACXX___CHRONO_CONVERT_TO_TIMESPEC_H
 
 #include <__chrono/duration.h>
 #include <__config>
 #include <limits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 // Convert a nanoseconds duration to the given TimeSpec type, which must have
 // the same properties as std::timespec.
 template <class _TimeSpec>
-_LIBCPP_HIDE_FROM_ABI inline
+_LIBCUDACXX_HIDE_FROM_ABI inline
 _TimeSpec __convert_to_timespec(const chrono::nanoseconds& __ns)
 {
   using namespace chrono;
@@ -48,8 +48,8 @@ _TimeSpec __convert_to_timespec(const chrono::nanoseconds& __ns)
   return __ts;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___CHRONO_CONVERT_TO_TIMESPEC_H
+#endif // _LIBCUDACXX___CHRONO_CONVERT_TO_TIMESPEC_H

diff  --git a/libcxx/include/__chrono/day.h b/libcxx/include/__chrono/day.h
index d9fa4ffbc45e..7f9cdf247a4d 100644
--- a/libcxx/include/__chrono/day.h
+++ b/libcxx/include/__chrono/day.h
@@ -7,20 +7,20 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___CHRONO_DAY_H
-#define _LIBCPP___CHRONO_DAY_H
+#ifndef _LIBCUDACXX___CHRONO_DAY_H
+#define _LIBCUDACXX___CHRONO_DAY_H
 
 #include <__chrono/duration.h>
 #include <__config>
 #include <compare>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace chrono
 {
@@ -29,56 +29,56 @@ class day {
 private:
     unsigned char __d;
 public:
-    _LIBCPP_HIDE_FROM_ABI day() = default;
-    _LIBCPP_HIDE_FROM_ABI explicit inline constexpr day(unsigned __val) noexcept : __d(static_cast<unsigned char>(__val)) {}
-    _LIBCPP_HIDE_FROM_ABI inline constexpr day& operator++()    noexcept { ++__d; return *this; }
-    _LIBCPP_HIDE_FROM_ABI inline constexpr day  operator++(int) noexcept { day __tmp = *this; ++(*this); return __tmp; }
-    _LIBCPP_HIDE_FROM_ABI inline constexpr day& operator--()    noexcept { --__d; return *this; }
-    _LIBCPP_HIDE_FROM_ABI inline constexpr day  operator--(int) noexcept { day __tmp = *this; --(*this); return __tmp; }
-    _LIBCPP_HIDE_FROM_ABI        constexpr day& operator+=(const days& __dd) noexcept;
-    _LIBCPP_HIDE_FROM_ABI        constexpr day& operator-=(const days& __dd) noexcept;
-    _LIBCPP_HIDE_FROM_ABI explicit inline constexpr operator unsigned() const noexcept { return __d; }
-    _LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __d >= 1 && __d <= 31; }
+    _LIBCUDACXX_HIDE_FROM_ABI day() = default;
+    _LIBCUDACXX_HIDE_FROM_ABI explicit inline constexpr day(unsigned __val) noexcept : __d(static_cast<unsigned char>(__val)) {}
+    _LIBCUDACXX_HIDE_FROM_ABI inline constexpr day& operator++()    noexcept { ++__d; return *this; }
+    _LIBCUDACXX_HIDE_FROM_ABI inline constexpr day  operator++(int) noexcept { day __tmp = *this; ++(*this); return __tmp; }
+    _LIBCUDACXX_HIDE_FROM_ABI inline constexpr day& operator--()    noexcept { --__d; return *this; }
+    _LIBCUDACXX_HIDE_FROM_ABI inline constexpr day  operator--(int) noexcept { day __tmp = *this; --(*this); return __tmp; }
+    _LIBCUDACXX_HIDE_FROM_ABI        constexpr day& operator+=(const days& __dd) noexcept;
+    _LIBCUDACXX_HIDE_FROM_ABI        constexpr day& operator-=(const days& __dd) noexcept;
+    _LIBCUDACXX_HIDE_FROM_ABI explicit inline constexpr operator unsigned() const noexcept { return __d; }
+    _LIBCUDACXX_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __d >= 1 && __d <= 31; }
   };
 
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator==(const day& __lhs, const day& __rhs) noexcept
 { return static_cast<unsigned>(__lhs) == static_cast<unsigned>(__rhs); }
 
-_LIBCPP_HIDE_FROM_ABI constexpr strong_ordering operator<=>(const day& __lhs, const day& __rhs) noexcept {
+_LIBCUDACXX_HIDE_FROM_ABI constexpr strong_ordering operator<=>(const day& __lhs, const day& __rhs) noexcept {
   return static_cast<unsigned>(__lhs) <=> static_cast<unsigned>(__rhs);
 }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 day operator+ (const day& __lhs, const days& __rhs) noexcept
 { return day(static_cast<unsigned>(__lhs) + __rhs.count()); }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 day operator+ (const days& __lhs, const day& __rhs) noexcept
 { return __rhs + __lhs; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 day operator- (const day& __lhs, const days& __rhs) noexcept
 { return __lhs + -__rhs; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 days operator-(const day& __lhs, const day& __rhs) noexcept
 { return days(static_cast<int>(static_cast<unsigned>(__lhs)) -
               static_cast<int>(static_cast<unsigned>(__rhs))); }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 day& day::operator+=(const days& __dd) noexcept
 { *this = *this + __dd; return *this; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 day& day::operator-=(const days& __dd) noexcept
 { *this = *this - __dd; return *this; }
 
 } // namespace chrono
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-#endif // _LIBCPP___CHRONO_DAY_H
+#endif // _LIBCUDACXX___CHRONO_DAY_H

diff  --git a/libcxx/include/__chrono/duration.h b/libcxx/include/__chrono/duration.h
index c502574fb267..8cde90f0652a 100644
--- a/libcxx/include/__chrono/duration.h
+++ b/libcxx/include/__chrono/duration.h
@@ -7,27 +7,27 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___CHRONO_DURATION_H
-#define _LIBCPP___CHRONO_DURATION_H
+#ifndef _LIBCUDACXX___CHRONO_DURATION_H
+#define _LIBCUDACXX___CHRONO_DURATION_H
 
 #include <__config>
 #include <limits>
 #include <ratio>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace chrono
 {
 
-template <class _Rep, class _Period = ratio<1> > class _LIBCPP_TEMPLATE_VIS duration;
+template <class _Rep, class _Period = ratio<1> > class _LIBCUDACXX_TEMPLATE_VIS duration;
 
 template <class _Tp>
 struct __is_duration : false_type {};
@@ -47,7 +47,7 @@ struct __is_duration<const volatile duration<_Rep, _Period> > : true_type  {};
 } // namespace chrono
 
 template <class _Rep1, class _Period1, class _Rep2, class _Period2>
-struct _LIBCPP_TEMPLATE_VIS common_type<chrono::duration<_Rep1, _Period1>,
+struct _LIBCUDACXX_TEMPLATE_VIS common_type<chrono::duration<_Rep1, _Period1>,
                                          chrono::duration<_Rep2, _Period2> >
 {
     typedef chrono::duration<typename common_type<_Rep1, _Rep2>::type,
@@ -67,7 +67,7 @@ struct __duration_cast;
 template <class _FromDuration, class _ToDuration, class _Period>
 struct __duration_cast<_FromDuration, _ToDuration, _Period, true, true>
 {
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR
     _ToDuration operator()(const _FromDuration& __fd) const
     {
         return _ToDuration(static_cast<typename _ToDuration::rep>(__fd.count()));
@@ -77,7 +77,7 @@ struct __duration_cast<_FromDuration, _ToDuration, _Period, true, true>
 template <class _FromDuration, class _ToDuration, class _Period>
 struct __duration_cast<_FromDuration, _ToDuration, _Period, true, false>
 {
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR
     _ToDuration operator()(const _FromDuration& __fd) const
     {
         typedef typename common_type<typename _ToDuration::rep, typename _FromDuration::rep, intmax_t>::type _Ct;
@@ -89,7 +89,7 @@ struct __duration_cast<_FromDuration, _ToDuration, _Period, true, false>
 template <class _FromDuration, class _ToDuration, class _Period>
 struct __duration_cast<_FromDuration, _ToDuration, _Period, false, true>
 {
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR
     _ToDuration operator()(const _FromDuration& __fd) const
     {
         typedef typename common_type<typename _ToDuration::rep, typename _FromDuration::rep, intmax_t>::type _Ct;
@@ -101,7 +101,7 @@ struct __duration_cast<_FromDuration, _ToDuration, _Period, false, true>
 template <class _FromDuration, class _ToDuration, class _Period>
 struct __duration_cast<_FromDuration, _ToDuration, _Period, false, false>
 {
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR
     _ToDuration operator()(const _FromDuration& __fd) const
     {
         typedef typename common_type<typename _ToDuration::rep, typename _FromDuration::rep, intmax_t>::type _Ct;
@@ -112,8 +112,8 @@ struct __duration_cast<_FromDuration, _ToDuration, _Period, false, false>
 };
 
 template <class _ToDuration, class _Rep, class _Period>
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR
 typename enable_if
 <
     __is_duration<_ToDuration>::value,
@@ -125,25 +125,25 @@ duration_cast(const duration<_Rep, _Period>& __fd)
 }
 
 template <class _Rep>
-struct _LIBCPP_TEMPLATE_VIS treat_as_floating_point : is_floating_point<_Rep> {};
+struct _LIBCUDACXX_TEMPLATE_VIS treat_as_floating_point : is_floating_point<_Rep> {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Rep>
 inline constexpr bool treat_as_floating_point_v = treat_as_floating_point<_Rep>::value;
 #endif
 
 template <class _Rep>
-struct _LIBCPP_TEMPLATE_VIS duration_values
+struct _LIBCUDACXX_TEMPLATE_VIS duration_values
 {
 public:
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR _Rep zero() _NOEXCEPT {return _Rep(0);}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR _Rep max()  _NOEXCEPT {return numeric_limits<_Rep>::max();}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR _Rep min()  _NOEXCEPT {return numeric_limits<_Rep>::lowest();}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR _Rep zero() _NOEXCEPT {return _Rep(0);}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR _Rep max()  _NOEXCEPT {return numeric_limits<_Rep>::max();}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR _Rep min()  _NOEXCEPT {return numeric_limits<_Rep>::lowest();}
 };
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _ToDuration, class _Rep, class _Period>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR
 typename enable_if
 <
     __is_duration<_ToDuration>::value,
@@ -158,7 +158,7 @@ floor(const duration<_Rep, _Period>& __d)
 }
 
 template <class _ToDuration, class _Rep, class _Period>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR
 typename enable_if
 <
     __is_duration<_ToDuration>::value,
@@ -173,7 +173,7 @@ ceil(const duration<_Rep, _Period>& __d)
 }
 
 template <class _ToDuration, class _Rep, class _Period>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR
 typename enable_if
 <
     __is_duration<_ToDuration>::value,
@@ -196,7 +196,7 @@ round(const duration<_Rep, _Period>& __d)
 // duration
 
 template <class _Rep, class _Period>
-class _LIBCPP_TEMPLATE_VIS duration
+class _LIBCUDACXX_TEMPLATE_VIS duration
 {
     static_assert(!__is_duration<_Rep>::value, "A duration representation can not be a duration");
     static_assert(__is_ratio<_Period>::value, "Second template parameter of duration must be a std::ratio");
@@ -239,15 +239,15 @@ class _LIBCPP_TEMPLATE_VIS duration
     rep __rep_;
 public:
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
-#ifndef _LIBCPP_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR
+#ifndef _LIBCUDACXX_CXX03_LANG
         duration() = default;
 #else
         duration() {}
 #endif
 
     template <class _Rep2>
-        _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+        _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR
         explicit duration(const _Rep2& __r,
             typename enable_if
             <
@@ -259,7 +259,7 @@ class _LIBCPP_TEMPLATE_VIS duration
 
     // conversions
     template <class _Rep2, class _Period2>
-        _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+        _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR
         duration(const duration<_Rep2, _Period2>& __d,
             typename enable_if
             <
@@ -272,30 +272,30 @@ class _LIBCPP_TEMPLATE_VIS duration
 
     // observer
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR rep count() const {return __rep_;}
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR rep count() const {return __rep_;}
 
     // arithmetic
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR typename common_type<duration>::type operator+() const {return typename common_type<duration>::type(*this);}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR typename common_type<duration>::type operator-() const {return typename common_type<duration>::type(-__rep_);}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 duration& operator++()      {++__rep_; return *this;}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 duration  operator++(int)   {return duration(__rep_++);}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 duration& operator--()      {--__rep_; return *this;}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 duration  operator--(int)   {return duration(__rep_--);}
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR typename common_type<duration>::type operator+() const {return typename common_type<duration>::type(*this);}
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR typename common_type<duration>::type operator-() const {return typename common_type<duration>::type(-__rep_);}
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14 duration& operator++()      {++__rep_; return *this;}
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14 duration  operator++(int)   {return duration(__rep_++);}
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14 duration& operator--()      {--__rep_; return *this;}
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14 duration  operator--(int)   {return duration(__rep_--);}
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 duration& operator+=(const duration& __d) {__rep_ += __d.count(); return *this;}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 duration& operator-=(const duration& __d) {__rep_ -= __d.count(); return *this;}
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14 duration& operator+=(const duration& __d) {__rep_ += __d.count(); return *this;}
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14 duration& operator-=(const duration& __d) {__rep_ -= __d.count(); return *this;}
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 duration& operator*=(const rep& __rhs) {__rep_ *= __rhs; return *this;}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 duration& operator/=(const rep& __rhs) {__rep_ /= __rhs; return *this;}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 duration& operator%=(const rep& __rhs) {__rep_ %= __rhs; return *this;}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 duration& operator%=(const duration& __rhs) {__rep_ %= __rhs.count(); return *this;}
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14 duration& operator*=(const rep& __rhs) {__rep_ *= __rhs; return *this;}
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14 duration& operator/=(const rep& __rhs) {__rep_ /= __rhs; return *this;}
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14 duration& operator%=(const rep& __rhs) {__rep_ %= __rhs; return *this;}
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14 duration& operator%=(const duration& __rhs) {__rep_ %= __rhs.count(); return *this;}
 
     // special values
 
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR duration zero() _NOEXCEPT {return duration(duration_values<rep>::zero());}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR duration min()  _NOEXCEPT {return duration(duration_values<rep>::min());}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR duration max()  _NOEXCEPT {return duration(duration_values<rep>::max());}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR duration zero() _NOEXCEPT {return duration(duration_values<rep>::zero());}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR duration min()  _NOEXCEPT {return duration(duration_values<rep>::min());}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR duration max()  _NOEXCEPT {return duration(duration_values<rep>::max());}
 };
 
 typedef duration<long long,         nano> nanoseconds;
@@ -304,7 +304,7 @@ typedef duration<long long,        milli> milliseconds;
 typedef duration<long long              > seconds;
 typedef duration<     long, ratio<  60> > minutes;
 typedef duration<     long, ratio<3600> > hours;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 typedef duration<     int, ratio_multiply<ratio<24>, hours::period>>         days;
 typedef duration<     int, ratio_multiply<ratio<7>,   days::period>>         weeks;
 typedef duration<     int, ratio_multiply<ratio<146097, 400>, days::period>> years;
@@ -315,7 +315,7 @@ typedef duration<     int, ratio_divide<years::period, ratio<12>>>           mon
 template <class _LhsDuration, class _RhsDuration>
 struct __duration_eq
 {
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR
     bool operator()(const _LhsDuration& __lhs, const _RhsDuration& __rhs) const
         {
             typedef typename common_type<_LhsDuration, _RhsDuration>::type _Ct;
@@ -326,14 +326,14 @@ struct __duration_eq
 template <class _LhsDuration>
 struct __duration_eq<_LhsDuration, _LhsDuration>
 {
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR
     bool operator()(const _LhsDuration& __lhs, const _LhsDuration& __rhs) const
         {return __lhs.count() == __rhs.count();}
 };
 
 template <class _Rep1, class _Period1, class _Rep2, class _Period2>
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR
 bool
 operator==(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
 {
@@ -343,8 +343,8 @@ operator==(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period
 // Duration !=
 
 template <class _Rep1, class _Period1, class _Rep2, class _Period2>
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR
 bool
 operator!=(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
 {
@@ -356,7 +356,7 @@ operator!=(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period
 template <class _LhsDuration, class _RhsDuration>
 struct __duration_lt
 {
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR
     bool operator()(const _LhsDuration& __lhs, const _RhsDuration& __rhs) const
         {
             typedef typename common_type<_LhsDuration, _RhsDuration>::type _Ct;
@@ -367,14 +367,14 @@ struct __duration_lt
 template <class _LhsDuration>
 struct __duration_lt<_LhsDuration, _LhsDuration>
 {
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR
     bool operator()(const _LhsDuration& __lhs, const _LhsDuration& __rhs) const
         {return __lhs.count() < __rhs.count();}
 };
 
 template <class _Rep1, class _Period1, class _Rep2, class _Period2>
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR
 bool
 operator< (const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
 {
@@ -384,8 +384,8 @@ operator< (const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period
 // Duration >
 
 template <class _Rep1, class _Period1, class _Rep2, class _Period2>
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR
 bool
 operator> (const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
 {
@@ -395,8 +395,8 @@ operator> (const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period
 // Duration <=
 
 template <class _Rep1, class _Period1, class _Rep2, class _Period2>
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR
 bool
 operator<=(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
 {
@@ -406,8 +406,8 @@ operator<=(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period
 // Duration >=
 
 template <class _Rep1, class _Period1, class _Rep2, class _Period2>
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR
 bool
 operator>=(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
 {
@@ -417,8 +417,8 @@ operator>=(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period
 // Duration +
 
 template <class _Rep1, class _Period1, class _Rep2, class _Period2>
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR
 typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type
 operator+(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
 {
@@ -429,8 +429,8 @@ operator+(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2
 // Duration -
 
 template <class _Rep1, class _Period1, class _Rep2, class _Period2>
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR
 typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type
 operator-(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
 {
@@ -441,8 +441,8 @@ operator-(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2
 // Duration *
 
 template <class _Rep1, class _Period, class _Rep2>
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR
 typename enable_if
 <
     is_convertible<_Rep2, typename common_type<_Rep1, _Rep2>::type>::value,
@@ -456,8 +456,8 @@ operator*(const duration<_Rep1, _Period>& __d, const _Rep2& __s)
 }
 
 template <class _Rep1, class _Period, class _Rep2>
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR
 typename enable_if
 <
     is_convertible<_Rep1, typename common_type<_Rep1, _Rep2>::type>::value,
@@ -471,8 +471,8 @@ operator*(const _Rep1& __s, const duration<_Rep2, _Period>& __d)
 // Duration /
 
 template <class _Rep1, class _Period, class _Rep2>
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR
 typename enable_if
 <
     !__is_duration<_Rep2>::value &&
@@ -487,8 +487,8 @@ operator/(const duration<_Rep1, _Period>& __d, const _Rep2& __s)
 }
 
 template <class _Rep1, class _Period1, class _Rep2, class _Period2>
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR
 typename common_type<_Rep1, _Rep2>::type
 operator/(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
 {
@@ -499,8 +499,8 @@ operator/(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2
 // Duration %
 
 template <class _Rep1, class _Period, class _Rep2>
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR
 typename enable_if
 <
     !__is_duration<_Rep2>::value &&
@@ -515,8 +515,8 @@ operator%(const duration<_Rep1, _Period>& __d, const _Rep2& __s)
 }
 
 template <class _Rep1, class _Period1, class _Rep2, class _Period2>
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR
 typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type
 operator%(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
 {
@@ -527,7 +527,7 @@ operator%(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2
 
 } // namespace chrono
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 // Suffixes for duration literals [time.duration.literals]
 inline namespace literals
 {
@@ -606,10 +606,10 @@ namespace chrono { // hoist the literals into namespace std::chrono
    using namespace literals::chrono_literals;
 } // namespace chrono
 
-#endif // _LIBCPP_STD_VER > 11
+#endif // _LIBCUDACXX_STD_VER > 11
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___CHRONO_DURATION_H
+#endif // _LIBCUDACXX___CHRONO_DURATION_H

diff  --git a/libcxx/include/__chrono/file_clock.h b/libcxx/include/__chrono/file_clock.h
index b8e08e78ba72..7845cdf73306 100644
--- a/libcxx/include/__chrono/file_clock.h
+++ b/libcxx/include/__chrono/file_clock.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___CHRONO_FILE_CLOCK_H
-#define _LIBCPP___CHRONO_FILE_CLOCK_H
+#ifndef _LIBCUDACXX___CHRONO_FILE_CLOCK_H
+#define _LIBCUDACXX___CHRONO_FILE_CLOCK_H
 
 #include <__availability>
 #include <__chrono/duration.h>
@@ -17,19 +17,19 @@
 #include <__config>
 #include <ratio>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#ifndef _LIBCPP_CXX03_LANG
-_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
+#ifndef _LIBCUDACXX_CXX03_LANG
+_LIBCUDACXX_BEGIN_NAMESPACE_FILESYSTEM
 struct _FilesystemClock;
-_LIBCPP_END_NAMESPACE_FILESYSTEM
-#endif // !_LIBCPP_CXX03_LANG
+_LIBCUDACXX_END_NAMESPACE_FILESYSTEM
+#endif // !_LIBCUDACXX_CXX03_LANG
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace chrono
 {
@@ -42,14 +42,14 @@ using file_time = time_point<file_clock, _Duration>;
 
 } // namespace chrono
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-#ifndef _LIBCPP_CXX03_LANG
-_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
+#ifndef _LIBCUDACXX_CXX03_LANG
+_LIBCUDACXX_BEGIN_NAMESPACE_FILESYSTEM
 struct _FilesystemClock {
-#if !defined(_LIBCPP_HAS_NO_INT128)
+#if !defined(_LIBCUDACXX_HAS_NO_INT128)
   typedef __int128_t rep;
   typedef nano period;
 #else
@@ -60,26 +60,26 @@ struct _FilesystemClock {
   typedef chrono::duration<rep, period> duration;
   typedef chrono::time_point<_FilesystemClock> time_point;
 
-  _LIBCPP_EXPORTED_FROM_ABI
-  static _LIBCPP_CONSTEXPR_AFTER_CXX11 const bool is_steady = false;
+  _LIBCUDACXX_EXPORTED_FROM_ABI
+  static _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 const bool is_steady = false;
 
-  _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_FUNC_VIS static time_point now() noexcept;
+  _LIBCUDACXX_AVAILABILITY_FILESYSTEM _LIBCUDACXX_FUNC_VIS static time_point now() noexcept;
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
   template <class _Duration>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   static chrono::sys_time<_Duration> to_sys(const chrono::file_time<_Duration>& __t) {
     return chrono::sys_time<_Duration>(__t.time_since_epoch());
   }
 
   template <class _Duration>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   static chrono::file_time<_Duration> from_sys(const chrono::sys_time<_Duration>& __t) {
     return chrono::file_time<_Duration>(__t.time_since_epoch());
   }
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 };
-_LIBCPP_END_NAMESPACE_FILESYSTEM
-#endif // !_LIBCPP_CXX03_LANG
+_LIBCUDACXX_END_NAMESPACE_FILESYSTEM
+#endif // !_LIBCUDACXX_CXX03_LANG
 
-#endif // _LIBCPP___CHRONO_FILE_CLOCK_H
+#endif // _LIBCUDACXX___CHRONO_FILE_CLOCK_H

diff  --git a/libcxx/include/__chrono/hh_mm_ss.h b/libcxx/include/__chrono/hh_mm_ss.h
index 6b3c5c09e68e..c8582c73bd41 100644
--- a/libcxx/include/__chrono/hh_mm_ss.h
+++ b/libcxx/include/__chrono/hh_mm_ss.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___CHRONO_HH_MM_SS_H
-#define _LIBCPP___CHRONO_HH_MM_SS_H
+#ifndef _LIBCUDACXX___CHRONO_HH_MM_SS_H
+#define _LIBCUDACXX___CHRONO_HH_MM_SS_H
 
 #include <__chrono/duration.h>
 #include <__chrono/time_point.h>
@@ -16,13 +16,13 @@
 #include <ratio>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace chrono
 {
@@ -34,7 +34,7 @@ class hh_mm_ss
     static_assert(__is_duration<_Duration>::value, "template parameter of hh_mm_ss must be a std::chrono::duration");
     using __CommonType = common_type_t<_Duration, chrono::seconds>;
 
-    _LIBCPP_HIDE_FROM_ABI static constexpr uint64_t __pow10(unsigned __exp)
+    _LIBCUDACXX_HIDE_FROM_ABI static constexpr uint64_t __pow10(unsigned __exp)
     {
         uint64_t __ret = 1;
         for (unsigned __i = 0; __i < __exp; ++__i)
@@ -42,7 +42,7 @@ class hh_mm_ss
         return __ret;
     }
 
-    _LIBCPP_HIDE_FROM_ABI static constexpr unsigned __width(uint64_t __n, uint64_t __d = 10, unsigned __w = 0)
+    _LIBCUDACXX_HIDE_FROM_ABI static constexpr unsigned __width(uint64_t __n, uint64_t __d = 10, unsigned __w = 0)
     {
         if (__n >= 2 && __d != 0 && __w < 19)
             return 1 + __width(__n, __d % __n * 10, __w+1);
@@ -50,13 +50,13 @@ class hh_mm_ss
     }
 
 public:
-    _LIBCPP_HIDE_FROM_ABI static unsigned constexpr fractional_width = __width(__CommonType::period::den) < 19 ?
+    _LIBCUDACXX_HIDE_FROM_ABI static unsigned constexpr fractional_width = __width(__CommonType::period::den) < 19 ?
                                                  __width(__CommonType::period::den) : 6u;
     using precision = duration<typename __CommonType::rep, ratio<1, __pow10(fractional_width)>>;
 
-    _LIBCPP_HIDE_FROM_ABI constexpr hh_mm_ss() noexcept : hh_mm_ss{_Duration::zero()} {}
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr hh_mm_ss() noexcept : hh_mm_ss{_Duration::zero()} {}
 
-    _LIBCPP_HIDE_FROM_ABI constexpr explicit hh_mm_ss(_Duration __d) noexcept :
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit hh_mm_ss(_Duration __d) noexcept :
         __is_neg(__d < _Duration(0)),
         __h(duration_cast<chrono::hours>  (abs(__d))),
         __m(duration_cast<chrono::minutes>(abs(__d) - hours())),
@@ -64,19 +64,19 @@ class hh_mm_ss
         __f(duration_cast<precision>      (abs(__d) - hours() - minutes() - seconds()))
         {}
 
-    _LIBCPP_HIDE_FROM_ABI constexpr bool is_negative()        const noexcept { return __is_neg; }
-    _LIBCPP_HIDE_FROM_ABI constexpr chrono::hours hours()     const noexcept { return __h; }
-    _LIBCPP_HIDE_FROM_ABI constexpr chrono::minutes minutes() const noexcept { return __m; }
-    _LIBCPP_HIDE_FROM_ABI constexpr chrono::seconds seconds() const noexcept { return __s; }
-    _LIBCPP_HIDE_FROM_ABI constexpr precision subseconds()    const noexcept { return __f; }
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr bool is_negative()        const noexcept { return __is_neg; }
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr chrono::hours hours()     const noexcept { return __h; }
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr chrono::minutes minutes() const noexcept { return __m; }
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr chrono::seconds seconds() const noexcept { return __s; }
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr precision subseconds()    const noexcept { return __f; }
 
-    _LIBCPP_HIDE_FROM_ABI constexpr precision to_duration() const noexcept
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr precision to_duration() const noexcept
     {
         auto __dur = __h + __m + __s + __f;
         return __is_neg ? -__dur : __dur;
     }
 
-    _LIBCPP_HIDE_FROM_ABI constexpr explicit operator precision() const noexcept { return to_duration(); }
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit operator precision() const noexcept { return to_duration(); }
 
 private:
     bool            __is_neg;
@@ -86,17 +86,17 @@ class hh_mm_ss
     precision       __f;
 };
 
-_LIBCPP_HIDE_FROM_ABI constexpr bool is_am(const hours& __h) noexcept { return __h >= hours( 0) && __h < hours(12); }
-_LIBCPP_HIDE_FROM_ABI constexpr bool is_pm(const hours& __h) noexcept { return __h >= hours(12) && __h < hours(24); }
+_LIBCUDACXX_HIDE_FROM_ABI constexpr bool is_am(const hours& __h) noexcept { return __h >= hours( 0) && __h < hours(12); }
+_LIBCUDACXX_HIDE_FROM_ABI constexpr bool is_pm(const hours& __h) noexcept { return __h >= hours(12) && __h < hours(24); }
 
-_LIBCPP_HIDE_FROM_ABI constexpr hours make12(const hours& __h) noexcept
+_LIBCUDACXX_HIDE_FROM_ABI constexpr hours make12(const hours& __h) noexcept
 {
     if      (__h == hours( 0)) return hours(12);
     else if (__h <= hours(12)) return __h;
     else                       return __h - hours(12);
 }
 
-_LIBCPP_HIDE_FROM_ABI constexpr hours make24(const hours& __h, bool __is_pm) noexcept
+_LIBCUDACXX_HIDE_FROM_ABI constexpr hours make24(const hours& __h, bool __is_pm) noexcept
 {
     if (__is_pm)
         return __h == hours(12) ? __h : __h + hours(12);
@@ -105,8 +105,8 @@ _LIBCPP_HIDE_FROM_ABI constexpr hours make24(const hours& __h, bool __is_pm) noe
 }
 } // namespace chrono
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-#endif // _LIBCPP___CHRONO_HH_MM_SS_H
+#endif // _LIBCUDACXX___CHRONO_HH_MM_SS_H

diff  --git a/libcxx/include/__chrono/high_resolution_clock.h b/libcxx/include/__chrono/high_resolution_clock.h
index 778ff44f3d09..e177b8d5dc79 100644
--- a/libcxx/include/__chrono/high_resolution_clock.h
+++ b/libcxx/include/__chrono/high_resolution_clock.h
@@ -7,23 +7,23 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___CHRONO_HIGH_RESOLUTION_CLOCK_H
-#define _LIBCPP___CHRONO_HIGH_RESOLUTION_CLOCK_H
+#ifndef _LIBCUDACXX___CHRONO_HIGH_RESOLUTION_CLOCK_H
+#define _LIBCUDACXX___CHRONO_HIGH_RESOLUTION_CLOCK_H
 
 #include <__chrono/steady_clock.h>
 #include <__chrono/system_clock.h>
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace chrono
 {
 
-#ifndef _LIBCPP_HAS_NO_MONOTONIC_CLOCK
+#ifndef _LIBCUDACXX_HAS_NO_MONOTONIC_CLOCK
 typedef steady_clock high_resolution_clock;
 #else
 typedef system_clock high_resolution_clock;
@@ -31,6 +31,6 @@ typedef system_clock high_resolution_clock;
 
 } // namespace chrono
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___CHRONO_HIGH_RESOLUTION_CLOCK_H
+#endif // _LIBCUDACXX___CHRONO_HIGH_RESOLUTION_CLOCK_H

diff  --git a/libcxx/include/__chrono/literals.h b/libcxx/include/__chrono/literals.h
index 50529bd44ad1..4ee4f5973ef5 100644
--- a/libcxx/include/__chrono/literals.h
+++ b/libcxx/include/__chrono/literals.h
@@ -7,31 +7,31 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___CHRONO_LITERALS_H
-#define _LIBCPP___CHRONO_LITERALS_H
+#ifndef _LIBCUDACXX___CHRONO_LITERALS_H
+#define _LIBCUDACXX___CHRONO_LITERALS_H
 
 #include <__chrono/day.h>
 #include <__chrono/year.h>
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 inline namespace literals
 {
   inline namespace chrono_literals
   {
-    _LIBCPP_HIDE_FROM_ABI constexpr chrono::day operator ""d(unsigned long long __d) noexcept
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr chrono::day operator ""d(unsigned long long __d) noexcept
     {
         return chrono::day(static_cast<unsigned>(__d));
     }
 
-    _LIBCPP_HIDE_FROM_ABI constexpr chrono::year operator ""y(unsigned long long __y) noexcept
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr chrono::year operator ""y(unsigned long long __y) noexcept
     {
         return chrono::year(static_cast<int>(__y));
     }
@@ -42,8 +42,8 @@ namespace chrono { // hoist the literals into namespace std::chrono
    using namespace literals::chrono_literals;
 } // namespace chrono
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-#endif // _LIBCPP___CHRONO_LITERALS_H
+#endif // _LIBCUDACXX___CHRONO_LITERALS_H

diff  --git a/libcxx/include/__chrono/month.h b/libcxx/include/__chrono/month.h
index 5aeb5b397182..aa1a719648f1 100644
--- a/libcxx/include/__chrono/month.h
+++ b/libcxx/include/__chrono/month.h
@@ -7,19 +7,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___CHRONO_MONTH_H
-#define _LIBCPP___CHRONO_MONTH_H
+#ifndef _LIBCUDACXX___CHRONO_MONTH_H
+#define _LIBCUDACXX___CHRONO_MONTH_H
 
 #include <__chrono/duration.h>
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace chrono
 {
@@ -28,44 +28,44 @@ class month {
 private:
     unsigned char __m;
 public:
-    _LIBCPP_HIDE_FROM_ABI month() = default;
-    _LIBCPP_HIDE_FROM_ABI explicit inline constexpr month(unsigned __val) noexcept : __m(static_cast<unsigned char>(__val)) {}
-    _LIBCPP_HIDE_FROM_ABI inline constexpr month& operator++()    noexcept { ++__m; return *this; }
-    _LIBCPP_HIDE_FROM_ABI inline constexpr month  operator++(int) noexcept { month __tmp = *this; ++(*this); return __tmp; }
-    _LIBCPP_HIDE_FROM_ABI inline constexpr month& operator--()    noexcept { --__m; return *this; }
-    _LIBCPP_HIDE_FROM_ABI inline constexpr month  operator--(int) noexcept { month __tmp = *this; --(*this); return __tmp; }
-    _LIBCPP_HIDE_FROM_ABI        constexpr month& operator+=(const months& __m1) noexcept;
-    _LIBCPP_HIDE_FROM_ABI        constexpr month& operator-=(const months& __m1) noexcept;
-    _LIBCPP_HIDE_FROM_ABI explicit inline constexpr operator unsigned() const noexcept { return __m; }
-    _LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __m >= 1 && __m <= 12; }
+    _LIBCUDACXX_HIDE_FROM_ABI month() = default;
+    _LIBCUDACXX_HIDE_FROM_ABI explicit inline constexpr month(unsigned __val) noexcept : __m(static_cast<unsigned char>(__val)) {}
+    _LIBCUDACXX_HIDE_FROM_ABI inline constexpr month& operator++()    noexcept { ++__m; return *this; }
+    _LIBCUDACXX_HIDE_FROM_ABI inline constexpr month  operator++(int) noexcept { month __tmp = *this; ++(*this); return __tmp; }
+    _LIBCUDACXX_HIDE_FROM_ABI inline constexpr month& operator--()    noexcept { --__m; return *this; }
+    _LIBCUDACXX_HIDE_FROM_ABI inline constexpr month  operator--(int) noexcept { month __tmp = *this; --(*this); return __tmp; }
+    _LIBCUDACXX_HIDE_FROM_ABI        constexpr month& operator+=(const months& __m1) noexcept;
+    _LIBCUDACXX_HIDE_FROM_ABI        constexpr month& operator-=(const months& __m1) noexcept;
+    _LIBCUDACXX_HIDE_FROM_ABI explicit inline constexpr operator unsigned() const noexcept { return __m; }
+    _LIBCUDACXX_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __m >= 1 && __m <= 12; }
 };
 
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator==(const month& __lhs, const month& __rhs) noexcept
 { return static_cast<unsigned>(__lhs) == static_cast<unsigned>(__rhs); }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator!=(const month& __lhs, const month& __rhs) noexcept
 { return !(__lhs == __rhs); }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator< (const month& __lhs, const month& __rhs) noexcept
 { return static_cast<unsigned>(__lhs)  < static_cast<unsigned>(__rhs); }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator> (const month& __lhs, const month& __rhs) noexcept
 { return __rhs < __lhs; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator<=(const month& __lhs, const month& __rhs) noexcept
 { return !(__rhs < __lhs); }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator>=(const month& __lhs, const month& __rhs) noexcept
 { return !(__lhs < __rhs); }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 month operator+ (const month& __lhs, const months& __rhs) noexcept
 {
     auto const __mu = static_cast<long long>(static_cast<unsigned>(__lhs)) + (__rhs.count() - 1);
@@ -73,26 +73,26 @@ month operator+ (const month& __lhs, const months& __rhs) noexcept
     return month{static_cast<unsigned>(__mu - __yr * 12 + 1)};
 }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 month operator+ (const months& __lhs, const month& __rhs) noexcept
 { return __rhs + __lhs; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 month operator- (const month& __lhs, const months& __rhs) noexcept
 { return __lhs + -__rhs; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 months operator-(const month& __lhs, const month& __rhs) noexcept
 {
     auto const __dm = static_cast<unsigned>(__lhs) - static_cast<unsigned>(__rhs);
     return months(__dm <= 11 ? __dm : __dm + 12);
 }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 month& month::operator+=(const months& __dm) noexcept
 { *this = *this + __dm; return *this; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 month& month::operator-=(const months& __dm) noexcept
 { *this = *this - __dm; return *this; }
 
@@ -111,8 +111,8 @@ inline constexpr month December{12};
 
 } // namespace chrono
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-#endif // _LIBCPP___CHRONO_MONTH_H
+#endif // _LIBCUDACXX___CHRONO_MONTH_H

diff  --git a/libcxx/include/__chrono/month_weekday.h b/libcxx/include/__chrono/month_weekday.h
index 270051397017..a360dc7fbd91 100644
--- a/libcxx/include/__chrono/month_weekday.h
+++ b/libcxx/include/__chrono/month_weekday.h
@@ -7,20 +7,20 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___CHRONO_MONTH_WEEKDAY_H
-#define _LIBCPP___CHRONO_MONTH_WEEKDAY_H
+#ifndef _LIBCUDACXX___CHRONO_MONTH_WEEKDAY_H
+#define _LIBCUDACXX___CHRONO_MONTH_WEEKDAY_H
 
 #include <__chrono/month.h>
 #include <__chrono/weekday.h>
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace chrono
 {
@@ -30,34 +30,34 @@ class month_weekday {
     chrono::month __m;
     chrono::weekday_indexed __wdi;
 public:
-    _LIBCPP_HIDE_FROM_ABI constexpr month_weekday(const chrono::month& __mval, const chrono::weekday_indexed& __wdival) noexcept
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr month_weekday(const chrono::month& __mval, const chrono::weekday_indexed& __wdival) noexcept
         : __m{__mval}, __wdi{__wdival} {}
-    _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month                     month() const noexcept { return __m; }
-    _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::weekday_indexed weekday_indexed() const noexcept { return __wdi; }
-    _LIBCPP_HIDE_FROM_ABI inline constexpr bool                                 ok() const noexcept { return __m.ok() && __wdi.ok(); }
+    _LIBCUDACXX_HIDE_FROM_ABI inline constexpr chrono::month                     month() const noexcept { return __m; }
+    _LIBCUDACXX_HIDE_FROM_ABI inline constexpr chrono::weekday_indexed weekday_indexed() const noexcept { return __wdi; }
+    _LIBCUDACXX_HIDE_FROM_ABI inline constexpr bool                                 ok() const noexcept { return __m.ok() && __wdi.ok(); }
 };
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator==(const month_weekday& __lhs, const month_weekday& __rhs) noexcept
 { return __lhs.month() == __rhs.month() && __lhs.weekday_indexed() == __rhs.weekday_indexed(); }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator!=(const month_weekday& __lhs, const month_weekday& __rhs) noexcept
 { return !(__lhs == __rhs); }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 month_weekday operator/(const month& __lhs, const weekday_indexed& __rhs) noexcept
 { return month_weekday{__lhs, __rhs}; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 month_weekday operator/(int __lhs, const weekday_indexed& __rhs) noexcept
 { return month_weekday{month(__lhs), __rhs}; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 month_weekday operator/(const weekday_indexed& __lhs, const month& __rhs) noexcept
 { return month_weekday{__rhs, __lhs}; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 month_weekday operator/(const weekday_indexed& __lhs, int __rhs) noexcept
 { return month_weekday{month(__rhs), __lhs}; }
 
@@ -66,41 +66,41 @@ class month_weekday_last {
     chrono::month        __m;
     chrono::weekday_last __wdl;
   public:
-    _LIBCPP_HIDE_FROM_ABI constexpr month_weekday_last(const chrono::month& __mval, const chrono::weekday_last& __wdlval) noexcept
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr month_weekday_last(const chrono::month& __mval, const chrono::weekday_last& __wdlval) noexcept
         : __m{__mval}, __wdl{__wdlval} {}
-    _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month               month() const noexcept { return __m; }
-    _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::weekday_last weekday_last() const noexcept { return __wdl; }
-    _LIBCPP_HIDE_FROM_ABI inline constexpr bool                           ok() const noexcept { return __m.ok() && __wdl.ok(); }
+    _LIBCUDACXX_HIDE_FROM_ABI inline constexpr chrono::month               month() const noexcept { return __m; }
+    _LIBCUDACXX_HIDE_FROM_ABI inline constexpr chrono::weekday_last weekday_last() const noexcept { return __wdl; }
+    _LIBCUDACXX_HIDE_FROM_ABI inline constexpr bool                           ok() const noexcept { return __m.ok() && __wdl.ok(); }
 };
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator==(const month_weekday_last& __lhs, const month_weekday_last& __rhs) noexcept
 { return __lhs.month() == __rhs.month() && __lhs.weekday_last() == __rhs.weekday_last(); }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator!=(const month_weekday_last& __lhs, const month_weekday_last& __rhs) noexcept
 { return !(__lhs == __rhs); }
 
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 month_weekday_last operator/(const month& __lhs, const weekday_last& __rhs) noexcept
 { return month_weekday_last{__lhs, __rhs}; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 month_weekday_last operator/(int __lhs, const weekday_last& __rhs) noexcept
 { return month_weekday_last{month(__lhs), __rhs}; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 month_weekday_last operator/(const weekday_last& __lhs, const month& __rhs) noexcept
 { return month_weekday_last{__rhs, __lhs}; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 month_weekday_last operator/(const weekday_last& __lhs, int __rhs) noexcept
 { return month_weekday_last{month(__rhs), __lhs}; }
 } // namespace chrono
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-#endif // _LIBCPP___CHRONO_MONTH_WEEKDAY_H
+#endif // _LIBCUDACXX___CHRONO_MONTH_WEEKDAY_H

diff  --git a/libcxx/include/__chrono/monthday.h b/libcxx/include/__chrono/monthday.h
index 485f0d4299b5..f9572661bcc8 100644
--- a/libcxx/include/__chrono/monthday.h
+++ b/libcxx/include/__chrono/monthday.h
@@ -7,21 +7,21 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___CHRONO_MONTHDAY_H
-#define _LIBCPP___CHRONO_MONTHDAY_H
+#ifndef _LIBCUDACXX___CHRONO_MONTHDAY_H
+#define _LIBCUDACXX___CHRONO_MONTHDAY_H
 
 #include <__chrono/calendar.h>
 #include <__chrono/day.h>
 #include <__chrono/month.h>
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace chrono
 {
@@ -31,15 +31,15 @@ class month_day {
    chrono::month __m;
    chrono::day   __d;
 public:
-    _LIBCPP_HIDE_FROM_ABI month_day() = default;
-    _LIBCPP_HIDE_FROM_ABI constexpr month_day(const chrono::month& __mval, const chrono::day& __dval) noexcept
+    _LIBCUDACXX_HIDE_FROM_ABI month_day() = default;
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr month_day(const chrono::month& __mval, const chrono::day& __dval) noexcept
         : __m{__mval}, __d{__dval} {}
-    _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m; }
-    _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::day   day()   const noexcept { return __d; }
-    _LIBCPP_HIDE_FROM_ABI constexpr bool ok() const noexcept;
+    _LIBCUDACXX_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m; }
+    _LIBCUDACXX_HIDE_FROM_ABI inline constexpr chrono::day   day()   const noexcept { return __d; }
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr bool ok() const noexcept;
 };
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool month_day::ok() const noexcept
 {
     if (!__m.ok()) return false;
@@ -54,48 +54,48 @@ bool month_day::ok() const noexcept
     return true;
 }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator==(const month_day& __lhs, const month_day& __rhs) noexcept
 { return __lhs.month() == __rhs.month() && __lhs.day() == __rhs.day(); }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator!=(const month_day& __lhs, const month_day& __rhs) noexcept
 { return !(__lhs == __rhs); }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 month_day operator/(const month& __lhs, const day& __rhs) noexcept
 { return month_day{__lhs, __rhs}; }
 
-_LIBCPP_HIDE_FROM_ABI constexpr
+_LIBCUDACXX_HIDE_FROM_ABI constexpr
 month_day operator/(const day& __lhs, const month& __rhs) noexcept
 { return __rhs / __lhs; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 month_day operator/(const month& __lhs, int __rhs) noexcept
 { return __lhs / day(__rhs); }
 
-_LIBCPP_HIDE_FROM_ABI constexpr
+_LIBCUDACXX_HIDE_FROM_ABI constexpr
 month_day operator/(int __lhs, const day& __rhs) noexcept
 { return month(__lhs) / __rhs; }
 
-_LIBCPP_HIDE_FROM_ABI constexpr
+_LIBCUDACXX_HIDE_FROM_ABI constexpr
 month_day operator/(const day& __lhs, int __rhs) noexcept
 { return month(__rhs) / __lhs; }
 
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator< (const month_day& __lhs, const month_day& __rhs) noexcept
 { return __lhs.month() != __rhs.month() ? __lhs.month() < __rhs.month() : __lhs.day() < __rhs.day(); }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator> (const month_day& __lhs, const month_day& __rhs) noexcept
 { return __rhs < __lhs; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator<=(const month_day& __lhs, const month_day& __rhs) noexcept
 { return !(__rhs < __lhs);}
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator>=(const month_day& __lhs, const month_day& __rhs) noexcept
 { return !(__lhs < __rhs); }
 
@@ -105,56 +105,56 @@ class month_day_last {
 private:
     chrono::month __m;
 public:
-    _LIBCPP_HIDE_FROM_ABI explicit constexpr month_day_last(const chrono::month& __val) noexcept
+    _LIBCUDACXX_HIDE_FROM_ABI explicit constexpr month_day_last(const chrono::month& __val) noexcept
         : __m{__val} {}
-    _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m; }
-    _LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __m.ok(); }
+    _LIBCUDACXX_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m; }
+    _LIBCUDACXX_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __m.ok(); }
 };
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator==(const month_day_last& __lhs, const month_day_last& __rhs) noexcept
 { return __lhs.month() == __rhs.month(); }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator!=(const month_day_last& __lhs, const month_day_last& __rhs) noexcept
 { return !(__lhs == __rhs); }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator< (const month_day_last& __lhs, const month_day_last& __rhs) noexcept
 { return __lhs.month() < __rhs.month(); }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator> (const month_day_last& __lhs, const month_day_last& __rhs) noexcept
 { return __rhs < __lhs; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator<=(const month_day_last& __lhs, const month_day_last& __rhs) noexcept
 { return !(__rhs < __lhs);}
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator>=(const month_day_last& __lhs, const month_day_last& __rhs) noexcept
 { return !(__lhs < __rhs); }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 month_day_last operator/(const month& __lhs, last_spec) noexcept
 { return month_day_last{__lhs}; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 month_day_last operator/(last_spec, const month& __rhs) noexcept
 { return month_day_last{__rhs}; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 month_day_last operator/(int __lhs, last_spec) noexcept
 { return month_day_last{month(__lhs)}; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 month_day_last operator/(last_spec, int __rhs) noexcept
 { return month_day_last{month(__rhs)}; }
 
 } // namespace chrono
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-#endif // _LIBCPP___CHRONO_MONTHDAY_H
+#endif // _LIBCUDACXX___CHRONO_MONTHDAY_H

diff  --git a/libcxx/include/__chrono/steady_clock.h b/libcxx/include/__chrono/steady_clock.h
index 657e5eef6c37..f115ec2a1298 100644
--- a/libcxx/include/__chrono/steady_clock.h
+++ b/libcxx/include/__chrono/steady_clock.h
@@ -7,31 +7,31 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___CHRONO_STEADY_CLOCK_H
-#define _LIBCPP___CHRONO_STEADY_CLOCK_H
+#ifndef _LIBCUDACXX___CHRONO_STEADY_CLOCK_H
+#define _LIBCUDACXX___CHRONO_STEADY_CLOCK_H
 
 #include <__chrono/duration.h>
 #include <__chrono/time_point.h>
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace chrono
 {
 
-#ifndef _LIBCPP_HAS_NO_MONOTONIC_CLOCK
-class _LIBCPP_TYPE_VIS steady_clock
+#ifndef _LIBCUDACXX_HAS_NO_MONOTONIC_CLOCK
+class _LIBCUDACXX_TYPE_VIS steady_clock
 {
 public:
     typedef nanoseconds                                   duration;
     typedef duration::rep                                 rep;
     typedef duration::period                              period;
     typedef chrono::time_point<steady_clock, duration>    time_point;
-    static _LIBCPP_CONSTEXPR_AFTER_CXX11 const bool is_steady = true;
+    static _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 const bool is_steady = true;
 
     static time_point now() _NOEXCEPT;
 };
@@ -39,6 +39,6 @@ class _LIBCPP_TYPE_VIS steady_clock
 
 } // namespace chrono
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___CHRONO_STEADY_CLOCK_H
+#endif // _LIBCUDACXX___CHRONO_STEADY_CLOCK_H

diff  --git a/libcxx/include/__chrono/system_clock.h b/libcxx/include/__chrono/system_clock.h
index 2922b78a74cb..dd6bd9436e4f 100644
--- a/libcxx/include/__chrono/system_clock.h
+++ b/libcxx/include/__chrono/system_clock.h
@@ -7,38 +7,38 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___CHRONO_SYSTEM_CLOCK_H
-#define _LIBCPP___CHRONO_SYSTEM_CLOCK_H
+#ifndef _LIBCUDACXX___CHRONO_SYSTEM_CLOCK_H
+#define _LIBCUDACXX___CHRONO_SYSTEM_CLOCK_H
 
 #include <__chrono/duration.h>
 #include <__chrono/time_point.h>
 #include <__config>
 #include <ctime>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace chrono
 {
 
-class _LIBCPP_TYPE_VIS system_clock
+class _LIBCUDACXX_TYPE_VIS system_clock
 {
 public:
     typedef microseconds                     duration;
     typedef duration::rep                    rep;
     typedef duration::period                 period;
     typedef chrono::time_point<system_clock> time_point;
-    static _LIBCPP_CONSTEXPR_AFTER_CXX11 const bool is_steady = false;
+    static _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 const bool is_steady = false;
 
     static time_point now() _NOEXCEPT;
     static time_t     to_time_t  (const time_point& __t) _NOEXCEPT;
     static time_point from_time_t(time_t __t) _NOEXCEPT;
 };
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 template <class _Duration>
 using sys_time    = time_point<system_clock, _Duration>;
@@ -49,6 +49,6 @@ using sys_days    = sys_time<days>;
 
 } // namespace chrono
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___CHRONO_SYSTEM_CLOCK_H
+#endif // _LIBCUDACXX___CHRONO_SYSTEM_CLOCK_H

diff  --git a/libcxx/include/__chrono/time_point.h b/libcxx/include/__chrono/time_point.h
index 63d67d77dd05..f6270062a89c 100644
--- a/libcxx/include/__chrono/time_point.h
+++ b/libcxx/include/__chrono/time_point.h
@@ -7,28 +7,28 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___CHRONO_TIME_POINT_H
-#define _LIBCPP___CHRONO_TIME_POINT_H
+#ifndef _LIBCUDACXX___CHRONO_TIME_POINT_H
+#define _LIBCUDACXX___CHRONO_TIME_POINT_H
 
 #include <__chrono/duration.h>
 #include <__config>
 #include <limits>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace chrono
 {
 
 template <class _Clock, class _Duration = typename _Clock::duration>
-class _LIBCPP_TEMPLATE_VIS time_point
+class _LIBCUDACXX_TEMPLATE_VIS time_point
 {
     static_assert(__is_duration<_Duration>::value,
                   "Second template parameter of time_point must be a std::chrono::duration");
@@ -41,12 +41,12 @@ class _LIBCPP_TEMPLATE_VIS time_point
     duration __d_;
 
 public:
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 time_point() : __d_(duration::zero()) {}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 explicit time_point(const duration& __d) : __d_(__d) {}
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 time_point() : __d_(duration::zero()) {}
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 explicit time_point(const duration& __d) : __d_(__d) {}
 
     // conversions
     template <class _Duration2>
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
     time_point(const time_point<clock, _Duration2>& __t,
         typename enable_if
         <
@@ -56,23 +56,23 @@ class _LIBCPP_TEMPLATE_VIS time_point
 
     // observer
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 duration time_since_epoch() const {return __d_;}
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 duration time_since_epoch() const {return __d_;}
 
     // arithmetic
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 time_point& operator+=(const duration& __d) {__d_ += __d; return *this;}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 time_point& operator-=(const duration& __d) {__d_ -= __d; return *this;}
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14 time_point& operator+=(const duration& __d) {__d_ += __d; return *this;}
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14 time_point& operator-=(const duration& __d) {__d_ -= __d; return *this;}
 
     // special values
 
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR time_point min() _NOEXCEPT {return time_point(duration::min());}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR time_point max() _NOEXCEPT {return time_point(duration::max());}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR time_point min() _NOEXCEPT {return time_point(duration::min());}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR time_point max() _NOEXCEPT {return time_point(duration::max());}
 };
 
 } // namespace chrono
 
 template <class _Clock, class _Duration1, class _Duration2>
-struct _LIBCPP_TEMPLATE_VIS common_type<chrono::time_point<_Clock, _Duration1>,
+struct _LIBCUDACXX_TEMPLATE_VIS common_type<chrono::time_point<_Clock, _Duration1>,
                                          chrono::time_point<_Clock, _Duration2> >
 {
     typedef chrono::time_point<_Clock, typename common_type<_Duration1, _Duration2>::type> type;
@@ -81,16 +81,16 @@ struct _LIBCPP_TEMPLATE_VIS common_type<chrono::time_point<_Clock, _Duration1>,
 namespace chrono {
 
 template <class _ToDuration, class _Clock, class _Duration>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 time_point<_Clock, _ToDuration>
 time_point_cast(const time_point<_Clock, _Duration>& __t)
 {
     return time_point<_Clock, _ToDuration>(chrono::duration_cast<_ToDuration>(__t.time_since_epoch()));
 }
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _ToDuration, class _Clock, class _Duration>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR
 typename enable_if
 <
     __is_duration<_ToDuration>::value,
@@ -102,7 +102,7 @@ floor(const time_point<_Clock, _Duration>& __t)
 }
 
 template <class _ToDuration, class _Clock, class _Duration>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR
 typename enable_if
 <
     __is_duration<_ToDuration>::value,
@@ -114,7 +114,7 @@ ceil(const time_point<_Clock, _Duration>& __t)
 }
 
 template <class _ToDuration, class _Clock, class _Duration>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR
 typename enable_if
 <
     __is_duration<_ToDuration>::value,
@@ -126,7 +126,7 @@ round(const time_point<_Clock, _Duration>& __t)
 }
 
 template <class _Rep, class _Period>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR
 typename enable_if
 <
     numeric_limits<_Rep>::is_signed,
@@ -136,12 +136,12 @@ abs(duration<_Rep, _Period> __d)
 {
     return __d >= __d.zero() ? +__d : -__d;
 }
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCUDACXX_STD_VER > 14
 
 // time_point ==
 
 template <class _Clock, class _Duration1, class _Duration2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 bool
 operator==(const time_point<_Clock, _Duration1>& __lhs, const time_point<_Clock, _Duration2>& __rhs)
 {
@@ -151,7 +151,7 @@ operator==(const time_point<_Clock, _Duration1>& __lhs, const time_point<_Clock,
 // time_point !=
 
 template <class _Clock, class _Duration1, class _Duration2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 bool
 operator!=(const time_point<_Clock, _Duration1>& __lhs, const time_point<_Clock, _Duration2>& __rhs)
 {
@@ -161,7 +161,7 @@ operator!=(const time_point<_Clock, _Duration1>& __lhs, const time_point<_Clock,
 // time_point <
 
 template <class _Clock, class _Duration1, class _Duration2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 bool
 operator<(const time_point<_Clock, _Duration1>& __lhs, const time_point<_Clock, _Duration2>& __rhs)
 {
@@ -171,7 +171,7 @@ operator<(const time_point<_Clock, _Duration1>& __lhs, const time_point<_Clock,
 // time_point >
 
 template <class _Clock, class _Duration1, class _Duration2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 bool
 operator>(const time_point<_Clock, _Duration1>& __lhs, const time_point<_Clock, _Duration2>& __rhs)
 {
@@ -181,7 +181,7 @@ operator>(const time_point<_Clock, _Duration1>& __lhs, const time_point<_Clock,
 // time_point <=
 
 template <class _Clock, class _Duration1, class _Duration2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 bool
 operator<=(const time_point<_Clock, _Duration1>& __lhs, const time_point<_Clock, _Duration2>& __rhs)
 {
@@ -191,7 +191,7 @@ operator<=(const time_point<_Clock, _Duration1>& __lhs, const time_point<_Clock,
 // time_point >=
 
 template <class _Clock, class _Duration1, class _Duration2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 bool
 operator>=(const time_point<_Clock, _Duration1>& __lhs, const time_point<_Clock, _Duration2>& __rhs)
 {
@@ -201,7 +201,7 @@ operator>=(const time_point<_Clock, _Duration1>& __lhs, const time_point<_Clock,
 // time_point operator+(time_point x, duration y);
 
 template <class _Clock, class _Duration1, class _Rep2, class _Period2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 time_point<_Clock, typename common_type<_Duration1, duration<_Rep2, _Period2> >::type>
 operator+(const time_point<_Clock, _Duration1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
 {
@@ -212,7 +212,7 @@ operator+(const time_point<_Clock, _Duration1>& __lhs, const duration<_Rep2, _Pe
 // time_point operator+(duration x, time_point y);
 
 template <class _Rep1, class _Period1, class _Clock, class _Duration2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 time_point<_Clock, typename common_type<duration<_Rep1, _Period1>, _Duration2>::type>
 operator+(const duration<_Rep1, _Period1>& __lhs, const time_point<_Clock, _Duration2>& __rhs)
 {
@@ -222,7 +222,7 @@ operator+(const duration<_Rep1, _Period1>& __lhs, const time_point<_Clock, _Dura
 // time_point operator-(time_point x, duration y);
 
 template <class _Clock, class _Duration1, class _Rep2, class _Period2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 time_point<_Clock, typename common_type<_Duration1, duration<_Rep2, _Period2> >::type>
 operator-(const time_point<_Clock, _Duration1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
 {
@@ -233,7 +233,7 @@ operator-(const time_point<_Clock, _Duration1>& __lhs, const duration<_Rep2, _Pe
 // duration operator-(time_point x, time_point y);
 
 template <class _Clock, class _Duration1, class _Duration2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 typename common_type<_Duration1, _Duration2>::type
 operator-(const time_point<_Clock, _Duration1>& __lhs, const time_point<_Clock, _Duration2>& __rhs)
 {
@@ -242,8 +242,8 @@ operator-(const time_point<_Clock, _Duration1>& __lhs, const time_point<_Clock,
 
 } // namespace chrono
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___CHRONO_TIME_POINT_H
+#endif // _LIBCUDACXX___CHRONO_TIME_POINT_H

diff  --git a/libcxx/include/__chrono/weekday.h b/libcxx/include/__chrono/weekday.h
index bad6781110f1..e87a0b180767 100644
--- a/libcxx/include/__chrono/weekday.h
+++ b/libcxx/include/__chrono/weekday.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___CHRONO_WEEKDAY_H
-#define _LIBCPP___CHRONO_WEEKDAY_H
+#ifndef _LIBCUDACXX___CHRONO_WEEKDAY_H
+#define _LIBCUDACXX___CHRONO_WEEKDAY_H
 
 #include <__chrono/calendar.h>
 #include <__chrono/duration.h>
@@ -16,13 +16,13 @@
 #include <__chrono/time_point.h>
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace chrono
 {
@@ -33,31 +33,31 @@ class weekday_last;
 class weekday {
 private:
     unsigned char __wd;
-    _LIBCPP_HIDE_FROM_ABI static constexpr unsigned char __weekday_from_days(int __days) noexcept;
+    _LIBCUDACXX_HIDE_FROM_ABI static constexpr unsigned char __weekday_from_days(int __days) noexcept;
 public:
-  _LIBCPP_HIDE_FROM_ABI weekday() = default;
-  _LIBCPP_HIDE_FROM_ABI inline explicit constexpr weekday(unsigned __val) noexcept : __wd(static_cast<unsigned char>(__val == 7 ? 0 : __val)) {}
-  _LIBCPP_HIDE_FROM_ABI inline constexpr          weekday(const sys_days& __sysd) noexcept
+  _LIBCUDACXX_HIDE_FROM_ABI weekday() = default;
+  _LIBCUDACXX_HIDE_FROM_ABI inline explicit constexpr weekday(unsigned __val) noexcept : __wd(static_cast<unsigned char>(__val == 7 ? 0 : __val)) {}
+  _LIBCUDACXX_HIDE_FROM_ABI inline constexpr          weekday(const sys_days& __sysd) noexcept
           : __wd(__weekday_from_days(__sysd.time_since_epoch().count())) {}
-  _LIBCPP_HIDE_FROM_ABI inline explicit constexpr weekday(const local_days& __locd) noexcept
+  _LIBCUDACXX_HIDE_FROM_ABI inline explicit constexpr weekday(const local_days& __locd) noexcept
           : __wd(__weekday_from_days(__locd.time_since_epoch().count())) {}
 
-  _LIBCPP_HIDE_FROM_ABI inline constexpr weekday& operator++()    noexcept { __wd = (__wd == 6 ? 0 : __wd + 1); return *this; }
-  _LIBCPP_HIDE_FROM_ABI inline constexpr weekday  operator++(int) noexcept { weekday __tmp = *this; ++(*this); return __tmp; }
-  _LIBCPP_HIDE_FROM_ABI inline constexpr weekday& operator--()    noexcept { __wd = (__wd == 0 ? 6 : __wd - 1); return *this; }
-  _LIBCPP_HIDE_FROM_ABI inline constexpr weekday  operator--(int) noexcept { weekday __tmp = *this; --(*this); return __tmp; }
-  _LIBCPP_HIDE_FROM_ABI        constexpr weekday& operator+=(const days& __dd) noexcept;
-  _LIBCPP_HIDE_FROM_ABI        constexpr weekday& operator-=(const days& __dd) noexcept;
-  _LIBCPP_HIDE_FROM_ABI inline constexpr unsigned c_encoding()   const noexcept { return __wd; }
-  _LIBCPP_HIDE_FROM_ABI inline constexpr unsigned iso_encoding() const noexcept { return __wd == 0u ? 7 : __wd; }
-  _LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __wd <= 6; }
-  _LIBCPP_HIDE_FROM_ABI        constexpr weekday_indexed operator[](unsigned __index) const noexcept;
-  _LIBCPP_HIDE_FROM_ABI        constexpr weekday_last    operator[](last_spec) const noexcept;
+  _LIBCUDACXX_HIDE_FROM_ABI inline constexpr weekday& operator++()    noexcept { __wd = (__wd == 6 ? 0 : __wd + 1); return *this; }
+  _LIBCUDACXX_HIDE_FROM_ABI inline constexpr weekday  operator++(int) noexcept { weekday __tmp = *this; ++(*this); return __tmp; }
+  _LIBCUDACXX_HIDE_FROM_ABI inline constexpr weekday& operator--()    noexcept { __wd = (__wd == 0 ? 6 : __wd - 1); return *this; }
+  _LIBCUDACXX_HIDE_FROM_ABI inline constexpr weekday  operator--(int) noexcept { weekday __tmp = *this; --(*this); return __tmp; }
+  _LIBCUDACXX_HIDE_FROM_ABI        constexpr weekday& operator+=(const days& __dd) noexcept;
+  _LIBCUDACXX_HIDE_FROM_ABI        constexpr weekday& operator-=(const days& __dd) noexcept;
+  _LIBCUDACXX_HIDE_FROM_ABI inline constexpr unsigned c_encoding()   const noexcept { return __wd; }
+  _LIBCUDACXX_HIDE_FROM_ABI inline constexpr unsigned iso_encoding() const noexcept { return __wd == 0u ? 7 : __wd; }
+  _LIBCUDACXX_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __wd <= 6; }
+  _LIBCUDACXX_HIDE_FROM_ABI        constexpr weekday_indexed operator[](unsigned __index) const noexcept;
+  _LIBCUDACXX_HIDE_FROM_ABI        constexpr weekday_last    operator[](last_spec) const noexcept;
 };
 
 
 // https://howardhinnant.github.io/date_algorithms.html#weekday_from_days
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 unsigned char weekday::__weekday_from_days(int __days) noexcept
 {
     return static_cast<unsigned char>(
@@ -65,31 +65,31 @@ unsigned char weekday::__weekday_from_days(int __days) noexcept
            );
 }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator==(const weekday& __lhs, const weekday& __rhs) noexcept
 { return __lhs.c_encoding() == __rhs.c_encoding(); }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator!=(const weekday& __lhs, const weekday& __rhs) noexcept
 { return !(__lhs == __rhs); }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator< (const weekday& __lhs, const weekday& __rhs) noexcept
 { return __lhs.c_encoding() < __rhs.c_encoding(); }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator> (const weekday& __lhs, const weekday& __rhs) noexcept
 { return __rhs < __lhs; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator<=(const weekday& __lhs, const weekday& __rhs) noexcept
 { return !(__rhs < __lhs);}
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator>=(const weekday& __lhs, const weekday& __rhs) noexcept
 { return !(__lhs < __rhs); }
 
-_LIBCPP_HIDE_FROM_ABI constexpr
+_LIBCUDACXX_HIDE_FROM_ABI constexpr
 weekday operator+(const weekday& __lhs, const days& __rhs) noexcept
 {
     auto const __mu = static_cast<long long>(__lhs.c_encoding()) + __rhs.count();
@@ -97,15 +97,15 @@ weekday operator+(const weekday& __lhs, const days& __rhs) noexcept
     return weekday{static_cast<unsigned>(__mu - __yr * 7)};
 }
 
-_LIBCPP_HIDE_FROM_ABI constexpr
+_LIBCUDACXX_HIDE_FROM_ABI constexpr
 weekday operator+(const days& __lhs, const weekday& __rhs) noexcept
 { return __rhs + __lhs; }
 
-_LIBCPP_HIDE_FROM_ABI constexpr
+_LIBCUDACXX_HIDE_FROM_ABI constexpr
 weekday operator-(const weekday& __lhs, const days& __rhs) noexcept
 { return __lhs + -__rhs; }
 
-_LIBCPP_HIDE_FROM_ABI constexpr
+_LIBCUDACXX_HIDE_FROM_ABI constexpr
 days operator-(const weekday& __lhs, const weekday& __rhs) noexcept
 {
     const int __wdu = __lhs.c_encoding() - __rhs.c_encoding();
@@ -113,11 +113,11 @@ days operator-(const weekday& __lhs, const weekday& __rhs) noexcept
     return days{__wdu - __wk * 7};
 }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 weekday& weekday::operator+=(const days& __dd) noexcept
 { *this = *this + __dd; return *this; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 weekday& weekday::operator-=(const days& __dd) noexcept
 { *this = *this - __dd; return *this; }
 
@@ -126,19 +126,19 @@ class weekday_indexed {
     chrono::weekday __wd;
     unsigned char   __idx;
 public:
-    _LIBCPP_HIDE_FROM_ABI weekday_indexed() = default;
-    _LIBCPP_HIDE_FROM_ABI inline constexpr weekday_indexed(const chrono::weekday& __wdval, unsigned __idxval) noexcept
+    _LIBCUDACXX_HIDE_FROM_ABI weekday_indexed() = default;
+    _LIBCUDACXX_HIDE_FROM_ABI inline constexpr weekday_indexed(const chrono::weekday& __wdval, unsigned __idxval) noexcept
         : __wd{__wdval}, __idx(__idxval) {}
-    _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::weekday weekday() const noexcept { return __wd; }
-    _LIBCPP_HIDE_FROM_ABI inline constexpr unsigned                 index() const noexcept { return __idx; }
-    _LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __wd.ok() && __idx >= 1 && __idx <= 5; }
+    _LIBCUDACXX_HIDE_FROM_ABI inline constexpr chrono::weekday weekday() const noexcept { return __wd; }
+    _LIBCUDACXX_HIDE_FROM_ABI inline constexpr unsigned                 index() const noexcept { return __idx; }
+    _LIBCUDACXX_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __wd.ok() && __idx >= 1 && __idx <= 5; }
 };
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator==(const weekday_indexed& __lhs, const weekday_indexed& __rhs) noexcept
 { return __lhs.weekday() == __rhs.weekday() && __lhs.index() == __rhs.index(); }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator!=(const weekday_indexed& __lhs, const weekday_indexed& __rhs) noexcept
 { return !(__lhs == __rhs); }
 
@@ -147,24 +147,24 @@ class weekday_last {
 private:
     chrono::weekday __wd;
 public:
-    _LIBCPP_HIDE_FROM_ABI explicit constexpr weekday_last(const chrono::weekday& __val) noexcept
+    _LIBCUDACXX_HIDE_FROM_ABI explicit constexpr weekday_last(const chrono::weekday& __val) noexcept
         : __wd{__val} {}
-    _LIBCPP_HIDE_FROM_ABI constexpr chrono::weekday weekday() const noexcept { return __wd; }
-    _LIBCPP_HIDE_FROM_ABI constexpr bool ok() const noexcept { return __wd.ok(); }
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr chrono::weekday weekday() const noexcept { return __wd; }
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr bool ok() const noexcept { return __wd.ok(); }
 };
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator==(const weekday_last& __lhs, const weekday_last& __rhs) noexcept
 { return __lhs.weekday() == __rhs.weekday(); }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator!=(const weekday_last& __lhs, const weekday_last& __rhs) noexcept
 { return !(__lhs == __rhs); }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 weekday_indexed weekday::operator[](unsigned __index) const noexcept { return weekday_indexed{*this, __index}; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 weekday_last weekday::operator[](last_spec) const noexcept { return weekday_last{*this}; }
 
 
@@ -178,8 +178,8 @@ inline constexpr weekday   Saturday{6};
 
 } // namespace chrono
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-#endif // _LIBCPP___CHRONO_WEEKDAY_H
+#endif // _LIBCUDACXX___CHRONO_WEEKDAY_H

diff  --git a/libcxx/include/__chrono/year.h b/libcxx/include/__chrono/year.h
index c7f0027eba7b..ac983e8ea0f8 100644
--- a/libcxx/include/__chrono/year.h
+++ b/libcxx/include/__chrono/year.h
@@ -7,23 +7,23 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___CHRONO_YEAR_H
-#define _LIBCPP___CHRONO_YEAR_H
+#ifndef _LIBCUDACXX___CHRONO_YEAR_H
+#define _LIBCUDACXX___CHRONO_YEAR_H
 
 #include <__chrono/duration.h>
 #include <__config>
 #include <limits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace chrono
 {
@@ -32,86 +32,86 @@ class year {
 private:
     short __y;
 public:
-    _LIBCPP_HIDE_FROM_ABI year() = default;
-    _LIBCPP_HIDE_FROM_ABI explicit inline constexpr year(int __val) noexcept : __y(static_cast<short>(__val)) {}
-
-    _LIBCPP_HIDE_FROM_ABI inline constexpr year& operator++()    noexcept { ++__y; return *this; }
-    _LIBCPP_HIDE_FROM_ABI inline constexpr year  operator++(int) noexcept { year __tmp = *this; ++(*this); return __tmp; }
-    _LIBCPP_HIDE_FROM_ABI inline constexpr year& operator--()    noexcept { --__y; return *this; }
-    _LIBCPP_HIDE_FROM_ABI inline constexpr year  operator--(int) noexcept { year __tmp = *this; --(*this); return __tmp; }
-    _LIBCPP_HIDE_FROM_ABI        constexpr year& operator+=(const years& __dy) noexcept;
-    _LIBCPP_HIDE_FROM_ABI        constexpr year& operator-=(const years& __dy) noexcept;
-    _LIBCPP_HIDE_FROM_ABI inline constexpr year operator+() const noexcept { return *this; }
-    _LIBCPP_HIDE_FROM_ABI inline constexpr year operator-() const noexcept { return year{-__y}; }
-
-    _LIBCPP_HIDE_FROM_ABI inline constexpr bool is_leap() const noexcept { return __y % 4 == 0 && (__y % 100 != 0 || __y % 400 == 0); }
-    _LIBCPP_HIDE_FROM_ABI explicit inline constexpr operator int() const noexcept { return __y; }
-    _LIBCPP_HIDE_FROM_ABI        constexpr bool ok() const noexcept;
-    _LIBCPP_HIDE_FROM_ABI static inline constexpr year min() noexcept { return year{-32767}; }
-    _LIBCPP_HIDE_FROM_ABI static inline constexpr year max() noexcept { return year{ 32767}; }
+    _LIBCUDACXX_HIDE_FROM_ABI year() = default;
+    _LIBCUDACXX_HIDE_FROM_ABI explicit inline constexpr year(int __val) noexcept : __y(static_cast<short>(__val)) {}
+
+    _LIBCUDACXX_HIDE_FROM_ABI inline constexpr year& operator++()    noexcept { ++__y; return *this; }
+    _LIBCUDACXX_HIDE_FROM_ABI inline constexpr year  operator++(int) noexcept { year __tmp = *this; ++(*this); return __tmp; }
+    _LIBCUDACXX_HIDE_FROM_ABI inline constexpr year& operator--()    noexcept { --__y; return *this; }
+    _LIBCUDACXX_HIDE_FROM_ABI inline constexpr year  operator--(int) noexcept { year __tmp = *this; --(*this); return __tmp; }
+    _LIBCUDACXX_HIDE_FROM_ABI        constexpr year& operator+=(const years& __dy) noexcept;
+    _LIBCUDACXX_HIDE_FROM_ABI        constexpr year& operator-=(const years& __dy) noexcept;
+    _LIBCUDACXX_HIDE_FROM_ABI inline constexpr year operator+() const noexcept { return *this; }
+    _LIBCUDACXX_HIDE_FROM_ABI inline constexpr year operator-() const noexcept { return year{-__y}; }
+
+    _LIBCUDACXX_HIDE_FROM_ABI inline constexpr bool is_leap() const noexcept { return __y % 4 == 0 && (__y % 100 != 0 || __y % 400 == 0); }
+    _LIBCUDACXX_HIDE_FROM_ABI explicit inline constexpr operator int() const noexcept { return __y; }
+    _LIBCUDACXX_HIDE_FROM_ABI        constexpr bool ok() const noexcept;
+    _LIBCUDACXX_HIDE_FROM_ABI static inline constexpr year min() noexcept { return year{-32767}; }
+    _LIBCUDACXX_HIDE_FROM_ABI static inline constexpr year max() noexcept { return year{ 32767}; }
 };
 
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator==(const year& __lhs, const year& __rhs) noexcept
 { return static_cast<int>(__lhs) == static_cast<int>(__rhs); }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator!=(const year& __lhs, const year& __rhs) noexcept
 { return !(__lhs == __rhs); }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator< (const year& __lhs, const year& __rhs) noexcept
 { return static_cast<int>(__lhs)  < static_cast<int>(__rhs); }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator> (const year& __lhs, const year& __rhs) noexcept
 { return __rhs < __lhs; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator<=(const year& __lhs, const year& __rhs) noexcept
 { return !(__rhs < __lhs); }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator>=(const year& __lhs, const year& __rhs) noexcept
 { return !(__lhs < __rhs); }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year operator+ (const year& __lhs, const years& __rhs) noexcept
 { return year(static_cast<int>(__lhs) + __rhs.count()); }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year operator+ (const years& __lhs, const year& __rhs) noexcept
 { return __rhs + __lhs; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year operator- (const year& __lhs, const years& __rhs) noexcept
 { return __lhs + -__rhs; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 years operator-(const year& __lhs, const year& __rhs) noexcept
 { return years{static_cast<int>(__lhs) - static_cast<int>(__rhs)}; }
 
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year& year::operator+=(const years& __dy) noexcept
 { *this = *this + __dy; return *this; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year& year::operator-=(const years& __dy) noexcept
 { *this = *this - __dy; return *this; }
 
-_LIBCPP_HIDE_FROM_ABI constexpr bool year::ok() const noexcept {
+_LIBCUDACXX_HIDE_FROM_ABI constexpr bool year::ok() const noexcept {
   static_assert(static_cast<int>(std::numeric_limits<decltype(__y)>::max()) == static_cast<int>(max()));
   return static_cast<int>(min()) <= __y;
 }
 
 } // namespace chrono
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___CHRONO_YEAR_H
+#endif // _LIBCUDACXX___CHRONO_YEAR_H

diff  --git a/libcxx/include/__chrono/year_month.h b/libcxx/include/__chrono/year_month.h
index 51b19caa1124..b674e898f408 100644
--- a/libcxx/include/__chrono/year_month.h
+++ b/libcxx/include/__chrono/year_month.h
@@ -7,21 +7,21 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___CHRONO_YEAR_MONTH_H
-#define _LIBCPP___CHRONO_YEAR_MONTH_H
+#ifndef _LIBCUDACXX___CHRONO_YEAR_MONTH_H
+#define _LIBCUDACXX___CHRONO_YEAR_MONTH_H
 
 #include <__chrono/duration.h>
 #include <__chrono/month.h>
 #include <__chrono/year.h>
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace chrono
 {
@@ -30,49 +30,49 @@ class year_month {
     chrono::year  __y;
     chrono::month __m;
 public:
-    _LIBCPP_HIDE_FROM_ABI year_month() = default;
-    _LIBCPP_HIDE_FROM_ABI constexpr year_month(const chrono::year& __yval, const chrono::month& __mval) noexcept
+    _LIBCUDACXX_HIDE_FROM_ABI year_month() = default;
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr year_month(const chrono::year& __yval, const chrono::month& __mval) noexcept
         : __y{__yval}, __m{__mval} {}
-    _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::year  year()  const noexcept { return __y; }
-    _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m; }
-    _LIBCPP_HIDE_FROM_ABI inline constexpr year_month& operator+=(const months& __dm) noexcept { this->__m += __dm; return *this; }
-    _LIBCPP_HIDE_FROM_ABI inline constexpr year_month& operator-=(const months& __dm) noexcept { this->__m -= __dm; return *this; }
-    _LIBCPP_HIDE_FROM_ABI inline constexpr year_month& operator+=(const years& __dy)  noexcept { this->__y += __dy; return *this; }
-    _LIBCPP_HIDE_FROM_ABI inline constexpr year_month& operator-=(const years& __dy)  noexcept { this->__y -= __dy; return *this; }
-    _LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __y.ok() && __m.ok(); }
+    _LIBCUDACXX_HIDE_FROM_ABI inline constexpr chrono::year  year()  const noexcept { return __y; }
+    _LIBCUDACXX_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m; }
+    _LIBCUDACXX_HIDE_FROM_ABI inline constexpr year_month& operator+=(const months& __dm) noexcept { this->__m += __dm; return *this; }
+    _LIBCUDACXX_HIDE_FROM_ABI inline constexpr year_month& operator-=(const months& __dm) noexcept { this->__m -= __dm; return *this; }
+    _LIBCUDACXX_HIDE_FROM_ABI inline constexpr year_month& operator+=(const years& __dy)  noexcept { this->__y += __dy; return *this; }
+    _LIBCUDACXX_HIDE_FROM_ABI inline constexpr year_month& operator-=(const years& __dy)  noexcept { this->__y -= __dy; return *this; }
+    _LIBCUDACXX_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __y.ok() && __m.ok(); }
 };
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year_month operator/(const year& __y, const month& __m) noexcept { return year_month{__y, __m}; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year_month operator/(const year& __y, int __m) noexcept { return year_month{__y, month(__m)}; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator==(const year_month& __lhs, const year_month& __rhs) noexcept
 { return __lhs.year() == __rhs.year() && __lhs.month() == __rhs.month(); }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator!=(const year_month& __lhs, const year_month& __rhs) noexcept
 { return !(__lhs == __rhs); }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator< (const year_month& __lhs, const year_month& __rhs) noexcept
 { return __lhs.year() != __rhs.year() ? __lhs.year() < __rhs.year() : __lhs.month() < __rhs.month(); }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator> (const year_month& __lhs, const year_month& __rhs) noexcept
 { return __rhs < __lhs; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator<=(const year_month& __lhs, const year_month& __rhs) noexcept
 { return !(__rhs < __lhs);}
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator>=(const year_month& __lhs, const year_month& __rhs) noexcept
 { return !(__lhs < __rhs); }
 
-_LIBCPP_HIDE_FROM_ABI constexpr
+_LIBCUDACXX_HIDE_FROM_ABI constexpr
 year_month operator+(const year_month& __lhs, const months& __rhs) noexcept
 {
     int __dmi = static_cast<int>(static_cast<unsigned>(__lhs.month())) - 1 + __rhs.count();
@@ -81,34 +81,34 @@ year_month operator+(const year_month& __lhs, const months& __rhs) noexcept
     return (__lhs.year() + years(__dy)) / month(static_cast<unsigned>(__dmi));
 }
 
-_LIBCPP_HIDE_FROM_ABI constexpr
+_LIBCUDACXX_HIDE_FROM_ABI constexpr
 year_month operator+(const months& __lhs, const year_month& __rhs) noexcept
 { return __rhs + __lhs; }
 
-_LIBCPP_HIDE_FROM_ABI constexpr
+_LIBCUDACXX_HIDE_FROM_ABI constexpr
 year_month operator+(const year_month& __lhs, const years& __rhs) noexcept
 { return (__lhs.year() + __rhs) / __lhs.month(); }
 
-_LIBCPP_HIDE_FROM_ABI constexpr
+_LIBCUDACXX_HIDE_FROM_ABI constexpr
 year_month operator+(const years& __lhs, const year_month& __rhs) noexcept
 { return __rhs + __lhs; }
 
-_LIBCPP_HIDE_FROM_ABI constexpr
+_LIBCUDACXX_HIDE_FROM_ABI constexpr
 months operator-(const year_month& __lhs, const year_month& __rhs) noexcept
 { return (__lhs.year() - __rhs.year()) + months(static_cast<unsigned>(__lhs.month()) - static_cast<unsigned>(__rhs.month())); }
 
-_LIBCPP_HIDE_FROM_ABI constexpr
+_LIBCUDACXX_HIDE_FROM_ABI constexpr
 year_month operator-(const year_month& __lhs, const months& __rhs) noexcept
 { return __lhs + -__rhs; }
 
-_LIBCPP_HIDE_FROM_ABI constexpr
+_LIBCUDACXX_HIDE_FROM_ABI constexpr
 year_month operator-(const year_month& __lhs, const years& __rhs) noexcept
 { return __lhs + -__rhs; }
 
 } // namespace chrono
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-#endif // _LIBCPP___CHRONO_YEAR_MONTH_H
+#endif // _LIBCUDACXX___CHRONO_YEAR_MONTH_H

diff  --git a/libcxx/include/__chrono/year_month_day.h b/libcxx/include/__chrono/year_month_day.h
index 957716aab690..5ad621e951bf 100644
--- a/libcxx/include/__chrono/year_month_day.h
+++ b/libcxx/include/__chrono/year_month_day.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___CHRONO_YEAR_MONTH_DAY_H
-#define _LIBCPP___CHRONO_YEAR_MONTH_DAY_H
+#ifndef _LIBCUDACXX___CHRONO_YEAR_MONTH_DAY_H
+#define _LIBCUDACXX___CHRONO_YEAR_MONTH_DAY_H
 
 #include <__chrono/calendar.h>
 #include <__chrono/day.h>
@@ -22,13 +22,13 @@
 #include <__config>
 #include <limits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace chrono
 {
@@ -41,36 +41,36 @@ class year_month_day {
     chrono::month __m;
     chrono::day   __d;
 public:
-     _LIBCPP_HIDE_FROM_ABI year_month_day() = default;
-     _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day(
+     _LIBCUDACXX_HIDE_FROM_ABI year_month_day() = default;
+     _LIBCUDACXX_HIDE_FROM_ABI inline constexpr year_month_day(
             const chrono::year& __yval, const chrono::month& __mval, const chrono::day& __dval) noexcept
             : __y{__yval}, __m{__mval}, __d{__dval} {}
-     _LIBCPP_HIDE_FROM_ABI        constexpr year_month_day(const year_month_day_last& __ymdl) noexcept;
-     _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day(const sys_days& __sysd) noexcept
+     _LIBCUDACXX_HIDE_FROM_ABI        constexpr year_month_day(const year_month_day_last& __ymdl) noexcept;
+     _LIBCUDACXX_HIDE_FROM_ABI inline constexpr year_month_day(const sys_days& __sysd) noexcept
             : year_month_day(__from_days(__sysd.time_since_epoch())) {}
-     _LIBCPP_HIDE_FROM_ABI inline explicit constexpr year_month_day(const local_days& __locd) noexcept
+     _LIBCUDACXX_HIDE_FROM_ABI inline explicit constexpr year_month_day(const local_days& __locd) noexcept
             : year_month_day(__from_days(__locd.time_since_epoch())) {}
 
-     _LIBCPP_HIDE_FROM_ABI        constexpr year_month_day& operator+=(const months& __dm) noexcept;
-     _LIBCPP_HIDE_FROM_ABI        constexpr year_month_day& operator-=(const months& __dm) noexcept;
-     _LIBCPP_HIDE_FROM_ABI        constexpr year_month_day& operator+=(const years& __dy)  noexcept;
-     _LIBCPP_HIDE_FROM_ABI        constexpr year_month_day& operator-=(const years& __dy)  noexcept;
+     _LIBCUDACXX_HIDE_FROM_ABI        constexpr year_month_day& operator+=(const months& __dm) noexcept;
+     _LIBCUDACXX_HIDE_FROM_ABI        constexpr year_month_day& operator-=(const months& __dm) noexcept;
+     _LIBCUDACXX_HIDE_FROM_ABI        constexpr year_month_day& operator+=(const years& __dy)  noexcept;
+     _LIBCUDACXX_HIDE_FROM_ABI        constexpr year_month_day& operator-=(const years& __dy)  noexcept;
 
-     _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::year   year() const noexcept { return __y; }
-     _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m; }
-     _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::day     day() const noexcept { return __d; }
-     _LIBCPP_HIDE_FROM_ABI inline constexpr operator   sys_days() const noexcept          { return   sys_days{__to_days()}; }
-     _LIBCPP_HIDE_FROM_ABI inline explicit constexpr operator local_days() const noexcept { return local_days{__to_days()}; }
+     _LIBCUDACXX_HIDE_FROM_ABI inline constexpr chrono::year   year() const noexcept { return __y; }
+     _LIBCUDACXX_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m; }
+     _LIBCUDACXX_HIDE_FROM_ABI inline constexpr chrono::day     day() const noexcept { return __d; }
+     _LIBCUDACXX_HIDE_FROM_ABI inline constexpr operator   sys_days() const noexcept          { return   sys_days{__to_days()}; }
+     _LIBCUDACXX_HIDE_FROM_ABI inline explicit constexpr operator local_days() const noexcept { return local_days{__to_days()}; }
 
-     _LIBCPP_HIDE_FROM_ABI        constexpr bool             ok() const noexcept;
+     _LIBCUDACXX_HIDE_FROM_ABI        constexpr bool             ok() const noexcept;
 
-     _LIBCPP_HIDE_FROM_ABI static constexpr year_month_day __from_days(days __d) noexcept;
-     _LIBCPP_HIDE_FROM_ABI constexpr days __to_days() const noexcept;
+     _LIBCUDACXX_HIDE_FROM_ABI static constexpr year_month_day __from_days(days __d) noexcept;
+     _LIBCUDACXX_HIDE_FROM_ABI constexpr days __to_days() const noexcept;
 };
 
 
 // https://howardhinnant.github.io/date_algorithms.html#civil_from_days
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year_month_day year_month_day::__from_days(days __d) noexcept
 {
     static_assert(numeric_limits<unsigned>::digits >= 18, "");
@@ -88,7 +88,7 @@ year_month_day year_month_day::__from_days(days __d) noexcept
 }
 
 // https://howardhinnant.github.io/date_algorithms.html#days_from_civil
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 days year_month_day::__to_days() const noexcept
 {
     static_assert(numeric_limits<unsigned>::digits >= 18, "");
@@ -105,15 +105,15 @@ days year_month_day::__to_days() const noexcept
     return days{__era * 146097 + static_cast<int>(__doe) - 719468};
 }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator==(const year_month_day& __lhs, const year_month_day& __rhs) noexcept
 { return __lhs.year() == __rhs.year() && __lhs.month() == __rhs.month() && __lhs.day() == __rhs.day(); }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator!=(const year_month_day& __lhs, const year_month_day& __rhs) noexcept
 { return !(__lhs == __rhs); }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator< (const year_month_day& __lhs, const year_month_day& __rhs) noexcept
 {
     if (__lhs.year() < __rhs.year()) return true;
@@ -123,95 +123,95 @@ bool operator< (const year_month_day& __lhs, const year_month_day& __rhs) noexce
     return __lhs.day() < __rhs.day();
 }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator> (const year_month_day& __lhs, const year_month_day& __rhs) noexcept
 { return __rhs < __lhs; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator<=(const year_month_day& __lhs, const year_month_day& __rhs) noexcept
 { return !(__rhs < __lhs);}
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator>=(const year_month_day& __lhs, const year_month_day& __rhs) noexcept
 { return !(__lhs < __rhs); }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year_month_day operator/(const year_month& __lhs, const day& __rhs) noexcept
 { return year_month_day{__lhs.year(), __lhs.month(), __rhs}; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year_month_day operator/(const year_month& __lhs, int __rhs) noexcept
 { return __lhs / day(__rhs); }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year_month_day operator/(const year& __lhs, const month_day& __rhs) noexcept
 { return __lhs / __rhs.month() / __rhs.day(); }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year_month_day operator/(int __lhs, const month_day& __rhs) noexcept
 { return year(__lhs) / __rhs; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year_month_day operator/(const month_day& __lhs, const year& __rhs) noexcept
 { return __rhs / __lhs; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year_month_day operator/(const month_day& __lhs, int __rhs) noexcept
 { return year(__rhs) / __lhs; }
 
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year_month_day operator+(const year_month_day& __lhs, const months& __rhs) noexcept
 { return (__lhs.year()/__lhs.month() + __rhs)/__lhs.day(); }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year_month_day operator+(const months& __lhs, const year_month_day& __rhs) noexcept
 { return __rhs + __lhs; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year_month_day operator-(const year_month_day& __lhs, const months& __rhs) noexcept
 { return __lhs + -__rhs; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year_month_day operator+(const year_month_day& __lhs, const years& __rhs) noexcept
 { return (__lhs.year() + __rhs) / __lhs.month() / __lhs.day(); }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year_month_day operator+(const years& __lhs, const year_month_day& __rhs) noexcept
 { return __rhs + __lhs; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year_month_day operator-(const year_month_day& __lhs, const years& __rhs) noexcept
 { return __lhs + -__rhs; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day& year_month_day::operator+=(const months& __dm) noexcept { *this = *this + __dm; return *this; }
-_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day& year_month_day::operator-=(const months& __dm) noexcept { *this = *this - __dm; return *this; }
-_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day& year_month_day::operator+=(const years& __dy)  noexcept { *this = *this + __dy; return *this; }
-_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day& year_month_day::operator-=(const years& __dy)  noexcept { *this = *this - __dy; return *this; }
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr year_month_day& year_month_day::operator+=(const months& __dm) noexcept { *this = *this + __dm; return *this; }
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr year_month_day& year_month_day::operator-=(const months& __dm) noexcept { *this = *this - __dm; return *this; }
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr year_month_day& year_month_day::operator+=(const years& __dy)  noexcept { *this = *this + __dy; return *this; }
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr year_month_day& year_month_day::operator-=(const years& __dy)  noexcept { *this = *this - __dy; return *this; }
 
 class year_month_day_last {
 private:
     chrono::year           __y;
     chrono::month_day_last __mdl;
 public:
-     _LIBCPP_HIDE_FROM_ABI constexpr year_month_day_last(const year& __yval, const month_day_last& __mdlval) noexcept
+     _LIBCUDACXX_HIDE_FROM_ABI constexpr year_month_day_last(const year& __yval, const month_day_last& __mdlval) noexcept
         : __y{__yval}, __mdl{__mdlval} {}
 
-     _LIBCPP_HIDE_FROM_ABI constexpr year_month_day_last& operator+=(const months& __m) noexcept;
-     _LIBCPP_HIDE_FROM_ABI constexpr year_month_day_last& operator-=(const months& __m) noexcept;
-     _LIBCPP_HIDE_FROM_ABI constexpr year_month_day_last& operator+=(const years& __y)  noexcept;
-     _LIBCPP_HIDE_FROM_ABI constexpr year_month_day_last& operator-=(const years& __y)  noexcept;
-
-     _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::year                     year() const noexcept { return __y; }
-     _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month                   month() const noexcept { return __mdl.month(); }
-     _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month_day_last month_day_last() const noexcept { return __mdl; }
-     _LIBCPP_HIDE_FROM_ABI        constexpr chrono::day                       day() const noexcept;
-     _LIBCPP_HIDE_FROM_ABI inline constexpr operator                     sys_days() const noexcept { return   sys_days{year()/month()/day()}; }
-     _LIBCPP_HIDE_FROM_ABI inline explicit constexpr operator          local_days() const noexcept { return local_days{year()/month()/day()}; }
-     _LIBCPP_HIDE_FROM_ABI inline constexpr bool                               ok() const noexcept { return __y.ok() && __mdl.ok(); }
+     _LIBCUDACXX_HIDE_FROM_ABI constexpr year_month_day_last& operator+=(const months& __m) noexcept;
+     _LIBCUDACXX_HIDE_FROM_ABI constexpr year_month_day_last& operator-=(const months& __m) noexcept;
+     _LIBCUDACXX_HIDE_FROM_ABI constexpr year_month_day_last& operator+=(const years& __y)  noexcept;
+     _LIBCUDACXX_HIDE_FROM_ABI constexpr year_month_day_last& operator-=(const years& __y)  noexcept;
+
+     _LIBCUDACXX_HIDE_FROM_ABI inline constexpr chrono::year                     year() const noexcept { return __y; }
+     _LIBCUDACXX_HIDE_FROM_ABI inline constexpr chrono::month                   month() const noexcept { return __mdl.month(); }
+     _LIBCUDACXX_HIDE_FROM_ABI inline constexpr chrono::month_day_last month_day_last() const noexcept { return __mdl; }
+     _LIBCUDACXX_HIDE_FROM_ABI        constexpr chrono::day                       day() const noexcept;
+     _LIBCUDACXX_HIDE_FROM_ABI inline constexpr operator                     sys_days() const noexcept { return   sys_days{year()/month()/day()}; }
+     _LIBCUDACXX_HIDE_FROM_ABI inline explicit constexpr operator          local_days() const noexcept { return local_days{year()/month()/day()}; }
+     _LIBCUDACXX_HIDE_FROM_ABI inline constexpr bool                               ok() const noexcept { return __y.ok() && __mdl.ok(); }
 };
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 chrono::day year_month_day_last::day() const noexcept
 {
     constexpr chrono::day __d[] =
@@ -225,15 +225,15 @@ chrono::day year_month_day_last::day() const noexcept
         __d[static_cast<unsigned>(month()) - 1] : chrono::day{29};
 }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator==(const year_month_day_last& __lhs, const year_month_day_last& __rhs) noexcept
 { return __lhs.year() == __rhs.year() && __lhs.month_day_last() == __rhs.month_day_last(); }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator!=(const year_month_day_last& __lhs, const year_month_day_last& __rhs) noexcept
 { return !(__lhs == __rhs); }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator< (const year_month_day_last& __lhs, const year_month_day_last& __rhs) noexcept
 {
     if (__lhs.year() < __rhs.year()) return true;
@@ -241,73 +241,73 @@ bool operator< (const year_month_day_last& __lhs, const year_month_day_last& __r
     return __lhs.month_day_last() < __rhs.month_day_last();
 }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator> (const year_month_day_last& __lhs, const year_month_day_last& __rhs) noexcept
 { return __rhs < __lhs; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator<=(const year_month_day_last& __lhs, const year_month_day_last& __rhs) noexcept
 { return !(__rhs < __lhs);}
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator>=(const year_month_day_last& __lhs, const year_month_day_last& __rhs) noexcept
 { return !(__lhs < __rhs); }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year_month_day_last operator/(const year_month& __lhs, last_spec) noexcept
 { return year_month_day_last{__lhs.year(), month_day_last{__lhs.month()}}; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year_month_day_last operator/(const year& __lhs, const month_day_last& __rhs) noexcept
 { return year_month_day_last{__lhs, __rhs}; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year_month_day_last operator/(int __lhs, const month_day_last& __rhs) noexcept
 { return year_month_day_last{year{__lhs}, __rhs}; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day_last
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr year_month_day_last
 operator/(const month_day_last& __lhs, const year& __rhs) noexcept
 { return __rhs / __lhs; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year_month_day_last operator/(const month_day_last& __lhs, int __rhs) noexcept
 { return year{__rhs} / __lhs; }
 
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year_month_day_last operator+(const year_month_day_last& __lhs, const months& __rhs) noexcept
 { return (__lhs.year() / __lhs.month() + __rhs) / last; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year_month_day_last operator+(const months& __lhs, const year_month_day_last& __rhs) noexcept
 { return __rhs + __lhs; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year_month_day_last operator-(const year_month_day_last& __lhs, const months& __rhs) noexcept
 { return __lhs + (-__rhs); }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year_month_day_last operator+(const year_month_day_last& __lhs, const years& __rhs) noexcept
 { return year_month_day_last{__lhs.year() + __rhs, __lhs.month_day_last()}; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year_month_day_last operator+(const years& __lhs, const year_month_day_last& __rhs) noexcept
 { return __rhs + __lhs; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year_month_day_last operator-(const year_month_day_last& __lhs, const years& __rhs) noexcept
 { return __lhs + (-__rhs); }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day_last& year_month_day_last::operator+=(const months& __dm) noexcept { *this = *this + __dm; return *this; }
-_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day_last& year_month_day_last::operator-=(const months& __dm) noexcept { *this = *this - __dm; return *this; }
-_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day_last& year_month_day_last::operator+=(const years& __dy)  noexcept { *this = *this + __dy; return *this; }
-_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day_last& year_month_day_last::operator-=(const years& __dy)  noexcept { *this = *this - __dy; return *this; }
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr year_month_day_last& year_month_day_last::operator+=(const months& __dm) noexcept { *this = *this + __dm; return *this; }
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr year_month_day_last& year_month_day_last::operator-=(const months& __dm) noexcept { *this = *this - __dm; return *this; }
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr year_month_day_last& year_month_day_last::operator+=(const years& __dy)  noexcept { *this = *this + __dy; return *this; }
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr year_month_day_last& year_month_day_last::operator-=(const years& __dy)  noexcept { *this = *this - __dy; return *this; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year_month_day::year_month_day(const year_month_day_last& __ymdl) noexcept
     : __y{__ymdl.year()}, __m{__ymdl.month()}, __d{__ymdl.day()} {}
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool year_month_day::ok() const noexcept
 {
     if (!__y.ok() || !__m.ok()) return false;
@@ -316,8 +316,8 @@ bool year_month_day::ok() const noexcept
 
 } // namespace chrono
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-#endif // _LIBCPP___CHRONO_YEAR_MONTH_DAY_H
+#endif // _LIBCUDACXX___CHRONO_YEAR_MONTH_DAY_H

diff  --git a/libcxx/include/__chrono/year_month_weekday.h b/libcxx/include/__chrono/year_month_weekday.h
index b69b77152fb1..3f441e6a2234 100644
--- a/libcxx/include/__chrono/year_month_weekday.h
+++ b/libcxx/include/__chrono/year_month_weekday.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___CHRONO_YEAR_MONTH_WEEKDAY_H
-#define _LIBCPP___CHRONO_YEAR_MONTH_WEEKDAY_H
+#ifndef _LIBCUDACXX___CHRONO_YEAR_MONTH_WEEKDAY_H
+#define _LIBCUDACXX___CHRONO_YEAR_MONTH_WEEKDAY_H
 
 #include <__chrono/calendar.h>
 #include <__chrono/day.h>
@@ -23,13 +23,13 @@
 #include <__chrono/year_month_day.h>
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace chrono
 {
@@ -39,28 +39,28 @@ class year_month_weekday {
     chrono::month           __m;
     chrono::weekday_indexed __wdi;
 public:
-    _LIBCPP_HIDE_FROM_ABI year_month_weekday() = default;
-    _LIBCPP_HIDE_FROM_ABI constexpr year_month_weekday(const chrono::year& __yval, const chrono::month& __mval,
+    _LIBCUDACXX_HIDE_FROM_ABI year_month_weekday() = default;
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr year_month_weekday(const chrono::year& __yval, const chrono::month& __mval,
                                const chrono::weekday_indexed& __wdival) noexcept
         : __y{__yval}, __m{__mval}, __wdi{__wdival} {}
-    _LIBCPP_HIDE_FROM_ABI constexpr year_month_weekday(const sys_days& __sysd) noexcept
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr year_month_weekday(const sys_days& __sysd) noexcept
             : year_month_weekday(__from_days(__sysd.time_since_epoch())) {}
-    _LIBCPP_HIDE_FROM_ABI inline explicit constexpr year_month_weekday(const local_days& __locd) noexcept
+    _LIBCUDACXX_HIDE_FROM_ABI inline explicit constexpr year_month_weekday(const local_days& __locd) noexcept
             : year_month_weekday(__from_days(__locd.time_since_epoch())) {}
-    _LIBCPP_HIDE_FROM_ABI constexpr year_month_weekday& operator+=(const months&) noexcept;
-    _LIBCPP_HIDE_FROM_ABI constexpr year_month_weekday& operator-=(const months&) noexcept;
-    _LIBCPP_HIDE_FROM_ABI constexpr year_month_weekday& operator+=(const years&)  noexcept;
-    _LIBCPP_HIDE_FROM_ABI constexpr year_month_weekday& operator-=(const years&)  noexcept;
-
-    _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::year                       year() const noexcept { return __y; }
-    _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month                     month() const noexcept { return __m; }
-    _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::weekday                 weekday() const noexcept { return __wdi.weekday(); }
-    _LIBCPP_HIDE_FROM_ABI inline constexpr unsigned                          index() const noexcept { return __wdi.index(); }
-    _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::weekday_indexed weekday_indexed() const noexcept { return __wdi; }
-
-    _LIBCPP_HIDE_FROM_ABI inline constexpr                       operator sys_days() const noexcept { return   sys_days{__to_days()}; }
-    _LIBCPP_HIDE_FROM_ABI inline explicit constexpr operator            local_days() const noexcept { return local_days{__to_days()}; }
-    _LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr year_month_weekday& operator+=(const months&) noexcept;
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr year_month_weekday& operator-=(const months&) noexcept;
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr year_month_weekday& operator+=(const years&)  noexcept;
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr year_month_weekday& operator-=(const years&)  noexcept;
+
+    _LIBCUDACXX_HIDE_FROM_ABI inline constexpr chrono::year                       year() const noexcept { return __y; }
+    _LIBCUDACXX_HIDE_FROM_ABI inline constexpr chrono::month                     month() const noexcept { return __m; }
+    _LIBCUDACXX_HIDE_FROM_ABI inline constexpr chrono::weekday                 weekday() const noexcept { return __wdi.weekday(); }
+    _LIBCUDACXX_HIDE_FROM_ABI inline constexpr unsigned                          index() const noexcept { return __wdi.index(); }
+    _LIBCUDACXX_HIDE_FROM_ABI inline constexpr chrono::weekday_indexed weekday_indexed() const noexcept { return __wdi; }
+
+    _LIBCUDACXX_HIDE_FROM_ABI inline constexpr                       operator sys_days() const noexcept { return   sys_days{__to_days()}; }
+    _LIBCUDACXX_HIDE_FROM_ABI inline explicit constexpr operator            local_days() const noexcept { return local_days{__to_days()}; }
+    _LIBCUDACXX_HIDE_FROM_ABI inline constexpr bool ok() const noexcept
     {
         if (!__y.ok() || !__m.ok() || !__wdi.ok()) return false;
         if (__wdi.index() <= 4) return true;
@@ -72,11 +72,11 @@ class year_month_weekday {
                static_cast<unsigned>((__y / __m / last).day());
     }
 
-    _LIBCPP_HIDE_FROM_ABI static constexpr year_month_weekday __from_days(days __d) noexcept;
-    _LIBCPP_HIDE_FROM_ABI constexpr days __to_days() const noexcept;
+    _LIBCUDACXX_HIDE_FROM_ABI static constexpr year_month_weekday __from_days(days __d) noexcept;
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr days __to_days() const noexcept;
 };
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year_month_weekday year_month_weekday::__from_days(days __d) noexcept
 {
     const sys_days      __sysd{__d};
@@ -86,7 +86,7 @@ year_month_weekday year_month_weekday::__from_days(days __d) noexcept
                               __wd[(static_cast<unsigned>(__ymd.day())-1)/7+1]};
 }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 days year_month_weekday::__to_days() const noexcept
 {
     const sys_days __sysd = sys_days(__y/__m/1);
@@ -94,64 +94,64 @@ days year_month_weekday::__to_days() const noexcept
                 .time_since_epoch();
 }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator==(const year_month_weekday& __lhs, const year_month_weekday& __rhs) noexcept
 { return __lhs.year() == __rhs.year() && __lhs.month() == __rhs.month() && __lhs.weekday_indexed() == __rhs.weekday_indexed(); }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator!=(const year_month_weekday& __lhs, const year_month_weekday& __rhs) noexcept
 { return !(__lhs == __rhs); }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year_month_weekday operator/(const year_month& __lhs, const weekday_indexed& __rhs) noexcept
 { return year_month_weekday{__lhs.year(), __lhs.month(), __rhs}; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year_month_weekday operator/(const year& __lhs, const month_weekday& __rhs) noexcept
 { return year_month_weekday{__lhs, __rhs.month(), __rhs.weekday_indexed()}; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year_month_weekday operator/(int __lhs, const month_weekday& __rhs) noexcept
 { return year(__lhs) / __rhs; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year_month_weekday operator/(const month_weekday& __lhs, const year& __rhs) noexcept
 { return __rhs / __lhs; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year_month_weekday operator/(const month_weekday& __lhs, int __rhs) noexcept
 { return year(__rhs) / __lhs; }
 
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year_month_weekday operator+(const year_month_weekday& __lhs, const months& __rhs) noexcept
 { return (__lhs.year() / __lhs.month() + __rhs) / __lhs.weekday_indexed(); }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year_month_weekday operator+(const months& __lhs, const year_month_weekday& __rhs) noexcept
 { return __rhs + __lhs; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year_month_weekday operator-(const year_month_weekday& __lhs, const months& __rhs) noexcept
 { return __lhs + (-__rhs); }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year_month_weekday operator+(const year_month_weekday& __lhs, const years& __rhs) noexcept
 { return year_month_weekday{__lhs.year() + __rhs, __lhs.month(), __lhs.weekday_indexed()}; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year_month_weekday operator+(const years& __lhs, const year_month_weekday& __rhs) noexcept
 { return __rhs + __lhs; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year_month_weekday operator-(const year_month_weekday& __lhs, const years& __rhs) noexcept
 { return __lhs + (-__rhs); }
 
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday& year_month_weekday::operator+=(const months& __dm) noexcept { *this = *this + __dm; return *this; }
-_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday& year_month_weekday::operator-=(const months& __dm) noexcept { *this = *this - __dm; return *this; }
-_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday& year_month_weekday::operator+=(const years& __dy)  noexcept { *this = *this + __dy; return *this; }
-_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday& year_month_weekday::operator-=(const years& __dy)  noexcept { *this = *this - __dy; return *this; }
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr year_month_weekday& year_month_weekday::operator+=(const months& __dm) noexcept { *this = *this + __dm; return *this; }
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr year_month_weekday& year_month_weekday::operator-=(const months& __dm) noexcept { *this = *this - __dm; return *this; }
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr year_month_weekday& year_month_weekday::operator+=(const years& __dy)  noexcept { *this = *this + __dy; return *this; }
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr year_month_weekday& year_month_weekday::operator-=(const years& __dy)  noexcept { *this = *this - __dy; return *this; }
 
 class year_month_weekday_last {
 private:
@@ -159,27 +159,27 @@ class year_month_weekday_last {
     chrono::month        __m;
     chrono::weekday_last __wdl;
 public:
-    _LIBCPP_HIDE_FROM_ABI constexpr year_month_weekday_last(const chrono::year& __yval, const chrono::month& __mval,
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr year_month_weekday_last(const chrono::year& __yval, const chrono::month& __mval,
                                       const chrono::weekday_last& __wdlval) noexcept
                 : __y{__yval}, __m{__mval}, __wdl{__wdlval} {}
-    _LIBCPP_HIDE_FROM_ABI constexpr year_month_weekday_last& operator+=(const months& __dm) noexcept;
-    _LIBCPP_HIDE_FROM_ABI constexpr year_month_weekday_last& operator-=(const months& __dm) noexcept;
-    _LIBCPP_HIDE_FROM_ABI constexpr year_month_weekday_last& operator+=(const years& __dy)  noexcept;
-    _LIBCPP_HIDE_FROM_ABI constexpr year_month_weekday_last& operator-=(const years& __dy)  noexcept;
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr year_month_weekday_last& operator+=(const months& __dm) noexcept;
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr year_month_weekday_last& operator-=(const months& __dm) noexcept;
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr year_month_weekday_last& operator+=(const years& __dy)  noexcept;
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr year_month_weekday_last& operator-=(const years& __dy)  noexcept;
 
-    _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::year                 year() const noexcept { return __y; }
-    _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month               month() const noexcept { return __m; }
-    _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::weekday           weekday() const noexcept { return __wdl.weekday(); }
-    _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::weekday_last weekday_last() const noexcept { return __wdl; }
-    _LIBCPP_HIDE_FROM_ABI inline constexpr operator                 sys_days() const noexcept { return   sys_days{__to_days()}; }
-    _LIBCPP_HIDE_FROM_ABI inline explicit constexpr operator      local_days() const noexcept { return local_days{__to_days()}; }
-    _LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __y.ok() && __m.ok() && __wdl.ok(); }
+    _LIBCUDACXX_HIDE_FROM_ABI inline constexpr chrono::year                 year() const noexcept { return __y; }
+    _LIBCUDACXX_HIDE_FROM_ABI inline constexpr chrono::month               month() const noexcept { return __m; }
+    _LIBCUDACXX_HIDE_FROM_ABI inline constexpr chrono::weekday           weekday() const noexcept { return __wdl.weekday(); }
+    _LIBCUDACXX_HIDE_FROM_ABI inline constexpr chrono::weekday_last weekday_last() const noexcept { return __wdl; }
+    _LIBCUDACXX_HIDE_FROM_ABI inline constexpr operator                 sys_days() const noexcept { return   sys_days{__to_days()}; }
+    _LIBCUDACXX_HIDE_FROM_ABI inline explicit constexpr operator      local_days() const noexcept { return local_days{__to_days()}; }
+    _LIBCUDACXX_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __y.ok() && __m.ok() && __wdl.ok(); }
 
-    _LIBCPP_HIDE_FROM_ABI constexpr days __to_days() const noexcept;
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr days __to_days() const noexcept;
 
 };
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 days year_month_weekday_last::__to_days() const noexcept
 {
     const sys_days __last = sys_days{__y/__m/last};
@@ -187,69 +187,69 @@ days year_month_weekday_last::__to_days() const noexcept
 
 }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator==(const year_month_weekday_last& __lhs, const year_month_weekday_last& __rhs) noexcept
 { return __lhs.year() == __rhs.year() && __lhs.month() == __rhs.month() && __lhs.weekday_last() == __rhs.weekday_last(); }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 bool operator!=(const year_month_weekday_last& __lhs, const year_month_weekday_last& __rhs) noexcept
 { return !(__lhs == __rhs); }
 
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year_month_weekday_last operator/(const year_month& __lhs, const weekday_last& __rhs) noexcept
 { return year_month_weekday_last{__lhs.year(), __lhs.month(), __rhs}; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year_month_weekday_last operator/(const year& __lhs, const month_weekday_last& __rhs) noexcept
 { return year_month_weekday_last{__lhs, __rhs.month(), __rhs.weekday_last()}; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year_month_weekday_last operator/(int __lhs, const month_weekday_last& __rhs) noexcept
 { return year(__lhs) / __rhs; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year_month_weekday_last operator/(const month_weekday_last& __lhs, const year& __rhs) noexcept
 { return __rhs / __lhs; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year_month_weekday_last operator/(const month_weekday_last& __lhs, int __rhs) noexcept
 { return year(__rhs) / __lhs; }
 
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year_month_weekday_last operator+(const year_month_weekday_last& __lhs, const months& __rhs) noexcept
 { return (__lhs.year() / __lhs.month() + __rhs) / __lhs.weekday_last(); }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year_month_weekday_last operator+(const months& __lhs, const year_month_weekday_last& __rhs) noexcept
 { return __rhs + __lhs; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year_month_weekday_last operator-(const year_month_weekday_last& __lhs, const months& __rhs) noexcept
 { return __lhs + (-__rhs); }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year_month_weekday_last operator+(const year_month_weekday_last& __lhs, const years& __rhs) noexcept
 { return year_month_weekday_last{__lhs.year() + __rhs, __lhs.month(), __lhs.weekday_last()}; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year_month_weekday_last operator+(const years& __lhs, const year_month_weekday_last& __rhs) noexcept
 { return __rhs + __lhs; }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr
 year_month_weekday_last operator-(const year_month_weekday_last& __lhs, const years& __rhs) noexcept
 { return __lhs + (-__rhs); }
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday_last& year_month_weekday_last::operator+=(const months& __dm) noexcept { *this = *this + __dm; return *this; }
-_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday_last& year_month_weekday_last::operator-=(const months& __dm) noexcept { *this = *this - __dm; return *this; }
-_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday_last& year_month_weekday_last::operator+=(const years& __dy)  noexcept { *this = *this + __dy; return *this; }
-_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday_last& year_month_weekday_last::operator-=(const years& __dy)  noexcept { *this = *this - __dy; return *this; }
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr year_month_weekday_last& year_month_weekday_last::operator+=(const months& __dm) noexcept { *this = *this + __dm; return *this; }
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr year_month_weekday_last& year_month_weekday_last::operator-=(const months& __dm) noexcept { *this = *this - __dm; return *this; }
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr year_month_weekday_last& year_month_weekday_last::operator+=(const years& __dy)  noexcept { *this = *this + __dy; return *this; }
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr year_month_weekday_last& year_month_weekday_last::operator-=(const years& __dy)  noexcept { *this = *this - __dy; return *this; }
 
 } // namespace chrono
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-#endif // _LIBCPP___CHRONO_YEAR_MONTH_WEEKDAY_H
+#endif // _LIBCUDACXX___CHRONO_YEAR_MONTH_WEEKDAY_H

diff  --git a/libcxx/include/__compare/common_comparison_category.h b/libcxx/include/__compare/common_comparison_category.h
index deab171846e2..462e75702188 100644
--- a/libcxx/include/__compare/common_comparison_category.h
+++ b/libcxx/include/__compare/common_comparison_category.h
@@ -6,20 +6,20 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___COMPARE_COMMON_COMPARISON_CATEGORY_H
-#define _LIBCPP___COMPARE_COMMON_COMPARISON_CATEGORY_H
+#ifndef _LIBCUDACXX___COMPARE_COMMON_COMPARISON_CATEGORY_H
+#define _LIBCUDACXX___COMPARE_COMMON_COMPARISON_CATEGORY_H
 
 #include <__compare/ordering.h>
 #include <__config>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 namespace __comp_detail {
 
@@ -32,7 +32,7 @@ enum _ClassifyCompCategory : unsigned {
 };
 
 template <class _Tp>
-_LIBCPP_HIDE_FROM_ABI
+_LIBCUDACXX_HIDE_FROM_ABI
 constexpr _ClassifyCompCategory __type_to_enum() noexcept {
   if (is_same_v<_Tp, partial_ordering>)
     return _PartialOrd;
@@ -44,7 +44,7 @@ constexpr _ClassifyCompCategory __type_to_enum() noexcept {
 }
 
 template <size_t _Size>
-_LIBCPP_HIDE_FROM_ABI
+_LIBCUDACXX_HIDE_FROM_ABI
 constexpr _ClassifyCompCategory
 __compute_comp_type(const _ClassifyCompCategory (&__types)[_Size]) {
   int __seen[_CCC_Size] = {};
@@ -60,7 +60,7 @@ __compute_comp_type(const _ClassifyCompCategory (&__types)[_Size]) {
 }
 
 template <class ..._Ts, bool _False = false>
-_LIBCPP_HIDE_FROM_ABI
+_LIBCUDACXX_HIDE_FROM_ABI
 constexpr auto __get_comp_type() {
   using _CCC = _ClassifyCompCategory;
   constexpr _CCC __type_kinds[] = {_StrongOrd, __type_to_enum<_Ts>()...};
@@ -80,15 +80,15 @@ constexpr auto __get_comp_type() {
 
 // [cmp.common], common comparison category type
 template<class... _Ts>
-struct _LIBCPP_TEMPLATE_VIS common_comparison_category {
+struct _LIBCUDACXX_TEMPLATE_VIS common_comparison_category {
   using type = decltype(__comp_detail::__get_comp_type<_Ts...>());
 };
 
 template<class... _Ts>
 using common_comparison_category_t = typename common_comparison_category<_Ts...>::type;
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___COMPARE_COMMON_COMPARISON_CATEGORY_H
+#endif // _LIBCUDACXX___COMPARE_COMMON_COMPARISON_CATEGORY_H

diff  --git a/libcxx/include/__compare/compare_partial_order_fallback.h b/libcxx/include/__compare/compare_partial_order_fallback.h
index ba746d6c7d9c..5b532bfac574 100644
--- a/libcxx/include/__compare/compare_partial_order_fallback.h
+++ b/libcxx/include/__compare/compare_partial_order_fallback.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___COMPARE_COMPARE_PARTIAL_ORDER_FALLBACK
-#define _LIBCPP___COMPARE_COMPARE_PARTIAL_ORDER_FALLBACK
+#ifndef _LIBCUDACXX___COMPARE_COMPARE_PARTIAL_ORDER_FALLBACK
+#define _LIBCUDACXX___COMPARE_COMPARE_PARTIAL_ORDER_FALLBACK
 
 #include <__compare/ordering.h>
 #include <__compare/partial_order.h>
@@ -16,49 +16,49 @@
 #include <__utility/priority_tag.h>
 #include <type_traits>
 
-#ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
+#ifndef _LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 // [cmp.alg]
 namespace __compare_partial_order_fallback {
     struct __fn {
         template<class _Tp, class _Up>
             requires is_same_v<decay_t<_Tp>, decay_t<_Up>>
-        _LIBCPP_HIDE_FROM_ABI static constexpr auto
+        _LIBCUDACXX_HIDE_FROM_ABI static constexpr auto
         __go(_Tp&& __t, _Up&& __u, __priority_tag<1>)
-            noexcept(noexcept(_VSTD::partial_order(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u))))
-            -> decltype(      _VSTD::partial_order(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u)))
-            { return          _VSTD::partial_order(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u)); }
+            noexcept(noexcept(_CUDA_VSTD::partial_order(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u))))
+            -> decltype(      _CUDA_VSTD::partial_order(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u)))
+            { return          _CUDA_VSTD::partial_order(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u)); }
 
         template<class _Tp, class _Up>
             requires is_same_v<decay_t<_Tp>, decay_t<_Up>>
-        _LIBCPP_HIDE_FROM_ABI static constexpr auto
+        _LIBCUDACXX_HIDE_FROM_ABI static constexpr auto
         __go(_Tp&& __t, _Up&& __u, __priority_tag<0>)
-            noexcept(noexcept(_VSTD::forward<_Tp>(__t) == _VSTD::forward<_Up>(__u) ? partial_ordering::equivalent :
-                              _VSTD::forward<_Tp>(__t) < _VSTD::forward<_Up>(__u) ? partial_ordering::less :
-                              _VSTD::forward<_Up>(__u) < _VSTD::forward<_Tp>(__t) ? partial_ordering::greater :
+            noexcept(noexcept(_CUDA_VSTD::forward<_Tp>(__t) == _CUDA_VSTD::forward<_Up>(__u) ? partial_ordering::equivalent :
+                              _CUDA_VSTD::forward<_Tp>(__t) < _CUDA_VSTD::forward<_Up>(__u) ? partial_ordering::less :
+                              _CUDA_VSTD::forward<_Up>(__u) < _CUDA_VSTD::forward<_Tp>(__t) ? partial_ordering::greater :
                               partial_ordering::unordered))
-            -> decltype(      _VSTD::forward<_Tp>(__t) == _VSTD::forward<_Up>(__u) ? partial_ordering::equivalent :
-                              _VSTD::forward<_Tp>(__t) < _VSTD::forward<_Up>(__u) ? partial_ordering::less :
-                              _VSTD::forward<_Up>(__u) < _VSTD::forward<_Tp>(__t) ? partial_ordering::greater :
+            -> decltype(      _CUDA_VSTD::forward<_Tp>(__t) == _CUDA_VSTD::forward<_Up>(__u) ? partial_ordering::equivalent :
+                              _CUDA_VSTD::forward<_Tp>(__t) < _CUDA_VSTD::forward<_Up>(__u) ? partial_ordering::less :
+                              _CUDA_VSTD::forward<_Up>(__u) < _CUDA_VSTD::forward<_Tp>(__t) ? partial_ordering::greater :
                               partial_ordering::unordered)
         {
-            return            _VSTD::forward<_Tp>(__t) == _VSTD::forward<_Up>(__u) ? partial_ordering::equivalent :
-                              _VSTD::forward<_Tp>(__t) < _VSTD::forward<_Up>(__u) ? partial_ordering::less :
-                              _VSTD::forward<_Up>(__u) < _VSTD::forward<_Tp>(__t) ? partial_ordering::greater :
+            return            _CUDA_VSTD::forward<_Tp>(__t) == _CUDA_VSTD::forward<_Up>(__u) ? partial_ordering::equivalent :
+                              _CUDA_VSTD::forward<_Tp>(__t) < _CUDA_VSTD::forward<_Up>(__u) ? partial_ordering::less :
+                              _CUDA_VSTD::forward<_Up>(__u) < _CUDA_VSTD::forward<_Tp>(__t) ? partial_ordering::greater :
                               partial_ordering::unordered;
         }
 
         template<class _Tp, class _Up>
-        _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t, _Up&& __u) const
-            noexcept(noexcept(__go(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u), __priority_tag<1>())))
-            -> decltype(      __go(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u), __priority_tag<1>()))
-            { return          __go(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u), __priority_tag<1>()); }
+        _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t, _Up&& __u) const
+            noexcept(noexcept(__go(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u), __priority_tag<1>())))
+            -> decltype(      __go(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u), __priority_tag<1>()))
+            { return          __go(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u), __priority_tag<1>()); }
     };
 } // namespace __compare_partial_order_fallback
 
@@ -66,8 +66,8 @@ inline namespace __cpo {
     inline constexpr auto compare_partial_order_fallback = __compare_partial_order_fallback::__fn{};
 } // namespace __cpo
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___COMPARE_COMPARE_PARTIAL_ORDER_FALLBACK
+#endif // _LIBCUDACXX___COMPARE_COMPARE_PARTIAL_ORDER_FALLBACK

diff  --git a/libcxx/include/__compare/compare_strong_order_fallback.h b/libcxx/include/__compare/compare_strong_order_fallback.h
index 312a08ef7e90..f28715af8421 100644
--- a/libcxx/include/__compare/compare_strong_order_fallback.h
+++ b/libcxx/include/__compare/compare_strong_order_fallback.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___COMPARE_COMPARE_STRONG_ORDER_FALLBACK
-#define _LIBCPP___COMPARE_COMPARE_STRONG_ORDER_FALLBACK
+#ifndef _LIBCUDACXX___COMPARE_COMPARE_STRONG_ORDER_FALLBACK
+#define _LIBCUDACXX___COMPARE_COMPARE_STRONG_ORDER_FALLBACK
 
 #include <__compare/ordering.h>
 #include <__compare/strong_order.h>
@@ -16,46 +16,46 @@
 #include <__utility/priority_tag.h>
 #include <type_traits>
 
-#ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
+#ifndef _LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 // [cmp.alg]
 namespace __compare_strong_order_fallback {
     struct __fn {
         template<class _Tp, class _Up>
             requires is_same_v<decay_t<_Tp>, decay_t<_Up>>
-        _LIBCPP_HIDE_FROM_ABI static constexpr auto
+        _LIBCUDACXX_HIDE_FROM_ABI static constexpr auto
         __go(_Tp&& __t, _Up&& __u, __priority_tag<1>)
-            noexcept(noexcept(_VSTD::strong_order(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u))))
-            -> decltype(      _VSTD::strong_order(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u)))
-            { return          _VSTD::strong_order(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u)); }
+            noexcept(noexcept(_CUDA_VSTD::strong_order(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u))))
+            -> decltype(      _CUDA_VSTD::strong_order(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u)))
+            { return          _CUDA_VSTD::strong_order(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u)); }
 
         template<class _Tp, class _Up>
             requires is_same_v<decay_t<_Tp>, decay_t<_Up>>
-        _LIBCPP_HIDE_FROM_ABI static constexpr auto
+        _LIBCUDACXX_HIDE_FROM_ABI static constexpr auto
         __go(_Tp&& __t, _Up&& __u, __priority_tag<0>)
-            noexcept(noexcept(_VSTD::forward<_Tp>(__t) == _VSTD::forward<_Up>(__u) ? strong_ordering::equal :
-                              _VSTD::forward<_Tp>(__t) < _VSTD::forward<_Up>(__u) ? strong_ordering::less :
+            noexcept(noexcept(_CUDA_VSTD::forward<_Tp>(__t) == _CUDA_VSTD::forward<_Up>(__u) ? strong_ordering::equal :
+                              _CUDA_VSTD::forward<_Tp>(__t) < _CUDA_VSTD::forward<_Up>(__u) ? strong_ordering::less :
                               strong_ordering::greater))
-            -> decltype(      _VSTD::forward<_Tp>(__t) == _VSTD::forward<_Up>(__u) ? strong_ordering::equal :
-                              _VSTD::forward<_Tp>(__t) < _VSTD::forward<_Up>(__u) ? strong_ordering::less :
+            -> decltype(      _CUDA_VSTD::forward<_Tp>(__t) == _CUDA_VSTD::forward<_Up>(__u) ? strong_ordering::equal :
+                              _CUDA_VSTD::forward<_Tp>(__t) < _CUDA_VSTD::forward<_Up>(__u) ? strong_ordering::less :
                               strong_ordering::greater)
         {
-            return            _VSTD::forward<_Tp>(__t) == _VSTD::forward<_Up>(__u) ? strong_ordering::equal :
-                              _VSTD::forward<_Tp>(__t) < _VSTD::forward<_Up>(__u) ? strong_ordering::less :
+            return            _CUDA_VSTD::forward<_Tp>(__t) == _CUDA_VSTD::forward<_Up>(__u) ? strong_ordering::equal :
+                              _CUDA_VSTD::forward<_Tp>(__t) < _CUDA_VSTD::forward<_Up>(__u) ? strong_ordering::less :
                               strong_ordering::greater;
         }
 
         template<class _Tp, class _Up>
-        _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t, _Up&& __u) const
-            noexcept(noexcept(__go(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u), __priority_tag<1>())))
-            -> decltype(      __go(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u), __priority_tag<1>()))
-            { return          __go(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u), __priority_tag<1>()); }
+        _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t, _Up&& __u) const
+            noexcept(noexcept(__go(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u), __priority_tag<1>())))
+            -> decltype(      __go(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u), __priority_tag<1>()))
+            { return          __go(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u), __priority_tag<1>()); }
     };
 } // namespace __compare_strong_order_fallback
 
@@ -63,8 +63,8 @@ inline namespace __cpo {
     inline constexpr auto compare_strong_order_fallback = __compare_strong_order_fallback::__fn{};
 } // namespace __cpo
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___COMPARE_COMPARE_STRONG_ORDER_FALLBACK
+#endif // _LIBCUDACXX___COMPARE_COMPARE_STRONG_ORDER_FALLBACK

diff  --git a/libcxx/include/__compare/compare_three_way.h b/libcxx/include/__compare/compare_three_way.h
index fdbba04a78e6..587f1192afe4 100644
--- a/libcxx/include/__compare/compare_three_way.h
+++ b/libcxx/include/__compare/compare_three_way.h
@@ -7,35 +7,35 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___COMPARE_COMPARE_THREE_WAY_H
-#define _LIBCPP___COMPARE_COMPARE_THREE_WAY_H
+#ifndef _LIBCUDACXX___COMPARE_COMPARE_THREE_WAY_H
+#define _LIBCUDACXX___COMPARE_COMPARE_THREE_WAY_H
 
 #include <__compare/three_way_comparable.h>
 #include <__config>
 #include <__utility/forward.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
-struct _LIBCPP_TEMPLATE_VIS compare_three_way
+struct _LIBCUDACXX_TEMPLATE_VIS compare_three_way
 {
     template<class _T1, class _T2>
         requires three_way_comparable_with<_T1, _T2>
-    constexpr _LIBCPP_HIDE_FROM_ABI
+    constexpr _LIBCUDACXX_HIDE_FROM_ABI
     auto operator()(_T1&& __t, _T2&& __u) const
-        noexcept(noexcept(_VSTD::forward<_T1>(__t) <=> _VSTD::forward<_T2>(__u)))
-        { return          _VSTD::forward<_T1>(__t) <=> _VSTD::forward<_T2>(__u); }
+        noexcept(noexcept(_CUDA_VSTD::forward<_T1>(__t) <=> _CUDA_VSTD::forward<_T2>(__u)))
+        { return          _CUDA_VSTD::forward<_T1>(__t) <=> _CUDA_VSTD::forward<_T2>(__u); }
 
     using is_transparent = void;
 };
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___COMPARE_COMPARE_THREE_WAY_H
+#endif // _LIBCUDACXX___COMPARE_COMPARE_THREE_WAY_H

diff  --git a/libcxx/include/__compare/compare_three_way_result.h b/libcxx/include/__compare/compare_three_way_result.h
index 7b03597ab1c1..aab4a69b91d9 100644
--- a/libcxx/include/__compare/compare_three_way_result.h
+++ b/libcxx/include/__compare/compare_three_way_result.h
@@ -6,38 +6,38 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___COMPARE_COMPARE_THREE_WAY_RESULT_H
-#define _LIBCPP___COMPARE_COMPARE_THREE_WAY_RESULT_H
+#ifndef _LIBCUDACXX___COMPARE_COMPARE_THREE_WAY_RESULT_H
+#define _LIBCUDACXX___COMPARE_COMPARE_THREE_WAY_RESULT_H
 
 #include <__config>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 template<class, class, class>
-struct _LIBCPP_HIDE_FROM_ABI __compare_three_way_result { };
+struct _LIBCUDACXX_HIDE_FROM_ABI __compare_three_way_result { };
 
 template<class _Tp, class _Up>
-struct _LIBCPP_HIDE_FROM_ABI __compare_three_way_result<_Tp, _Up, decltype(
+struct _LIBCUDACXX_HIDE_FROM_ABI __compare_three_way_result<_Tp, _Up, decltype(
   declval<__make_const_lvalue_ref<_Tp>>() <=> declval<__make_const_lvalue_ref<_Up>>(), void()
 )> {
     using type = decltype(declval<__make_const_lvalue_ref<_Tp>>() <=> declval<__make_const_lvalue_ref<_Up>>());
 };
 
 template<class _Tp, class _Up = _Tp>
-struct _LIBCPP_TEMPLATE_VIS compare_three_way_result : __compare_three_way_result<_Tp, _Up, void> { };
+struct _LIBCUDACXX_TEMPLATE_VIS compare_three_way_result : __compare_three_way_result<_Tp, _Up, void> { };
 
 template<class _Tp, class _Up = _Tp>
 using compare_three_way_result_t = typename compare_three_way_result<_Tp, _Up>::type;
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___COMPARE_COMPARE_THREE_WAY_RESULT_H
+#endif // _LIBCUDACXX___COMPARE_COMPARE_THREE_WAY_RESULT_H

diff  --git a/libcxx/include/__compare/compare_weak_order_fallback.h b/libcxx/include/__compare/compare_weak_order_fallback.h
index 844d67608703..00c0a824d5da 100644
--- a/libcxx/include/__compare/compare_weak_order_fallback.h
+++ b/libcxx/include/__compare/compare_weak_order_fallback.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___COMPARE_COMPARE_WEAK_ORDER_FALLBACK
-#define _LIBCPP___COMPARE_COMPARE_WEAK_ORDER_FALLBACK
+#ifndef _LIBCUDACXX___COMPARE_COMPARE_WEAK_ORDER_FALLBACK
+#define _LIBCUDACXX___COMPARE_COMPARE_WEAK_ORDER_FALLBACK
 
 #include <__compare/ordering.h>
 #include <__compare/weak_order.h>
@@ -16,46 +16,46 @@
 #include <__utility/priority_tag.h>
 #include <type_traits>
 
-#ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
+#ifndef _LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 // [cmp.alg]
 namespace __compare_weak_order_fallback {
     struct __fn {
         template<class _Tp, class _Up>
             requires is_same_v<decay_t<_Tp>, decay_t<_Up>>
-        _LIBCPP_HIDE_FROM_ABI static constexpr auto
+        _LIBCUDACXX_HIDE_FROM_ABI static constexpr auto
         __go(_Tp&& __t, _Up&& __u, __priority_tag<1>)
-            noexcept(noexcept(_VSTD::weak_order(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u))))
-            -> decltype(      _VSTD::weak_order(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u)))
-            { return          _VSTD::weak_order(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u)); }
+            noexcept(noexcept(_CUDA_VSTD::weak_order(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u))))
+            -> decltype(      _CUDA_VSTD::weak_order(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u)))
+            { return          _CUDA_VSTD::weak_order(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u)); }
 
         template<class _Tp, class _Up>
             requires is_same_v<decay_t<_Tp>, decay_t<_Up>>
-        _LIBCPP_HIDE_FROM_ABI static constexpr auto
+        _LIBCUDACXX_HIDE_FROM_ABI static constexpr auto
         __go(_Tp&& __t, _Up&& __u, __priority_tag<0>)
-            noexcept(noexcept(_VSTD::forward<_Tp>(__t) == _VSTD::forward<_Up>(__u) ? weak_ordering::equivalent :
-                              _VSTD::forward<_Tp>(__t) < _VSTD::forward<_Up>(__u) ? weak_ordering::less :
+            noexcept(noexcept(_CUDA_VSTD::forward<_Tp>(__t) == _CUDA_VSTD::forward<_Up>(__u) ? weak_ordering::equivalent :
+                              _CUDA_VSTD::forward<_Tp>(__t) < _CUDA_VSTD::forward<_Up>(__u) ? weak_ordering::less :
                               weak_ordering::greater))
-            -> decltype(      _VSTD::forward<_Tp>(__t) == _VSTD::forward<_Up>(__u) ? weak_ordering::equivalent :
-                              _VSTD::forward<_Tp>(__t) < _VSTD::forward<_Up>(__u) ? weak_ordering::less :
+            -> decltype(      _CUDA_VSTD::forward<_Tp>(__t) == _CUDA_VSTD::forward<_Up>(__u) ? weak_ordering::equivalent :
+                              _CUDA_VSTD::forward<_Tp>(__t) < _CUDA_VSTD::forward<_Up>(__u) ? weak_ordering::less :
                               weak_ordering::greater)
         {
-            return            _VSTD::forward<_Tp>(__t) == _VSTD::forward<_Up>(__u) ? weak_ordering::equivalent :
-                              _VSTD::forward<_Tp>(__t) < _VSTD::forward<_Up>(__u) ? weak_ordering::less :
+            return            _CUDA_VSTD::forward<_Tp>(__t) == _CUDA_VSTD::forward<_Up>(__u) ? weak_ordering::equivalent :
+                              _CUDA_VSTD::forward<_Tp>(__t) < _CUDA_VSTD::forward<_Up>(__u) ? weak_ordering::less :
                               weak_ordering::greater;
         }
 
         template<class _Tp, class _Up>
-        _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t, _Up&& __u) const
-            noexcept(noexcept(__go(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u), __priority_tag<1>())))
-            -> decltype(      __go(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u), __priority_tag<1>()))
-            { return          __go(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u), __priority_tag<1>()); }
+        _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t, _Up&& __u) const
+            noexcept(noexcept(__go(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u), __priority_tag<1>())))
+            -> decltype(      __go(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u), __priority_tag<1>()))
+            { return          __go(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u), __priority_tag<1>()); }
     };
 } // namespace __compare_weak_order_fallback
 
@@ -63,8 +63,8 @@ inline namespace __cpo {
     inline constexpr auto compare_weak_order_fallback = __compare_weak_order_fallback::__fn{};
 } // namespace __cpo
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___COMPARE_COMPARE_WEAK_ORDER_FALLBACK
+#endif // _LIBCUDACXX___COMPARE_COMPARE_WEAK_ORDER_FALLBACK

diff  --git a/libcxx/include/__compare/is_eq.h b/libcxx/include/__compare/is_eq.h
index 49648924e81f..5d0f9262962c 100644
--- a/libcxx/include/__compare/is_eq.h
+++ b/libcxx/include/__compare/is_eq.h
@@ -6,29 +6,29 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___COMPARE_IS_EQ_H
-#define _LIBCPP___COMPARE_IS_EQ_H
+#ifndef _LIBCUDACXX___COMPARE_IS_EQ_H
+#define _LIBCUDACXX___COMPARE_IS_EQ_H
 
 #include <__compare/ordering.h>
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr bool is_eq(partial_ordering __c) noexcept { return __c == 0; }
-_LIBCPP_HIDE_FROM_ABI inline constexpr bool is_neq(partial_ordering __c) noexcept { return __c != 0; }
-_LIBCPP_HIDE_FROM_ABI inline constexpr bool is_lt(partial_ordering __c) noexcept { return __c < 0; }
-_LIBCPP_HIDE_FROM_ABI inline constexpr bool is_lteq(partial_ordering __c) noexcept { return __c <= 0; }
-_LIBCPP_HIDE_FROM_ABI inline constexpr bool is_gt(partial_ordering __c) noexcept { return __c > 0; }
-_LIBCPP_HIDE_FROM_ABI inline constexpr bool is_gteq(partial_ordering __c) noexcept { return __c >= 0; }
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr bool is_eq(partial_ordering __c) noexcept { return __c == 0; }
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr bool is_neq(partial_ordering __c) noexcept { return __c != 0; }
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr bool is_lt(partial_ordering __c) noexcept { return __c < 0; }
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr bool is_lteq(partial_ordering __c) noexcept { return __c <= 0; }
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr bool is_gt(partial_ordering __c) noexcept { return __c > 0; }
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr bool is_gteq(partial_ordering __c) noexcept { return __c >= 0; }
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___COMPARE_IS_EQ_H
+#endif // _LIBCUDACXX___COMPARE_IS_EQ_H

diff  --git a/libcxx/include/__compare/ordering.h b/libcxx/include/__compare/ordering.h
index 1d466d669eec..5f4c59ca6028 100644
--- a/libcxx/include/__compare/ordering.h
+++ b/libcxx/include/__compare/ordering.h
@@ -6,28 +6,28 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___COMPARE_ORDERING_H
-#define _LIBCPP___COMPARE_ORDERING_H
+#ifndef _LIBCUDACXX___COMPARE_ORDERING_H
+#define _LIBCUDACXX___COMPARE_ORDERING_H
 
 #include <__config>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 // exposition only
-enum class _LIBCPP_ENUM_VIS _OrdResult : signed char {
+enum class _LIBCUDACXX_ENUM_VIS _OrdResult : signed char {
   __less = -1,
   __equiv = 0,
   __greater = 1
 };
 
-enum class _LIBCPP_ENUM_VIS _NCmpResult : signed char {
+enum class _LIBCUDACXX_ENUM_VIS _NCmpResult : signed char {
   __unordered = -127
 };
 
@@ -39,7 +39,7 @@ template<class _Tp, class... _Args>
 inline constexpr bool __one_of_v = (is_same_v<_Tp, _Args> || ...);
 
 struct _CmpUnspecifiedParam {
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEVAL
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEVAL
   _CmpUnspecifiedParam(int _CmpUnspecifiedParam::*) noexcept {}
 
   template<class _Tp, class = enable_if_t<!__one_of_v<_Tp, int, partial_ordering, weak_ordering, strong_ordering>>>
@@ -49,15 +49,15 @@ struct _CmpUnspecifiedParam {
 class partial_ordering {
   using _ValueT = signed char;
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   explicit constexpr partial_ordering(_OrdResult __v) noexcept
       : __value_(_ValueT(__v)) {}
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   explicit constexpr partial_ordering(_NCmpResult __v) noexcept
       : __value_(_ValueT(__v)) {}
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr bool __is_ordered() const noexcept {
     return __value_ != _ValueT(_NCmpResult::__unordered);
   }
@@ -69,60 +69,60 @@ class partial_ordering {
   static const partial_ordering unordered;
 
   // comparisons
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr bool operator==(partial_ordering, partial_ordering) noexcept = default;
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr bool operator==(partial_ordering __v, _CmpUnspecifiedParam) noexcept {
     return __v.__is_ordered() && __v.__value_ == 0;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr bool operator< (partial_ordering __v, _CmpUnspecifiedParam) noexcept {
     return __v.__is_ordered() && __v.__value_ < 0;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr bool operator<=(partial_ordering __v, _CmpUnspecifiedParam) noexcept  {
     return __v.__is_ordered() && __v.__value_ <= 0;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr bool operator> (partial_ordering __v, _CmpUnspecifiedParam) noexcept  {
     return __v.__is_ordered() && __v.__value_ > 0;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr bool operator>=(partial_ordering __v, _CmpUnspecifiedParam) noexcept  {
     return __v.__is_ordered() && __v.__value_ >= 0;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr bool operator< (_CmpUnspecifiedParam, partial_ordering __v) noexcept  {
     return __v.__is_ordered() && 0 < __v.__value_;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr bool operator<=(_CmpUnspecifiedParam, partial_ordering __v) noexcept  {
     return __v.__is_ordered() && 0 <= __v.__value_;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr bool operator> (_CmpUnspecifiedParam, partial_ordering __v) noexcept  {
     return __v.__is_ordered() && 0 > __v.__value_;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr bool operator>=(_CmpUnspecifiedParam, partial_ordering __v) noexcept  {
     return __v.__is_ordered() && 0 >= __v.__value_;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr partial_ordering operator<=>(partial_ordering __v, _CmpUnspecifiedParam) noexcept  {
     return __v;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr partial_ordering operator<=>(_CmpUnspecifiedParam, partial_ordering __v) noexcept  {
     return __v < 0 ? partial_ordering::greater : (__v > 0 ? partial_ordering::less : __v);
   }
@@ -138,7 +138,7 @@ inline constexpr partial_ordering partial_ordering::unordered(_NCmpResult ::__un
 class weak_ordering {
   using _ValueT = signed char;
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   explicit constexpr weak_ordering(_OrdResult __v) noexcept : __value_(_ValueT(__v)) {}
 
 public:
@@ -146,67 +146,67 @@ class weak_ordering {
   static const weak_ordering equivalent;
   static const weak_ordering greater;
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr operator partial_ordering() const noexcept {
     return __value_ == 0 ? partial_ordering::equivalent
         : (__value_ < 0 ? partial_ordering::less : partial_ordering::greater);
   }
 
   // comparisons
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr bool operator==(weak_ordering, weak_ordering) noexcept = default;
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr bool operator==(weak_ordering __v, _CmpUnspecifiedParam) noexcept {
     return __v.__value_ == 0;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr bool operator< (weak_ordering __v, _CmpUnspecifiedParam) noexcept {
     return __v.__value_ < 0;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr bool operator<=(weak_ordering __v, _CmpUnspecifiedParam) noexcept {
     return __v.__value_ <= 0;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr bool operator> (weak_ordering __v, _CmpUnspecifiedParam) noexcept {
     return __v.__value_ > 0;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr bool operator>=(weak_ordering __v, _CmpUnspecifiedParam) noexcept {
     return __v.__value_ >= 0;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr bool operator< (_CmpUnspecifiedParam, weak_ordering __v) noexcept {
     return 0 < __v.__value_;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr bool operator<=(_CmpUnspecifiedParam, weak_ordering __v) noexcept {
     return 0 <= __v.__value_;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr bool operator> (_CmpUnspecifiedParam, weak_ordering __v) noexcept {
     return 0 > __v.__value_;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr bool operator>=(_CmpUnspecifiedParam, weak_ordering __v) noexcept {
     return 0 >= __v.__value_;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr weak_ordering operator<=>(weak_ordering __v, _CmpUnspecifiedParam) noexcept {
     return __v;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr weak_ordering operator<=>(_CmpUnspecifiedParam, weak_ordering __v) noexcept {
     return __v < 0 ? weak_ordering::greater : (__v > 0 ? weak_ordering::less : __v);
   }
@@ -222,7 +222,7 @@ inline constexpr weak_ordering weak_ordering::greater(_OrdResult::__greater);
 class strong_ordering {
   using _ValueT = signed char;
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   explicit constexpr strong_ordering(_OrdResult __v) noexcept : __value_(_ValueT(__v)) {}
 
 public:
@@ -232,73 +232,73 @@ class strong_ordering {
   static const strong_ordering greater;
 
   // conversions
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr operator partial_ordering() const noexcept {
     return __value_ == 0 ? partial_ordering::equivalent
         : (__value_ < 0 ? partial_ordering::less : partial_ordering::greater);
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr operator weak_ordering() const noexcept {
     return __value_ == 0 ? weak_ordering::equivalent
         : (__value_ < 0 ? weak_ordering::less : weak_ordering::greater);
   }
 
   // comparisons
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr bool operator==(strong_ordering, strong_ordering) noexcept = default;
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr bool operator==(strong_ordering __v, _CmpUnspecifiedParam) noexcept {
     return __v.__value_ == 0;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr bool operator< (strong_ordering __v, _CmpUnspecifiedParam) noexcept {
     return __v.__value_ < 0;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr bool operator<=(strong_ordering __v, _CmpUnspecifiedParam) noexcept {
     return __v.__value_ <= 0;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr bool operator> (strong_ordering __v, _CmpUnspecifiedParam) noexcept {
     return __v.__value_ > 0;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr bool operator>=(strong_ordering __v, _CmpUnspecifiedParam) noexcept {
     return __v.__value_ >= 0;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr bool operator< (_CmpUnspecifiedParam, strong_ordering __v) noexcept {
     return 0 < __v.__value_;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr bool operator<=(_CmpUnspecifiedParam, strong_ordering __v) noexcept {
     return 0 <= __v.__value_;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr bool operator> (_CmpUnspecifiedParam, strong_ordering __v) noexcept {
     return 0 > __v.__value_;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr bool operator>=(_CmpUnspecifiedParam, strong_ordering __v) noexcept {
     return 0 >= __v.__value_;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr strong_ordering operator<=>(strong_ordering __v, _CmpUnspecifiedParam) noexcept {
     return __v;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr strong_ordering operator<=>(_CmpUnspecifiedParam, strong_ordering __v) noexcept {
     return __v < 0 ? strong_ordering::greater : (__v > 0 ? strong_ordering::less : __v);
   }
@@ -312,8 +312,8 @@ inline constexpr strong_ordering strong_ordering::equal(_OrdResult::__equiv);
 inline constexpr strong_ordering strong_ordering::equivalent(_OrdResult::__equiv);
 inline constexpr strong_ordering strong_ordering::greater(_OrdResult::__greater);
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___COMPARE_ORDERING_H
+#endif // _LIBCUDACXX___COMPARE_ORDERING_H

diff  --git a/libcxx/include/__compare/partial_order.h b/libcxx/include/__compare/partial_order.h
index 970f01b3f1b0..c860e5584bc7 100644
--- a/libcxx/include/__compare/partial_order.h
+++ b/libcxx/include/__compare/partial_order.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___COMPARE_PARTIAL_ORDER
-#define _LIBCPP___COMPARE_PARTIAL_ORDER
+#ifndef _LIBCUDACXX___COMPARE_PARTIAL_ORDER
+#define _LIBCUDACXX___COMPARE_PARTIAL_ORDER
 
 #include <__compare/compare_three_way.h>
 #include <__compare/ordering.h>
@@ -17,46 +17,46 @@
 #include <__utility/priority_tag.h>
 #include <type_traits>
 
-#ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
+#ifndef _LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 // [cmp.alg]
 namespace __partial_order {
     struct __fn {
         template<class _Tp, class _Up>
             requires is_same_v<decay_t<_Tp>, decay_t<_Up>>
-        _LIBCPP_HIDE_FROM_ABI static constexpr auto
+        _LIBCUDACXX_HIDE_FROM_ABI static constexpr auto
         __go(_Tp&& __t, _Up&& __u, __priority_tag<2>)
-            noexcept(noexcept(partial_ordering(partial_order(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u)))))
-            -> decltype(      partial_ordering(partial_order(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u))))
-            { return          partial_ordering(partial_order(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u))); }
+            noexcept(noexcept(partial_ordering(partial_order(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u)))))
+            -> decltype(      partial_ordering(partial_order(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u))))
+            { return          partial_ordering(partial_order(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u))); }
 
         template<class _Tp, class _Up>
             requires is_same_v<decay_t<_Tp>, decay_t<_Up>>
-        _LIBCPP_HIDE_FROM_ABI static constexpr auto
+        _LIBCUDACXX_HIDE_FROM_ABI static constexpr auto
         __go(_Tp&& __t, _Up&& __u, __priority_tag<1>)
-            noexcept(noexcept(partial_ordering(compare_three_way()(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u)))))
-            -> decltype(      partial_ordering(compare_three_way()(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u))))
-            { return          partial_ordering(compare_three_way()(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u))); }
+            noexcept(noexcept(partial_ordering(compare_three_way()(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u)))))
+            -> decltype(      partial_ordering(compare_three_way()(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u))))
+            { return          partial_ordering(compare_three_way()(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u))); }
 
         template<class _Tp, class _Up>
             requires is_same_v<decay_t<_Tp>, decay_t<_Up>>
-        _LIBCPP_HIDE_FROM_ABI static constexpr auto
+        _LIBCUDACXX_HIDE_FROM_ABI static constexpr auto
         __go(_Tp&& __t, _Up&& __u, __priority_tag<0>)
-            noexcept(noexcept(partial_ordering(_VSTD::weak_order(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u)))))
-            -> decltype(      partial_ordering(_VSTD::weak_order(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u))))
-            { return          partial_ordering(_VSTD::weak_order(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u))); }
+            noexcept(noexcept(partial_ordering(_CUDA_VSTD::weak_order(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u)))))
+            -> decltype(      partial_ordering(_CUDA_VSTD::weak_order(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u))))
+            { return          partial_ordering(_CUDA_VSTD::weak_order(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u))); }
 
         template<class _Tp, class _Up>
-        _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t, _Up&& __u) const
-            noexcept(noexcept(__go(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u), __priority_tag<2>())))
-            -> decltype(      __go(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u), __priority_tag<2>()))
-            { return          __go(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u), __priority_tag<2>()); }
+        _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t, _Up&& __u) const
+            noexcept(noexcept(__go(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u), __priority_tag<2>())))
+            -> decltype(      __go(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u), __priority_tag<2>()))
+            { return          __go(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u), __priority_tag<2>()); }
     };
 } // namespace __partial_order
 
@@ -64,8 +64,8 @@ inline namespace __cpo {
     inline constexpr auto partial_order = __partial_order::__fn{};
 } // namespace __cpo
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___COMPARE_PARTIAL_ORDER
+#endif // _LIBCUDACXX___COMPARE_PARTIAL_ORDER

diff  --git a/libcxx/include/__compare/strong_order.h b/libcxx/include/__compare/strong_order.h
index 67c7b2910bd5..e73a6056ae4f 100644
--- a/libcxx/include/__compare/strong_order.h
+++ b/libcxx/include/__compare/strong_order.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___COMPARE_STRONG_ORDER
-#define _LIBCPP___COMPARE_STRONG_ORDER
+#ifndef _LIBCUDACXX___COMPARE_STRONG_ORDER
+#define _LIBCUDACXX___COMPARE_STRONG_ORDER
 
 #include <__bit/bit_cast.h>
 #include <__compare/compare_three_way.h>
@@ -20,42 +20,42 @@
 #include <limits>
 #include <type_traits>
 
-#ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
+#ifndef _LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 // [cmp.alg]
 namespace __strong_order {
     struct __fn {
         template<class _Tp, class _Up>
             requires is_same_v<decay_t<_Tp>, decay_t<_Up>>
-        _LIBCPP_HIDE_FROM_ABI static constexpr auto
+        _LIBCUDACXX_HIDE_FROM_ABI static constexpr auto
         __go(_Tp&& __t, _Up&& __u, __priority_tag<2>)
-            noexcept(noexcept(strong_ordering(strong_order(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u)))))
-            -> decltype(      strong_ordering(strong_order(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u))))
-            { return          strong_ordering(strong_order(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u))); }
+            noexcept(noexcept(strong_ordering(strong_order(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u)))))
+            -> decltype(      strong_ordering(strong_order(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u))))
+            { return          strong_ordering(strong_order(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u))); }
 
         template<class _Tp, class _Up, class _Dp = decay_t<_Tp>>
             requires is_same_v<_Dp, decay_t<_Up>> && is_floating_point_v<_Dp>
-        _LIBCPP_HIDE_FROM_ABI static constexpr strong_ordering
+        _LIBCUDACXX_HIDE_FROM_ABI static constexpr strong_ordering
         __go(_Tp&& __t, _Up&& __u, __priority_tag<1>) noexcept
         {
             if constexpr (numeric_limits<_Dp>::is_iec559 && sizeof(_Dp) == sizeof(int32_t)) {
-                int32_t __rx = _VSTD::bit_cast<int32_t>(__t);
-                int32_t __ry = _VSTD::bit_cast<int32_t>(__u);
+                int32_t __rx = _CUDA_VSTD::bit_cast<int32_t>(__t);
+                int32_t __ry = _CUDA_VSTD::bit_cast<int32_t>(__u);
                 __rx = (__rx < 0) ? (numeric_limits<int32_t>::min() - __rx - 1) : __rx;
                 __ry = (__ry < 0) ? (numeric_limits<int32_t>::min() - __ry - 1) : __ry;
                 return (__rx <=> __ry);
             } else if constexpr (numeric_limits<_Dp>::is_iec559 && sizeof(_Dp) == sizeof(int64_t)) {
-                int64_t __rx = _VSTD::bit_cast<int64_t>(__t);
-                int64_t __ry = _VSTD::bit_cast<int64_t>(__u);
+                int64_t __rx = _CUDA_VSTD::bit_cast<int64_t>(__t);
+                int64_t __ry = _CUDA_VSTD::bit_cast<int64_t>(__u);
                 __rx = (__rx < 0) ? (numeric_limits<int64_t>::min() - __rx - 1) : __rx;
                 __ry = (__ry < 0) ? (numeric_limits<int64_t>::min() - __ry - 1) : __ry;
                 return (__rx <=> __ry);
@@ -65,27 +65,27 @@ namespace __strong_order {
                 return strong_ordering::greater;
             } else if (__t == __u) {
                 if constexpr (numeric_limits<_Dp>::radix == 2) {
-                    return _VSTD::signbit(__u) <=> _VSTD::signbit(__t);
+                    return _CUDA_VSTD::signbit(__u) <=> _CUDA_VSTD::signbit(__t);
                 } else {
                     // This is bullet 3 of the IEEE754 algorithm, relevant
                     // only for decimal floating-point;
                     // see https://stackoverflow.com/questions/69068075/
-                    if (__t == 0 || _VSTD::isinf(__t)) {
-                        return _VSTD::signbit(__u) <=> _VSTD::signbit(__t);
+                    if (__t == 0 || _CUDA_VSTD::isinf(__t)) {
+                        return _CUDA_VSTD::signbit(__u) <=> _CUDA_VSTD::signbit(__t);
                     } else {
                         int __texp, __uexp;
-                        (void)_VSTD::frexp(__t, &__texp);
-                        (void)_VSTD::frexp(__u, &__uexp);
+                        (void)_CUDA_VSTD::frexp(__t, &__texp);
+                        (void)_CUDA_VSTD::frexp(__u, &__uexp);
                         return (__t < 0) ? (__texp <=> __uexp) : (__uexp <=> __texp);
                     }
                 }
             } else {
                 // They're unordered, so one of them must be a NAN.
                 // The order is -QNAN, -SNAN, numbers, +SNAN, +QNAN.
-                bool __t_is_nan = _VSTD::isnan(__t);
-                bool __u_is_nan = _VSTD::isnan(__u);
-                bool __t_is_negative = _VSTD::signbit(__t);
-                bool __u_is_negative = _VSTD::signbit(__u);
+                bool __t_is_nan = _CUDA_VSTD::isnan(__t);
+                bool __u_is_nan = _CUDA_VSTD::isnan(__u);
+                bool __t_is_negative = _CUDA_VSTD::signbit(__t);
+                bool __u_is_negative = _CUDA_VSTD::signbit(__u);
                 using _IntType = conditional_t<
                     sizeof(__t) == sizeof(int32_t), int32_t, conditional_t<
                     sizeof(__t) == sizeof(int64_t), int64_t, void>
@@ -97,7 +97,7 @@ namespace __strong_order {
                     if (__t_is_negative != __u_is_negative) {
                         return (__u_is_negative <=> __t_is_negative);
                     } else {
-                        return _VSTD::bit_cast<_IntType>(__t) <=> _VSTD::bit_cast<_IntType>(__u);
+                        return _CUDA_VSTD::bit_cast<_IntType>(__t) <=> _CUDA_VSTD::bit_cast<_IntType>(__u);
                     }
                 } else if (__t_is_nan) {
                     return __t_is_negative ? strong_ordering::less : strong_ordering::greater;
@@ -109,17 +109,17 @@ namespace __strong_order {
 
         template<class _Tp, class _Up>
             requires is_same_v<decay_t<_Tp>, decay_t<_Up>>
-        _LIBCPP_HIDE_FROM_ABI static constexpr auto
+        _LIBCUDACXX_HIDE_FROM_ABI static constexpr auto
         __go(_Tp&& __t, _Up&& __u, __priority_tag<0>)
-            noexcept(noexcept(strong_ordering(compare_three_way()(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u)))))
-            -> decltype(      strong_ordering(compare_three_way()(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u))))
-            { return          strong_ordering(compare_three_way()(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u))); }
+            noexcept(noexcept(strong_ordering(compare_three_way()(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u)))))
+            -> decltype(      strong_ordering(compare_three_way()(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u))))
+            { return          strong_ordering(compare_three_way()(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u))); }
 
         template<class _Tp, class _Up>
-        _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t, _Up&& __u) const
-            noexcept(noexcept(__go(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u), __priority_tag<2>())))
-            -> decltype(      __go(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u), __priority_tag<2>()))
-            { return          __go(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u), __priority_tag<2>()); }
+        _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t, _Up&& __u) const
+            noexcept(noexcept(__go(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u), __priority_tag<2>())))
+            -> decltype(      __go(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u), __priority_tag<2>()))
+            { return          __go(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u), __priority_tag<2>()); }
     };
 } // namespace __strong_order
 
@@ -127,10 +127,10 @@ inline namespace __cpo {
     inline constexpr auto strong_order = __strong_order::__fn{};
 } // namespace __cpo
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___COMPARE_STRONG_ORDER
+#endif // _LIBCUDACXX___COMPARE_STRONG_ORDER

diff  --git a/libcxx/include/__compare/synth_three_way.h b/libcxx/include/__compare/synth_three_way.h
index fa8cbda79ba2..43eb2a2b95b8 100644
--- a/libcxx/include/__compare/synth_three_way.h
+++ b/libcxx/include/__compare/synth_three_way.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___COMPARE_SYNTH_THREE_WAY_H
-#define _LIBCPP___COMPARE_SYNTH_THREE_WAY_H
+#ifndef _LIBCUDACXX___COMPARE_SYNTH_THREE_WAY_H
+#define _LIBCUDACXX___COMPARE_SYNTH_THREE_WAY_H
 
 #include <__compare/ordering.h>
 #include <__compare/three_way_comparable.h>
@@ -15,17 +15,17 @@
 #include <__config>
 #include <__utility/declval.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 // [expos.only.func]
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr auto __synth_three_way =
+_LIBCUDACXX_HIDE_FROM_ABI inline constexpr auto __synth_three_way =
   []<class _Tp, class _Up>(const _Tp& __t, const _Up& __u)
     requires requires {
       { __t < __u } -> __boolean_testable;
@@ -44,8 +44,8 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr auto __synth_three_way =
 template <class _Tp, class _Up = _Tp>
 using __synth_three_way_result = decltype(std::__synth_three_way(declval<_Tp&>(), declval<_Up&>()));
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___COMPARE_SYNTH_THREE_WAY_H
+#endif // _LIBCUDACXX___COMPARE_SYNTH_THREE_WAY_H

diff  --git a/libcxx/include/__compare/three_way_comparable.h b/libcxx/include/__compare/three_way_comparable.h
index b317d750590e..f3a825ca5a19 100644
--- a/libcxx/include/__compare/three_way_comparable.h
+++ b/libcxx/include/__compare/three_way_comparable.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___COMPARE_THREE_WAY_COMPARABLE_H
-#define _LIBCPP___COMPARE_THREE_WAY_COMPARABLE_H
+#ifndef _LIBCUDACXX___COMPARE_THREE_WAY_COMPARABLE_H
+#define _LIBCUDACXX___COMPARE_THREE_WAY_COMPARABLE_H
 
 #include <__compare/common_comparison_category.h>
 #include <__compare/ordering.h>
@@ -18,13 +18,13 @@
 #include <__config>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 template<class _Tp, class _Cat>
 concept __compares_as =
@@ -51,8 +51,8 @@ concept three_way_comparable_with =
     { __u <=> __t } -> __compares_as<_Cat>;
   };
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___COMPARE_THREE_WAY_COMPARABLE_H
+#endif // _LIBCUDACXX___COMPARE_THREE_WAY_COMPARABLE_H

diff  --git a/libcxx/include/__compare/weak_order.h b/libcxx/include/__compare/weak_order.h
index c2fae1a98deb..59c7363ca652 100644
--- a/libcxx/include/__compare/weak_order.h
+++ b/libcxx/include/__compare/weak_order.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___COMPARE_WEAK_ORDER
-#define _LIBCPP___COMPARE_WEAK_ORDER
+#ifndef _LIBCUDACXX___COMPARE_WEAK_ORDER
+#define _LIBCUDACXX___COMPARE_WEAK_ORDER
 
 #include <__compare/compare_three_way.h>
 #include <__compare/ordering.h>
@@ -18,28 +18,28 @@
 #include <cmath>
 #include <type_traits>
 
-#ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
+#ifndef _LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 // [cmp.alg]
 namespace __weak_order {
     struct __fn {
         template<class _Tp, class _Up>
             requires is_same_v<decay_t<_Tp>, decay_t<_Up>>
-        _LIBCPP_HIDE_FROM_ABI static constexpr auto
+        _LIBCUDACXX_HIDE_FROM_ABI static constexpr auto
         __go(_Tp&& __t, _Up&& __u, __priority_tag<3>)
-            noexcept(noexcept(weak_ordering(weak_order(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u)))))
-            -> decltype(      weak_ordering(weak_order(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u))))
-            { return          weak_ordering(weak_order(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u))); }
+            noexcept(noexcept(weak_ordering(weak_order(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u)))))
+            -> decltype(      weak_ordering(weak_order(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u))))
+            { return          weak_ordering(weak_order(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u))); }
 
         template<class _Tp, class _Up, class _Dp = decay_t<_Tp>>
             requires is_same_v<_Dp, decay_t<_Up>> && is_floating_point_v<_Dp>
-        _LIBCPP_HIDE_FROM_ABI static constexpr weak_ordering
+        _LIBCUDACXX_HIDE_FROM_ABI static constexpr weak_ordering
         __go(_Tp&& __t, _Up&& __u, __priority_tag<2>) noexcept
         {
             partial_ordering __po = (__t <=> __u);
@@ -51,10 +51,10 @@ namespace __weak_order {
                 return weak_ordering::greater;
             } else {
                 // Otherwise, at least one of them is a NaN.
-                bool __t_is_nan = _VSTD::isnan(__t);
-                bool __u_is_nan = _VSTD::isnan(__u);
-                bool __t_is_negative = _VSTD::signbit(__t);
-                bool __u_is_negative = _VSTD::signbit(__u);
+                bool __t_is_nan = _CUDA_VSTD::isnan(__t);
+                bool __u_is_nan = _CUDA_VSTD::isnan(__u);
+                bool __t_is_negative = _CUDA_VSTD::signbit(__t);
+                bool __u_is_negative = _CUDA_VSTD::signbit(__u);
                 if (__t_is_nan && __u_is_nan) {
                     return (__u_is_negative <=> __t_is_negative);
                 } else if (__t_is_nan) {
@@ -67,25 +67,25 @@ namespace __weak_order {
 
         template<class _Tp, class _Up>
             requires is_same_v<decay_t<_Tp>, decay_t<_Up>>
-        _LIBCPP_HIDE_FROM_ABI static constexpr auto
+        _LIBCUDACXX_HIDE_FROM_ABI static constexpr auto
         __go(_Tp&& __t, _Up&& __u, __priority_tag<1>)
-            noexcept(noexcept(weak_ordering(compare_three_way()(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u)))))
-            -> decltype(      weak_ordering(compare_three_way()(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u))))
-            { return          weak_ordering(compare_three_way()(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u))); }
+            noexcept(noexcept(weak_ordering(compare_three_way()(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u)))))
+            -> decltype(      weak_ordering(compare_three_way()(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u))))
+            { return          weak_ordering(compare_three_way()(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u))); }
 
         template<class _Tp, class _Up>
             requires is_same_v<decay_t<_Tp>, decay_t<_Up>>
-        _LIBCPP_HIDE_FROM_ABI static constexpr auto
+        _LIBCUDACXX_HIDE_FROM_ABI static constexpr auto
         __go(_Tp&& __t, _Up&& __u, __priority_tag<0>)
-            noexcept(noexcept(weak_ordering(_VSTD::strong_order(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u)))))
-            -> decltype(      weak_ordering(_VSTD::strong_order(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u))))
-            { return          weak_ordering(_VSTD::strong_order(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u))); }
+            noexcept(noexcept(weak_ordering(_CUDA_VSTD::strong_order(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u)))))
+            -> decltype(      weak_ordering(_CUDA_VSTD::strong_order(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u))))
+            { return          weak_ordering(_CUDA_VSTD::strong_order(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u))); }
 
         template<class _Tp, class _Up>
-        _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t, _Up&& __u) const
-            noexcept(noexcept(__go(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u), __priority_tag<3>())))
-            -> decltype(      __go(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u), __priority_tag<3>()))
-            { return          __go(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u), __priority_tag<3>()); }
+        _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t, _Up&& __u) const
+            noexcept(noexcept(__go(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u), __priority_tag<3>())))
+            -> decltype(      __go(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u), __priority_tag<3>()))
+            { return          __go(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u), __priority_tag<3>()); }
     };
 } // namespace __weak_order
 
@@ -93,8 +93,8 @@ inline namespace __cpo {
     inline constexpr auto weak_order = __weak_order::__fn{};
 } // namespace __cpo
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___COMPARE_WEAK_ORDER
+#endif // _LIBCUDACXX___COMPARE_WEAK_ORDER

diff  --git a/libcxx/include/__concepts/arithmetic.h b/libcxx/include/__concepts/arithmetic.h
index d91570f02b8b..f4adc0949aff 100644
--- a/libcxx/include/__concepts/arithmetic.h
+++ b/libcxx/include/__concepts/arithmetic.h
@@ -6,21 +6,21 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___CONCEPTS_ARITHMETIC_H
-#define _LIBCPP___CONCEPTS_ARITHMETIC_H
+#ifndef _LIBCUDACXX___CONCEPTS_ARITHMETIC_H
+#define _LIBCUDACXX___CONCEPTS_ARITHMETIC_H
 
 #include <__config>
 #include <__type_traits/is_signed_integer.h>
 #include <__type_traits/is_unsigned_integer.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 // [concepts.arithmetic], arithmetic concepts
 
@@ -39,12 +39,12 @@ concept floating_point = is_floating_point_v<_Tp>;
 // Concept helpers for the internal type traits for the fundamental types.
 
 template <class _Tp>
-concept __libcpp_unsigned_integer = __libcpp_is_unsigned_integer<_Tp>::value;
+concept __LIBCUDACXX_unsigned_integer = __LIBCUDACXX_is_unsigned_integer<_Tp>::value;
 template <class _Tp>
-concept __libcpp_signed_integer = __libcpp_is_signed_integer<_Tp>::value;
+concept __LIBCUDACXX_signed_integer = __LIBCUDACXX_is_signed_integer<_Tp>::value;
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___CONCEPTS_ARITHMETIC_H
+#endif // _LIBCUDACXX___CONCEPTS_ARITHMETIC_H

diff  --git a/libcxx/include/__concepts/assignable.h b/libcxx/include/__concepts/assignable.h
index 7f187a39f8f8..8c691767a001 100644
--- a/libcxx/include/__concepts/assignable.h
+++ b/libcxx/include/__concepts/assignable.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___CONCEPTS_ASSIGNABLE_H
-#define _LIBCPP___CONCEPTS_ASSIGNABLE_H
+#ifndef _LIBCUDACXX___CONCEPTS_ASSIGNABLE_H
+#define _LIBCUDACXX___CONCEPTS_ASSIGNABLE_H
 
 #include <__concepts/common_reference_with.h>
 #include <__concepts/same_as.h>
@@ -15,13 +15,13 @@
 #include <__utility/forward.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 // [concept.assignable]
 
@@ -30,11 +30,11 @@ concept assignable_from =
   is_lvalue_reference_v<_Lhs> &&
   common_reference_with<__make_const_lvalue_ref<_Lhs>, __make_const_lvalue_ref<_Rhs>> &&
   requires (_Lhs __lhs, _Rhs&& __rhs) {
-    { __lhs = _VSTD::forward<_Rhs>(__rhs) } -> same_as<_Lhs>;
+    { __lhs = _CUDA_VSTD::forward<_Rhs>(__rhs) } -> same_as<_Lhs>;
   };
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___CONCEPTS_ASSIGNABLE_H
+#endif // _LIBCUDACXX___CONCEPTS_ASSIGNABLE_H

diff  --git a/libcxx/include/__concepts/boolean_testable.h b/libcxx/include/__concepts/boolean_testable.h
index a96bde711749..8ca1078fc2c3 100644
--- a/libcxx/include/__concepts/boolean_testable.h
+++ b/libcxx/include/__concepts/boolean_testable.h
@@ -6,20 +6,20 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___CONCEPTS_BOOLEAN_TESTABLE_H
-#define _LIBCPP___CONCEPTS_BOOLEAN_TESTABLE_H
+#ifndef _LIBCUDACXX___CONCEPTS_BOOLEAN_TESTABLE_H
+#define _LIBCUDACXX___CONCEPTS_BOOLEAN_TESTABLE_H
 
 #include <__concepts/convertible_to.h>
 #include <__config>
 #include <__utility/forward.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 // [concepts.booleantestable]
 
@@ -28,11 +28,11 @@ concept __boolean_testable_impl = convertible_to<_Tp, bool>;
 
 template<class _Tp>
 concept __boolean_testable = __boolean_testable_impl<_Tp> && requires(_Tp&& __t) {
-  { !_VSTD::forward<_Tp>(__t) } -> __boolean_testable_impl;
+  { !_CUDA_VSTD::forward<_Tp>(__t) } -> __boolean_testable_impl;
 };
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___CONCEPTS_BOOLEAN_TESTABLE_H
+#endif // _LIBCUDACXX___CONCEPTS_BOOLEAN_TESTABLE_H

diff  --git a/libcxx/include/__concepts/class_or_enum.h b/libcxx/include/__concepts/class_or_enum.h
index 9fd62ba89243..a3a237f61850 100644
--- a/libcxx/include/__concepts/class_or_enum.h
+++ b/libcxx/include/__concepts/class_or_enum.h
@@ -6,19 +6,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___CONCEPTS_CLASS_OR_ENUM_H
-#define _LIBCPP___CONCEPTS_CLASS_OR_ENUM_H
+#ifndef _LIBCUDACXX___CONCEPTS_CLASS_OR_ENUM_H
+#define _LIBCUDACXX___CONCEPTS_CLASS_OR_ENUM_H
 
 #include <__config>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 // Whether a type is a class type or enumeration type according to the Core wording.
 
@@ -30,8 +30,8 @@ concept __class_or_enum = is_class_v<_Tp> || is_union_v<_Tp> || is_enum_v<_Tp>;
 template<class _Tp>
 concept __workaround_52970 = is_class_v<__uncvref_t<_Tp>> || is_union_v<__uncvref_t<_Tp>>;
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___CONCEPTS_CLASS_OR_ENUM_H
+#endif // _LIBCUDACXX___CONCEPTS_CLASS_OR_ENUM_H

diff  --git a/libcxx/include/__concepts/common_reference_with.h b/libcxx/include/__concepts/common_reference_with.h
index cae2f5bccce0..cfdb07a6e843 100644
--- a/libcxx/include/__concepts/common_reference_with.h
+++ b/libcxx/include/__concepts/common_reference_with.h
@@ -6,21 +6,21 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___CONCEPTS_COMMON_REFERENCE_WITH_H
-#define _LIBCPP___CONCEPTS_COMMON_REFERENCE_WITH_H
+#ifndef _LIBCUDACXX___CONCEPTS_COMMON_REFERENCE_WITH_H
+#define _LIBCUDACXX___CONCEPTS_COMMON_REFERENCE_WITH_H
 
 #include <__concepts/convertible_to.h>
 #include <__concepts/same_as.h>
 #include <__config>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 // [concept.commonref]
 
@@ -30,8 +30,8 @@ concept common_reference_with =
   convertible_to<_Tp, common_reference_t<_Tp, _Up>> &&
   convertible_to<_Up, common_reference_t<_Tp, _Up>>;
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___CONCEPTS_COMMON_REFERENCE_WITH_H
+#endif // _LIBCUDACXX___CONCEPTS_COMMON_REFERENCE_WITH_H

diff  --git a/libcxx/include/__concepts/common_with.h b/libcxx/include/__concepts/common_with.h
index 1b5f4da4af9a..8ddfbc89ba32 100644
--- a/libcxx/include/__concepts/common_with.h
+++ b/libcxx/include/__concepts/common_with.h
@@ -6,21 +6,21 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___CONCEPTS_COMMON_WITH_H
-#define _LIBCPP___CONCEPTS_COMMON_WITH_H
+#ifndef _LIBCUDACXX___CONCEPTS_COMMON_WITH_H
+#define _LIBCUDACXX___CONCEPTS_COMMON_WITH_H
 
 #include <__concepts/common_reference_with.h>
 #include <__concepts/same_as.h>
 #include <__config>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 // [concept.common]
 
@@ -40,8 +40,8 @@ concept common_with =
       add_lvalue_reference_t<const _Tp>,
       add_lvalue_reference_t<const _Up>>>;
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___CONCEPTS_COMMON_WITH_H
+#endif // _LIBCUDACXX___CONCEPTS_COMMON_WITH_H

diff  --git a/libcxx/include/__concepts/constructible.h b/libcxx/include/__concepts/constructible.h
index aaf515417e4c..1b1a967505ff 100644
--- a/libcxx/include/__concepts/constructible.h
+++ b/libcxx/include/__concepts/constructible.h
@@ -6,21 +6,21 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___CONCEPTS_CONSTRUCTIBLE_H
-#define _LIBCPP___CONCEPTS_CONSTRUCTIBLE_H
+#ifndef _LIBCUDACXX___CONCEPTS_CONSTRUCTIBLE_H
+#define _LIBCUDACXX___CONCEPTS_CONSTRUCTIBLE_H
 
 #include <__concepts/convertible_to.h>
 #include <__concepts/destructible.h>
 #include <__config>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 // [concept.constructible]
 template<class _Tp, class... _Args>
@@ -49,8 +49,8 @@ concept copy_constructible =
   constructible_from<_Tp, const _Tp&> && convertible_to<const _Tp&, _Tp> &&
   constructible_from<_Tp, const _Tp> && convertible_to<const _Tp, _Tp>;
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___CONCEPTS_CONSTRUCTIBLE_H
+#endif // _LIBCUDACXX___CONCEPTS_CONSTRUCTIBLE_H

diff  --git a/libcxx/include/__concepts/convertible_to.h b/libcxx/include/__concepts/convertible_to.h
index 5d9d43710421..65f373613402 100644
--- a/libcxx/include/__concepts/convertible_to.h
+++ b/libcxx/include/__concepts/convertible_to.h
@@ -6,20 +6,20 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___CONCEPTS_CONVERTIBLE_TO_H
-#define _LIBCPP___CONCEPTS_CONVERTIBLE_TO_H
+#ifndef _LIBCUDACXX___CONCEPTS_CONVERTIBLE_TO_H
+#define _LIBCUDACXX___CONCEPTS_CONVERTIBLE_TO_H
 
 #include <__config>
 #include <__utility/declval.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 // [concept.convertible]
 
@@ -30,8 +30,8 @@ concept convertible_to =
     static_cast<_To>(declval<_From>());
   };
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___CONCEPTS_CONVERTIBLE_TO_H
+#endif // _LIBCUDACXX___CONCEPTS_CONVERTIBLE_TO_H

diff  --git a/libcxx/include/__concepts/copyable.h b/libcxx/include/__concepts/copyable.h
index c5d8a80b9dad..cd88c65f4a28 100644
--- a/libcxx/include/__concepts/copyable.h
+++ b/libcxx/include/__concepts/copyable.h
@@ -6,21 +6,21 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___CONCEPTS_COPYABLE_H
-#define _LIBCPP___CONCEPTS_COPYABLE_H
+#ifndef _LIBCUDACXX___CONCEPTS_COPYABLE_H
+#define _LIBCUDACXX___CONCEPTS_COPYABLE_H
 
 #include <__concepts/assignable.h>
 #include <__concepts/constructible.h>
 #include <__concepts/movable.h>
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 // [concepts.object]
 
@@ -32,8 +32,8 @@ concept copyable =
   assignable_from<_Tp&, const _Tp&> &&
   assignable_from<_Tp&, const _Tp>;
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___CONCEPTS_COPYABLE_H
+#endif // _LIBCUDACXX___CONCEPTS_COPYABLE_H

diff  --git a/libcxx/include/__concepts/derived_from.h b/libcxx/include/__concepts/derived_from.h
index 4b2914794735..99d387529530 100644
--- a/libcxx/include/__concepts/derived_from.h
+++ b/libcxx/include/__concepts/derived_from.h
@@ -6,19 +6,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___CONCEPTS_DERIVED_FROM_H
-#define _LIBCPP___CONCEPTS_DERIVED_FROM_H
+#ifndef _LIBCUDACXX___CONCEPTS_DERIVED_FROM_H
+#define _LIBCUDACXX___CONCEPTS_DERIVED_FROM_H
 
 #include <__config>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 // [concept.derived]
 
@@ -27,8 +27,8 @@ concept derived_from =
   is_base_of_v<_Bp, _Dp> &&
   is_convertible_v<const volatile _Dp*, const volatile _Bp*>;
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___CONCEPTS_DERIVED_FROM_H
+#endif // _LIBCUDACXX___CONCEPTS_DERIVED_FROM_H

diff  --git a/libcxx/include/__concepts/destructible.h b/libcxx/include/__concepts/destructible.h
index 90a043d314c2..4ad449b36280 100644
--- a/libcxx/include/__concepts/destructible.h
+++ b/libcxx/include/__concepts/destructible.h
@@ -6,27 +6,27 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___CONCEPTS_DESTRUCTIBLE_H
-#define _LIBCPP___CONCEPTS_DESTRUCTIBLE_H
+#ifndef _LIBCUDACXX___CONCEPTS_DESTRUCTIBLE_H
+#define _LIBCUDACXX___CONCEPTS_DESTRUCTIBLE_H
 
 #include <__config>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 // [concept.destructible]
 
 template<class _Tp>
 concept destructible = is_nothrow_destructible_v<_Tp>;
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___CONCEPTS_DESTRUCTIBLE_H
+#endif // _LIBCUDACXX___CONCEPTS_DESTRUCTIBLE_H

diff  --git a/libcxx/include/__concepts/
diff erent_from.h b/libcxx/include/__concepts/
diff erent_from.h
index 3066372e8683..4308546175e5 100644
--- a/libcxx/include/__concepts/
diff erent_from.h
+++ b/libcxx/include/__concepts/
diff erent_from.h
@@ -6,26 +6,26 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___CONCEPTS_DIFFERENT_FROM_H
-#define _LIBCPP___CONCEPTS_DIFFERENT_FROM_H
+#ifndef _LIBCUDACXX___CONCEPTS_DIFFERENT_FROM_H
+#define _LIBCUDACXX___CONCEPTS_DIFFERENT_FROM_H
 
 #include <__concepts/same_as.h>
 #include <__config>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 template<class _Tp, class _Up>
 concept __
diff erent_from = !same_as<remove_cvref_t<_Tp>, remove_cvref_t<_Up>>;
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___CONCEPTS_DIFFERENT_FROM_H
+#endif // _LIBCUDACXX___CONCEPTS_DIFFERENT_FROM_H

diff  --git a/libcxx/include/__concepts/equality_comparable.h b/libcxx/include/__concepts/equality_comparable.h
index 7c750c5937b5..b57f207d7aae 100644
--- a/libcxx/include/__concepts/equality_comparable.h
+++ b/libcxx/include/__concepts/equality_comparable.h
@@ -6,21 +6,21 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___CONCEPTS_EQUALITY_COMPARABLE_H
-#define _LIBCPP___CONCEPTS_EQUALITY_COMPARABLE_H
+#ifndef _LIBCUDACXX___CONCEPTS_EQUALITY_COMPARABLE_H
+#define _LIBCUDACXX___CONCEPTS_EQUALITY_COMPARABLE_H
 
 #include <__concepts/boolean_testable.h>
 #include <__concepts/common_reference_with.h>
 #include <__config>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 // [concept.equalitycomparable]
 
@@ -46,8 +46,8 @@ concept equality_comparable_with =
       __make_const_lvalue_ref<_Up>>> &&
   __weakly_equality_comparable_with<_Tp, _Up>;
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___CONCEPTS_EQUALITY_COMPARABLE_H
+#endif // _LIBCUDACXX___CONCEPTS_EQUALITY_COMPARABLE_H

diff  --git a/libcxx/include/__concepts/invocable.h b/libcxx/include/__concepts/invocable.h
index d90389e97f3b..51e6b18c6469 100644
--- a/libcxx/include/__concepts/invocable.h
+++ b/libcxx/include/__concepts/invocable.h
@@ -6,27 +6,27 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___CONCEPTS_INVOCABLE_H
-#define _LIBCPP___CONCEPTS_INVOCABLE_H
+#ifndef _LIBCUDACXX___CONCEPTS_INVOCABLE_H
+#define _LIBCUDACXX___CONCEPTS_INVOCABLE_H
 
 #include <__config>
 #include <__functional/invoke.h>
 #include <__utility/forward.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 // [concept.invocable]
 
 template<class _Fn, class... _Args>
 concept invocable = requires(_Fn&& __fn, _Args&&... __args) {
-  _VSTD::invoke(_VSTD::forward<_Fn>(__fn), _VSTD::forward<_Args>(__args)...); // not required to be equality preserving
+  _CUDA_VSTD::invoke(_CUDA_VSTD::forward<_Fn>(__fn), _CUDA_VSTD::forward<_Args>(__args)...); // not required to be equality preserving
 };
 
 // [concept.regular.invocable]
@@ -34,8 +34,8 @@ concept invocable = requires(_Fn&& __fn, _Args&&... __args) {
 template<class _Fn, class... _Args>
 concept regular_invocable = invocable<_Fn, _Args...>;
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___CONCEPTS_INVOCABLE_H
+#endif // _LIBCUDACXX___CONCEPTS_INVOCABLE_H

diff  --git a/libcxx/include/__concepts/movable.h b/libcxx/include/__concepts/movable.h
index 639219ed6b48..61d3041ed474 100644
--- a/libcxx/include/__concepts/movable.h
+++ b/libcxx/include/__concepts/movable.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___CONCEPTS_MOVABLE_H
-#define _LIBCPP___CONCEPTS_MOVABLE_H
+#ifndef _LIBCUDACXX___CONCEPTS_MOVABLE_H
+#define _LIBCUDACXX___CONCEPTS_MOVABLE_H
 
 #include <__concepts/assignable.h>
 #include <__concepts/constructible.h>
@@ -15,13 +15,13 @@
 #include <__config>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 // [concepts.object]
 
@@ -32,8 +32,8 @@ concept movable =
   assignable_from<_Tp&, _Tp> &&
   swappable<_Tp>;
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___CONCEPTS_MOVABLE_H
+#endif // _LIBCUDACXX___CONCEPTS_MOVABLE_H

diff  --git a/libcxx/include/__concepts/predicate.h b/libcxx/include/__concepts/predicate.h
index cb239752309f..7ea7dc8d7886 100644
--- a/libcxx/include/__concepts/predicate.h
+++ b/libcxx/include/__concepts/predicate.h
@@ -6,21 +6,21 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___CONCEPTS_PREDICATE_H
-#define _LIBCPP___CONCEPTS_PREDICATE_H
+#ifndef _LIBCUDACXX___CONCEPTS_PREDICATE_H
+#define _LIBCUDACXX___CONCEPTS_PREDICATE_H
 
 #include <__concepts/boolean_testable.h>
 #include <__concepts/invocable.h>
 #include <__config>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 // [concept.predicate]
 
@@ -28,8 +28,8 @@ template<class _Fn, class... _Args>
 concept predicate =
   regular_invocable<_Fn, _Args...> && __boolean_testable<invoke_result_t<_Fn, _Args...>>;
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___CONCEPTS_PREDICATE_H
+#endif // _LIBCUDACXX___CONCEPTS_PREDICATE_H

diff  --git a/libcxx/include/__concepts/regular.h b/libcxx/include/__concepts/regular.h
index d15728d298bd..b2e3fcef0a05 100644
--- a/libcxx/include/__concepts/regular.h
+++ b/libcxx/include/__concepts/regular.h
@@ -6,28 +6,28 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___CONCEPTS_REGULAR_H
-#define _LIBCPP___CONCEPTS_REGULAR_H
+#ifndef _LIBCUDACXX___CONCEPTS_REGULAR_H
+#define _LIBCUDACXX___CONCEPTS_REGULAR_H
 
 #include <__concepts/equality_comparable.h>
 #include <__concepts/semiregular.h>
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 // [concept.object]
 
 template<class _Tp>
 concept regular = semiregular<_Tp> && equality_comparable<_Tp>;
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___CONCEPTS_REGULAR_H
+#endif // _LIBCUDACXX___CONCEPTS_REGULAR_H

diff  --git a/libcxx/include/__concepts/relation.h b/libcxx/include/__concepts/relation.h
index 7d5141cac74c..5952e6833268 100644
--- a/libcxx/include/__concepts/relation.h
+++ b/libcxx/include/__concepts/relation.h
@@ -6,19 +6,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___CONCEPTS_RELATION_H
-#define _LIBCPP___CONCEPTS_RELATION_H
+#ifndef _LIBCUDACXX___CONCEPTS_RELATION_H
+#define _LIBCUDACXX___CONCEPTS_RELATION_H
 
 #include <__concepts/predicate.h>
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 // [concept.relation]
 
@@ -37,8 +37,8 @@ concept equivalence_relation = relation<_Rp, _Tp, _Up>;
 template<class _Rp, class _Tp, class _Up>
 concept strict_weak_order = relation<_Rp, _Tp, _Up>;
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___CONCEPTS_RELATION_H
+#endif // _LIBCUDACXX___CONCEPTS_RELATION_H

diff  --git a/libcxx/include/__concepts/same_as.h b/libcxx/include/__concepts/same_as.h
index 765490661148..82567a675cd1 100644
--- a/libcxx/include/__concepts/same_as.h
+++ b/libcxx/include/__concepts/same_as.h
@@ -6,19 +6,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___CONCEPTS_SAME_AS_H
-#define _LIBCPP___CONCEPTS_SAME_AS_H
+#ifndef _LIBCUDACXX___CONCEPTS_SAME_AS_H
+#define _LIBCUDACXX___CONCEPTS_SAME_AS_H
 
 #include <__config>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 // [concept.same]
 
@@ -28,8 +28,8 @@ concept __same_as_impl = _IsSame<_Tp, _Up>::value;
 template<class _Tp, class _Up>
 concept same_as = __same_as_impl<_Tp, _Up> && __same_as_impl<_Up, _Tp>;
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___CONCEPTS_SAME_AS_H
+#endif // _LIBCUDACXX___CONCEPTS_SAME_AS_H

diff  --git a/libcxx/include/__concepts/semiregular.h b/libcxx/include/__concepts/semiregular.h
index d15bb3ba42ba..a0edcd7969d9 100644
--- a/libcxx/include/__concepts/semiregular.h
+++ b/libcxx/include/__concepts/semiregular.h
@@ -6,28 +6,28 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___CONCEPTS_SEMIREGULAR_H
-#define _LIBCPP___CONCEPTS_SEMIREGULAR_H
+#ifndef _LIBCUDACXX___CONCEPTS_SEMIREGULAR_H
+#define _LIBCUDACXX___CONCEPTS_SEMIREGULAR_H
 
 #include <__concepts/constructible.h>
 #include <__concepts/copyable.h>
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 // [concept.object]
 
 template<class _Tp>
 concept semiregular = copyable<_Tp> && default_initializable<_Tp>;
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___CONCEPTS_SEMIREGULAR_H
+#endif // _LIBCUDACXX___CONCEPTS_SEMIREGULAR_H

diff  --git a/libcxx/include/__concepts/swappable.h b/libcxx/include/__concepts/swappable.h
index fef940f21fed..1bcce696da4d 100644
--- a/libcxx/include/__concepts/swappable.h
+++ b/libcxx/include/__concepts/swappable.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___CONCEPTS_SWAPPABLE_H
-#define _LIBCPP___CONCEPTS_SWAPPABLE_H
+#ifndef _LIBCUDACXX___CONCEPTS_SWAPPABLE_H
+#define _LIBCUDACXX___CONCEPTS_SWAPPABLE_H
 
 #include <__concepts/assignable.h>
 #include <__concepts/class_or_enum.h>
@@ -19,13 +19,13 @@
 #include <__utility/move.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 // [concept.swappable]
 
@@ -39,7 +39,7 @@ namespace __swap {
   concept __unqualified_swappable_with =
     (__class_or_enum<remove_cvref_t<_Tp>> || __class_or_enum<remove_cvref_t<_Up>>) &&
     requires(_Tp&& __t, _Up&& __u) {
-      swap(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u));
+      swap(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u));
     };
 
   struct __fn;
@@ -64,9 +64,9 @@ namespace __swap {
     template<class _Tp, class _Up>
       requires __unqualified_swappable_with<_Tp, _Up>
     constexpr void operator()(_Tp&& __t, _Up&& __u) const
-      noexcept(noexcept(swap(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u))))
+      noexcept(noexcept(swap(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u))))
     {
-      swap(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u));
+      swap(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u));
     }
 
     // 2.2   Otherwise, if `E1` and `E2` are lvalues of array types with equal extent and...
@@ -86,7 +86,7 @@ namespace __swap {
     constexpr void operator()(_Tp& __x, _Tp& __y) const
       noexcept(is_nothrow_move_constructible_v<_Tp> && is_nothrow_move_assignable_v<_Tp>)
     {
-      __y = _VSTD::exchange(__x, _VSTD::move(__y));
+      __y = _CUDA_VSTD::exchange(__x, _CUDA_VSTD::move(__y));
     }
   };
 } // namespace __swap
@@ -103,14 +103,14 @@ template<class _Tp, class _Up>
 concept swappable_with =
   common_reference_with<_Tp, _Up> &&
   requires(_Tp&& __t, _Up&& __u) {
-    ranges::swap(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Tp>(__t));
-    ranges::swap(_VSTD::forward<_Up>(__u), _VSTD::forward<_Up>(__u));
-    ranges::swap(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u));
-    ranges::swap(_VSTD::forward<_Up>(__u), _VSTD::forward<_Tp>(__t));
+    ranges::swap(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Tp>(__t));
+    ranges::swap(_CUDA_VSTD::forward<_Up>(__u), _CUDA_VSTD::forward<_Up>(__u));
+    ranges::swap(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u));
+    ranges::swap(_CUDA_VSTD::forward<_Up>(__u), _CUDA_VSTD::forward<_Tp>(__t));
   };
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___CONCEPTS_SWAPPABLE_H
+#endif // _LIBCUDACXX___CONCEPTS_SWAPPABLE_H

diff  --git a/libcxx/include/__concepts/totally_ordered.h b/libcxx/include/__concepts/totally_ordered.h
index 25347790de07..8453d97449cd 100644
--- a/libcxx/include/__concepts/totally_ordered.h
+++ b/libcxx/include/__concepts/totally_ordered.h
@@ -6,21 +6,21 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___CONCEPTS_TOTALLY_ORDERED_H
-#define _LIBCPP___CONCEPTS_TOTALLY_ORDERED_H
+#ifndef _LIBCUDACXX___CONCEPTS_TOTALLY_ORDERED_H
+#define _LIBCUDACXX___CONCEPTS_TOTALLY_ORDERED_H
 
 #include <__concepts/boolean_testable.h>
 #include <__concepts/equality_comparable.h>
 #include <__config>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 // [concept.totallyordered]
 
@@ -50,8 +50,8 @@ concept totally_ordered_with =
       __make_const_lvalue_ref<_Up>>> &&
   __partially_ordered_with<_Tp, _Up>;
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___CONCEPTS_TOTALLY_ORDERED_H
+#endif // _LIBCUDACXX___CONCEPTS_TOTALLY_ORDERED_H

diff  --git a/libcxx/include/__config b/libcxx/include/__config
index 8c2f7614af53..1f6b1f65d9b4 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -7,125 +7,125 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___CONFIG
-#define _LIBCPP___CONFIG
+#ifndef _LIBCUDACXX___CONFIG
+#define _LIBCUDACXX___CONFIG
 
 #include <__config_site>
 
 #if defined(_MSC_VER) && !defined(__clang__)
-#  if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-#    define _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
+#  if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#    define _LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER
 #  endif
 #endif
 
-#ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
+#ifndef _LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER
 #  pragma GCC system_header
 #endif
 
 #ifdef __cplusplus
 
-#  define _LIBCPP_VERSION 15000
+#  define _LIBCUDACXX_VERSION 15000
 
-#  define _LIBCPP_CONCAT_IMPL(_X, _Y) _X##_Y
-#  define _LIBCPP_CONCAT(_X, _Y) _LIBCPP_CONCAT_IMPL(_X, _Y)
+#  define _LIBCUDACXX_CONCAT_IMPL(_X, _Y) _X##_Y
+#  define _LIBCUDACXX_CONCAT(_X, _Y) _LIBCUDACXX_CONCAT_IMPL(_X, _Y)
 
 // Valid C++ identifier that revs with every libc++ version. This can be used to
 // generate identifiers that must be unique for every released libc++ version.
-#  define _LIBCPP_VERSIONED_IDENTIFIER _LIBCPP_CONCAT(v, _LIBCPP_VERSION)
+#  define _LIBCUDACXX_VERSIONED_IDENTIFIER _LIBCUDACXX_CONCAT(v, _LIBCUDACXX_VERSION)
 
 #  if __STDC_HOSTED__ == 0
-#    define _LIBCPP_FREESTANDING
+#    define _LIBCUDACXX_FREESTANDING
 #  endif
 
-#  ifndef _LIBCPP_STD_VER
+#  ifndef _LIBCUDACXX_STD_VER
 #    if __cplusplus <= 201103L
-#      define _LIBCPP_STD_VER 11
+#      define _LIBCUDACXX_STD_VER 11
 #    elif __cplusplus <= 201402L
-#      define _LIBCPP_STD_VER 14
+#      define _LIBCUDACXX_STD_VER 14
 #    elif __cplusplus <= 201703L
-#      define _LIBCPP_STD_VER 17
+#      define _LIBCUDACXX_STD_VER 17
 #    elif __cplusplus <= 202002L
-#      define _LIBCPP_STD_VER 20
+#      define _LIBCUDACXX_STD_VER 20
 #    else
-#      define _LIBCPP_STD_VER 22 // current year, or date of c++2b ratification
+#      define _LIBCUDACXX_STD_VER 22 // current year, or date of c++2b ratification
 #    endif
-#  endif // _LIBCPP_STD_VER
+#  endif // _LIBCUDACXX_STD_VER
 
 #  if defined(__ELF__)
-#    define _LIBCPP_OBJECT_FORMAT_ELF 1
+#    define _LIBCUDACXX_OBJECT_FORMAT_ELF 1
 #  elif defined(__MACH__)
-#    define _LIBCPP_OBJECT_FORMAT_MACHO 1
+#    define _LIBCUDACXX_OBJECT_FORMAT_MACHO 1
 #  elif defined(_WIN32)
-#    define _LIBCPP_OBJECT_FORMAT_COFF 1
+#    define _LIBCUDACXX_OBJECT_FORMAT_COFF 1
 #  elif defined(__wasm__)
-#    define _LIBCPP_OBJECT_FORMAT_WASM 1
+#    define _LIBCUDACXX_OBJECT_FORMAT_WASM 1
 #  elif defined(_AIX)
-#    define _LIBCPP_OBJECT_FORMAT_XCOFF 1
+#    define _LIBCUDACXX_OBJECT_FORMAT_XCOFF 1
 #  else
 // ... add new file formats here ...
 #  endif
 
-#  if _LIBCPP_ABI_VERSION >= 2
+#  if _LIBCUDACXX_ABI_VERSION >= 2
 // Change short string representation so that string data starts at offset 0,
 // improving its alignment in some cases.
-#    define _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
+#    define _LIBCUDACXX_ABI_ALTERNATE_STRING_LAYOUT
 // Fix deque iterator type in order to support incomplete types.
-#    define _LIBCPP_ABI_INCOMPLETE_TYPES_IN_DEQUE
+#    define _LIBCUDACXX_ABI_INCOMPLETE_TYPES_IN_DEQUE
 // Fix undefined behavior in how std::list stores its linked nodes.
-#    define _LIBCPP_ABI_LIST_REMOVE_NODE_POINTER_UB
+#    define _LIBCUDACXX_ABI_LIST_REMOVE_NODE_POINTER_UB
 // Fix undefined behavior in  how __tree stores its end and parent nodes.
-#    define _LIBCPP_ABI_TREE_REMOVE_NODE_POINTER_UB
+#    define _LIBCUDACXX_ABI_TREE_REMOVE_NODE_POINTER_UB
 // Fix undefined behavior in how __hash_table stores its pointer types.
-#    define _LIBCPP_ABI_FIX_UNORDERED_NODE_POINTER_UB
-#    define _LIBCPP_ABI_FORWARD_LIST_REMOVE_NODE_POINTER_UB
-#    define _LIBCPP_ABI_FIX_UNORDERED_CONTAINER_SIZE_TYPE
+#    define _LIBCUDACXX_ABI_FIX_UNORDERED_NODE_POINTER_UB
+#    define _LIBCUDACXX_ABI_FORWARD_LIST_REMOVE_NODE_POINTER_UB
+#    define _LIBCUDACXX_ABI_FIX_UNORDERED_CONTAINER_SIZE_TYPE
 // Define a key function for `bad_function_call` in the library, to centralize
 // its vtable and typeinfo to libc++ rather than having all other libraries
 // using that class define their own copies.
-#    define _LIBCPP_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION
+#    define _LIBCUDACXX_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION
 // Override the default return value of exception::what() for
 // bad_function_call::what() with a string that is specific to
 // bad_function_call (see http://wg21.link/LWG2233). This is an ABI break
 // because it changes the vtable layout of bad_function_call.
-#    define _LIBCPP_ABI_BAD_FUNCTION_CALL_GOOD_WHAT_MESSAGE
+#    define _LIBCUDACXX_ABI_BAD_FUNCTION_CALL_GOOD_WHAT_MESSAGE
 // Enable optimized version of __do_get_(un)signed which avoids redundant copies.
-#    define _LIBCPP_ABI_OPTIMIZED_LOCALE_NUM_GET
+#    define _LIBCUDACXX_ABI_OPTIMIZED_LOCALE_NUM_GET
 // Give reverse_iterator<T> one data member of type T, not two.
 // Also, in C++17 and later, don't derive iterator types from std::iterator.
-#    define _LIBCPP_ABI_NO_ITERATOR_BASES
+#    define _LIBCUDACXX_ABI_NO_ITERATOR_BASES
 // Use the smallest possible integer type to represent the index of the variant.
 // Previously libc++ used "unsigned int" exclusively.
-#    define _LIBCPP_ABI_VARIANT_INDEX_TYPE_OPTIMIZATION
+#    define _LIBCUDACXX_ABI_VARIANT_INDEX_TYPE_OPTIMIZATION
 // Unstable attempt to provide a more optimized std::function
-#    define _LIBCPP_ABI_OPTIMIZED_FUNCTION
+#    define _LIBCUDACXX_ABI_OPTIMIZED_FUNCTION
 // All the regex constants must be distinct and nonzero.
-#    define _LIBCPP_ABI_REGEX_CONSTANTS_NONZERO
+#    define _LIBCUDACXX_ABI_REGEX_CONSTANTS_NONZERO
 // Re-worked external template instantiations for std::string with a focus on
 // performance and fast-path inlining.
-#    define _LIBCPP_ABI_STRING_OPTIMIZED_EXTERNAL_INSTANTIATION
+#    define _LIBCUDACXX_ABI_STRING_OPTIMIZED_EXTERNAL_INSTANTIATION
 // Enable clang::trivial_abi on std::unique_ptr.
-#    define _LIBCPP_ABI_ENABLE_UNIQUE_PTR_TRIVIAL_ABI
+#    define _LIBCUDACXX_ABI_ENABLE_UNIQUE_PTR_TRIVIAL_ABI
 // Enable clang::trivial_abi on std::shared_ptr and std::weak_ptr
-#    define _LIBCPP_ABI_ENABLE_SHARED_PTR_TRIVIAL_ABI
+#    define _LIBCUDACXX_ABI_ENABLE_SHARED_PTR_TRIVIAL_ABI
 // std::random_device holds some state when it uses an implementation that gets
-// entropy from a file (see _LIBCPP_USING_DEV_RANDOM). When switching from this
+// entropy from a file (see _LIBCUDACXX_USING_DEV_RANDOM). When switching from this
 // implementation to another one on a platform that has already shipped
 // std::random_device, one needs to retain the same object layout to remain ABI
 // compatible. This switch removes these workarounds for platforms that don't care
 // about ABI compatibility.
-#    define _LIBCPP_ABI_NO_RANDOM_DEVICE_COMPATIBILITY_LAYOUT
+#    define _LIBCUDACXX_ABI_NO_RANDOM_DEVICE_COMPATIBILITY_LAYOUT
 // Don't export the legacy __basic_string_common class and its methods from the built library.
-#    define _LIBCPP_ABI_DO_NOT_EXPORT_BASIC_STRING_COMMON
+#    define _LIBCUDACXX_ABI_DO_NOT_EXPORT_BASIC_STRING_COMMON
 // Don't export the legacy __vector_base_common class and its methods from the built library.
-#    define _LIBCPP_ABI_DO_NOT_EXPORT_VECTOR_BASE_COMMON
+#    define _LIBCUDACXX_ABI_DO_NOT_EXPORT_VECTOR_BASE_COMMON
 // According to the Standard, `bitset::operator[] const` returns bool
-#    define _LIBCPP_ABI_BITSET_VECTOR_BOOL_CONST_SUBSCRIPT_RETURN_BOOL
+#    define _LIBCUDACXX_ABI_BITSET_VECTOR_BOOL_CONST_SUBSCRIPT_RETURN_BOOL
 // Remove the base 10 implementation of std::to_chars from the dylib.
 // The implementation moved to the header, but we still export the symbols from
 // the dylib for backwards compatibility.
-#    define _LIBCPP_ABI_DO_NOT_EXPORT_TO_CHARS_BASE_10
-#  elif _LIBCPP_ABI_VERSION == 1
-#    if !(defined(_LIBCPP_OBJECT_FORMAT_COFF) || defined(_LIBCPP_OBJECT_FORMAT_XCOFF))
+#    define _LIBCUDACXX_ABI_DO_NOT_EXPORT_TO_CHARS_BASE_10
+#  elif _LIBCUDACXX_ABI_VERSION == 1
+#    if !(defined(_LIBCUDACXX_OBJECT_FORMAT_COFF) || defined(_LIBCUDACXX_OBJECT_FORMAT_XCOFF))
 // Enable compiling copies of now inline methods into the dylib to support
 // applications compiled against older libraries. This is unnecessary with
 // COFF dllexport semantics, since dllexport forces a non-inline definition
@@ -134,32 +134,32 @@
 // the linker will take issue with the symbols in the shared object if the
 // weak inline methods get visibility (such as from -fvisibility-inlines-hidden),
 // so disable it.
-#      define _LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS
+#      define _LIBCUDACXX_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS
 #    endif
 // Feature macros for disabling pre ABI v1 features. All of these options
 // are deprecated.
 #    if defined(__FreeBSD__)
-#      define _LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR
+#      define _LIBCUDACXX_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR
 #    endif
 #  endif
 
-#  if defined(_LIBCPP_BUILDING_LIBRARY) || _LIBCPP_ABI_VERSION >= 2
+#  if defined(_LIBCUDACXX_BUILDING_LIBRARY) || _LIBCUDACXX_ABI_VERSION >= 2
 // Enable additional explicit instantiations of iostreams components. This
 // reduces the number of weak definitions generated in programs that use
 // iostreams by providing a single strong definition in the shared library.
-#    define _LIBCPP_ABI_ENABLE_ADDITIONAL_IOSTREAM_EXPLICIT_INSTANTIATIONS_1
+#    define _LIBCUDACXX_ABI_ENABLE_ADDITIONAL_IOSTREAM_EXPLICIT_INSTANTIATIONS_1
 
 // Define a key function for `bad_function_call` in the library, to centralize
 // its vtable and typeinfo to libc++ rather than having all other libraries
 // using that class define their own copies.
-#    define _LIBCPP_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION
+#    define _LIBCUDACXX_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION
 #  endif
 
-#  define _LIBCPP_TOSTRING2(x) #  x
-#  define _LIBCPP_TOSTRING(x) _LIBCPP_TOSTRING2(x)
+#  define _LIBCUDACXX_TOSTRING2(x) #  x
+#  define _LIBCUDACXX_TOSTRING(x) _LIBCUDACXX_TOSTRING2(x)
 
 #  if __cplusplus < 201103L
-#    define _LIBCPP_CXX03_LANG
+#    define _LIBCUDACXX_CXX03_LANG
 #  endif
 
 #  ifndef __has_attribute
@@ -199,22 +199,22 @@
 #  endif
 
 #  if defined(__apple_build_version__)
-#    define _LIBCPP_COMPILER_CLANG_BASED
-#    define _LIBCPP_APPLE_CLANG_VER (__apple_build_version__ / 10000)
+#    define _LIBCUDACXX_COMPILER_CLANG_BASED
+#    define _LIBCUDACXX_APPLE_CLANG_VER (__apple_build_version__ / 10000)
 #  elif defined(__clang__)
-#    define _LIBCPP_COMPILER_CLANG_BASED
-#    define _LIBCPP_CLANG_VER (__clang_major__ * 100 + __clang_minor__)
+#    define _LIBCUDACXX_COMPILER_CLANG_BASED
+#    define _LIBCUDACXX_CLANG_VER (__clang_major__ * 100 + __clang_minor__)
 #  elif defined(__GNUC__)
-#    define _LIBCPP_COMPILER_GCC
+#    define _LIBCUDACXX_COMPILER_GCC
 #  elif defined(_MSC_VER)
-#    define _LIBCPP_COMPILER_MSVC
+#    define _LIBCUDACXX_COMPILER_MSVC
 #  endif
 
-#  if !defined(_LIBCPP_COMPILER_CLANG_BASED) && __cplusplus < 201103L
+#  if !defined(_LIBCUDACXX_COMPILER_CLANG_BASED) && __cplusplus < 201103L
 #    error "libc++ only supports C++03 with Clang-based compilers. Please enable C++11"
 #  endif
 
-#  ifdef _LIBCPP_COMPILER_MSVC
+#  ifdef _LIBCUDACXX_COMPILER_MSVC
 #    error If you successfully use libc++ with MSVC please tell the libc++ developers and consider upstreaming your \
 changes. We are not aware of anybody using this configuration and know that at least some code is currently broken. \
 If there are users of this configuration we are happy to provide support.
@@ -225,44 +225,44 @@ If there are users of this configuration we are happy to provide support.
 // that Windows compilers pretending to be MSVC++ target the Microsoft ABI,
 // and allow the user to explicitly specify the ABI to handle cases where this
 // heuristic falls short.
-#  if defined(_LIBCPP_ABI_FORCE_ITANIUM) && defined(_LIBCPP_ABI_FORCE_MICROSOFT)
-#    error "Only one of _LIBCPP_ABI_FORCE_ITANIUM and _LIBCPP_ABI_FORCE_MICROSOFT can be defined"
-#  elif defined(_LIBCPP_ABI_FORCE_ITANIUM)
-#    define _LIBCPP_ABI_ITANIUM
-#  elif defined(_LIBCPP_ABI_FORCE_MICROSOFT)
-#    define _LIBCPP_ABI_MICROSOFT
+#  if defined(_LIBCUDACXX_ABI_FORCE_ITANIUM) && defined(_LIBCUDACXX_ABI_FORCE_MICROSOFT)
+#    error "Only one of _LIBCUDACXX_ABI_FORCE_ITANIUM and _LIBCUDACXX_ABI_FORCE_MICROSOFT can be defined"
+#  elif defined(_LIBCUDACXX_ABI_FORCE_ITANIUM)
+#    define _LIBCUDACXX_ABI_ITANIUM
+#  elif defined(_LIBCUDACXX_ABI_FORCE_MICROSOFT)
+#    define _LIBCUDACXX_ABI_MICROSOFT
 #  else
 #    if defined(_WIN32) && defined(_MSC_VER)
-#      define _LIBCPP_ABI_MICROSOFT
+#      define _LIBCUDACXX_ABI_MICROSOFT
 #    else
-#      define _LIBCPP_ABI_ITANIUM
+#      define _LIBCUDACXX_ABI_ITANIUM
 #    endif
 #  endif
 
-#  if defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_NO_VCRUNTIME)
-#    define _LIBCPP_ABI_VCRUNTIME
+#  if defined(_LIBCUDACXX_ABI_MICROSOFT) && !defined(_LIBCUDACXX_NO_VCRUNTIME)
+#    define _LIBCUDACXX_ABI_VCRUNTIME
 #  endif
 
 #  if __has_feature(experimental_library)
-#    ifndef _LIBCPP_ENABLE_EXPERIMENTAL
-#      define _LIBCPP_ENABLE_EXPERIMENTAL
+#    ifndef _LIBCUDACXX_ENABLE_EXPERIMENTAL
+#      define _LIBCUDACXX_ENABLE_EXPERIMENTAL
 #    endif
 #  endif
 
 // Incomplete features get their own specific disabling flags. This makes it
 // easier to grep for target specific flags once the feature is complete.
-#  if !defined(_LIBCPP_ENABLE_EXPERIMENTAL) && !defined(_LIBCPP_BUILDING_LIBRARY)
-#    define _LIBCPP_HAS_NO_INCOMPLETE_FORMAT
-#    define _LIBCPP_HAS_NO_INCOMPLETE_RANGES
+#  if !defined(_LIBCUDACXX_ENABLE_EXPERIMENTAL) && !defined(_LIBCUDACXX_BUILDING_LIBRARY)
+#    define _LIBCUDACXX_HAS_NO_INCOMPLETE_FORMAT
+#    define _LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES
 #  endif
 
 // Need to detect which libc we're using if we're on Linux.
 #  if defined(__linux__)
 #    include <features.h>
 #    if defined(__GLIBC_PREREQ)
-#      define _LIBCPP_GLIBC_PREREQ(a, b) __GLIBC_PREREQ(a, b)
+#      define _LIBCUDACXX_GLIBC_PREREQ(a, b) __GLIBC_PREREQ(a, b)
 #    else
-#      define _LIBCPP_GLIBC_PREREQ(a, b) 0
+#      define _LIBCUDACXX_GLIBC_PREREQ(a, b) 0
 #    endif // defined(__GLIBC_PREREQ)
 #  endif   // defined(__linux__)
 
@@ -272,21 +272,21 @@ If there are users of this configuration we are happy to provide support.
 
 #  ifdef __LITTLE_ENDIAN__
 #    if __LITTLE_ENDIAN__
-#      define _LIBCPP_LITTLE_ENDIAN
+#      define _LIBCUDACXX_LITTLE_ENDIAN
 #    endif // __LITTLE_ENDIAN__
 #  endif   // __LITTLE_ENDIAN__
 
 #  ifdef __BIG_ENDIAN__
 #    if __BIG_ENDIAN__
-#      define _LIBCPP_BIG_ENDIAN
+#      define _LIBCUDACXX_BIG_ENDIAN
 #    endif // __BIG_ENDIAN__
 #  endif   // __BIG_ENDIAN__
 
 #  ifdef __BYTE_ORDER__
 #    if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
-#      define _LIBCPP_LITTLE_ENDIAN
+#      define _LIBCUDACXX_LITTLE_ENDIAN
 #    elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
-#      define _LIBCPP_BIG_ENDIAN
+#      define _LIBCUDACXX_BIG_ENDIAN
 #    endif // __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
 #  endif   // __BYTE_ORDER__
 
@@ -294,138 +294,138 @@ If there are users of this configuration we are happy to provide support.
 #    include <sys/endian.h>
 #    include <osreldate.h>
 #    if _BYTE_ORDER == _LITTLE_ENDIAN
-#      define _LIBCPP_LITTLE_ENDIAN
+#      define _LIBCUDACXX_LITTLE_ENDIAN
 #    else // _BYTE_ORDER == _LITTLE_ENDIAN
-#      define _LIBCPP_BIG_ENDIAN
+#      define _LIBCUDACXX_BIG_ENDIAN
 #    endif // _BYTE_ORDER == _LITTLE_ENDIAN
 #  endif   // __FreeBSD__
 
 #  if defined(__NetBSD__) || defined(__OpenBSD__)
 #    include <sys/endian.h>
 #    if _BYTE_ORDER == _LITTLE_ENDIAN
-#      define _LIBCPP_LITTLE_ENDIAN
+#      define _LIBCUDACXX_LITTLE_ENDIAN
 #    else // _BYTE_ORDER == _LITTLE_ENDIAN
-#      define _LIBCPP_BIG_ENDIAN
+#      define _LIBCUDACXX_BIG_ENDIAN
 #    endif // _BYTE_ORDER == _LITTLE_ENDIAN
 #  endif   // defined(__NetBSD__) || defined(__OpenBSD__)
 
 #  if defined(_WIN32)
-#    define _LIBCPP_WIN32API
-#    define _LIBCPP_LITTLE_ENDIAN
-#    define _LIBCPP_SHORT_WCHAR 1
+#    define _LIBCUDACXX_WIN32API
+#    define _LIBCUDACXX_LITTLE_ENDIAN
+#    define _LIBCUDACXX_SHORT_WCHAR 1
 // Both MinGW and native MSVC provide a "MSVC"-like environment
-#    define _LIBCPP_MSVCRT_LIKE
+#    define _LIBCUDACXX_MSVCRT_LIKE
 // If mingw not explicitly detected, assume using MS C runtime only if
 // a MS compatibility version is specified.
 #    if defined(_MSC_VER) && !defined(__MINGW32__)
-#      define _LIBCPP_MSVCRT // Using Microsoft's C Runtime library
+#      define _LIBCUDACXX_MSVCRT // Using Microsoft's C Runtime library
 #    endif
 #    if (defined(_M_AMD64) || defined(__x86_64__)) || (defined(_M_ARM) || defined(__arm__))
-#      define _LIBCPP_HAS_BITSCAN64
+#      define _LIBCUDACXX_HAS_BITSCAN64
 #    endif
-#    define _LIBCPP_HAS_OPEN_WITH_WCHAR
+#    define _LIBCUDACXX_HAS_OPEN_WITH_WCHAR
 #  endif // defined(_WIN32)
 
 #  ifdef __sun__
 #    include <sys/isa_defs.h>
 #    ifdef _LITTLE_ENDIAN
-#      define _LIBCPP_LITTLE_ENDIAN
+#      define _LIBCUDACXX_LITTLE_ENDIAN
 #    else
-#      define _LIBCPP_BIG_ENDIAN
+#      define _LIBCUDACXX_BIG_ENDIAN
 #    endif
 #  endif // __sun__
 
 #  if defined(_AIX) && !defined(__64BIT__)
 // The size of wchar is 2 byte on 32-bit mode on AIX.
-#    define _LIBCPP_SHORT_WCHAR 1
+#    define _LIBCUDACXX_SHORT_WCHAR 1
 #  endif
 
 // Libc++ supports various implementations of std::random_device.
 //
-// _LIBCPP_USING_DEV_RANDOM
+// _LIBCUDACXX_USING_DEV_RANDOM
 //      Read entropy from the given file, by default `/dev/urandom`.
 //      If a token is provided, it is assumed to be the path to a file
 //      to read entropy from. This is the default behavior if nothing
 //      else is specified. This implementation requires storing state
 //      inside `std::random_device`.
 //
-// _LIBCPP_USING_ARC4_RANDOM
+// _LIBCUDACXX_USING_ARC4_RANDOM
 //      Use arc4random(). This allows obtaining random data even when
 //      using sandboxing mechanisms. On some platforms like Apple, this
 //      is the recommended source of entropy for user-space programs.
 //      When this option is used, the token passed to `std::random_device`'s
 //      constructor *must* be "/dev/urandom" -- anything else is an error.
 //
-// _LIBCPP_USING_GETENTROPY
+// _LIBCUDACXX_USING_GETENTROPY
 //      Use getentropy().
 //      When this option is used, the token passed to `std::random_device`'s
 //      constructor *must* be "/dev/urandom" -- anything else is an error.
 //
-// _LIBCPP_USING_FUCHSIA_CPRNG
+// _LIBCUDACXX_USING_FUCHSIA_CPRNG
 //      Use Fuchsia's zx_cprng_draw() system call, which is specified to
 //      deliver high-quality entropy and cannot fail.
 //      When this option is used, the token passed to `std::random_device`'s
 //      constructor *must* be "/dev/urandom" -- anything else is an error.
 //
-// _LIBCPP_USING_NACL_RANDOM
+// _LIBCUDACXX_USING_NACL_RANDOM
 //      NaCl's sandbox (which PNaCl also runs in) doesn't allow filesystem access,
 //      including accesses to the special files under `/dev`. This implementation
 //      uses the NaCL syscall `nacl_secure_random_init()` to get entropy.
 //      When this option is used, the token passed to `std::random_device`'s
 //      constructor *must* be "/dev/urandom" -- anything else is an error.
 //
-// _LIBCPP_USING_WIN32_RANDOM
+// _LIBCUDACXX_USING_WIN32_RANDOM
 //      Use rand_s(), for use on Windows.
 //      When this option is used, the token passed to `std::random_device`'s
 //      constructor *must* be "/dev/urandom" -- anything else is an error.
 #  if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) ||                     \
       defined(__DragonFly__) || defined(__sun__)
-#    define _LIBCPP_USING_ARC4_RANDOM
+#    define _LIBCUDACXX_USING_ARC4_RANDOM
 #  elif defined(__wasi__) || defined(__EMSCRIPTEN__)
-#    define _LIBCPP_USING_GETENTROPY
+#    define _LIBCUDACXX_USING_GETENTROPY
 #  elif defined(__Fuchsia__)
-#    define _LIBCPP_USING_FUCHSIA_CPRNG
+#    define _LIBCUDACXX_USING_FUCHSIA_CPRNG
 #  elif defined(__native_client__)
-#    define _LIBCPP_USING_NACL_RANDOM
-#  elif defined(_LIBCPP_WIN32API)
-#    define _LIBCPP_USING_WIN32_RANDOM
+#    define _LIBCUDACXX_USING_NACL_RANDOM
+#  elif defined(_LIBCUDACXX_WIN32API)
+#    define _LIBCUDACXX_USING_WIN32_RANDOM
 #  else
-#    define _LIBCPP_USING_DEV_RANDOM
+#    define _LIBCUDACXX_USING_DEV_RANDOM
 #  endif
 
-#  if !defined(_LIBCPP_LITTLE_ENDIAN) && !defined(_LIBCPP_BIG_ENDIAN)
+#  if !defined(_LIBCUDACXX_LITTLE_ENDIAN) && !defined(_LIBCUDACXX_BIG_ENDIAN)
 #    include <endian.h>
 #    if __BYTE_ORDER == __LITTLE_ENDIAN
-#      define _LIBCPP_LITTLE_ENDIAN
+#      define _LIBCUDACXX_LITTLE_ENDIAN
 #    elif __BYTE_ORDER == __BIG_ENDIAN
-#      define _LIBCPP_BIG_ENDIAN
+#      define _LIBCUDACXX_BIG_ENDIAN
 #    else // __BYTE_ORDER == __BIG_ENDIAN
 #      error unable to determine endian
 #    endif
-#  endif // !defined(_LIBCPP_LITTLE_ENDIAN) && !defined(_LIBCPP_BIG_ENDIAN)
+#  endif // !defined(_LIBCUDACXX_LITTLE_ENDIAN) && !defined(_LIBCUDACXX_BIG_ENDIAN)
 
-#  if __has_attribute(__no_sanitize__) && !defined(_LIBCPP_COMPILER_GCC)
-#    define _LIBCPP_NO_CFI __attribute__((__no_sanitize__("cfi")))
+#  if __has_attribute(__no_sanitize__) && !defined(_LIBCUDACXX_COMPILER_GCC)
+#    define _LIBCUDACXX_NO_CFI __attribute__((__no_sanitize__("cfi")))
 #  else
-#    define _LIBCPP_NO_CFI
+#    define _LIBCUDACXX_NO_CFI
 #  endif
 
-#  ifndef _LIBCPP_CXX03_LANG
+#  ifndef _LIBCUDACXX_CXX03_LANG
 
-#    define _LIBCPP_ALIGNOF(_Tp) alignof(_Tp)
+#    define _LIBCUDACXX_ALIGNOF(_Tp) alignof(_Tp)
 #    define _ALIGNAS_TYPE(x) alignas(x)
 #    define _ALIGNAS(x) alignas(x)
-#    define _LIBCPP_NORETURN [[noreturn]]
+#    define _LIBCUDACXX_NORETURN [[noreturn]]
 #    define _NOEXCEPT noexcept
 #    define _NOEXCEPT_(x) noexcept(x)
 
 #  else
 
-#    define _LIBCPP_ALIGNOF(_Tp) _Alignof(_Tp)
-#    define _ALIGNAS_TYPE(x) __attribute__((__aligned__(_LIBCPP_ALIGNOF(x))))
+#    define _LIBCUDACXX_ALIGNOF(_Tp) _Alignof(_Tp)
+#    define _ALIGNAS_TYPE(x) __attribute__((__aligned__(_LIBCUDACXX_ALIGNOF(x))))
 #    define _ALIGNAS(x) __attribute__((__aligned__(x)))
-#    define _LIBCPP_NORETURN __attribute__((noreturn))
-#    define _LIBCPP_HAS_NO_NOEXCEPT
+#    define _LIBCUDACXX_NORETURN __attribute__((noreturn))
+#    define _LIBCUDACXX_HAS_NO_NOEXCEPT
 #    define nullptr __nullptr
 #    define _NOEXCEPT throw()
 #    define _NOEXCEPT_(x)
@@ -436,175 +436,175 @@ typedef __char32_t char32_t;
 #  endif
 
 #  if !defined(__cpp_exceptions) || __cpp_exceptions < 199711L
-#    define _LIBCPP_NO_EXCEPTIONS
+#    define _LIBCUDACXX_NO_EXCEPTIONS
 #  endif
 
-#  define _LIBCPP_PREFERRED_ALIGNOF(_Tp) __alignof(_Tp)
+#  define _LIBCUDACXX_PREFERRED_ALIGNOF(_Tp) __alignof(_Tp)
 
-#  if defined(_LIBCPP_COMPILER_CLANG_BASED)
+#  if defined(_LIBCUDACXX_COMPILER_CLANG_BASED)
 
 #    if defined(__APPLE__) && !defined(__i386__) && !defined(__x86_64__) && (!defined(__arm__) || __ARM_ARCH_7K__ >= 2)
-#      define _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
+#      define _LIBCUDACXX_ABI_ALTERNATE_STRING_LAYOUT
 #    endif
 
 // Objective-C++ features (opt-in)
 #    if __has_feature(objc_arc)
-#      define _LIBCPP_HAS_OBJC_ARC
+#      define _LIBCUDACXX_HAS_OBJC_ARC
 #    endif
 
 #    if __has_feature(objc_arc_weak)
-#      define _LIBCPP_HAS_OBJC_ARC_WEAK
+#      define _LIBCUDACXX_HAS_OBJC_ARC_WEAK
 #    endif
 
 #    if __has_extension(blocks)
-#      define _LIBCPP_HAS_EXTENSION_BLOCKS
+#      define _LIBCUDACXX_HAS_EXTENSION_BLOCKS
 #    endif
 
-#    if defined(_LIBCPP_HAS_EXTENSION_BLOCKS) && defined(__APPLE__)
-#      define _LIBCPP_HAS_BLOCKS_RUNTIME
+#    if defined(_LIBCUDACXX_HAS_EXTENSION_BLOCKS) && defined(__APPLE__)
+#      define _LIBCUDACXX_HAS_BLOCKS_RUNTIME
 #    endif
 
 #    if !__has_feature(address_sanitizer)
-#      define _LIBCPP_HAS_NO_ASAN
+#      define _LIBCUDACXX_HAS_NO_ASAN
 #    endif
 
 // Allow for build-time disabling of unsigned integer sanitization
 #    if __has_attribute(no_sanitize)
-#      define _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK __attribute__((__no_sanitize__("unsigned-integer-overflow")))
+#      define _LIBCUDACXX_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK __attribute__((__no_sanitize__("unsigned-integer-overflow")))
 #    endif
 
-#    define _LIBCPP_ALWAYS_INLINE __attribute__((__always_inline__))
+#    define _LIBCUDACXX_ALWAYS_INLINE __attribute__((__always_inline__))
 
-#    define _LIBCPP_DISABLE_EXTENSION_WARNING __extension__
+#    define _LIBCUDACXX_DISABLE_EXTENSION_WARNING __extension__
 
-#  elif defined(_LIBCPP_COMPILER_GCC)
+#  elif defined(_LIBCUDACXX_COMPILER_GCC)
 
 #    if !defined(__SANITIZE_ADDRESS__)
-#      define _LIBCPP_HAS_NO_ASAN
+#      define _LIBCUDACXX_HAS_NO_ASAN
 #    endif
 
-#    define _LIBCPP_ALWAYS_INLINE __attribute__((__always_inline__))
+#    define _LIBCUDACXX_ALWAYS_INLINE __attribute__((__always_inline__))
 
-#    define _LIBCPP_DISABLE_EXTENSION_WARNING __extension__
+#    define _LIBCUDACXX_DISABLE_EXTENSION_WARNING __extension__
 
-#  elif defined(_LIBCPP_COMPILER_MSVC)
+#  elif defined(_LIBCUDACXX_COMPILER_MSVC)
 
-#    define _LIBCPP_WARNING(x) __pragma(message(__FILE__ "(" _LIBCPP_TOSTRING(__LINE__) ") : warning note: " x))
+#    define _LIBCUDACXX_WARNING(x) __pragma(message(__FILE__ "(" _LIBCUDACXX_TOSTRING(__LINE__) ") : warning note: " x))
 
 #    if _MSC_VER < 1900
 #      error "MSVC versions prior to Visual Studio 2015 are not supported"
 #    endif
 
-#    define _LIBCPP_NORETURN __declspec(noreturn)
+#    define _LIBCUDACXX_NORETURN __declspec(noreturn)
 
-#    define _LIBCPP_WEAK
+#    define _LIBCUDACXX_WEAK
 
-#    define _LIBCPP_HAS_NO_ASAN
+#    define _LIBCUDACXX_HAS_NO_ASAN
 
-#    define _LIBCPP_ALWAYS_INLINE __forceinline
+#    define _LIBCUDACXX_ALWAYS_INLINE __forceinline
 
-#    define _LIBCPP_HAS_NO_VECTOR_EXTENSION
+#    define _LIBCUDACXX_HAS_NO_VECTOR_EXTENSION
 
-#    define _LIBCPP_DISABLE_EXTENSION_WARNING
+#    define _LIBCUDACXX_DISABLE_EXTENSION_WARNING
 
-#  endif // _LIBCPP_COMPILER_[CLANG|GCC|MSVC]
+#  endif // _LIBCUDACXX_COMPILER_[CLANG|GCC|MSVC]
 
-#  if defined(_LIBCPP_OBJECT_FORMAT_COFF)
+#  if defined(_LIBCUDACXX_OBJECT_FORMAT_COFF)
 
 #    ifdef _DLL
-#      define _LIBCPP_CRT_FUNC __declspec(dllimport)
+#      define _LIBCUDACXX_CRT_FUNC __declspec(dllimport)
 #    else
-#      define _LIBCPP_CRT_FUNC
+#      define _LIBCUDACXX_CRT_FUNC
 #    endif
 
-#    if defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) || (defined(__MINGW32__) && !defined(_LIBCPP_BUILDING_LIBRARY))
-#      define _LIBCPP_DLL_VIS
-#      define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS
-#      define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS
-#      define _LIBCPP_OVERRIDABLE_FUNC_VIS
-#      define _LIBCPP_EXPORTED_FROM_ABI
-#    elif defined(_LIBCPP_BUILDING_LIBRARY)
-#      define _LIBCPP_DLL_VIS __declspec(dllexport)
+#    if defined(_LIBCUDACXX_DISABLE_VISIBILITY_ANNOTATIONS) || (defined(__MINGW32__) && !defined(_LIBCUDACXX_BUILDING_LIBRARY))
+#      define _LIBCUDACXX_DLL_VIS
+#      define _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS
+#      define _LIBCUDACXX_CLASS_TEMPLATE_INSTANTIATION_VIS
+#      define _LIBCUDACXX_OVERRIDABLE_FUNC_VIS
+#      define _LIBCUDACXX_EXPORTED_FROM_ABI
+#    elif defined(_LIBCUDACXX_BUILDING_LIBRARY)
+#      define _LIBCUDACXX_DLL_VIS __declspec(dllexport)
 #      if defined(__MINGW32__)
-#        define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS _LIBCPP_DLL_VIS
-#        define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS
+#        define _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS _LIBCUDACXX_DLL_VIS
+#        define _LIBCUDACXX_CLASS_TEMPLATE_INSTANTIATION_VIS
 #      else
-#        define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS
-#        define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS _LIBCPP_DLL_VIS
+#        define _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS
+#        define _LIBCUDACXX_CLASS_TEMPLATE_INSTANTIATION_VIS _LIBCUDACXX_DLL_VIS
 #      endif
-#      define _LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_DLL_VIS
-#      define _LIBCPP_EXPORTED_FROM_ABI __declspec(dllexport)
+#      define _LIBCUDACXX_OVERRIDABLE_FUNC_VIS _LIBCUDACXX_DLL_VIS
+#      define _LIBCUDACXX_EXPORTED_FROM_ABI __declspec(dllexport)
 #    else
-#      define _LIBCPP_DLL_VIS __declspec(dllimport)
-#      define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS _LIBCPP_DLL_VIS
-#      define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS
-#      define _LIBCPP_OVERRIDABLE_FUNC_VIS
-#      define _LIBCPP_EXPORTED_FROM_ABI __declspec(dllimport)
+#      define _LIBCUDACXX_DLL_VIS __declspec(dllimport)
+#      define _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS _LIBCUDACXX_DLL_VIS
+#      define _LIBCUDACXX_CLASS_TEMPLATE_INSTANTIATION_VIS
+#      define _LIBCUDACXX_OVERRIDABLE_FUNC_VIS
+#      define _LIBCUDACXX_EXPORTED_FROM_ABI __declspec(dllimport)
 #    endif
 
-#    define _LIBCPP_TYPE_VIS _LIBCPP_DLL_VIS
-#    define _LIBCPP_FUNC_VIS _LIBCPP_DLL_VIS
-#    define _LIBCPP_EXCEPTION_ABI _LIBCPP_DLL_VIS
-#    define _LIBCPP_HIDDEN
-#    define _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
-#    define _LIBCPP_TEMPLATE_VIS
-#    define _LIBCPP_TEMPLATE_DATA_VIS
-#    define _LIBCPP_ENUM_VIS
+#    define _LIBCUDACXX_TYPE_VIS _LIBCUDACXX_DLL_VIS
+#    define _LIBCUDACXX_FUNC_VIS _LIBCUDACXX_DLL_VIS
+#    define _LIBCUDACXX_EXCEPTION_ABI _LIBCUDACXX_DLL_VIS
+#    define _LIBCUDACXX_HIDDEN
+#    define _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
+#    define _LIBCUDACXX_TEMPLATE_VIS
+#    define _LIBCUDACXX_TEMPLATE_DATA_VIS
+#    define _LIBCUDACXX_ENUM_VIS
 
 #  else
 
-#    if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
-#      define _LIBCPP_VISIBILITY(vis) __attribute__((__visibility__(vis)))
+#    if !defined(_LIBCUDACXX_DISABLE_VISIBILITY_ANNOTATIONS)
+#      define _LIBCUDACXX_VISIBILITY(vis) __attribute__((__visibility__(vis)))
 #    else
-#      define _LIBCPP_VISIBILITY(vis)
+#      define _LIBCUDACXX_VISIBILITY(vis)
 #    endif
 
-#    define _LIBCPP_HIDDEN _LIBCPP_VISIBILITY("hidden")
-#    define _LIBCPP_FUNC_VIS _LIBCPP_VISIBILITY("default")
-#    define _LIBCPP_TYPE_VIS _LIBCPP_VISIBILITY("default")
-#    define _LIBCPP_TEMPLATE_DATA_VIS _LIBCPP_VISIBILITY("default")
-#    define _LIBCPP_EXPORTED_FROM_ABI _LIBCPP_VISIBILITY("default")
-#    define _LIBCPP_EXCEPTION_ABI _LIBCPP_VISIBILITY("default")
-#    define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS _LIBCPP_VISIBILITY("default")
-#    define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS
+#    define _LIBCUDACXX_HIDDEN _LIBCUDACXX_VISIBILITY("hidden")
+#    define _LIBCUDACXX_FUNC_VIS _LIBCUDACXX_VISIBILITY("default")
+#    define _LIBCUDACXX_TYPE_VIS _LIBCUDACXX_VISIBILITY("default")
+#    define _LIBCUDACXX_TEMPLATE_DATA_VIS _LIBCUDACXX_VISIBILITY("default")
+#    define _LIBCUDACXX_EXPORTED_FROM_ABI _LIBCUDACXX_VISIBILITY("default")
+#    define _LIBCUDACXX_EXCEPTION_ABI _LIBCUDACXX_VISIBILITY("default")
+#    define _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS _LIBCUDACXX_VISIBILITY("default")
+#    define _LIBCUDACXX_CLASS_TEMPLATE_INSTANTIATION_VIS
 
 // TODO: Make this a proper customization point or remove the option to override it.
-#    ifndef _LIBCPP_OVERRIDABLE_FUNC_VIS
-#      define _LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_VISIBILITY("default")
+#    ifndef _LIBCUDACXX_OVERRIDABLE_FUNC_VIS
+#      define _LIBCUDACXX_OVERRIDABLE_FUNC_VIS _LIBCUDACXX_VISIBILITY("default")
 #    endif
 
-#    if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
+#    if !defined(_LIBCUDACXX_DISABLE_VISIBILITY_ANNOTATIONS)
 // The inline should be removed once PR32114 is resolved
-#      define _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS inline _LIBCPP_HIDDEN
+#      define _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS inline _LIBCUDACXX_HIDDEN
 #    else
-#      define _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
+#      define _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
 #    endif
 
-#    if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
+#    if !defined(_LIBCUDACXX_DISABLE_VISIBILITY_ANNOTATIONS)
 #      if __has_attribute(__type_visibility__)
-#        define _LIBCPP_TEMPLATE_VIS __attribute__((__type_visibility__("default")))
+#        define _LIBCUDACXX_TEMPLATE_VIS __attribute__((__type_visibility__("default")))
 #      else
-#        define _LIBCPP_TEMPLATE_VIS __attribute__((__visibility__("default")))
+#        define _LIBCUDACXX_TEMPLATE_VIS __attribute__((__visibility__("default")))
 #      endif
 #    else
-#      define _LIBCPP_TEMPLATE_VIS
+#      define _LIBCUDACXX_TEMPLATE_VIS
 #    endif
 
-#    if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) && __has_attribute(__type_visibility__)
-#      define _LIBCPP_ENUM_VIS __attribute__((__type_visibility__("default")))
+#    if !defined(_LIBCUDACXX_DISABLE_VISIBILITY_ANNOTATIONS) && __has_attribute(__type_visibility__)
+#      define _LIBCUDACXX_ENUM_VIS __attribute__((__type_visibility__("default")))
 #    else
-#      define _LIBCPP_ENUM_VIS
+#      define _LIBCUDACXX_ENUM_VIS
 #    endif
 
-#  endif // defined(_LIBCPP_OBJECT_FORMAT_COFF)
+#  endif // defined(_LIBCUDACXX_OBJECT_FORMAT_COFF)
 
 #  if __has_attribute(exclude_from_explicit_instantiation)
-#    define _LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION __attribute__((__exclude_from_explicit_instantiation__))
+#    define _LIBCUDACXX_EXCLUDE_FROM_EXPLICIT_INSTANTIATION __attribute__((__exclude_from_explicit_instantiation__))
 #  else
 // Try to approximate the effect of exclude_from_explicit_instantiation
 // (which is that entities are not assumed to be provided by explicit
 // template instantiations in the dylib) by always inlining those entities.
-#    define _LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION _LIBCPP_ALWAYS_INLINE
+#    define _LIBCUDACXX_EXCLUDE_FROM_EXPLICIT_INSTANTIATION _LIBCUDACXX_ALWAYS_INLINE
 #  endif
 
 // This macro marks a symbol as being hidden from libc++'s ABI. This is achieved
@@ -624,112 +624,112 @@ typedef __char32_t char32_t;
 //    all functions or giving internal linkage to all functions. Both these (previous) solutions
 //    suffer from drawbacks that lead notably to code bloat.
 //
-// Note that we use _LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION to ensure that we don't depend
-// on _LIBCPP_HIDE_FROM_ABI methods of classes explicitly instantiated in the dynamic library.
+// Note that we use _LIBCUDACXX_EXCLUDE_FROM_EXPLICIT_INSTANTIATION to ensure that we don't depend
+// on _LIBCUDACXX_HIDE_FROM_ABI methods of classes explicitly instantiated in the dynamic library.
 //
-// TODO: We provide a escape hatch with _LIBCPP_NO_ABI_TAG for folks who want to avoid increasing
+// TODO: We provide a escape hatch with _LIBCUDACXX_NO_ABI_TAG for folks who want to avoid increasing
 //       the length of symbols with an ABI tag. In practice, we should remove the escape hatch and
 //       use compression mangling instead, see https://github.com/itanium-cxx-abi/cxx-abi/issues/70.
-#  ifndef _LIBCPP_NO_ABI_TAG
-#    define _LIBCPP_HIDE_FROM_ABI                                                                                      \
-      _LIBCPP_HIDDEN _LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION                                                       \
-          __attribute__((__abi_tag__(_LIBCPP_TOSTRING(_LIBCPP_VERSIONED_IDENTIFIER))))
+#  ifndef _LIBCUDACXX_NO_ABI_TAG
+#    define _LIBCUDACXX_HIDE_FROM_ABI                                                                                      \
+      _LIBCUDACXX_HIDDEN _LIBCUDACXX_EXCLUDE_FROM_EXPLICIT_INSTANTIATION                                                       \
+          __attribute__((__abi_tag__(_LIBCUDACXX_TOSTRING(_LIBCUDACXX_VERSIONED_IDENTIFIER))))
 #  else
-#    define _LIBCPP_HIDE_FROM_ABI _LIBCPP_HIDDEN _LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION
+#    define _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_HIDDEN _LIBCUDACXX_EXCLUDE_FROM_EXPLICIT_INSTANTIATION
 #  endif
 
-#  ifdef _LIBCPP_BUILDING_LIBRARY
-#    if _LIBCPP_ABI_VERSION > 1
-#      define _LIBCPP_HIDE_FROM_ABI_AFTER_V1 _LIBCPP_HIDE_FROM_ABI
+#  ifdef _LIBCUDACXX_BUILDING_LIBRARY
+#    if _LIBCUDACXX_ABI_VERSION > 1
+#      define _LIBCUDACXX_HIDE_FROM_ABI_AFTER_V1 _LIBCUDACXX_HIDE_FROM_ABI
 #    else
-#      define _LIBCPP_HIDE_FROM_ABI_AFTER_V1
+#      define _LIBCUDACXX_HIDE_FROM_ABI_AFTER_V1
 #    endif
 #  else
-#    define _LIBCPP_HIDE_FROM_ABI_AFTER_V1 _LIBCPP_HIDE_FROM_ABI
+#    define _LIBCUDACXX_HIDE_FROM_ABI_AFTER_V1 _LIBCUDACXX_HIDE_FROM_ABI
 #  endif
 
 // Just so we can migrate to the new macros gradually.
-#  define _LIBCPP_INLINE_VISIBILITY _LIBCPP_HIDE_FROM_ABI
+#  define _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_HIDE_FROM_ABI
 
 // Inline namespaces are available in Clang/GCC/MSVC regardless of C++ dialect.
 // clang-format off
-#  define _LIBCPP_BEGIN_NAMESPACE_STD namespace std { inline namespace _LIBCPP_ABI_NAMESPACE {
-#  define _LIBCPP_END_NAMESPACE_STD }}
-#  define _VSTD std
+#  define _LIBCUDACXX_BEGIN_NAMESPACE_STD namespace std { inline namespace _LIBCUDACXX_ABI_NAMESPACE {
+#  define _LIBCUDACXX_END_NAMESPACE_STD }}
+#  define _CUDA_VSTD std
 
-_LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD _LIBCUDACXX_END_NAMESPACE_STD
 
-#  if _LIBCPP_STD_VER > 14
-#    define _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM                                                                         \
-       _LIBCPP_BEGIN_NAMESPACE_STD inline namespace __fs { namespace filesystem {
+#  if _LIBCUDACXX_STD_VER > 14
+#    define _LIBCUDACXX_BEGIN_NAMESPACE_FILESYSTEM                                                                         \
+       _LIBCUDACXX_BEGIN_NAMESPACE_STD inline namespace __fs { namespace filesystem {
 #  else
-#    define _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM                                                                         \
-      _LIBCPP_BEGIN_NAMESPACE_STD namespace __fs { namespace filesystem {
+#    define _LIBCUDACXX_BEGIN_NAMESPACE_FILESYSTEM                                                                         \
+      _LIBCUDACXX_BEGIN_NAMESPACE_STD namespace __fs { namespace filesystem {
 #  endif
 
-#  define _LIBCPP_END_NAMESPACE_FILESYSTEM _LIBCPP_END_NAMESPACE_STD }}
+#  define _LIBCUDACXX_END_NAMESPACE_FILESYSTEM _LIBCUDACXX_END_NAMESPACE_STD }}
 // clang-format on
 
 #  define _VSTD_FS std::__fs::filesystem
 
 #  if __has_attribute(__enable_if__)
-#    define _LIBCPP_PREFERRED_OVERLOAD __attribute__((__enable_if__(true, "")))
+#    define _LIBCUDACXX_PREFERRED_OVERLOAD __attribute__((__enable_if__(true, "")))
 #  endif
 
 #  ifndef __SIZEOF_INT128__
-#    define _LIBCPP_HAS_NO_INT128
+#    define _LIBCUDACXX_HAS_NO_INT128
 #  endif
 
-#  ifdef _LIBCPP_CXX03_LANG
+#  ifdef _LIBCUDACXX_CXX03_LANG
 #    define static_assert(...) _Static_assert(__VA_ARGS__)
 #    define decltype(...) __decltype(__VA_ARGS__)
-#  endif // _LIBCPP_CXX03_LANG
+#  endif // _LIBCUDACXX_CXX03_LANG
 
-#  ifdef _LIBCPP_CXX03_LANG
-#    define _LIBCPP_CONSTEXPR
+#  ifdef _LIBCUDACXX_CXX03_LANG
+#    define _LIBCUDACXX_CONSTEXPR
 #  else
-#    define _LIBCPP_CONSTEXPR constexpr
+#    define _LIBCUDACXX_CONSTEXPR constexpr
 #  endif
 
 #  ifndef __cpp_consteval
-#    define _LIBCPP_CONSTEVAL _LIBCPP_CONSTEXPR
+#    define _LIBCUDACXX_CONSTEVAL _LIBCUDACXX_CONSTEXPR
 #  else
-#    define _LIBCPP_CONSTEVAL consteval
+#    define _LIBCUDACXX_CONSTEVAL consteval
 #  endif
 
 #  ifdef __GNUC__
-#    define _LIBCPP_NOALIAS __attribute__((__malloc__))
+#    define _LIBCUDACXX_NOALIAS __attribute__((__malloc__))
 #  else
-#    define _LIBCPP_NOALIAS
+#    define _LIBCUDACXX_NOALIAS
 #  endif
 
 #  if __has_attribute(using_if_exists)
-#    define _LIBCPP_USING_IF_EXISTS __attribute__((using_if_exists))
+#    define _LIBCUDACXX_USING_IF_EXISTS __attribute__((using_if_exists))
 #  else
-#    define _LIBCPP_USING_IF_EXISTS
+#    define _LIBCUDACXX_USING_IF_EXISTS
 #  endif
 
-#  ifdef _LIBCPP_CXX03_LANG
-#    define _LIBCPP_DECLARE_STRONG_ENUM(x)                                                                             \
-      struct _LIBCPP_TYPE_VIS x {                                                                                      \
+#  ifdef _LIBCUDACXX_CXX03_LANG
+#    define _LIBCUDACXX_DECLARE_STRONG_ENUM(x)                                                                             \
+      struct _LIBCUDACXX_TYPE_VIS x {                                                                                      \
         enum __lx
 // clang-format off
-#    define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x)                                                                      \
+#    define _LIBCUDACXX_DECLARE_STRONG_ENUM_EPILOG(x)                                                                      \
       __lx __v_;                                                                                                       \
-      _LIBCPP_INLINE_VISIBILITY x(__lx __v) : __v_(__v) {}                                                             \
-      _LIBCPP_INLINE_VISIBILITY explicit x(int __v) : __v_(static_cast<__lx>(__v)) {}                                  \
-      _LIBCPP_INLINE_VISIBILITY operator int() const { return __v_; }                                                  \
+      _LIBCUDACXX_INLINE_VISIBILITY x(__lx __v) : __v_(__v) {}                                                             \
+      _LIBCUDACXX_INLINE_VISIBILITY explicit x(int __v) : __v_(static_cast<__lx>(__v)) {}                                  \
+      _LIBCUDACXX_INLINE_VISIBILITY operator int() const { return __v_; }                                                  \
       };
 // clang-format on
 
-#  else // _LIBCPP_CXX03_LANG
-#    define _LIBCPP_DECLARE_STRONG_ENUM(x) enum class _LIBCPP_ENUM_VIS x
-#    define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x)
-#  endif // _LIBCPP_CXX03_LANG
+#  else // _LIBCUDACXX_CXX03_LANG
+#    define _LIBCUDACXX_DECLARE_STRONG_ENUM(x) enum class _LIBCUDACXX_ENUM_VIS x
+#    define _LIBCUDACXX_DECLARE_STRONG_ENUM_EPILOG(x)
+#  endif // _LIBCUDACXX_CXX03_LANG
 
-#  if defined(__APPLE__) || defined(__FreeBSD__) || defined(_LIBCPP_MSVCRT_LIKE) || defined(__sun__) ||                \
+#  if defined(__APPLE__) || defined(__FreeBSD__) || defined(_LIBCUDACXX_MSVCRT_LIKE) || defined(__sun__) ||                \
       defined(__NetBSD__)
-#    define _LIBCPP_LOCALE__L_EXTENSIONS 1
+#    define _LIBCUDACXX_LOCALE__L_EXTENSIONS 1
 #  endif
 
 #  ifdef __FreeBSD__
@@ -738,168 +738,168 @@ _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD
 
 // If we are getting operator new from the MSVC CRT, then allocation overloads
 // for align_val_t were added in 19.12, aka VS 2017 version 15.3.
-#  if defined(_LIBCPP_MSVCRT) && defined(_MSC_VER) && _MSC_VER < 1912
-#    define _LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION
-#  elif defined(_LIBCPP_ABI_VCRUNTIME) && !defined(__cpp_aligned_new)
+#  if defined(_LIBCUDACXX_MSVCRT) && defined(_MSC_VER) && _MSC_VER < 1912
+#    define _LIBCUDACXX_HAS_NO_LIBRARY_ALIGNED_ALLOCATION
+#  elif defined(_LIBCUDACXX_ABI_VCRUNTIME) && !defined(__cpp_aligned_new)
 // We're deferring to Microsoft's STL to provide aligned new et al. We don't
 // have it unless the language feature test macro is defined.
-#    define _LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION
+#    define _LIBCUDACXX_HAS_NO_LIBRARY_ALIGNED_ALLOCATION
 #  elif defined(__MVS__)
-#    define _LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION
+#    define _LIBCUDACXX_HAS_NO_LIBRARY_ALIGNED_ALLOCATION
 #  endif
 
-#  if defined(_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION) || (!defined(__cpp_aligned_new) || __cpp_aligned_new < 201606)
-#    define _LIBCPP_HAS_NO_ALIGNED_ALLOCATION
+#  if defined(_LIBCUDACXX_HAS_NO_LIBRARY_ALIGNED_ALLOCATION) || (!defined(__cpp_aligned_new) || __cpp_aligned_new < 201606)
+#    define _LIBCUDACXX_HAS_NO_ALIGNED_ALLOCATION
 #  endif
 
 #  if defined(__APPLE__) || defined(__FreeBSD__)
-#    define _LIBCPP_HAS_DEFAULTRUNELOCALE
+#    define _LIBCUDACXX_HAS_DEFAULTRUNELOCALE
 #  endif
 
 #  if defined(__APPLE__) || defined(__FreeBSD__) || defined(__sun__)
-#    define _LIBCPP_WCTYPE_IS_MASK
+#    define _LIBCUDACXX_WCTYPE_IS_MASK
 #  endif
 
-#  if _LIBCPP_STD_VER <= 17 || !defined(__cpp_char8_t)
-#    define _LIBCPP_HAS_NO_CHAR8_T
+#  if _LIBCUDACXX_STD_VER <= 17 || !defined(__cpp_char8_t)
+#    define _LIBCUDACXX_HAS_NO_CHAR8_T
 #  endif
 
 // Deprecation macros.
 //
 // Deprecations warnings are always enabled, except when users explicitly opt-out
-// by defining _LIBCPP_DISABLE_DEPRECATION_WARNINGS.
-#  if !defined(_LIBCPP_DISABLE_DEPRECATION_WARNINGS)
+// by defining _LIBCUDACXX_DISABLE_DEPRECATION_WARNINGS.
+#  if !defined(_LIBCUDACXX_DISABLE_DEPRECATION_WARNINGS)
 #    if __has_attribute(deprecated)
-#      define _LIBCPP_DEPRECATED __attribute__((deprecated))
-#      define _LIBCPP_DEPRECATED_(m) __attribute__((deprected(m)))
-#    elif _LIBCPP_STD_VER > 11
-#      define _LIBCPP_DEPRECATED [[deprecated]]
-#      define _LIBCPP_DEPRECATED_(m) [[deprecated(m)]]
+#      define _LIBCUDACXX_DEPRECATED __attribute__((deprecated))
+#      define _LIBCUDACXX_DEPRECATED_(m) __attribute__((deprected(m)))
+#    elif _LIBCUDACXX_STD_VER > 11
+#      define _LIBCUDACXX_DEPRECATED [[deprecated]]
+#      define _LIBCUDACXX_DEPRECATED_(m) [[deprecated(m)]]
 #    else
-#      define _LIBCPP_DEPRECATED
-#      define _LIBCPP_DEPRECATED_(m)
+#      define _LIBCUDACXX_DEPRECATED
+#      define _LIBCUDACXX_DEPRECATED_(m)
 #    endif
 #  else
-#    define _LIBCPP_DEPRECATED
-#    define _LIBCPP_DEPRECATED_(m)
+#    define _LIBCUDACXX_DEPRECATED
+#    define _LIBCUDACXX_DEPRECATED_(m)
 #  endif
 
-#  if !defined(_LIBCPP_CXX03_LANG)
-#    define _LIBCPP_DEPRECATED_IN_CXX11 _LIBCPP_DEPRECATED
+#  if !defined(_LIBCUDACXX_CXX03_LANG)
+#    define _LIBCUDACXX_DEPRECATED_IN_CXX11 _LIBCUDACXX_DEPRECATED
 #  else
-#    define _LIBCPP_DEPRECATED_IN_CXX11
+#    define _LIBCUDACXX_DEPRECATED_IN_CXX11
 #  endif
 
-#  if _LIBCPP_STD_VER > 11
-#    define _LIBCPP_DEPRECATED_IN_CXX14 _LIBCPP_DEPRECATED
+#  if _LIBCUDACXX_STD_VER > 11
+#    define _LIBCUDACXX_DEPRECATED_IN_CXX14 _LIBCUDACXX_DEPRECATED
 #  else
-#    define _LIBCPP_DEPRECATED_IN_CXX14
+#    define _LIBCUDACXX_DEPRECATED_IN_CXX14
 #  endif
 
-#  if _LIBCPP_STD_VER > 14
-#    define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
+#  if _LIBCUDACXX_STD_VER > 14
+#    define _LIBCUDACXX_DEPRECATED_IN_CXX17 _LIBCUDACXX_DEPRECATED
 #  else
-#    define _LIBCPP_DEPRECATED_IN_CXX17
+#    define _LIBCUDACXX_DEPRECATED_IN_CXX17
 #  endif
 
-#  if _LIBCPP_STD_VER > 17
-#    define _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_DEPRECATED
+#  if _LIBCUDACXX_STD_VER > 17
+#    define _LIBCUDACXX_DEPRECATED_IN_CXX20 _LIBCUDACXX_DEPRECATED
 #  else
-#    define _LIBCPP_DEPRECATED_IN_CXX20
+#    define _LIBCUDACXX_DEPRECATED_IN_CXX20
 #  endif
 
-#  if !defined(_LIBCPP_HAS_NO_CHAR8_T)
-#    define _LIBCPP_DEPRECATED_WITH_CHAR8_T _LIBCPP_DEPRECATED
+#  if !defined(_LIBCUDACXX_HAS_NO_CHAR8_T)
+#    define _LIBCUDACXX_DEPRECATED_WITH_CHAR8_T _LIBCUDACXX_DEPRECATED
 #  else
-#    define _LIBCPP_DEPRECATED_WITH_CHAR8_T
+#    define _LIBCUDACXX_DEPRECATED_WITH_CHAR8_T
 #  endif
 
 // Macros to enter and leave a state where deprecation warnings are suppressed.
-#  if defined(_LIBCPP_COMPILER_CLANG_BASED) || defined(_LIBCPP_COMPILER_GCC)
-#    define _LIBCPP_SUPPRESS_DEPRECATED_PUSH                                                                           \
+#  if defined(_LIBCUDACXX_COMPILER_CLANG_BASED) || defined(_LIBCUDACXX_COMPILER_GCC)
+#    define _LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH                                                                           \
       _Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wdeprecated\"")                                \
           _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
-#    define _LIBCPP_SUPPRESS_DEPRECATED_POP _Pragma("GCC diagnostic pop")
+#    define _LIBCUDACXX_SUPPRESS_DEPRECATED_POP _Pragma("GCC diagnostic pop")
 #  else
-#    define _LIBCPP_SUPPRESS_DEPRECATED_PUSH
-#    define _LIBCPP_SUPPRESS_DEPRECATED_POP
+#    define _LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
+#    define _LIBCUDACXX_SUPPRESS_DEPRECATED_POP
 #  endif
 
-#  if _LIBCPP_STD_VER <= 11
-#    define _LIBCPP_EXPLICIT_AFTER_CXX11
+#  if _LIBCUDACXX_STD_VER <= 11
+#    define _LIBCUDACXX_EXPLICIT_AFTER_CXX11
 #  else
-#    define _LIBCPP_EXPLICIT_AFTER_CXX11 explicit
+#    define _LIBCUDACXX_EXPLICIT_AFTER_CXX11 explicit
 #  endif
 
-#  if _LIBCPP_STD_VER > 11
-#    define _LIBCPP_CONSTEXPR_AFTER_CXX11 constexpr
+#  if _LIBCUDACXX_STD_VER > 11
+#    define _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 constexpr
 #  else
-#    define _LIBCPP_CONSTEXPR_AFTER_CXX11
+#    define _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 #  endif
 
-#  if _LIBCPP_STD_VER > 14
-#    define _LIBCPP_CONSTEXPR_AFTER_CXX14 constexpr
+#  if _LIBCUDACXX_STD_VER > 14
+#    define _LIBCUDACXX_CONSTEXPR_AFTER_CXX14 constexpr
 #  else
-#    define _LIBCPP_CONSTEXPR_AFTER_CXX14
+#    define _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 #  endif
 
-#  if _LIBCPP_STD_VER > 17
-#    define _LIBCPP_CONSTEXPR_AFTER_CXX17 constexpr
+#  if _LIBCUDACXX_STD_VER > 17
+#    define _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 constexpr
 #  else
-#    define _LIBCPP_CONSTEXPR_AFTER_CXX17
+#    define _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 #  endif
 
-#  if __has_cpp_attribute(nodiscard) || defined(_LIBCPP_COMPILER_MSVC)
-#    define _LIBCPP_NODISCARD [[nodiscard]]
-#  elif defined(_LIBCPP_COMPILER_CLANG_BASED) && !defined(_LIBCPP_CXX03_LANG)
-#    define _LIBCPP_NODISCARD [[clang::warn_unused_result]]
+#  if __has_cpp_attribute(nodiscard) || defined(_LIBCUDACXX_COMPILER_MSVC)
+#    define _LIBCUDACXX_NODISCARD [[nodiscard]]
+#  elif defined(_LIBCUDACXX_COMPILER_CLANG_BASED) && !defined(_LIBCUDACXX_CXX03_LANG)
+#    define _LIBCUDACXX_NODISCARD [[clang::warn_unused_result]]
 #  else
 // We can't use GCC's [[gnu::warn_unused_result]] and
 // __attribute__((warn_unused_result)), because GCC does not silence them via
 // (void) cast.
-#    define _LIBCPP_NODISCARD
+#    define _LIBCUDACXX_NODISCARD
 #  endif
 
-// _LIBCPP_NODISCARD_EXT may be used to apply [[nodiscard]] to entities not
+// _LIBCUDACXX_NODISCARD_EXT may be used to apply [[nodiscard]] to entities not
 // specified as such as an extension.
-#  if defined(_LIBCPP_ENABLE_NODISCARD) && !defined(_LIBCPP_DISABLE_NODISCARD_EXT)
-#    define _LIBCPP_NODISCARD_EXT _LIBCPP_NODISCARD
+#  if defined(_LIBCUDACXX_ENABLE_NODISCARD) && !defined(_LIBCUDACXX_DISABLE_NODISCARD_EXT)
+#    define _LIBCUDACXX_NODISCARD_EXT _LIBCUDACXX_NODISCARD
 #  else
-#    define _LIBCPP_NODISCARD_EXT
+#    define _LIBCUDACXX_NODISCARD_EXT
 #  endif
 
-#  if !defined(_LIBCPP_DISABLE_NODISCARD_AFTER_CXX17) && (_LIBCPP_STD_VER > 17 || defined(_LIBCPP_ENABLE_NODISCARD))
-#    define _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_NODISCARD
+#  if !defined(_LIBCUDACXX_DISABLE_NODISCARD_AFTER_CXX17) && (_LIBCUDACXX_STD_VER > 17 || defined(_LIBCUDACXX_ENABLE_NODISCARD))
+#    define _LIBCUDACXX_NODISCARD_AFTER_CXX17 _LIBCUDACXX_NODISCARD
 #  else
-#    define _LIBCPP_NODISCARD_AFTER_CXX17
+#    define _LIBCUDACXX_NODISCARD_AFTER_CXX17
 #  endif
 
 #  if __has_attribute(no_destroy)
-#    define _LIBCPP_NO_DESTROY __attribute__((__no_destroy__))
+#    define _LIBCUDACXX_NO_DESTROY __attribute__((__no_destroy__))
 #  else
-#    define _LIBCPP_NO_DESTROY
+#    define _LIBCUDACXX_NO_DESTROY
 #  endif
 
-#  ifndef _LIBCPP_HAS_NO_ASAN
-    extern "C" _LIBCPP_FUNC_VIS void
+#  ifndef _LIBCUDACXX_HAS_NO_ASAN
+    extern "C" _LIBCUDACXX_FUNC_VIS void
     __sanitizer_annotate_contiguous_container(const void*, const void*, const void*, const void*);
 #  endif
 
 // Try to find out if RTTI is disabled.
 #  if !defined(__cpp_rtti) || __cpp_rtti < 199711L
-#    define _LIBCPP_NO_RTTI
+#    define _LIBCUDACXX_NO_RTTI
 #  endif
 
-#  ifndef _LIBCPP_WEAK
-#    define _LIBCPP_WEAK __attribute__((__weak__))
+#  ifndef _LIBCUDACXX_WEAK
+#    define _LIBCUDACXX_WEAK __attribute__((__weak__))
 #  endif
 
 // Thread API
 // clang-format off
-#  if !defined(_LIBCPP_HAS_NO_THREADS) &&                                                                              \
-      !defined(_LIBCPP_HAS_THREAD_API_PTHREAD) &&                                                                      \
-      !defined(_LIBCPP_HAS_THREAD_API_WIN32) &&                                                                        \
-      !defined(_LIBCPP_HAS_THREAD_API_EXTERNAL)
+#  if !defined(_LIBCUDACXX_HAS_NO_THREADS) &&                                                                              \
+      !defined(_LIBCUDACXX_HAS_THREAD_API_PTHREAD) &&                                                                      \
+      !defined(_LIBCUDACXX_HAS_THREAD_API_WIN32) &&                                                                        \
+      !defined(_LIBCUDACXX_HAS_THREAD_API_EXTERNAL)
 
 #    if defined(__FreeBSD__) ||                                                                                        \
         defined(__wasi__) ||                                                                                           \
@@ -914,43 +914,43 @@ _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD
         defined(_AIX) ||                                                                                               \
         defined(__EMSCRIPTEN__)
 // clang-format on
-#      define _LIBCPP_HAS_THREAD_API_PTHREAD
+#      define _LIBCUDACXX_HAS_THREAD_API_PTHREAD
 #    elif defined(__Fuchsia__)
 // TODO(44575): Switch to C11 thread API when possible.
-#      define _LIBCPP_HAS_THREAD_API_PTHREAD
-#    elif defined(_LIBCPP_WIN32API)
-#      define _LIBCPP_HAS_THREAD_API_WIN32
+#      define _LIBCUDACXX_HAS_THREAD_API_PTHREAD
+#    elif defined(_LIBCUDACXX_WIN32API)
+#      define _LIBCUDACXX_HAS_THREAD_API_WIN32
 #    else
 #      error "No thread API"
-#    endif // _LIBCPP_HAS_THREAD_API
-#  endif   // _LIBCPP_HAS_NO_THREADS
+#    endif // _LIBCUDACXX_HAS_THREAD_API
+#  endif   // _LIBCUDACXX_HAS_NO_THREADS
 
-#  if defined(_LIBCPP_HAS_THREAD_API_PTHREAD)
+#  if defined(_LIBCUDACXX_HAS_THREAD_API_PTHREAD)
 #    if defined(__ANDROID__) && __ANDROID_API__ >= 30
-#      define _LIBCPP_HAS_COND_CLOCKWAIT
-#    elif defined(_LIBCPP_GLIBC_PREREQ)
-#      if _LIBCPP_GLIBC_PREREQ(2, 30)
-#        define _LIBCPP_HAS_COND_CLOCKWAIT
+#      define _LIBCUDACXX_HAS_COND_CLOCKWAIT
+#    elif defined(_LIBCUDACXX_GLIBC_PREREQ)
+#      if _LIBCUDACXX_GLIBC_PREREQ(2, 30)
+#        define _LIBCUDACXX_HAS_COND_CLOCKWAIT
 #      endif
 #    endif
 #  endif
 
-#  if defined(_LIBCPP_HAS_NO_THREADS) && defined(_LIBCPP_HAS_THREAD_API_PTHREAD)
-#    error _LIBCPP_HAS_THREAD_API_PTHREAD may only be defined when \
-       _LIBCPP_HAS_NO_THREADS is not defined.
+#  if defined(_LIBCUDACXX_HAS_NO_THREADS) && defined(_LIBCUDACXX_HAS_THREAD_API_PTHREAD)
+#    error _LIBCUDACXX_HAS_THREAD_API_PTHREAD may only be defined when \
+       _LIBCUDACXX_HAS_NO_THREADS is not defined.
 #  endif
 
-#  if defined(_LIBCPP_HAS_NO_THREADS) && defined(_LIBCPP_HAS_THREAD_API_EXTERNAL)
-#    error _LIBCPP_HAS_THREAD_API_EXTERNAL may not be defined when \
-       _LIBCPP_HAS_NO_THREADS is defined.
+#  if defined(_LIBCUDACXX_HAS_NO_THREADS) && defined(_LIBCUDACXX_HAS_THREAD_API_EXTERNAL)
+#    error _LIBCUDACXX_HAS_THREAD_API_EXTERNAL may not be defined when \
+       _LIBCUDACXX_HAS_NO_THREADS is defined.
 #  endif
 
-#  if defined(_LIBCPP_HAS_NO_MONOTONIC_CLOCK) && !defined(_LIBCPP_HAS_NO_THREADS)
-#    error _LIBCPP_HAS_NO_MONOTONIC_CLOCK may only be defined when \
-       _LIBCPP_HAS_NO_THREADS is defined.
+#  if defined(_LIBCUDACXX_HAS_NO_MONOTONIC_CLOCK) && !defined(_LIBCUDACXX_HAS_NO_THREADS)
+#    error _LIBCUDACXX_HAS_NO_MONOTONIC_CLOCK may only be defined when \
+       _LIBCUDACXX_HAS_NO_THREADS is defined.
 #  endif
 
-#  if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(__STDCPP_THREADS__)
+#  if !defined(_LIBCUDACXX_HAS_NO_THREADS) && !defined(__STDCPP_THREADS__)
 #    define __STDCPP_THREADS__ 1
 #  endif
 
@@ -965,11 +965,11 @@ _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD
 // TODO(EricWF): Enable this optimization on Bionic after speaking to their
 //               respective stakeholders.
 // clang-format off
-#  if (defined(_LIBCPP_HAS_THREAD_API_PTHREAD) && defined(__GLIBC__)) ||                                               \
-      (defined(_LIBCPP_HAS_THREAD_API_C11) && defined(__Fuchsia__)) ||                                                 \
-       defined(_LIBCPP_HAS_THREAD_API_WIN32)
+#  if (defined(_LIBCUDACXX_HAS_THREAD_API_PTHREAD) && defined(__GLIBC__)) ||                                               \
+      (defined(_LIBCUDACXX_HAS_THREAD_API_C11) && defined(__Fuchsia__)) ||                                                 \
+       defined(_LIBCUDACXX_HAS_THREAD_API_WIN32)
 // clang-format on
-#    define _LIBCPP_HAS_TRIVIAL_MUTEX_DESTRUCTION
+#    define _LIBCUDACXX_HAS_TRIVIAL_MUTEX_DESTRUCTION
 #  endif
 
 // Destroying a condvar is a nop on Windows.
@@ -980,152 +980,152 @@ _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD
 //
 // TODO(EricWF): This is potentially true for some pthread implementations
 // as well.
-#  if (defined(_LIBCPP_HAS_THREAD_API_C11) && defined(__Fuchsia__)) || defined(_LIBCPP_HAS_THREAD_API_WIN32)
-#    define _LIBCPP_HAS_TRIVIAL_CONDVAR_DESTRUCTION
+#  if (defined(_LIBCUDACXX_HAS_THREAD_API_C11) && defined(__Fuchsia__)) || defined(_LIBCUDACXX_HAS_THREAD_API_WIN32)
+#    define _LIBCUDACXX_HAS_TRIVIAL_CONDVAR_DESTRUCTION
 #  endif
 
 // Some systems do not provide gets() in their C library, for security reasons.
-#  if defined(_LIBCPP_MSVCRT) || (defined(__FreeBSD_version) && __FreeBSD_version >= 1300043) || defined(__OpenBSD__)
-#    define _LIBCPP_C_HAS_NO_GETS
+#  if defined(_LIBCUDACXX_MSVCRT) || (defined(__FreeBSD_version) && __FreeBSD_version >= 1300043) || defined(__OpenBSD__)
+#    define _LIBCUDACXX_C_HAS_NO_GETS
 #  endif
 
 #  if defined(__BIONIC__) || defined(__NuttX__) || defined(__Fuchsia__) || defined(__wasi__) ||                        \
-      defined(_LIBCPP_HAS_MUSL_LIBC) || defined(__OpenBSD__)
-#    define _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE
+      defined(_LIBCUDACXX_HAS_MUSL_LIBC) || defined(__OpenBSD__)
+#    define _LIBCUDACXX_PROVIDES_DEFAULT_RUNE_TABLE
 #  endif
 
 #  if __has_feature(cxx_atomic) || __has_extension(c_atomic) || __has_keyword(_Atomic)
-#    define _LIBCPP_HAS_C_ATOMIC_IMP
-#  elif defined(_LIBCPP_COMPILER_GCC)
-#    define _LIBCPP_HAS_GCC_ATOMIC_IMP
+#    define _LIBCUDACXX_HAS_C_ATOMIC_IMP
+#  elif defined(_LIBCUDACXX_COMPILER_GCC)
+#    define _LIBCUDACXX_HAS_GCC_ATOMIC_IMP
 #  endif
 
-#  if !defined(_LIBCPP_HAS_C_ATOMIC_IMP) && !defined(_LIBCPP_HAS_GCC_ATOMIC_IMP) &&                                    \
-      !defined(_LIBCPP_HAS_EXTERNAL_ATOMIC_IMP)
-#    define _LIBCPP_HAS_NO_ATOMIC_HEADER
+#  if !defined(_LIBCUDACXX_HAS_C_ATOMIC_IMP) && !defined(_LIBCUDACXX_HAS_GCC_ATOMIC_IMP) &&                                    \
+      !defined(_LIBCUDACXX_HAS_EXTERNAL_ATOMIC_IMP)
+#    define _LIBCUDACXX_HAS_NO_ATOMIC_HEADER
 #  else
-#    ifndef _LIBCPP_ATOMIC_FLAG_TYPE
-#      define _LIBCPP_ATOMIC_FLAG_TYPE bool
+#    ifndef _LIBCUDACXX_ATOMIC_FLAG_TYPE
+#      define _LIBCUDACXX_ATOMIC_FLAG_TYPE bool
 #    endif
-#    ifdef _LIBCPP_FREESTANDING
-#      define _LIBCPP_ATOMIC_ONLY_USE_BUILTINS
+#    ifdef _LIBCUDACXX_FREESTANDING
+#      define _LIBCUDACXX_ATOMIC_ONLY_USE_BUILTINS
 #    endif
 #  endif
 
-#  ifndef _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
-#    define _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
+#  ifndef _LIBCUDACXX_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
+#    define _LIBCUDACXX_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
 #  endif
 
-#  if defined(_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS)
+#  if defined(_LIBCUDACXX_ENABLE_THREAD_SAFETY_ANNOTATIONS)
 #    if defined(__clang__) && __has_attribute(acquire_capability)
 // Work around the attribute handling in clang.  When both __declspec and
 // __attribute__ are present, the processing goes awry preventing the definition
 // of the types. In MinGW mode, __declspec evaluates to __attribute__, and thus
 // combining the two does work.
 #      if !defined(_MSC_VER)
-#        define _LIBCPP_HAS_THREAD_SAFETY_ANNOTATIONS
+#        define _LIBCUDACXX_HAS_THREAD_SAFETY_ANNOTATIONS
 #      endif
 #    endif
 #  endif
 
-#  ifdef _LIBCPP_HAS_THREAD_SAFETY_ANNOTATIONS
-#    define _LIBCPP_THREAD_SAFETY_ANNOTATION(x) __attribute__((x))
+#  ifdef _LIBCUDACXX_HAS_THREAD_SAFETY_ANNOTATIONS
+#    define _LIBCUDACXX_THREAD_SAFETY_ANNOTATION(x) __attribute__((x))
 #  else
-#    define _LIBCPP_THREAD_SAFETY_ANNOTATION(x)
+#    define _LIBCUDACXX_THREAD_SAFETY_ANNOTATION(x)
 #  endif
 
-#  if _LIBCPP_STD_VER > 17
-#    define _LIBCPP_CONSTINIT constinit
+#  if _LIBCUDACXX_STD_VER > 17
+#    define _LIBCUDACXX_CONSTINIT constinit
 #  elif __has_attribute(require_constant_initialization)
-#    define _LIBCPP_CONSTINIT __attribute__((__require_constant_initialization__))
+#    define _LIBCUDACXX_CONSTINIT __attribute__((__require_constant_initialization__))
 #  else
-#    define _LIBCPP_CONSTINIT
+#    define _LIBCUDACXX_CONSTINIT
 #  endif
 
-#  if __has_attribute(diagnose_if) && !defined(_LIBCPP_DISABLE_ADDITIONAL_DIAGNOSTICS)
-#    define _LIBCPP_DIAGNOSE_WARNING(...) __attribute__((diagnose_if(__VA_ARGS__, "warning")))
-#    define _LIBCPP_DIAGNOSE_ERROR(...) __attribute__((diagnose_if(__VA_ARGS__, "error")))
+#  if __has_attribute(diagnose_if) && !defined(_LIBCUDACXX_DISABLE_ADDITIONAL_DIAGNOSTICS)
+#    define _LIBCUDACXX_DIAGNOSE_WARNING(...) __attribute__((diagnose_if(__VA_ARGS__, "warning")))
+#    define _LIBCUDACXX_DIAGNOSE_ERROR(...) __attribute__((diagnose_if(__VA_ARGS__, "error")))
 #  else
-#    define _LIBCPP_DIAGNOSE_WARNING(...)
-#    define _LIBCPP_DIAGNOSE_ERROR(...)
+#    define _LIBCUDACXX_DIAGNOSE_WARNING(...)
+#    define _LIBCUDACXX_DIAGNOSE_ERROR(...)
 #  endif
 
 // Use a function like macro to imply that it must be followed by a semicolon
 #  if __has_cpp_attribute(fallthrough)
-#    define _LIBCPP_FALLTHROUGH() [[fallthrough]]
+#    define _LIBCUDACXX_FALLTHROUGH() [[fallthrough]]
 #  elif __has_attribute(__fallthrough__)
-#    define _LIBCPP_FALLTHROUGH() __attribute__((__fallthrough__))
+#    define _LIBCUDACXX_FALLTHROUGH() __attribute__((__fallthrough__))
 #  else
-#    define _LIBCPP_FALLTHROUGH() ((void)0)
+#    define _LIBCUDACXX_FALLTHROUGH() ((void)0)
 #  endif
 
 #  if __has_attribute(__nodebug__)
-#    define _LIBCPP_NODEBUG __attribute__((__nodebug__))
+#    define _LIBCUDACXX_NODEBUG __attribute__((__nodebug__))
 #  else
-#    define _LIBCPP_NODEBUG
+#    define _LIBCUDACXX_NODEBUG
 #  endif
 
 #  if __has_attribute(__standalone_debug__)
-#    define _LIBCPP_STANDALONE_DEBUG __attribute__((__standalone_debug__))
+#    define _LIBCUDACXX_STANDALONE_DEBUG __attribute__((__standalone_debug__))
 #  else
-#    define _LIBCPP_STANDALONE_DEBUG
+#    define _LIBCUDACXX_STANDALONE_DEBUG
 #  endif
 
 #  if __has_attribute(__preferred_name__)
-#    define _LIBCPP_PREFERRED_NAME(x) __attribute__((__preferred_name__(x)))
+#    define _LIBCUDACXX_PREFERRED_NAME(x) __attribute__((__preferred_name__(x)))
 #  else
-#    define _LIBCPP_PREFERRED_NAME(x)
+#    define _LIBCUDACXX_PREFERRED_NAME(x)
 #  endif
 
 // We often repeat things just for handling wide characters in the library.
 // When wide characters are disabled, it can be useful to have a quick way of
 // disabling it without having to resort to #if-#endif, which has a larger
 // impact on readability.
-#  if defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS)
-#    define _LIBCPP_IF_WIDE_CHARACTERS(...)
+#  if defined(_LIBCUDACXX_HAS_NO_WIDE_CHARACTERS)
+#    define _LIBCUDACXX_IF_WIDE_CHARACTERS(...)
 #  else
-#    define _LIBCPP_IF_WIDE_CHARACTERS(...) __VA_ARGS__
+#    define _LIBCUDACXX_IF_WIDE_CHARACTERS(...) __VA_ARGS__
 #  endif
 
-#  if defined(_LIBCPP_ABI_MICROSOFT) && (defined(_LIBCPP_COMPILER_MSVC) || __has_declspec_attribute(empty_bases))
-#    define _LIBCPP_DECLSPEC_EMPTY_BASES __declspec(empty_bases)
+#  if defined(_LIBCUDACXX_ABI_MICROSOFT) && (defined(_LIBCUDACXX_COMPILER_MSVC) || __has_declspec_attribute(empty_bases))
+#    define _LIBCUDACXX_DECLSPEC_EMPTY_BASES __declspec(empty_bases)
 #  else
-#    define _LIBCPP_DECLSPEC_EMPTY_BASES
-#  endif
-
-#  if defined(_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES)
-#    define _LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR
-#    define _LIBCPP_ENABLE_CXX17_REMOVED_BINDERS
-#    define _LIBCPP_ENABLE_CXX17_REMOVED_RANDOM_SHUFFLE
-#    define _LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS
-#    define _LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION
-#  endif // _LIBCPP_ENABLE_CXX17_REMOVED_FEATURES
-
-#  if defined(_LIBCPP_ENABLE_CXX20_REMOVED_FEATURES)
-#    define _LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS
-#    define _LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_VOID_SPECIALIZATION
-#    define _LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS
-#    define _LIBCPP_ENABLE_CXX20_REMOVED_NEGATORS
-#    define _LIBCPP_ENABLE_CXX20_REMOVED_RAW_STORAGE_ITERATOR
-#    define _LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS
-#  endif // _LIBCPP_ENABLE_CXX20_REMOVED_FEATURES
+#    define _LIBCUDACXX_DECLSPEC_EMPTY_BASES
+#  endif
+
+#  if defined(_LIBCUDACXX_ENABLE_CXX17_REMOVED_FEATURES)
+#    define _LIBCUDACXX_ENABLE_CXX17_REMOVED_AUTO_PTR
+#    define _LIBCUDACXX_ENABLE_CXX17_REMOVED_BINDERS
+#    define _LIBCUDACXX_ENABLE_CXX17_REMOVED_RANDOM_SHUFFLE
+#    define _LIBCUDACXX_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS
+#    define _LIBCUDACXX_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION
+#  endif // _LIBCUDACXX_ENABLE_CXX17_REMOVED_FEATURES
+
+#  if defined(_LIBCUDACXX_ENABLE_CXX20_REMOVED_FEATURES)
+#    define _LIBCUDACXX_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS
+#    define _LIBCUDACXX_ENABLE_CXX20_REMOVED_ALLOCATOR_VOID_SPECIALIZATION
+#    define _LIBCUDACXX_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS
+#    define _LIBCUDACXX_ENABLE_CXX20_REMOVED_NEGATORS
+#    define _LIBCUDACXX_ENABLE_CXX20_REMOVED_RAW_STORAGE_ITERATOR
+#    define _LIBCUDACXX_ENABLE_CXX20_REMOVED_TYPE_TRAITS
+#  endif // _LIBCUDACXX_ENABLE_CXX20_REMOVED_FEATURES
 
 #  if !defined(__cpp_impl_coroutine) || __cpp_impl_coroutine < 201902L
-#    define _LIBCPP_HAS_NO_CXX20_COROUTINES
+#    define _LIBCUDACXX_HAS_NO_CXX20_COROUTINES
 #  endif
 
-#  define _LIBCPP_PUSH_MACROS _Pragma("push_macro(\"min\")") _Pragma("push_macro(\"max\")")
-#  define _LIBCPP_POP_MACROS _Pragma("pop_macro(\"min\")") _Pragma("pop_macro(\"max\")")
+#  define _LIBCUDACXX_PUSH_MACROS _Pragma("push_macro(\"min\")") _Pragma("push_macro(\"max\")")
+#  define _LIBCUDACXX_POP_MACROS _Pragma("pop_macro(\"min\")") _Pragma("pop_macro(\"max\")")
 
-#  ifndef _LIBCPP_NO_AUTO_LINK
-#    if defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_BUILDING_LIBRARY)
-#      if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
+#  ifndef _LIBCUDACXX_NO_AUTO_LINK
+#    if defined(_LIBCUDACXX_ABI_MICROSOFT) && !defined(_LIBCUDACXX_BUILDING_LIBRARY)
+#      if !defined(_LIBCUDACXX_DISABLE_VISIBILITY_ANNOTATIONS)
 #        pragma comment(lib, "c++.lib")
 #      else
 #        pragma comment(lib, "libc++.lib")
 #      endif
-#    endif // defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_BUILDING_LIBRARY)
-#  endif   // _LIBCPP_NO_AUTO_LINK
+#    endif // defined(_LIBCUDACXX_ABI_MICROSOFT) && !defined(_LIBCUDACXX_BUILDING_LIBRARY)
+#  endif   // _LIBCUDACXX_NO_AUTO_LINK
 
 // Configures the fopen close-on-exec mode character, if any. This string will
 // be appended to any mode string used by fstream for fopen/fdopen.
@@ -1133,37 +1133,37 @@ _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD
 // Not all platforms support this, but it helps avoid fd-leaks on platforms that
 // do.
 #  if defined(__BIONIC__)
-#    define _LIBCPP_FOPEN_CLOEXEC_MODE "e"
+#    define _LIBCUDACXX_FOPEN_CLOEXEC_MODE "e"
 #  else
-#    define _LIBCPP_FOPEN_CLOEXEC_MODE
+#    define _LIBCUDACXX_FOPEN_CLOEXEC_MODE
 #  endif
 
 // Support for _FILE_OFFSET_BITS=64 landed gradually in Android, so the full set
 // of functions used in cstdio may not be available for low API levels when
 // using 64-bit file offsets on LP32.
 #  if defined(__BIONIC__) && defined(__USE_FILE_OFFSET64) && __ANDROID_API__ < 24
-#    define _LIBCPP_HAS_NO_FGETPOS_FSETPOS
+#    define _LIBCUDACXX_HAS_NO_FGETPOS_FSETPOS
 #  endif
 
 #  if __has_attribute(init_priority)
 // TODO: Remove this once we drop support for building libc++ with old Clangs
-#    if (defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER < 1200) ||                                                    \
+#    if (defined(_LIBCUDACXX_CLANG_VER) && _LIBCUDACXX_CLANG_VER < 1200) ||                                                    \
         (defined(__apple_build_version__) && __apple_build_version__ < 13000000)
-#      define _LIBCPP_INIT_PRIORITY_MAX __attribute__((init_priority(101)))
+#      define _LIBCUDACXX_INIT_PRIORITY_MAX __attribute__((init_priority(101)))
 #    else
-#      define _LIBCPP_INIT_PRIORITY_MAX __attribute__((init_priority(100)))
+#      define _LIBCUDACXX_INIT_PRIORITY_MAX __attribute__((init_priority(100)))
 #    endif
 #  else
-#    define _LIBCPP_INIT_PRIORITY_MAX
+#    define _LIBCUDACXX_INIT_PRIORITY_MAX
 #  endif
 
 #  if defined(__GNUC__) || defined(__clang__)
 // The attribute uses 1-based indices for ordinary and static member functions.
 // The attribute uses 2-based indices for non-static member functions.
-#    define _LIBCPP_ATTRIBUTE_FORMAT(archetype, format_string_index, first_format_arg_index)                           \
+#    define _LIBCUDACXX_ATTRIBUTE_FORMAT(archetype, format_string_index, first_format_arg_index)                           \
       __attribute__((__format__(archetype, format_string_index, first_format_arg_index)))
 #  else
-#    define _LIBCPP_ATTRIBUTE_FORMAT(archetype, format_string_index, first_format_arg_index) /* nothing */
+#    define _LIBCUDACXX_ATTRIBUTE_FORMAT(archetype, format_string_index, first_format_arg_index) /* nothing */
 #  endif
 
 #  if __has_cpp_attribute(msvc::no_unique_address)
@@ -1175,11 +1175,11 @@ _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD
 // Clang-cl does not yet (14.0) implement either [[no_unique_address]] or
 // [[msvc::no_unique_address]] though. If/when it does implement
 // [[msvc::no_unique_address]], this should be preferred though.
-#    define _LIBCPP_NO_UNIQUE_ADDRESS [[msvc::no_unique_address]]
+#    define _LIBCUDACXX_NO_UNIQUE_ADDRESS [[msvc::no_unique_address]]
 #  elif __has_cpp_attribute(no_unique_address)
-#    define _LIBCPP_NO_UNIQUE_ADDRESS [[no_unique_address]]
+#    define _LIBCUDACXX_NO_UNIQUE_ADDRESS [[no_unique_address]]
 #  else
-#    define _LIBCPP_NO_UNIQUE_ADDRESS /* nothing */
+#    define _LIBCUDACXX_NO_UNIQUE_ADDRESS /* nothing */
 // Note that this can be replaced by #error as soon as clang-cl
 // implements msvc::no_unique_address, since there should be no C++20
 // compiler that doesn't support one of the two attributes at that point.
@@ -1188,37 +1188,37 @@ _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD
 // the ABI inconsistent.
 #  endif
 
-#  ifdef _LIBCPP_COMPILER_CLANG_BASED
-#    define _LIBCPP_DIAGNOSTIC_PUSH _Pragma("clang diagnostic push")
-#    define _LIBCPP_DIAGNOSTIC_POP _Pragma("clang diagnostic pop")
-#    define _LIBCPP_CLANG_DIAGNOSTIC_IGNORED(str) _Pragma(_LIBCPP_TOSTRING(clang diagnostic ignored str))
-#    define _LIBCPP_GCC_DIAGNOSTIC_IGNORED(str)
-#  elif defined(_LIBCPP_COMPILER_GCC)
-#    define _LIBCPP_DIAGNOSTIC_PUSH _Pragma("GCC diagnostic push")
-#    define _LIBCPP_DIAGNOSTIC_POP _Pragma("GCC diagnostic pop")
-#    define _LIBCPP_CLANG_DIAGNOSTIC_IGNORED(str)
-#    define _LIBCPP_GCC_DIAGNOSTIC_IGNORED(str) _Pragma(_LIBCPP_TOSTRING(GCC diagnostic ignored str))
+#  ifdef _LIBCUDACXX_COMPILER_CLANG_BASED
+#    define _LIBCUDACXX_DIAGNOSTIC_PUSH _Pragma("clang diagnostic push")
+#    define _LIBCUDACXX_DIAGNOSTIC_POP _Pragma("clang diagnostic pop")
+#    define _LIBCUDACXX_CLANG_DIAGNOSTIC_IGNORED(str) _Pragma(_LIBCUDACXX_TOSTRING(clang diagnostic ignored str))
+#    define _LIBCUDACXX_GCC_DIAGNOSTIC_IGNORED(str)
+#  elif defined(_LIBCUDACXX_COMPILER_GCC)
+#    define _LIBCUDACXX_DIAGNOSTIC_PUSH _Pragma("GCC diagnostic push")
+#    define _LIBCUDACXX_DIAGNOSTIC_POP _Pragma("GCC diagnostic pop")
+#    define _LIBCUDACXX_CLANG_DIAGNOSTIC_IGNORED(str)
+#    define _LIBCUDACXX_GCC_DIAGNOSTIC_IGNORED(str) _Pragma(_LIBCUDACXX_TOSTRING(GCC diagnostic ignored str))
 #  else
-#    define _LIBCPP_DIAGNOSTIC_PUSH
-#    define _LIBCPP_DIAGNOSTIC_POP
-#    define _LIBCPP_CLANG_DIAGNOSTIC_IGNORED(str)
-#    define _LIBCPP_GCC_DIAGNOSTIC_IGNORED(str)
+#    define _LIBCUDACXX_DIAGNOSTIC_PUSH
+#    define _LIBCUDACXX_DIAGNOSTIC_POP
+#    define _LIBCUDACXX_CLANG_DIAGNOSTIC_IGNORED(str)
+#    define _LIBCUDACXX_GCC_DIAGNOSTIC_IGNORED(str)
 #  endif
 
-#  if defined(_AIX) && !defined(_LIBCPP_COMPILER_GCC)
-#    define _LIBCPP_PACKED_BYTE_FOR_AIX _Pragma("pack(1)")
-#    define _LIBCPP_PACKED_BYTE_FOR_AIX_END _Pragma("pack(pop)")
+#  if defined(_AIX) && !defined(_LIBCUDACXX_COMPILER_GCC)
+#    define _LIBCUDACXX_PACKED_BYTE_FOR_AIX _Pragma("pack(1)")
+#    define _LIBCUDACXX_PACKED_BYTE_FOR_AIX_END _Pragma("pack(pop)")
 #  else
-#    define _LIBCPP_PACKED_BYTE_FOR_AIX     /* empty */
-#    define _LIBCPP_PACKED_BYTE_FOR_AIX_END /* empty */
+#    define _LIBCUDACXX_PACKED_BYTE_FOR_AIX     /* empty */
+#    define _LIBCUDACXX_PACKED_BYTE_FOR_AIX_END /* empty */
 #  endif
 
 #  if __has_attribute(__packed__)
-#    define _LIBCPP_PACKED __attribute__((__packed__))
+#    define _LIBCUDACXX_PACKED __attribute__((__packed__))
 #  else
-#    define _LIBCPP_PACKED
+#    define _LIBCUDACXX_PACKED
 #  endif
 
 #endif // __cplusplus
 
-#endif // _LIBCPP___CONFIG
+#endif // _LIBCUDACXX___CONFIG

diff  --git a/libcxx/include/__config_site.in b/libcxx/include/__config_site.in
index 7c11fae98619..a1ea902f2f24 100644
--- a/libcxx/include/__config_site.in
+++ b/libcxx/include/__config_site.in
@@ -6,31 +6,31 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___CONFIG_SITE
-#define _LIBCPP___CONFIG_SITE
+#ifndef _LIBCUDACXX___CONFIG_SITE
+#define _LIBCUDACXX___CONFIG_SITE
 
-#cmakedefine _LIBCPP_ABI_VERSION @_LIBCPP_ABI_VERSION@
-#cmakedefine _LIBCPP_ABI_NAMESPACE @_LIBCPP_ABI_NAMESPACE@
-#cmakedefine _LIBCPP_ABI_FORCE_ITANIUM
-#cmakedefine _LIBCPP_ABI_FORCE_MICROSOFT
-#cmakedefine _LIBCPP_HAS_NO_THREADS
-#cmakedefine _LIBCPP_HAS_NO_MONOTONIC_CLOCK
-#cmakedefine _LIBCPP_HAS_MUSL_LIBC
-#cmakedefine _LIBCPP_HAS_THREAD_API_PTHREAD
-#cmakedefine _LIBCPP_HAS_THREAD_API_EXTERNAL
-#cmakedefine _LIBCPP_HAS_THREAD_API_WIN32
-#cmakedefine _LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL
-#cmakedefine _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS
-#cmakedefine _LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS
-#cmakedefine _LIBCPP_NO_VCRUNTIME
-#cmakedefine _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION @_LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION@
-#cmakedefine _LIBCPP_HAS_NO_FILESYSTEM_LIBRARY
-#cmakedefine _LIBCPP_HAS_PARALLEL_ALGORITHMS
-#cmakedefine _LIBCPP_HAS_NO_RANDOM_DEVICE
-#cmakedefine _LIBCPP_HAS_NO_LOCALIZATION
-#cmakedefine _LIBCPP_HAS_NO_WIDE_CHARACTERS
-#cmakedefine01 _LIBCPP_ENABLE_ASSERTIONS_DEFAULT
-#cmakedefine _LIBCPP_ENABLE_DEBUG_MODE
+#cmakedefine _LIBCUDACXX_ABI_VERSION @_LIBCUDACXX_ABI_VERSION@
+#cmakedefine _LIBCUDACXX_ABI_NAMESPACE @_LIBCUDACXX_ABI_NAMESPACE@
+#cmakedefine _LIBCUDACXX_ABI_FORCE_ITANIUM
+#cmakedefine _LIBCUDACXX_ABI_FORCE_MICROSOFT
+#cmakedefine _LIBCUDACXX_HAS_NO_THREADS
+#cmakedefine _LIBCUDACXX_HAS_NO_MONOTONIC_CLOCK
+#cmakedefine _LIBCUDACXX_HAS_MUSL_LIBC
+#cmakedefine _LIBCUDACXX_HAS_THREAD_API_PTHREAD
+#cmakedefine _LIBCUDACXX_HAS_THREAD_API_EXTERNAL
+#cmakedefine _LIBCUDACXX_HAS_THREAD_API_WIN32
+#cmakedefine _LIBCUDACXX_HAS_THREAD_LIBRARY_EXTERNAL
+#cmakedefine _LIBCUDACXX_DISABLE_VISIBILITY_ANNOTATIONS
+#cmakedefine _LIBCUDACXX_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS
+#cmakedefine _LIBCUDACXX_NO_VCRUNTIME
+#cmakedefine _LIBCUDACXX_TYPEINFO_COMPARISON_IMPLEMENTATION @_LIBCUDACXX_TYPEINFO_COMPARISON_IMPLEMENTATION@
+#cmakedefine _LIBCUDACXX_HAS_NO_FILESYSTEM_LIBRARY
+#cmakedefine _LIBCUDACXX_HAS_PARALLEL_ALGORITHMS
+#cmakedefine _LIBCUDACXX_HAS_NO_RANDOM_DEVICE
+#cmakedefine _LIBCUDACXX_HAS_NO_LOCALIZATION
+#cmakedefine _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
+#cmakedefine01 _LIBCUDACXX_ENABLE_ASSERTIONS_DEFAULT
+#cmakedefine _LIBCUDACXX_ENABLE_DEBUG_MODE
 
 // __USE_MINGW_ANSI_STDIO gets redefined on MinGW
 #ifdef __clang__
@@ -38,11 +38,11 @@
 #  pragma clang diagnostic ignored "-Wmacro-redefined"
 #endif
 
- at _LIBCPP_ABI_DEFINES@
- at _LIBCPP_EXTRA_SITE_DEFINES@
+ at _LIBCUDACXX_ABI_DEFINES@
+ at _LIBCUDACXX_EXTRA_SITE_DEFINES@
 
 #ifdef __clang__
 #  pragma clang diagnostic pop
 #endif
 
-#endif // _LIBCPP___CONFIG_SITE
+#endif // _LIBCUDACXX___CONFIG_SITE

diff  --git a/libcxx/include/__coroutine/coroutine_handle.h b/libcxx/include/__coroutine/coroutine_handle.h
index 4bf323789217..0a733bffb505 100644
--- a/libcxx/include/__coroutine/coroutine_handle.h
+++ b/libcxx/include/__coroutine/coroutine_handle.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___COROUTINE_COROUTINE_HANDLE_H
-#define _LIBCPP___COROUTINE_COROUTINE_HANDLE_H
+#ifndef _LIBCUDACXX___COROUTINE_COROUTINE_HANDLE_H
+#define _LIBCUDACXX___COROUTINE_COROUTINE_HANDLE_H
 
 #include <__assert>
 #include <__config>
@@ -16,39 +16,39 @@
 #include <compare>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CXX20_COROUTINES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_CXX20_COROUTINES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 // [coroutine.handle]
 template <class _Promise = void>
-struct _LIBCPP_TEMPLATE_VIS coroutine_handle;
+struct _LIBCUDACXX_TEMPLATE_VIS coroutine_handle;
 
 template <>
-struct _LIBCPP_TEMPLATE_VIS coroutine_handle<void> {
+struct _LIBCUDACXX_TEMPLATE_VIS coroutine_handle<void> {
 public:
     // [coroutine.handle.con], construct/reset
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr coroutine_handle() noexcept = default;
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr coroutine_handle(nullptr_t) noexcept {}
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     coroutine_handle& operator=(nullptr_t) noexcept {
         __handle_ = nullptr;
         return *this;
     }
 
     // [coroutine.handle.export.import], export/import
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr void* address() const noexcept { return __handle_; }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     static constexpr coroutine_handle from_address(void* __addr) noexcept {
         coroutine_handle __tmp;
         __tmp.__handle_ = __addr;
@@ -56,31 +56,31 @@ struct _LIBCPP_TEMPLATE_VIS coroutine_handle<void> {
     }
 
     // [coroutine.handle.observers], observers
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr explicit operator bool() const noexcept {
         return __handle_ != nullptr;
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     bool done() const {
-        _LIBCPP_ASSERT(__is_suspended(), "done() can be called only on suspended coroutines");
+        _LIBCUDACXX_ASSERT(__is_suspended(), "done() can be called only on suspended coroutines");
         return __builtin_coro_done(__handle_);
     }
 
     // [coroutine.handle.resumption], resumption
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     void operator()() const { resume(); }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     void resume() const {
-        _LIBCPP_ASSERT(__is_suspended(), "resume() can be called only on suspended coroutines");
-        _LIBCPP_ASSERT(!done(), "resume() has undefined behavior when the coroutine is done");
+        _LIBCUDACXX_ASSERT(__is_suspended(), "resume() can be called only on suspended coroutines");
+        _LIBCUDACXX_ASSERT(!done(), "resume() has undefined behavior when the coroutine is done");
         __builtin_coro_resume(__handle_);
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     void destroy() const {
-        _LIBCPP_ASSERT(__is_suspended(), "destroy() can be called only on suspended coroutines");
+        _LIBCUDACXX_ASSERT(__is_suspended(), "destroy() can be called only on suspended coroutines");
         __builtin_coro_destroy(__handle_);
     }
 
@@ -94,45 +94,45 @@ struct _LIBCPP_TEMPLATE_VIS coroutine_handle<void> {
 };
 
 // [coroutine.handle.compare]
-inline _LIBCPP_HIDE_FROM_ABI
+inline _LIBCUDACXX_HIDE_FROM_ABI
 constexpr bool operator==(coroutine_handle<> __x, coroutine_handle<> __y) noexcept {
     return __x.address() == __y.address();
 }
-inline _LIBCPP_HIDE_FROM_ABI
+inline _LIBCUDACXX_HIDE_FROM_ABI
 constexpr strong_ordering operator<=>(coroutine_handle<> __x, coroutine_handle<> __y) noexcept {
     return compare_three_way()(__x.address(), __y.address());
 }
 
 template <class _Promise>
-struct _LIBCPP_TEMPLATE_VIS coroutine_handle {
+struct _LIBCUDACXX_TEMPLATE_VIS coroutine_handle {
 public:
     // [coroutine.handle.con], construct/reset
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr coroutine_handle() noexcept = default;
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr coroutine_handle(nullptr_t) noexcept {}
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     static coroutine_handle from_promise(_Promise& __promise) {
         using _RawPromise = typename remove_cv<_Promise>::type;
         coroutine_handle __tmp;
         __tmp.__handle_ =
-            __builtin_coro_promise(_VSTD::addressof(const_cast<_RawPromise&>(__promise)), alignof(_Promise), true);
+            __builtin_coro_promise(_CUDA_VSTD::addressof(const_cast<_RawPromise&>(__promise)), alignof(_Promise), true);
         return __tmp;
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     coroutine_handle& operator=(nullptr_t) noexcept {
         __handle_ = nullptr;
         return *this;
     }
 
     // [coroutine.handle.export.import], export/import
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr void* address() const noexcept { return __handle_; }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     static constexpr coroutine_handle from_address(void* __addr) noexcept {
         coroutine_handle __tmp;
         __tmp.__handle_ = __addr;
@@ -140,42 +140,42 @@ struct _LIBCPP_TEMPLATE_VIS coroutine_handle {
     }
 
     // [coroutine.handle.conv], conversion
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr operator coroutine_handle<>() const noexcept {
         return coroutine_handle<>::from_address(address());
     }
 
     // [coroutine.handle.observers], observers
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr explicit operator bool() const noexcept {
         return __handle_ != nullptr;
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     bool done() const {
-        _LIBCPP_ASSERT(__is_suspended(), "done() can be called only on suspended coroutines");
+        _LIBCUDACXX_ASSERT(__is_suspended(), "done() can be called only on suspended coroutines");
         return __builtin_coro_done(__handle_);
     }
 
     // [coroutine.handle.resumption], resumption
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     void operator()() const { resume(); }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     void resume() const {
-        _LIBCPP_ASSERT(__is_suspended(), "resume() can be called only on suspended coroutines");
-        _LIBCPP_ASSERT(!done(), "resume() has undefined behavior when the coroutine is done");
+        _LIBCUDACXX_ASSERT(__is_suspended(), "resume() can be called only on suspended coroutines");
+        _LIBCUDACXX_ASSERT(!done(), "resume() has undefined behavior when the coroutine is done");
         __builtin_coro_resume(__handle_);
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     void destroy() const {
-        _LIBCPP_ASSERT(__is_suspended(), "destroy() can be called only on suspended coroutines");
+        _LIBCUDACXX_ASSERT(__is_suspended(), "destroy() can be called only on suspended coroutines");
         __builtin_coro_destroy(__handle_);
     }
 
     // [coroutine.handle.promise], promise access
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     _Promise& promise() const {
         return *static_cast<_Promise*>(__builtin_coro_promise(this->__handle_, alignof(_Promise), false));
     }
@@ -191,12 +191,12 @@ struct _LIBCPP_TEMPLATE_VIS coroutine_handle {
 // [coroutine.handle.hash]
 template <class _Tp>
 struct hash<coroutine_handle<_Tp>> {
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     size_t operator()(const coroutine_handle<_Tp>& __v) const noexcept { return hash<void*>()(__v.address()); }
 };
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // __LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CXX20_COROUTINES)
+#endif // __LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_CXX20_COROUTINES)
 
-#endif // _LIBCPP___COROUTINE_COROUTINE_HANDLE_H
+#endif // _LIBCUDACXX___COROUTINE_COROUTINE_HANDLE_H

diff  --git a/libcxx/include/__coroutine/coroutine_traits.h b/libcxx/include/__coroutine/coroutine_traits.h
index 0a5229b45945..d2cdc2269566 100644
--- a/libcxx/include/__coroutine/coroutine_traits.h
+++ b/libcxx/include/__coroutine/coroutine_traits.h
@@ -6,19 +6,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___COROUTINE_COROUTINE_TRAITS_H
-#define _LIBCPP___COROUTINE_COROUTINE_TRAITS_H
+#ifndef _LIBCUDACXX___COROUTINE_COROUTINE_TRAITS_H
+#define _LIBCUDACXX___COROUTINE_COROUTINE_TRAITS_H
 
 #include <__config>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CXX20_COROUTINES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_CXX20_COROUTINES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 // [coroutine.traits]
 // [coroutine.traits.primary]
@@ -46,8 +46,8 @@ struct coroutine_traits
 {
 };
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // __LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CXX20_COROUTINES)
+#endif // __LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_CXX20_COROUTINES)
 
-#endif // _LIBCPP___COROUTINE_COROUTINE_TRAITS_H
+#endif // _LIBCUDACXX___COROUTINE_COROUTINE_TRAITS_H

diff  --git a/libcxx/include/__coroutine/noop_coroutine_handle.h b/libcxx/include/__coroutine/noop_coroutine_handle.h
index 7a2c672057cb..882280793d70 100644
--- a/libcxx/include/__coroutine/noop_coroutine_handle.h
+++ b/libcxx/include/__coroutine/noop_coroutine_handle.h
@@ -6,21 +6,21 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___COROUTINE_NOOP_COROUTINE_HANDLE_H
-#define _LIBCPP___COROUTINE_NOOP_COROUTINE_HANDLE_H
+#ifndef _LIBCUDACXX___COROUTINE_NOOP_COROUTINE_HANDLE_H
+#define _LIBCUDACXX___COROUTINE_NOOP_COROUTINE_HANDLE_H
 
 #include <__config>
 #include <__coroutine/coroutine_handle.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CXX20_COROUTINES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_CXX20_COROUTINES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if __has_builtin(__builtin_coro_noop) || defined(_LIBCPP_COMPILER_GCC)
+#if __has_builtin(__builtin_coro_noop) || defined(_LIBCUDACXX_COMPILER_GCC)
 
 // [coroutine.noop]
 // [coroutine.promise.noop]
@@ -28,51 +28,51 @@ struct noop_coroutine_promise {};
 
 // [coroutine.handle.noop]
 template <>
-struct _LIBCPP_TEMPLATE_VIS coroutine_handle<noop_coroutine_promise> {
+struct _LIBCUDACXX_TEMPLATE_VIS coroutine_handle<noop_coroutine_promise> {
 public:
     // [coroutine.handle.noop.conv], conversion
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr operator coroutine_handle<>() const noexcept {
         return coroutine_handle<>::from_address(address());
     }
 
     // [coroutine.handle.noop.observers], observers
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr explicit operator bool() const noexcept { return true; }
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr bool done() const noexcept { return false; }
 
     // [coroutine.handle.noop.resumption], resumption
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr void operator()() const noexcept {}
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr void resume() const noexcept {}
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr void destroy() const noexcept {}
 
     // [coroutine.handle.noop.promise], promise access
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     noop_coroutine_promise& promise() const noexcept {
         return *static_cast<noop_coroutine_promise*>(
             __builtin_coro_promise(this->__handle_, alignof(noop_coroutine_promise), false));
     }
 
     // [coroutine.handle.noop.address], address
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr void* address() const noexcept { return __handle_; }
 
 private:
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     friend coroutine_handle<noop_coroutine_promise> noop_coroutine() noexcept;
 
 #if __has_builtin(__builtin_coro_noop)
-    _LIBCPP_HIDE_FROM_ABI coroutine_handle() noexcept {
+    _LIBCUDACXX_HIDE_FROM_ABI coroutine_handle() noexcept {
         this->__handle_ = __builtin_coro_noop();
     }
 
     void* __handle_ = nullptr;
 
-#elif defined(_LIBCPP_COMPILER_GCC)
+#elif defined(_LIBCUDACXX_COMPILER_GCC)
     // GCC doesn't implement __builtin_coro_noop().
     // Construct the coroutine frame manually instead.
     struct __noop_coroutine_frame_ty_ {
@@ -87,26 +87,26 @@ struct _LIBCPP_TEMPLATE_VIS coroutine_handle<noop_coroutine_promise> {
 
     void* __handle_ = &__noop_coroutine_frame_;
 
-    _LIBCPP_HIDE_FROM_ABI coroutine_handle() noexcept = default;
+    _LIBCUDACXX_HIDE_FROM_ABI coroutine_handle() noexcept = default;
 
 #endif // __has_builtin(__builtin_coro_noop)
 };
 
 using noop_coroutine_handle = coroutine_handle<noop_coroutine_promise>;
 
-#if defined(_LIBCPP_COMPILER_GCC)
+#if defined(_LIBCUDACXX_COMPILER_GCC)
 inline noop_coroutine_handle::__noop_coroutine_frame_ty_
     noop_coroutine_handle::__noop_coroutine_frame_{};
 #endif
 
 // [coroutine.noop.coroutine]
-inline _LIBCPP_HIDE_FROM_ABI
+inline _LIBCUDACXX_HIDE_FROM_ABI
 noop_coroutine_handle noop_coroutine() noexcept { return noop_coroutine_handle(); }
 
-#endif // __has_builtin(__builtin_coro_noop) || defined(_LIBCPP_COMPILER_GCC)
+#endif // __has_builtin(__builtin_coro_noop) || defined(_LIBCUDACXX_COMPILER_GCC)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // __LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CXX20_COROUTINES)
+#endif // __LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_CXX20_COROUTINES)
 
-#endif // _LIBCPP___COROUTINE_NOOP_COROUTINE_HANDLE_H
+#endif // _LIBCUDACXX___COROUTINE_NOOP_COROUTINE_HANDLE_H

diff  --git a/libcxx/include/__coroutine/trivial_awaitables.h b/libcxx/include/__coroutine/trivial_awaitables.h
index 31399ab29a00..566a94539e85 100644
--- a/libcxx/include/__coroutine/trivial_awaitables.h
+++ b/libcxx/include/__coroutine/trivial_awaitables.h
@@ -6,41 +6,41 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef __LIBCPP___COROUTINE_TRIVIAL_AWAITABLES_H
-#define __LIBCPP___COROUTINE_TRIVIAL_AWAITABLES_H
+#ifndef __LIBCUDACXX___COROUTINE_TRIVIAL_AWAITABLES_H
+#define __LIBCUDACXX___COROUTINE_TRIVIAL_AWAITABLES_H
 
 #include <__config>
 #include <__coroutine/coroutine_handle.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CXX20_COROUTINES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_CXX20_COROUTINES)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 // [coroutine.trivial.awaitables]
 struct suspend_never {
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr bool await_ready() const noexcept { return true; }
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr void await_suspend(coroutine_handle<>) const noexcept {}
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr void await_resume() const noexcept {}
 };
 
 struct suspend_always {
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr bool await_ready() const noexcept { return false; }
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr void await_suspend(coroutine_handle<>) const noexcept {}
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr void await_resume() const noexcept {}
 };
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // __LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CXX20_COROUTINES)
+#endif // __LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_CXX20_COROUTINES)
 
-#endif // __LIBCPP___COROUTINE_TRIVIAL_AWAITABLES_H
+#endif // __LIBCUDACXX___COROUTINE_TRIVIAL_AWAITABLES_H

diff  --git a/libcxx/include/__debug b/libcxx/include/__debug
index 59e85cb7d1bc..1a87725af97d 100644
--- a/libcxx/include/__debug
+++ b/libcxx/include/__debug
@@ -7,40 +7,40 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___DEBUG
-#define _LIBCPP___DEBUG
+#ifndef _LIBCUDACXX___DEBUG
+#define _LIBCUDACXX___DEBUG
 
 #include <__assert>
 #include <__config>
 #include <cstddef>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-// Catch invalid uses of the legacy _LIBCPP_DEBUG toggle.
-#if defined(_LIBCPP_DEBUG) && _LIBCPP_DEBUG != 0 && !defined(_LIBCPP_ENABLE_DEBUG_MODE)
+// Catch invalid uses of the legacy _LIBCUDACXX_DEBUG toggle.
+#if defined(_LIBCUDACXX_DEBUG) && _LIBCUDACXX_DEBUG != 0 && !defined(_LIBCUDACXX_ENABLE_DEBUG_MODE)
 #   error "Enabling the debug mode now requires having configured the library with support for the debug mode"
 #endif
 
-#if defined(_LIBCPP_ENABLE_DEBUG_MODE) && !defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY)
-# define _LIBCPP_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY
+#if defined(_LIBCUDACXX_ENABLE_DEBUG_MODE) && !defined(_LIBCUDACXX_CXX03_LANG) && !defined(_LIBCUDACXX_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY)
+# define _LIBCUDACXX_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY
 #endif
 
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
-#   define _LIBCPP_DEBUG_ASSERT(x, m) _LIBCPP_ASSERT(::std::__libcpp_is_constant_evaluated() || (x), m)
+#ifdef _LIBCUDACXX_ENABLE_DEBUG_MODE
+#   define _LIBCUDACXX_DEBUG_ASSERT(x, m) _LIBCUDACXX_ASSERT(::std::__LIBCUDACXX_is_constant_evaluated() || (x), m)
 #else
-#   define _LIBCPP_DEBUG_ASSERT(x, m) ((void)0)
+#   define _LIBCUDACXX_DEBUG_ASSERT(x, m) ((void)0)
 #endif
 
-#if defined(_LIBCPP_ENABLE_DEBUG_MODE) || defined(_LIBCPP_BUILDING_LIBRARY)
+#if defined(_LIBCUDACXX_ENABLE_DEBUG_MODE) || defined(_LIBCUDACXX_BUILDING_LIBRARY)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-struct _LIBCPP_TYPE_VIS __c_node;
+struct _LIBCUDACXX_TYPE_VIS __c_node;
 
-struct _LIBCPP_TYPE_VIS __i_node
+struct _LIBCUDACXX_TYPE_VIS __i_node
 {
     void* __i_;
     __i_node* __next_;
@@ -49,13 +49,13 @@ struct _LIBCPP_TYPE_VIS __i_node
     __i_node(const __i_node&) = delete;
     __i_node& operator=(const __i_node&) = delete;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __i_node(void* __i, __i_node* __next, __c_node* __c)
         : __i_(__i), __next_(__next), __c_(__c) {}
     ~__i_node();
 };
 
-struct _LIBCPP_TYPE_VIS __c_node
+struct _LIBCUDACXX_TYPE_VIS __c_node
 {
     void* __c_;
     __c_node* __next_;
@@ -66,7 +66,7 @@ struct _LIBCPP_TYPE_VIS __c_node
     __c_node(const __c_node&) = delete;
     __c_node& operator=(const __c_node&) = delete;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __c_node(void* __c, __c_node* __next)
         : __c_(__c), __next_(__next), beg_(nullptr), end_(nullptr), cap_(nullptr) {}
     virtual ~__c_node();
@@ -77,7 +77,7 @@ struct _LIBCPP_TYPE_VIS __c_node
     virtual bool __subscriptable(const void*, ptr
diff _t) const = 0;
 
     void __add(__i_node* __i);
-    _LIBCPP_HIDDEN void __remove(__i_node* __i);
+    _LIBCUDACXX_HIDDEN void __remove(__i_node* __i);
 };
 
 template <class _Cont>
@@ -133,7 +133,7 @@ _C_node<_Cont>::__subscriptable(const void* __i, ptr
diff _t __n) const
     return _Cp->__subscriptable(__j, __n);
 }
 
-class _LIBCPP_TYPE_VIS __libcpp_db
+class _LIBCUDACXX_TYPE_VIS __LIBCUDACXX_db
 {
     __c_node** __cbeg_;
     __c_node** __cend_;
@@ -142,12 +142,12 @@ class _LIBCPP_TYPE_VIS __libcpp_db
     __i_node** __iend_;
     size_t   __isz_;
 
-    explicit __libcpp_db();
+    explicit __LIBCUDACXX_db();
 public:
-    __libcpp_db(const __libcpp_db&) = delete;
-    __libcpp_db& operator=(const __libcpp_db&) = delete;
+    __LIBCUDACXX_db(const __LIBCUDACXX_db&) = delete;
+    __LIBCUDACXX_db& operator=(const __LIBCUDACXX_db&) = delete;
 
-    ~__libcpp_db();
+    ~__LIBCUDACXX_db();
 
     class __db_c_iterator;
     class __db_c_const_iterator;
@@ -160,12 +160,12 @@ public:
     typedef __c_node*(_InsertConstruct)(void*, void*, __c_node*);
 
     template <class _Cont>
-    _LIBCPP_INLINE_VISIBILITY static __c_node* __create_C_node(void *__mem, void *__c, __c_node *__next) {
+    _LIBCUDACXX_INLINE_VISIBILITY static __c_node* __create_C_node(void *__mem, void *__c, __c_node *__next) {
         return ::new (__mem) _C_node<_Cont>(__c, __next);
     }
 
     template <class _Cont>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __insert_c(_Cont* __c)
     {
         __insert_c(static_cast<void*>(__c), &__create_C_node<_Cont>);
@@ -194,27 +194,27 @@ public:
     bool __subscriptable(const void* __i, ptr
diff _t __n) const;
     bool __less_than_comparable(const void* __i, const void* __j) const;
 private:
-    _LIBCPP_HIDDEN
+    _LIBCUDACXX_HIDDEN
     __i_node* __insert_iterator(void* __i);
-    _LIBCPP_HIDDEN
+    _LIBCUDACXX_HIDDEN
     __i_node* __find_iterator(const void* __i) const;
 
-    friend _LIBCPP_FUNC_VIS __libcpp_db* __get_db();
+    friend _LIBCUDACXX_FUNC_VIS __LIBCUDACXX_db* __get_db();
 };
 
-_LIBCPP_FUNC_VIS __libcpp_db* __get_db();
-_LIBCPP_FUNC_VIS const __libcpp_db* __get_const_db();
+_LIBCUDACXX_FUNC_VIS __LIBCUDACXX_db* __get_db();
+_LIBCUDACXX_FUNC_VIS const __LIBCUDACXX_db* __get_const_db();
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // defined(_LIBCPP_ENABLE_DEBUG_MODE) || defined(_LIBCPP_BUILDING_LIBRARY)
+#endif // defined(_LIBCUDACXX_ENABLE_DEBUG_MODE) || defined(_LIBCUDACXX_BUILDING_LIBRARY)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Tp>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 inline void __debug_db_insert_c(_Tp* __c) {
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
-    if (!__libcpp_is_constant_evaluated())
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 inline void __debug_db_insert_c(_Tp* __c) {
+#ifdef _LIBCUDACXX_ENABLE_DEBUG_MODE
+    if (!__LIBCUDACXX_is_constant_evaluated())
         __get_db()->__insert_c(__c);
 #else
     (void)(__c);
@@ -222,9 +222,9 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 inline void __debug_db_inser
 }
 
 template <class _Tp>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 inline void __debug_db_insert_i(_Tp* __i) {
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
-    if (!__libcpp_is_constant_evaluated())
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 inline void __debug_db_insert_i(_Tp* __i) {
+#ifdef _LIBCUDACXX_ENABLE_DEBUG_MODE
+    if (!__LIBCUDACXX_is_constant_evaluated())
         __get_db()->__insert_i(__i);
 #else
     (void)(__i);
@@ -232,9 +232,9 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 inline void __debug_db_inser
 }
 
 template <class _Tp>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 inline void __debug_db_erase_c(_Tp* __c) {
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
-    if (!__libcpp_is_constant_evaluated())
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 inline void __debug_db_erase_c(_Tp* __c) {
+#ifdef _LIBCUDACXX_ENABLE_DEBUG_MODE
+    if (!__LIBCUDACXX_is_constant_evaluated())
         __get_db()->__erase_c(__c);
 #else
     (void)(__c);
@@ -242,9 +242,9 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 inline void __debug_db_erase
 }
 
 template <class _Tp>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 inline void __debug_db_swap(_Tp* __lhs, _Tp* __rhs) {
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
-    if (!__libcpp_is_constant_evaluated())
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 inline void __debug_db_swap(_Tp* __lhs, _Tp* __rhs) {
+#ifdef _LIBCUDACXX_ENABLE_DEBUG_MODE
+    if (!__LIBCUDACXX_is_constant_evaluated())
         __get_db()->swap(__lhs, __rhs);
 #else
     (void)(__lhs);
@@ -253,15 +253,15 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 inline void __debug_db_swap(
 }
 
 template <class _Tp>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 inline void __debug_db_invalidate_all(_Tp* __c) {
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
-    if (!__libcpp_is_constant_evaluated())
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 inline void __debug_db_invalidate_all(_Tp* __c) {
+#ifdef _LIBCUDACXX_ENABLE_DEBUG_MODE
+    if (!__LIBCUDACXX_is_constant_evaluated())
         __get_db()->__invalidate_all(__c);
 #else
     (void)(__c);
 #endif
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___DEBUG
+#endif // _LIBCUDACXX___DEBUG

diff  --git a/libcxx/include/__debug_utils/randomize_range.h b/libcxx/include/__debug_utils/randomize_range.h
index 9843709019d4..123221dc2aa2 100644
--- a/libcxx/include/__debug_utils/randomize_range.h
+++ b/libcxx/include/__debug_utils/randomize_range.h
@@ -6,38 +6,38 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___LIBCXX_DEBUG_RANDOMIZE_RANGE_H
-#define _LIBCPP___LIBCXX_DEBUG_RANDOMIZE_RANGE_H
+#ifndef _LIBCUDACXX___LIBCXX_DEBUG_RANDOMIZE_RANGE_H
+#define _LIBCUDACXX___LIBCXX_DEBUG_RANDOMIZE_RANGE_H
 
 #include <__config>
 
-#ifdef _LIBCPP_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY
+#ifdef _LIBCUDACXX_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY
 #  include <__algorithm/shuffle.h>
 #  include <__type_traits/is_constant_evaluated.h>
 #endif
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _AlgPolicy, class _Iterator, class _Sentinel>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 void __debug_randomize_range(_Iterator __first, _Sentinel __last) {
-#ifdef _LIBCPP_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY
-#  ifdef _LIBCPP_CXX03_LANG
+#ifdef _LIBCUDACXX_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY
+#  ifdef _LIBCUDACXX_CXX03_LANG
 #    error Support for unspecified stability is only for C++11 and higher
 #  endif
 
-  if (!__libcpp_is_constant_evaluated())
-    std::__shuffle<_AlgPolicy>(__first, __last, __libcpp_debug_randomizer());
+  if (!__LIBCUDACXX_is_constant_evaluated())
+    std::__shuffle<_AlgPolicy>(__first, __last, __LIBCUDACXX_debug_randomizer());
 #else
   (void)__first;
   (void)__last;
 #endif
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___LIBCXX_DEBUG_RANDOMIZE_RANGE_H
+#endif // _LIBCUDACXX___LIBCXX_DEBUG_RANDOMIZE_RANGE_H

diff  --git a/libcxx/include/__errc b/libcxx/include/__errc
index 17bbe0e2afce..73339bbb8df5 100644
--- a/libcxx/include/__errc
+++ b/libcxx/include/__errc
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ERRC
-#define _LIBCPP___ERRC
+#ifndef _LIBCUDACXX___ERRC
+#define _LIBCUDACXX___ERRC
 
 /*
     system_error synopsis
@@ -103,17 +103,17 @@ enum class errc
 #include <__config>
 #include <cerrno>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 // Some error codes are not present on all platforms, so we provide equivalents
 // for them:
 
 //enum class errc
-_LIBCPP_DECLARE_STRONG_ENUM(errc)
+_LIBCUDACXX_DECLARE_STRONG_ENUM(errc)
 {
     address_family_not_supported        = EAFNOSUPPORT,
     address_in_use                      = EADDRINUSE,
@@ -210,8 +210,8 @@ _LIBCPP_DECLARE_STRONG_ENUM(errc)
     value_too_large                     = EOVERFLOW,
     wrong_protocol_type                 = EPROTOTYPE
 };
-_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(errc)
+_LIBCUDACXX_DECLARE_STRONG_ENUM_EPILOG(errc)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ERRC
+#endif // _LIBCUDACXX___ERRC

diff  --git a/libcxx/include/__filesystem/copy_options.h b/libcxx/include/__filesystem/copy_options.h
index 96c7535812e2..141cc29eb0f5 100644
--- a/libcxx/include/__filesystem/copy_options.h
+++ b/libcxx/include/__filesystem/copy_options.h
@@ -7,23 +7,23 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FILESYSTEM_COPY_OPTIONS_H
-#define _LIBCPP___FILESYSTEM_COPY_OPTIONS_H
+#ifndef _LIBCUDACXX___FILESYSTEM_COPY_OPTIONS_H
+#define _LIBCUDACXX___FILESYSTEM_COPY_OPTIONS_H
 
 #include <__availability>
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
-_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
+_LIBCUDACXX_BEGIN_NAMESPACE_FILESYSTEM
 
-_LIBCPP_AVAILABILITY_FILESYSTEM_PUSH
+_LIBCUDACXX_AVAILABILITY_FILESYSTEM_PUSH
 
-enum class _LIBCPP_ENUM_VIS copy_options : unsigned short {
+enum class _LIBCUDACXX_ENUM_VIS copy_options : unsigned short {
   none = 0,
   skip_existing = 1,
   overwrite_existing = 2,
@@ -37,48 +37,48 @@ enum class _LIBCPP_ENUM_VIS copy_options : unsigned short {
   __in_recursive_copy = 512,
 };
 
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 inline constexpr copy_options operator&(copy_options __lhs, copy_options __rhs) {
   return static_cast<copy_options>(static_cast<unsigned short>(__lhs) &
                                    static_cast<unsigned short>(__rhs));
 }
 
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 inline constexpr copy_options operator|(copy_options __lhs, copy_options __rhs) {
   return static_cast<copy_options>(static_cast<unsigned short>(__lhs) |
                                    static_cast<unsigned short>(__rhs));
 }
 
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 inline constexpr copy_options operator^(copy_options __lhs, copy_options __rhs) {
   return static_cast<copy_options>(static_cast<unsigned short>(__lhs) ^
                                    static_cast<unsigned short>(__rhs));
 }
 
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 inline constexpr copy_options operator~(copy_options __lhs) {
   return static_cast<copy_options>(~static_cast<unsigned short>(__lhs));
 }
 
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 inline copy_options& operator&=(copy_options& __lhs, copy_options __rhs) {
   return __lhs = __lhs & __rhs;
 }
 
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 inline copy_options& operator|=(copy_options& __lhs, copy_options __rhs) {
   return __lhs = __lhs | __rhs;
 }
 
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 inline copy_options& operator^=(copy_options& __lhs, copy_options __rhs) {
   return __lhs = __lhs ^ __rhs;
 }
 
-_LIBCPP_AVAILABILITY_FILESYSTEM_POP
+_LIBCUDACXX_AVAILABILITY_FILESYSTEM_POP
 
-_LIBCPP_END_NAMESPACE_FILESYSTEM
+_LIBCUDACXX_END_NAMESPACE_FILESYSTEM
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
-#endif // _LIBCPP___FILESYSTEM_COPY_OPTIONS_H
+#endif // _LIBCUDACXX___FILESYSTEM_COPY_OPTIONS_H

diff  --git a/libcxx/include/__filesystem/directory_entry.h b/libcxx/include/__filesystem/directory_entry.h
index 5ba3ef96de48..86aa0daaf72d 100644
--- a/libcxx/include/__filesystem/directory_entry.h
+++ b/libcxx/include/__filesystem/directory_entry.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FILESYSTEM_DIRECTORY_ENTRY_H
-#define _LIBCPP___FILESYSTEM_DIRECTORY_ENTRY_H
+#ifndef _LIBCUDACXX___FILESYSTEM_DIRECTORY_ENTRY_H
+#define _LIBCUDACXX___FILESYSTEM_DIRECTORY_ENTRY_H
 
 #include <__availability>
 #include <__chrono/time_point.h>
@@ -27,18 +27,18 @@
 #include <iosfwd>
 #include <system_error>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
-_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
+_LIBCUDACXX_BEGIN_NAMESPACE_FILESYSTEM
 
-_LIBCPP_AVAILABILITY_FILESYSTEM_PUSH
+_LIBCUDACXX_AVAILABILITY_FILESYSTEM_PUSH
 
 
 class directory_entry {
@@ -50,13 +50,13 @@ class directory_entry {
   directory_entry(directory_entry const&) = default;
   directory_entry(directory_entry&&) noexcept = default;
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   explicit directory_entry(_Path const& __p) : __p_(__p) {
     error_code __ec;
     __refresh(&__ec);
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   directory_entry(_Path const& __p, error_code& __ec) : __p_(__p) {
     __refresh(&__ec);
   }
@@ -66,187 +66,187 @@ class directory_entry {
   directory_entry& operator=(directory_entry const&) = default;
   directory_entry& operator=(directory_entry&&) noexcept = default;
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   void assign(_Path const& __p) {
     __p_ = __p;
     error_code __ec;
     __refresh(&__ec);
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   void assign(_Path const& __p, error_code& __ec) {
     __p_ = __p;
     __refresh(&__ec);
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   void replace_filename(_Path const& __p) {
     __p_.replace_filename(__p);
     error_code __ec;
     __refresh(&__ec);
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   void replace_filename(_Path const& __p, error_code& __ec) {
     __p_ = __p_.parent_path() / __p;
     __refresh(&__ec);
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   void refresh() { __refresh(); }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   void refresh(error_code& __ec) noexcept { __refresh(&__ec); }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   _Path const& path() const noexcept { return __p_; }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   operator const _Path&() const noexcept { return __p_; }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   bool exists() const { return _VSTD_FS::exists(file_status{__get_ft()}); }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   bool exists(error_code& __ec) const noexcept {
     return _VSTD_FS::exists(file_status{__get_ft(&__ec)});
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   bool is_block_file() const { return __get_ft() == file_type::block; }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   bool is_block_file(error_code& __ec) const noexcept {
     return __get_ft(&__ec) == file_type::block;
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   bool is_character_file() const { return __get_ft() == file_type::character; }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   bool is_character_file(error_code& __ec) const noexcept {
     return __get_ft(&__ec) == file_type::character;
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   bool is_directory() const { return __get_ft() == file_type::directory; }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   bool is_directory(error_code& __ec) const noexcept {
     return __get_ft(&__ec) == file_type::directory;
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   bool is_fifo() const { return __get_ft() == file_type::fifo; }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   bool is_fifo(error_code& __ec) const noexcept {
     return __get_ft(&__ec) == file_type::fifo;
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   bool is_other() const { return _VSTD_FS::is_other(file_status{__get_ft()}); }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   bool is_other(error_code& __ec) const noexcept {
     return _VSTD_FS::is_other(file_status{__get_ft(&__ec)});
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   bool is_regular_file() const { return __get_ft() == file_type::regular; }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   bool is_regular_file(error_code& __ec) const noexcept {
     return __get_ft(&__ec) == file_type::regular;
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   bool is_socket() const { return __get_ft() == file_type::socket; }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   bool is_socket(error_code& __ec) const noexcept {
     return __get_ft(&__ec) == file_type::socket;
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   bool is_symlink() const { return __get_sym_ft() == file_type::symlink; }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   bool is_symlink(error_code& __ec) const noexcept {
     return __get_sym_ft(&__ec) == file_type::symlink;
   }
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   uintmax_t file_size() const { return __get_size(); }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   uintmax_t file_size(error_code& __ec) const noexcept {
     return __get_size(&__ec);
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   uintmax_t hard_link_count() const { return __get_nlink(); }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   uintmax_t hard_link_count(error_code& __ec) const noexcept {
     return __get_nlink(&__ec);
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   file_time_type last_write_time() const { return __get_write_time(); }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   file_time_type last_write_time(error_code& __ec) const noexcept {
     return __get_write_time(&__ec);
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   file_status status() const { return __get_status(); }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   file_status status(error_code& __ec) const noexcept {
     return __get_status(&__ec);
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   file_status symlink_status() const { return __get_symlink_status(); }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   file_status symlink_status(error_code& __ec) const noexcept {
     return __get_symlink_status(&__ec);
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   bool operator<(directory_entry const& __rhs) const noexcept {
     return __p_ < __rhs.__p_;
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   bool operator==(directory_entry const& __rhs) const noexcept {
     return __p_ == __rhs.__p_;
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   bool operator!=(directory_entry const& __rhs) const noexcept {
     return __p_ != __rhs.__p_;
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   bool operator<=(directory_entry const& __rhs) const noexcept {
     return __p_ <= __rhs.__p_;
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   bool operator>(directory_entry const& __rhs) const noexcept {
     return __p_ > __rhs.__p_;
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   bool operator>=(directory_entry const& __rhs) const noexcept {
     return __p_ >= __rhs.__p_;
   }
 
   template <class _CharT, class _Traits>
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   friend basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const directory_entry& __d) {
     return __os << __d.path();
   }
@@ -254,7 +254,7 @@ class directory_entry {
 private:
   friend class directory_iterator;
   friend class recursive_directory_iterator;
-  friend class _LIBCPP_HIDDEN __dir_stream;
+  friend class _LIBCUDACXX_HIDDEN __dir_stream;
 
   enum _CacheType : unsigned char {
     _Empty,
@@ -274,10 +274,10 @@ class directory_entry {
     file_type __type_;
     _CacheType __cache_type_;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __cached_data() noexcept { __reset(); }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __reset() {
       __cache_type_ = _Empty;
       __type_ = file_type::none;
@@ -287,7 +287,7 @@ class directory_entry {
     }
   };
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   static __cached_data __create_iter_result(file_type __ft) {
     __cached_data __data;
     __data.__type_ = __ft;
@@ -304,16 +304,16 @@ class directory_entry {
     return __data;
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   void __assign_iter_entry(_Path&& __p, __cached_data __dt) {
-    __p_ = _VSTD::move(__p);
+    __p_ = _CUDA_VSTD::move(__p);
     __data_ = __dt;
   }
 
-  _LIBCPP_FUNC_VIS
+  _LIBCUDACXX_FUNC_VIS
   error_code __do_refresh() noexcept;
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   static bool __is_dne_error(error_code const& __ec) {
     if (!__ec)
       return true;
@@ -326,7 +326,7 @@ class directory_entry {
     }
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   void __handle_error(const char* __msg, error_code* __dest_ec,
                       error_code const& __ec, bool __allow_dne = false) const {
     if (__dest_ec) {
@@ -337,13 +337,13 @@ class directory_entry {
       __throw_filesystem_error(__msg, __p_, __ec);
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   void __refresh(error_code* __ec = nullptr) {
     __handle_error("in directory_entry::refresh", __ec, __do_refresh(),
                    /*allow_dne*/ true);
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   file_type __get_sym_ft(error_code* __ec = nullptr) const {
     switch (__data_.__cache_type_) {
     case _Empty:
@@ -363,10 +363,10 @@ class directory_entry {
         __ec->clear();
       return __data_.__type_;
     }
-    __libcpp_unreachable();
+    __LIBCUDACXX_unreachable();
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   file_type __get_ft(error_code* __ec = nullptr) const {
     switch (__data_.__cache_type_) {
     case _Empty:
@@ -384,10 +384,10 @@ class directory_entry {
       return __data_.__type_;
     }
     }
-    __libcpp_unreachable();
+    __LIBCUDACXX_unreachable();
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   file_status __get_status(error_code* __ec = nullptr) const {
     switch (__data_.__cache_type_) {
     case _Empty:
@@ -399,10 +399,10 @@ class directory_entry {
     case _RefreshSymlink:
       return file_status(__get_ft(__ec), __data_.__non_sym_perms_);
     }
-    __libcpp_unreachable();
+    __LIBCUDACXX_unreachable();
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   file_status __get_symlink_status(error_code* __ec = nullptr) const {
     switch (__data_.__cache_type_) {
     case _Empty:
@@ -415,10 +415,10 @@ class directory_entry {
     case _RefreshSymlinkUnresolved:
       return file_status(__get_sym_ft(__ec), __data_.__sym_perms_);
     }
-    __libcpp_unreachable();
+    __LIBCUDACXX_unreachable();
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   uintmax_t __get_size(error_code* __ec = nullptr) const {
     switch (__data_.__cache_type_) {
     case _Empty:
@@ -440,10 +440,10 @@ class directory_entry {
       return __data_.__size_;
     }
     }
-    __libcpp_unreachable();
+    __LIBCUDACXX_unreachable();
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   uintmax_t __get_nlink(error_code* __ec = nullptr) const {
     switch (__data_.__cache_type_) {
     case _Empty:
@@ -459,10 +459,10 @@ class directory_entry {
       return __data_.__nlink_;
     }
     }
-    __libcpp_unreachable();
+    __LIBCUDACXX_unreachable();
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   file_time_type __get_write_time(error_code* __ec = nullptr) const {
     switch (__data_.__cache_type_) {
     case _Empty:
@@ -482,7 +482,7 @@ class directory_entry {
       return __data_.__write_time_;
     }
     }
-    __libcpp_unreachable();
+    __LIBCUDACXX_unreachable();
   }
 
 private:
@@ -492,8 +492,8 @@ class directory_entry {
 
 class __dir_element_proxy {
 public:
-  inline _LIBCPP_INLINE_VISIBILITY directory_entry operator*() {
-    return _VSTD::move(__elem_);
+  inline _LIBCUDACXX_INLINE_VISIBILITY directory_entry operator*() {
+    return _CUDA_VSTD::move(__elem_);
   }
 
 private:
@@ -501,16 +501,16 @@ class __dir_element_proxy {
   friend class recursive_directory_iterator;
   explicit __dir_element_proxy(directory_entry const& __e) : __elem_(__e) {}
   __dir_element_proxy(__dir_element_proxy&& __o)
-      : __elem_(_VSTD::move(__o.__elem_)) {}
+      : __elem_(_CUDA_VSTD::move(__o.__elem_)) {}
   directory_entry __elem_;
 };
 
-_LIBCPP_AVAILABILITY_FILESYSTEM_POP
+_LIBCUDACXX_AVAILABILITY_FILESYSTEM_POP
 
-_LIBCPP_END_NAMESPACE_FILESYSTEM
+_LIBCUDACXX_END_NAMESPACE_FILESYSTEM
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___FILESYSTEM_DIRECTORY_ENTRY_H
+#endif // _LIBCUDACXX___FILESYSTEM_DIRECTORY_ENTRY_H

diff  --git a/libcxx/include/__filesystem/directory_iterator.h b/libcxx/include/__filesystem/directory_iterator.h
index 5ff2f01ac7b2..686d2d09994f 100644
--- a/libcxx/include/__filesystem/directory_iterator.h
+++ b/libcxx/include/__filesystem/directory_iterator.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FILESYSTEM_DIRECTORY_ITERATOR_H
-#define _LIBCPP___FILESYSTEM_DIRECTORY_ITERATOR_H
+#ifndef _LIBCUDACXX___FILESYSTEM_DIRECTORY_ITERATOR_H
+#define _LIBCUDACXX___FILESYSTEM_DIRECTORY_ITERATOR_H
 
 #include <__assert>
 #include <__availability>
@@ -23,17 +23,17 @@
 #include <cstddef>
 #include <system_error>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
-_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
+_LIBCUDACXX_BEGIN_NAMESPACE_FILESYSTEM
 
-_LIBCPP_AVAILABILITY_FILESYSTEM_PUSH
+_LIBCUDACXX_AVAILABILITY_FILESYSTEM_PUSH
 
-class _LIBCPP_HIDDEN __dir_stream;
+class _LIBCUDACXX_HIDDEN __dir_stream;
 class directory_iterator {
 public:
   typedef directory_entry value_type;
@@ -44,122 +44,122 @@ class directory_iterator {
 
 public:
   //ctor & dtor
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   directory_iterator() noexcept {}
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   explicit directory_iterator(const path& __p)
       : directory_iterator(__p, nullptr) {}
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   directory_iterator(const path& __p, directory_options __opts)
       : directory_iterator(__p, nullptr, __opts) {}
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   directory_iterator(const path& __p, error_code& __ec)
       : directory_iterator(__p, &__ec) {}
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   directory_iterator(const path& __p, directory_options __opts,
                      error_code& __ec)
       : directory_iterator(__p, &__ec, __opts) {}
 
-  _LIBCPP_HIDE_FROM_ABI directory_iterator(const directory_iterator&) = default;
-  _LIBCPP_HIDE_FROM_ABI directory_iterator(directory_iterator&&) = default;
-  _LIBCPP_HIDE_FROM_ABI directory_iterator& operator=(const directory_iterator&) = default;
+  _LIBCUDACXX_HIDE_FROM_ABI directory_iterator(const directory_iterator&) = default;
+  _LIBCUDACXX_HIDE_FROM_ABI directory_iterator(directory_iterator&&) = default;
+  _LIBCUDACXX_HIDE_FROM_ABI directory_iterator& operator=(const directory_iterator&) = default;
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   directory_iterator& operator=(directory_iterator&& __o) noexcept {
     // non-default implementation provided to support self-move assign.
     if (this != &__o) {
-      __imp_ = _VSTD::move(__o.__imp_);
+      __imp_ = _CUDA_VSTD::move(__o.__imp_);
     }
     return *this;
   }
 
-  _LIBCPP_HIDE_FROM_ABI ~directory_iterator() = default;
+  _LIBCUDACXX_HIDE_FROM_ABI ~directory_iterator() = default;
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   const directory_entry& operator*() const {
-    _LIBCPP_ASSERT(__imp_, "The end iterator cannot be dereferenced");
+    _LIBCUDACXX_ASSERT(__imp_, "The end iterator cannot be dereferenced");
     return __dereference();
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   const directory_entry* operator->() const { return &**this; }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   directory_iterator& operator++() { return __increment(); }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   __dir_element_proxy operator++(int) {
     __dir_element_proxy __p(**this);
     __increment();
     return __p;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   directory_iterator& increment(error_code& __ec) { return __increment(&__ec); }
 
 private:
-  inline _LIBCPP_HIDE_FROM_ABI friend bool
+  inline _LIBCUDACXX_HIDE_FROM_ABI friend bool
   operator==(const directory_iterator& __lhs,
              const directory_iterator& __rhs) noexcept;
 
   // construct the dir_stream
-  _LIBCPP_FUNC_VIS
+  _LIBCUDACXX_FUNC_VIS
   directory_iterator(const path&, error_code*,
                      directory_options = directory_options::none);
 
-  _LIBCPP_FUNC_VIS
+  _LIBCUDACXX_FUNC_VIS
   directory_iterator& __increment(error_code* __ec = nullptr);
 
-  _LIBCPP_FUNC_VIS
+  _LIBCUDACXX_FUNC_VIS
   const directory_entry& __dereference() const;
 
 private:
   shared_ptr<__dir_stream> __imp_;
 };
 
-inline _LIBCPP_HIDE_FROM_ABI bool
+inline _LIBCUDACXX_HIDE_FROM_ABI bool
 operator==(const directory_iterator& __lhs,
            const directory_iterator& __rhs) noexcept {
   return __lhs.__imp_ == __rhs.__imp_;
 }
 
-inline _LIBCPP_HIDE_FROM_ABI bool
+inline _LIBCUDACXX_HIDE_FROM_ABI bool
 operator!=(const directory_iterator& __lhs,
            const directory_iterator& __rhs) noexcept {
   return !(__lhs == __rhs);
 }
 
 // enable directory_iterator range-based for statements
-inline _LIBCPP_HIDE_FROM_ABI directory_iterator
+inline _LIBCUDACXX_HIDE_FROM_ABI directory_iterator
 begin(directory_iterator __iter) noexcept {
   return __iter;
 }
 
-inline _LIBCPP_HIDE_FROM_ABI directory_iterator
+inline _LIBCUDACXX_HIDE_FROM_ABI directory_iterator
 end(directory_iterator) noexcept {
   return directory_iterator();
 }
 
-_LIBCPP_AVAILABILITY_FILESYSTEM_POP
+_LIBCUDACXX_AVAILABILITY_FILESYSTEM_POP
 
-_LIBCPP_END_NAMESPACE_FILESYSTEM
+_LIBCUDACXX_END_NAMESPACE_FILESYSTEM
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 template <>
-_LIBCPP_AVAILABILITY_FILESYSTEM
-inline constexpr bool _VSTD::ranges::enable_borrowed_range<_VSTD_FS::directory_iterator> = true;
+_LIBCUDACXX_AVAILABILITY_FILESYSTEM
+inline constexpr bool _CUDA_VSTD::ranges::enable_borrowed_range<_VSTD_FS::directory_iterator> = true;
 
 template <>
-_LIBCPP_AVAILABILITY_FILESYSTEM
-inline constexpr bool _VSTD::ranges::enable_view<_VSTD_FS::directory_iterator> = true;
+_LIBCUDACXX_AVAILABILITY_FILESYSTEM
+inline constexpr bool _CUDA_VSTD::ranges::enable_view<_VSTD_FS::directory_iterator> = true;
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
-#endif // _LIBCPP___FILESYSTEM_DIRECTORY_ITERATOR_H
+#endif // _LIBCUDACXX___FILESYSTEM_DIRECTORY_ITERATOR_H

diff  --git a/libcxx/include/__filesystem/directory_options.h b/libcxx/include/__filesystem/directory_options.h
index c5c031a567cf..5c8ccf28d15c 100644
--- a/libcxx/include/__filesystem/directory_options.h
+++ b/libcxx/include/__filesystem/directory_options.h
@@ -7,76 +7,76 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FILESYSTEM_DIRECTORY_OPTIONS_H
-#define _LIBCPP___FILESYSTEM_DIRECTORY_OPTIONS_H
+#ifndef _LIBCUDACXX___FILESYSTEM_DIRECTORY_OPTIONS_H
+#define _LIBCUDACXX___FILESYSTEM_DIRECTORY_OPTIONS_H
 
 #include <__availability>
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
-_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
+_LIBCUDACXX_BEGIN_NAMESPACE_FILESYSTEM
 
-_LIBCPP_AVAILABILITY_FILESYSTEM_PUSH
+_LIBCUDACXX_AVAILABILITY_FILESYSTEM_PUSH
 
-enum class _LIBCPP_ENUM_VIS directory_options : unsigned char {
+enum class _LIBCUDACXX_ENUM_VIS directory_options : unsigned char {
   none = 0,
   follow_directory_symlink = 1,
   skip_permission_denied = 2
 };
 
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 inline constexpr directory_options operator&(directory_options __lhs,
                                              directory_options __rhs) {
   return static_cast<directory_options>(static_cast<unsigned char>(__lhs) &
                                         static_cast<unsigned char>(__rhs));
 }
 
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 inline constexpr directory_options operator|(directory_options __lhs,
                                              directory_options __rhs) {
   return static_cast<directory_options>(static_cast<unsigned char>(__lhs) |
                                         static_cast<unsigned char>(__rhs));
 }
 
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 inline constexpr directory_options operator^(directory_options __lhs,
                                              directory_options __rhs) {
   return static_cast<directory_options>(static_cast<unsigned char>(__lhs) ^
                                         static_cast<unsigned char>(__rhs));
 }
 
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 inline constexpr directory_options operator~(directory_options __lhs) {
   return static_cast<directory_options>(~static_cast<unsigned char>(__lhs));
 }
 
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 inline directory_options& operator&=(directory_options& __lhs,
                                      directory_options __rhs) {
   return __lhs = __lhs & __rhs;
 }
 
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 inline directory_options& operator|=(directory_options& __lhs,
                                      directory_options __rhs) {
   return __lhs = __lhs | __rhs;
 }
 
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 inline directory_options& operator^=(directory_options& __lhs,
                                      directory_options __rhs) {
   return __lhs = __lhs ^ __rhs;
 }
 
-_LIBCPP_AVAILABILITY_FILESYSTEM_POP
+_LIBCUDACXX_AVAILABILITY_FILESYSTEM_POP
 
-_LIBCPP_END_NAMESPACE_FILESYSTEM
+_LIBCUDACXX_END_NAMESPACE_FILESYSTEM
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
-#endif // _LIBCPP___FILESYSTEM_DIRECTORY_OPTIONS_H
+#endif // _LIBCUDACXX___FILESYSTEM_DIRECTORY_OPTIONS_H

diff  --git a/libcxx/include/__filesystem/file_status.h b/libcxx/include/__filesystem/file_status.h
index ac3f6cbed9d7..3b1abbdbea94 100644
--- a/libcxx/include/__filesystem/file_status.h
+++ b/libcxx/include/__filesystem/file_status.h
@@ -7,30 +7,30 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FILESYSTEM_FILE_STATUS_H
-#define _LIBCPP___FILESYSTEM_FILE_STATUS_H
+#ifndef _LIBCUDACXX___FILESYSTEM_FILE_STATUS_H
+#define _LIBCUDACXX___FILESYSTEM_FILE_STATUS_H
 
 #include <__availability>
 #include <__config>
 #include <__filesystem/file_type.h>
 #include <__filesystem/perms.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
-_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
+_LIBCUDACXX_BEGIN_NAMESPACE_FILESYSTEM
 
-_LIBCPP_AVAILABILITY_FILESYSTEM_PUSH
+_LIBCUDACXX_AVAILABILITY_FILESYSTEM_PUSH
 
-class _LIBCPP_TYPE_VIS file_status {
+class _LIBCUDACXX_TYPE_VIS file_status {
 public:
   // constructors
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   file_status() noexcept : file_status(file_type::none) {}
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   explicit file_status(file_type __ft, perms __prms = perms::unknown) noexcept
       : __ft_(__ft),
         __prms_(__prms) {}
@@ -38,24 +38,24 @@ class _LIBCPP_TYPE_VIS file_status {
   file_status(const file_status&) noexcept = default;
   file_status(file_status&&) noexcept = default;
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   ~file_status() {}
 
   file_status& operator=(const file_status&) noexcept = default;
   file_status& operator=(file_status&&) noexcept = default;
 
   // observers
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   file_type type() const noexcept { return __ft_; }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   perms permissions() const noexcept { return __prms_; }
 
   // modifiers
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   void type(file_type __ft) noexcept { __ft_ = __ft; }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   void permissions(perms __p) noexcept { __prms_ = __p; }
 
 private:
@@ -63,10 +63,10 @@ class _LIBCPP_TYPE_VIS file_status {
   perms __prms_;
 };
 
-_LIBCPP_AVAILABILITY_FILESYSTEM_POP
+_LIBCUDACXX_AVAILABILITY_FILESYSTEM_POP
 
-_LIBCPP_END_NAMESPACE_FILESYSTEM
+_LIBCUDACXX_END_NAMESPACE_FILESYSTEM
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
-#endif // _LIBCPP___FILESYSTEM_FILE_STATUS_H
+#endif // _LIBCUDACXX___FILESYSTEM_FILE_STATUS_H

diff  --git a/libcxx/include/__filesystem/file_time_type.h b/libcxx/include/__filesystem/file_time_type.h
index 7c4932e603bc..335e29cd2144 100644
--- a/libcxx/include/__filesystem/file_time_type.h
+++ b/libcxx/include/__filesystem/file_time_type.h
@@ -7,26 +7,26 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FILESYSTEM_FILE_TIME_TYPE_H
-#define _LIBCPP___FILESYSTEM_FILE_TIME_TYPE_H
+#ifndef _LIBCUDACXX___FILESYSTEM_FILE_TIME_TYPE_H
+#define _LIBCUDACXX___FILESYSTEM_FILE_TIME_TYPE_H
 
 #include <__availability>
 #include <__chrono/file_clock.h>
 #include <__chrono/time_point.h>
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
-_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
+_LIBCUDACXX_BEGIN_NAMESPACE_FILESYSTEM
 
 typedef chrono::time_point<_FilesystemClock> file_time_type;
 
-_LIBCPP_END_NAMESPACE_FILESYSTEM
+_LIBCUDACXX_END_NAMESPACE_FILESYSTEM
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
-#endif // _LIBCPP___FILESYSTEM_FILE_TIME_TYPE_H
+#endif // _LIBCUDACXX___FILESYSTEM_FILE_TIME_TYPE_H

diff  --git a/libcxx/include/__filesystem/file_type.h b/libcxx/include/__filesystem/file_type.h
index c756a05c848b..ee33d740ddec 100644
--- a/libcxx/include/__filesystem/file_type.h
+++ b/libcxx/include/__filesystem/file_type.h
@@ -7,23 +7,23 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FILESYSTEM_FILE_TYPE_H
-#define _LIBCPP___FILESYSTEM_FILE_TYPE_H
+#ifndef _LIBCUDACXX___FILESYSTEM_FILE_TYPE_H
+#define _LIBCUDACXX___FILESYSTEM_FILE_TYPE_H
 
 #include <__availability>
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
-_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
+_LIBCUDACXX_BEGIN_NAMESPACE_FILESYSTEM
 
 // On Windows, the library never identifies files as block, character, fifo
 // or socket.
-enum class _LIBCPP_ENUM_VIS file_type : signed char {
+enum class _LIBCUDACXX_ENUM_VIS file_type : signed char {
   none = 0,
   not_found = -1,
   regular = 1,
@@ -36,8 +36,8 @@ enum class _LIBCPP_ENUM_VIS file_type : signed char {
   unknown = 8
 };
 
-_LIBCPP_END_NAMESPACE_FILESYSTEM
+_LIBCUDACXX_END_NAMESPACE_FILESYSTEM
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
-#endif // _LIBCPP___FILESYSTEM_FILE_TYPE_H
+#endif // _LIBCUDACXX___FILESYSTEM_FILE_TYPE_H

diff  --git a/libcxx/include/__filesystem/filesystem_error.h b/libcxx/include/__filesystem/filesystem_error.h
index e32b14c1b7bf..88c596fe85f9 100644
--- a/libcxx/include/__filesystem/filesystem_error.h
+++ b/libcxx/include/__filesystem/filesystem_error.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FILESYSTEM_FILESYSTEM_ERROR_H
-#define _LIBCPP___FILESYSTEM_FILESYSTEM_ERROR_H
+#ifndef _LIBCUDACXX___FILESYSTEM_FILESYSTEM_ERROR_H
+#define _LIBCUDACXX___FILESYSTEM_FILESYSTEM_ERROR_H
 
 #include <__availability>
 #include <__config>
@@ -19,31 +19,31 @@
 #include <system_error>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
-_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
+_LIBCUDACXX_BEGIN_NAMESPACE_FILESYSTEM
 
-class _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_EXCEPTION_ABI filesystem_error : public system_error {
+class _LIBCUDACXX_AVAILABILITY_FILESYSTEM _LIBCUDACXX_EXCEPTION_ABI filesystem_error : public system_error {
 public:
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   filesystem_error(const string& __what, error_code __ec)
       : system_error(__ec, __what),
         __storage_(make_shared<_Storage>(path(), path())) {
     __create_what(0);
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   filesystem_error(const string& __what, const path& __p1, error_code __ec)
       : system_error(__ec, __what),
         __storage_(make_shared<_Storage>(__p1, path())) {
     __create_what(1);
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   filesystem_error(const string& __what, const path& __p1, const path& __p2,
                    error_code __ec)
       : system_error(__ec, __what),
@@ -51,16 +51,16 @@ class _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_EXCEPTION_ABI filesystem_error : p
     __create_what(2);
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   const path& path1() const noexcept { return __storage_->__p1_; }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   const path& path2() const noexcept { return __storage_->__p2_; }
 
   filesystem_error(const filesystem_error&) = default;
   ~filesystem_error() override; // key function
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   const char* what() const noexcept override {
     return __storage_->__what_.c_str();
   }
@@ -68,8 +68,8 @@ class _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_EXCEPTION_ABI filesystem_error : p
   void __create_what(int __num_paths);
 
 private:
-  struct _LIBCPP_HIDDEN _Storage {
-    _LIBCPP_INLINE_VISIBILITY
+  struct _LIBCUDACXX_HIDDEN _Storage {
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Storage(const path& __p1, const path& __p2) : __p1_(__p1), __p2_(__p2) {}
 
     path __p1_;
@@ -81,23 +81,23 @@ class _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_EXCEPTION_ABI filesystem_error : p
 
 // TODO(ldionne): We need to pop the pragma and push it again after
 //                filesystem_error to work around PR41078.
-_LIBCPP_AVAILABILITY_FILESYSTEM_PUSH
+_LIBCUDACXX_AVAILABILITY_FILESYSTEM_PUSH
 
 template <class... _Args>
-_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
-#ifndef _LIBCPP_NO_EXCEPTIONS
+_LIBCUDACXX_NORETURN inline _LIBCUDACXX_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
 void __throw_filesystem_error(_Args&&... __args) {
-  throw filesystem_error(_VSTD::forward<_Args>(__args)...);
+  throw filesystem_error(_CUDA_VSTD::forward<_Args>(__args)...);
 }
 #else
 void __throw_filesystem_error(_Args&&...) {
-  _VSTD::abort();
+  _CUDA_VSTD::abort();
 }
 #endif
-_LIBCPP_AVAILABILITY_FILESYSTEM_POP
+_LIBCUDACXX_AVAILABILITY_FILESYSTEM_POP
 
-_LIBCPP_END_NAMESPACE_FILESYSTEM
+_LIBCUDACXX_END_NAMESPACE_FILESYSTEM
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
-#endif // _LIBCPP___FILESYSTEM_FILESYSTEM_ERROR_H
+#endif // _LIBCUDACXX___FILESYSTEM_FILESYSTEM_ERROR_H

diff  --git a/libcxx/include/__filesystem/operations.h b/libcxx/include/__filesystem/operations.h
index f48d301d090c..c27e272991d7 100644
--- a/libcxx/include/__filesystem/operations.h
+++ b/libcxx/include/__filesystem/operations.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FILESYSTEM_OPERATIONS_H
-#define _LIBCPP___FILESYSTEM_OPERATIONS_H
+#ifndef _LIBCUDACXX___FILESYSTEM_OPERATIONS_H
+#define _LIBCUDACXX___FILESYSTEM_OPERATIONS_H
 
 #include <__availability>
 #include <__chrono/time_point.h>
@@ -24,128 +24,128 @@
 #include <cstdint>
 #include <system_error>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#ifndef _LIBCPP_CXX03_LANG
-
-_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
-
-_LIBCPP_AVAILABILITY_FILESYSTEM_PUSH
-
-_LIBCPP_FUNC_VIS path __absolute(const path&, error_code* __ec = nullptr);
-_LIBCPP_FUNC_VIS path __canonical(const path&, error_code* __ec = nullptr);
-_LIBCPP_FUNC_VIS bool __copy_file(const path& __from, const path& __to, copy_options __opt, error_code* __ec = nullptr);
-_LIBCPP_FUNC_VIS void __copy_symlink(const path& __existing_symlink, const path& __new_symlink, error_code* __ec = nullptr);
-_LIBCPP_FUNC_VIS void __copy(const path& __from, const path& __to, copy_options __opt, error_code* __ec = nullptr);
-_LIBCPP_FUNC_VIS bool __create_directories(const path&, error_code* = nullptr);
-_LIBCPP_FUNC_VIS void __create_directory_symlink(const path& __to, const path& __new_symlink, error_code* __ec = nullptr);
-_LIBCPP_FUNC_VIS bool __create_directory(const path&, error_code* = nullptr);
-_LIBCPP_FUNC_VIS bool __create_directory(const path&, const path& __attributes, error_code* = nullptr);
-_LIBCPP_FUNC_VIS void __create_hard_link(const path& __to, const path& __new_hard_link, error_code* __ec = nullptr);
-_LIBCPP_FUNC_VIS void __create_symlink(const path& __to, const path& __new_symlink, error_code* __ec = nullptr);
-_LIBCPP_FUNC_VIS path __current_path(error_code* __ec = nullptr);
-_LIBCPP_FUNC_VIS void __current_path(const path&, error_code* __ec = nullptr);
-_LIBCPP_FUNC_VIS bool __equivalent(const path&, const path&, error_code* __ec = nullptr);
-_LIBCPP_FUNC_VIS file_status __status(const path&, error_code* __ec = nullptr);
-_LIBCPP_FUNC_VIS uintmax_t __file_size(const path&, error_code* __ec = nullptr);
-_LIBCPP_FUNC_VIS uintmax_t __hard_link_count(const path&, error_code* __ec = nullptr);
-_LIBCPP_FUNC_VIS file_status __symlink_status(const path&, error_code* __ec = nullptr);
-_LIBCPP_FUNC_VIS file_time_type __last_write_time(const path&, error_code* __ec = nullptr);
-_LIBCPP_FUNC_VIS void __last_write_time(const path&, file_time_type __new_time, error_code* __ec = nullptr);
-_LIBCPP_FUNC_VIS path __weakly_canonical(path const& __p, error_code* __ec = nullptr);
-_LIBCPP_FUNC_VIS path __read_symlink(const path&, error_code* __ec = nullptr);
-_LIBCPP_FUNC_VIS uintmax_t __remove_all(const path&, error_code* __ec = nullptr);
-_LIBCPP_FUNC_VIS bool __remove(const path&, error_code* __ec = nullptr);
-_LIBCPP_FUNC_VIS void __rename(const path& __from, const path& __to, error_code* __ec = nullptr);
-_LIBCPP_FUNC_VIS void __resize_file(const path&, uintmax_t __size, error_code* = nullptr);
-_LIBCPP_FUNC_VIS path __temp_directory_path(error_code* __ec = nullptr);
-
-inline _LIBCPP_HIDE_FROM_ABI path absolute(const path& __p) { return __absolute(__p); }
-inline _LIBCPP_HIDE_FROM_ABI path absolute(const path& __p, error_code& __ec) { return __absolute(__p, &__ec); }
-inline _LIBCPP_HIDE_FROM_ABI path canonical(const path& __p)                   { return __canonical(__p); }
-inline _LIBCPP_HIDE_FROM_ABI path canonical(const path& __p, error_code& __ec) { return __canonical(__p, &__ec); }
-inline _LIBCPP_HIDE_FROM_ABI bool copy_file(const path& __from, const path& __to) { return __copy_file(__from, __to, copy_options::none); }
-inline _LIBCPP_HIDE_FROM_ABI bool copy_file(const path& __from, const path& __to, error_code& __ec) { return __copy_file(__from, __to, copy_options::none, &__ec); }
-inline _LIBCPP_HIDE_FROM_ABI bool copy_file(const path& __from, const path& __to, copy_options __opt) { return __copy_file(__from, __to, __opt); }
-inline _LIBCPP_HIDE_FROM_ABI bool copy_file(const path& __from, const path& __to, copy_options __opt, error_code& __ec) { return __copy_file(__from, __to, __opt, &__ec); }
-inline _LIBCPP_HIDE_FROM_ABI void copy_symlink(const path& __from, const path& __to) { __copy_symlink(__from, __to); }
-inline _LIBCPP_HIDE_FROM_ABI void copy_symlink(const path& __from, const path& __to, error_code& __ec) noexcept { __copy_symlink(__from, __to, &__ec); }
-inline _LIBCPP_HIDE_FROM_ABI void copy(const path& __from, const path& __to) { __copy(__from, __to, copy_options::none); }
-inline _LIBCPP_HIDE_FROM_ABI void copy(const path& __from, const path& __to, error_code& __ec) { __copy(__from, __to, copy_options::none, &__ec); }
-inline _LIBCPP_HIDE_FROM_ABI void copy(const path& __from, const path& __to, copy_options __opt) { __copy(__from, __to, __opt); }
-inline _LIBCPP_HIDE_FROM_ABI void copy(const path& __from, const path& __to, copy_options __opt, error_code& __ec) { __copy(__from, __to, __opt, &__ec); }
-inline _LIBCPP_HIDE_FROM_ABI bool create_directories(const path& __p) { return __create_directories(__p); }
-inline _LIBCPP_HIDE_FROM_ABI bool create_directories(const path& __p, error_code& __ec) { return __create_directories(__p, &__ec); }
-inline _LIBCPP_HIDE_FROM_ABI void create_directory_symlink(const path& __target, const path& __link) { __create_directory_symlink(__target, __link); }
-inline _LIBCPP_HIDE_FROM_ABI void create_directory_symlink(const path& __target, const path& __link, error_code& __ec) noexcept { __create_directory_symlink(__target, __link, &__ec); }
-inline _LIBCPP_HIDE_FROM_ABI bool create_directory(const path& __p) { return __create_directory(__p); }
-inline _LIBCPP_HIDE_FROM_ABI bool create_directory(const path& __p, error_code& __ec) noexcept { return __create_directory(__p, &__ec); }
-inline _LIBCPP_HIDE_FROM_ABI bool create_directory(const path& __p, const path& __attrs) { return __create_directory(__p, __attrs); }
-inline _LIBCPP_HIDE_FROM_ABI bool create_directory(const path& __p, const path& __attrs, error_code& __ec) noexcept { return __create_directory(__p, __attrs, &__ec); }
-inline _LIBCPP_HIDE_FROM_ABI void create_hard_link(const path& __target, const path& __link) { __create_hard_link(__target, __link); }
-inline _LIBCPP_HIDE_FROM_ABI void create_hard_link(const path& __target, const path& __link, error_code& __ec) noexcept { __create_hard_link(__target, __link, &__ec); }
-inline _LIBCPP_HIDE_FROM_ABI void create_symlink(const path& __target, const path& __link) { __create_symlink(__target, __link); }
-inline _LIBCPP_HIDE_FROM_ABI void create_symlink(const path& __target, const path& __link, error_code& __ec) noexcept { return __create_symlink(__target, __link, &__ec); }
-inline _LIBCPP_HIDE_FROM_ABI path current_path() { return __current_path(); }
-inline _LIBCPP_HIDE_FROM_ABI path current_path(error_code& __ec) { return __current_path(&__ec); }
-inline _LIBCPP_HIDE_FROM_ABI void current_path(const path& __p) { __current_path(__p); }
-inline _LIBCPP_HIDE_FROM_ABI void current_path(const path& __p, error_code& __ec) noexcept { __current_path(__p, &__ec); }
-inline _LIBCPP_HIDE_FROM_ABI bool equivalent(const path& __p1, const path& __p2) { return __equivalent(__p1, __p2); }
-inline _LIBCPP_HIDE_FROM_ABI bool equivalent(const path& __p1, const path& __p2, error_code& __ec) noexcept { return __equivalent(__p1, __p2, &__ec); }
-inline _LIBCPP_HIDE_FROM_ABI bool status_known(file_status __s) noexcept { return __s.type() != file_type::none; }
-inline _LIBCPP_HIDE_FROM_ABI bool exists(file_status __s) noexcept { return status_known(__s) && __s.type() != file_type::not_found; }
-inline _LIBCPP_HIDE_FROM_ABI bool exists(const path& __p) { return exists(__status(__p)); }
-
-inline _LIBCPP_INLINE_VISIBILITY bool exists(const path& __p, error_code& __ec) noexcept {
+#ifndef _LIBCUDACXX_CXX03_LANG
+
+_LIBCUDACXX_BEGIN_NAMESPACE_FILESYSTEM
+
+_LIBCUDACXX_AVAILABILITY_FILESYSTEM_PUSH
+
+_LIBCUDACXX_FUNC_VIS path __absolute(const path&, error_code* __ec = nullptr);
+_LIBCUDACXX_FUNC_VIS path __canonical(const path&, error_code* __ec = nullptr);
+_LIBCUDACXX_FUNC_VIS bool __copy_file(const path& __from, const path& __to, copy_options __opt, error_code* __ec = nullptr);
+_LIBCUDACXX_FUNC_VIS void __copy_symlink(const path& __existing_symlink, const path& __new_symlink, error_code* __ec = nullptr);
+_LIBCUDACXX_FUNC_VIS void __copy(const path& __from, const path& __to, copy_options __opt, error_code* __ec = nullptr);
+_LIBCUDACXX_FUNC_VIS bool __create_directories(const path&, error_code* = nullptr);
+_LIBCUDACXX_FUNC_VIS void __create_directory_symlink(const path& __to, const path& __new_symlink, error_code* __ec = nullptr);
+_LIBCUDACXX_FUNC_VIS bool __create_directory(const path&, error_code* = nullptr);
+_LIBCUDACXX_FUNC_VIS bool __create_directory(const path&, const path& __attributes, error_code* = nullptr);
+_LIBCUDACXX_FUNC_VIS void __create_hard_link(const path& __to, const path& __new_hard_link, error_code* __ec = nullptr);
+_LIBCUDACXX_FUNC_VIS void __create_symlink(const path& __to, const path& __new_symlink, error_code* __ec = nullptr);
+_LIBCUDACXX_FUNC_VIS path __current_path(error_code* __ec = nullptr);
+_LIBCUDACXX_FUNC_VIS void __current_path(const path&, error_code* __ec = nullptr);
+_LIBCUDACXX_FUNC_VIS bool __equivalent(const path&, const path&, error_code* __ec = nullptr);
+_LIBCUDACXX_FUNC_VIS file_status __status(const path&, error_code* __ec = nullptr);
+_LIBCUDACXX_FUNC_VIS uintmax_t __file_size(const path&, error_code* __ec = nullptr);
+_LIBCUDACXX_FUNC_VIS uintmax_t __hard_link_count(const path&, error_code* __ec = nullptr);
+_LIBCUDACXX_FUNC_VIS file_status __symlink_status(const path&, error_code* __ec = nullptr);
+_LIBCUDACXX_FUNC_VIS file_time_type __last_write_time(const path&, error_code* __ec = nullptr);
+_LIBCUDACXX_FUNC_VIS void __last_write_time(const path&, file_time_type __new_time, error_code* __ec = nullptr);
+_LIBCUDACXX_FUNC_VIS path __weakly_canonical(path const& __p, error_code* __ec = nullptr);
+_LIBCUDACXX_FUNC_VIS path __read_symlink(const path&, error_code* __ec = nullptr);
+_LIBCUDACXX_FUNC_VIS uintmax_t __remove_all(const path&, error_code* __ec = nullptr);
+_LIBCUDACXX_FUNC_VIS bool __remove(const path&, error_code* __ec = nullptr);
+_LIBCUDACXX_FUNC_VIS void __rename(const path& __from, const path& __to, error_code* __ec = nullptr);
+_LIBCUDACXX_FUNC_VIS void __resize_file(const path&, uintmax_t __size, error_code* = nullptr);
+_LIBCUDACXX_FUNC_VIS path __temp_directory_path(error_code* __ec = nullptr);
+
+inline _LIBCUDACXX_HIDE_FROM_ABI path absolute(const path& __p) { return __absolute(__p); }
+inline _LIBCUDACXX_HIDE_FROM_ABI path absolute(const path& __p, error_code& __ec) { return __absolute(__p, &__ec); }
+inline _LIBCUDACXX_HIDE_FROM_ABI path canonical(const path& __p)                   { return __canonical(__p); }
+inline _LIBCUDACXX_HIDE_FROM_ABI path canonical(const path& __p, error_code& __ec) { return __canonical(__p, &__ec); }
+inline _LIBCUDACXX_HIDE_FROM_ABI bool copy_file(const path& __from, const path& __to) { return __copy_file(__from, __to, copy_options::none); }
+inline _LIBCUDACXX_HIDE_FROM_ABI bool copy_file(const path& __from, const path& __to, error_code& __ec) { return __copy_file(__from, __to, copy_options::none, &__ec); }
+inline _LIBCUDACXX_HIDE_FROM_ABI bool copy_file(const path& __from, const path& __to, copy_options __opt) { return __copy_file(__from, __to, __opt); }
+inline _LIBCUDACXX_HIDE_FROM_ABI bool copy_file(const path& __from, const path& __to, copy_options __opt, error_code& __ec) { return __copy_file(__from, __to, __opt, &__ec); }
+inline _LIBCUDACXX_HIDE_FROM_ABI void copy_symlink(const path& __from, const path& __to) { __copy_symlink(__from, __to); }
+inline _LIBCUDACXX_HIDE_FROM_ABI void copy_symlink(const path& __from, const path& __to, error_code& __ec) noexcept { __copy_symlink(__from, __to, &__ec); }
+inline _LIBCUDACXX_HIDE_FROM_ABI void copy(const path& __from, const path& __to) { __copy(__from, __to, copy_options::none); }
+inline _LIBCUDACXX_HIDE_FROM_ABI void copy(const path& __from, const path& __to, error_code& __ec) { __copy(__from, __to, copy_options::none, &__ec); }
+inline _LIBCUDACXX_HIDE_FROM_ABI void copy(const path& __from, const path& __to, copy_options __opt) { __copy(__from, __to, __opt); }
+inline _LIBCUDACXX_HIDE_FROM_ABI void copy(const path& __from, const path& __to, copy_options __opt, error_code& __ec) { __copy(__from, __to, __opt, &__ec); }
+inline _LIBCUDACXX_HIDE_FROM_ABI bool create_directories(const path& __p) { return __create_directories(__p); }
+inline _LIBCUDACXX_HIDE_FROM_ABI bool create_directories(const path& __p, error_code& __ec) { return __create_directories(__p, &__ec); }
+inline _LIBCUDACXX_HIDE_FROM_ABI void create_directory_symlink(const path& __target, const path& __link) { __create_directory_symlink(__target, __link); }
+inline _LIBCUDACXX_HIDE_FROM_ABI void create_directory_symlink(const path& __target, const path& __link, error_code& __ec) noexcept { __create_directory_symlink(__target, __link, &__ec); }
+inline _LIBCUDACXX_HIDE_FROM_ABI bool create_directory(const path& __p) { return __create_directory(__p); }
+inline _LIBCUDACXX_HIDE_FROM_ABI bool create_directory(const path& __p, error_code& __ec) noexcept { return __create_directory(__p, &__ec); }
+inline _LIBCUDACXX_HIDE_FROM_ABI bool create_directory(const path& __p, const path& __attrs) { return __create_directory(__p, __attrs); }
+inline _LIBCUDACXX_HIDE_FROM_ABI bool create_directory(const path& __p, const path& __attrs, error_code& __ec) noexcept { return __create_directory(__p, __attrs, &__ec); }
+inline _LIBCUDACXX_HIDE_FROM_ABI void create_hard_link(const path& __target, const path& __link) { __create_hard_link(__target, __link); }
+inline _LIBCUDACXX_HIDE_FROM_ABI void create_hard_link(const path& __target, const path& __link, error_code& __ec) noexcept { __create_hard_link(__target, __link, &__ec); }
+inline _LIBCUDACXX_HIDE_FROM_ABI void create_symlink(const path& __target, const path& __link) { __create_symlink(__target, __link); }
+inline _LIBCUDACXX_HIDE_FROM_ABI void create_symlink(const path& __target, const path& __link, error_code& __ec) noexcept { return __create_symlink(__target, __link, &__ec); }
+inline _LIBCUDACXX_HIDE_FROM_ABI path current_path() { return __current_path(); }
+inline _LIBCUDACXX_HIDE_FROM_ABI path current_path(error_code& __ec) { return __current_path(&__ec); }
+inline _LIBCUDACXX_HIDE_FROM_ABI void current_path(const path& __p) { __current_path(__p); }
+inline _LIBCUDACXX_HIDE_FROM_ABI void current_path(const path& __p, error_code& __ec) noexcept { __current_path(__p, &__ec); }
+inline _LIBCUDACXX_HIDE_FROM_ABI bool equivalent(const path& __p1, const path& __p2) { return __equivalent(__p1, __p2); }
+inline _LIBCUDACXX_HIDE_FROM_ABI bool equivalent(const path& __p1, const path& __p2, error_code& __ec) noexcept { return __equivalent(__p1, __p2, &__ec); }
+inline _LIBCUDACXX_HIDE_FROM_ABI bool status_known(file_status __s) noexcept { return __s.type() != file_type::none; }
+inline _LIBCUDACXX_HIDE_FROM_ABI bool exists(file_status __s) noexcept { return status_known(__s) && __s.type() != file_type::not_found; }
+inline _LIBCUDACXX_HIDE_FROM_ABI bool exists(const path& __p) { return exists(__status(__p)); }
+
+inline _LIBCUDACXX_INLINE_VISIBILITY bool exists(const path& __p, error_code& __ec) noexcept {
   auto __s = __status(__p, &__ec);
   if (status_known(__s))
     __ec.clear();
   return exists(__s);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI uintmax_t file_size(const path& __p) { return __file_size(__p); }
-inline _LIBCPP_HIDE_FROM_ABI uintmax_t file_size(const path& __p, error_code& __ec) noexcept { return __file_size(__p, &__ec); }
-inline _LIBCPP_HIDE_FROM_ABI uintmax_t hard_link_count(const path& __p) { return __hard_link_count(__p); }
-inline _LIBCPP_HIDE_FROM_ABI uintmax_t hard_link_count(const path& __p, error_code& __ec) noexcept { return __hard_link_count(__p, &__ec); }
-inline _LIBCPP_HIDE_FROM_ABI bool is_block_file(file_status __s) noexcept { return __s.type() == file_type::block; }
-inline _LIBCPP_HIDE_FROM_ABI bool is_block_file(const path& __p) { return is_block_file(__status(__p)); }
-inline _LIBCPP_HIDE_FROM_ABI bool is_block_file(const path& __p, error_code& __ec) noexcept { return is_block_file(__status(__p, &__ec)); }
-inline _LIBCPP_HIDE_FROM_ABI bool is_character_file(file_status __s) noexcept { return __s.type() == file_type::character; }
-inline _LIBCPP_HIDE_FROM_ABI bool is_character_file(const path& __p) { return is_character_file(__status(__p)); }
-inline _LIBCPP_HIDE_FROM_ABI bool is_character_file(const path& __p, error_code& __ec) noexcept { return is_character_file(__status(__p, &__ec)); }
-inline _LIBCPP_HIDE_FROM_ABI bool is_directory(file_status __s) noexcept { return __s.type() == file_type::directory; }
-inline _LIBCPP_HIDE_FROM_ABI bool is_directory(const path& __p) { return is_directory(__status(__p)); }
-inline _LIBCPP_HIDE_FROM_ABI bool is_directory(const path& __p, error_code& __ec) noexcept { return is_directory(__status(__p, &__ec)); }
-_LIBCPP_FUNC_VIS bool __fs_is_empty(const path& __p, error_code* __ec = nullptr);
-inline _LIBCPP_HIDE_FROM_ABI bool is_empty(const path& __p) { return __fs_is_empty(__p); }
-inline _LIBCPP_HIDE_FROM_ABI bool is_empty(const path& __p, error_code& __ec) { return __fs_is_empty(__p, &__ec); }
-inline _LIBCPP_HIDE_FROM_ABI bool is_fifo(file_status __s) noexcept { return __s.type() == file_type::fifo; }
-inline _LIBCPP_HIDE_FROM_ABI bool is_fifo(const path& __p) { return is_fifo(__status(__p)); }
-inline _LIBCPP_HIDE_FROM_ABI bool is_fifo(const path& __p, error_code& __ec) noexcept { return is_fifo(__status(__p, &__ec)); }
-inline _LIBCPP_HIDE_FROM_ABI bool is_regular_file(file_status __s) noexcept { return __s.type() == file_type::regular; }
-inline _LIBCPP_HIDE_FROM_ABI bool is_regular_file(const path& __p) { return is_regular_file(__status(__p)); }
-inline _LIBCPP_HIDE_FROM_ABI bool is_regular_file(const path& __p, error_code& __ec) noexcept { return is_regular_file(__status(__p, &__ec)); }
-inline _LIBCPP_HIDE_FROM_ABI bool is_symlink(file_status __s) noexcept { return __s.type() == file_type::symlink; }
-inline _LIBCPP_HIDE_FROM_ABI bool is_symlink(const path& __p) { return is_symlink(__symlink_status(__p)); }
-inline _LIBCPP_HIDE_FROM_ABI bool is_symlink(const path& __p, error_code& __ec) noexcept { return is_symlink(__symlink_status(__p, &__ec)); }
-inline _LIBCPP_HIDE_FROM_ABI bool is_other(file_status __s) noexcept { return exists(__s) && !is_regular_file(__s) && !is_directory(__s) && !is_symlink(__s); }
-inline _LIBCPP_HIDE_FROM_ABI bool is_other(const path& __p) { return is_other(__status(__p)); }
-inline _LIBCPP_HIDE_FROM_ABI bool is_other(const path& __p, error_code& __ec) noexcept { return is_other(__status(__p, &__ec)); }
-inline _LIBCPP_HIDE_FROM_ABI bool is_socket(file_status __s) noexcept { return __s.type() == file_type::socket; }
-inline _LIBCPP_HIDE_FROM_ABI bool is_socket(const path& __p) { return is_socket(__status(__p)); }
-inline _LIBCPP_HIDE_FROM_ABI bool is_socket(const path& __p, error_code& __ec) noexcept { return is_socket(__status(__p, &__ec)); }
-inline _LIBCPP_HIDE_FROM_ABI file_time_type last_write_time(const path& __p) { return __last_write_time(__p); }
-inline _LIBCPP_HIDE_FROM_ABI file_time_type last_write_time(const path& __p, error_code& __ec) noexcept { return __last_write_time(__p, &__ec); }
-inline _LIBCPP_HIDE_FROM_ABI void last_write_time(const path& __p, file_time_type __t) { __last_write_time(__p, __t); }
-inline _LIBCPP_HIDE_FROM_ABI void last_write_time(const path& __p, file_time_type __t, error_code& __ec) noexcept { __last_write_time(__p, __t, &__ec); }
-_LIBCPP_FUNC_VIS void __permissions(const path&, perms, perm_options, error_code* = nullptr);
-inline _LIBCPP_HIDE_FROM_ABI void permissions(const path& __p, perms __prms, perm_options __opts = perm_options::replace) { __permissions(__p, __prms, __opts); }
-inline _LIBCPP_HIDE_FROM_ABI void permissions(const path& __p, perms __prms, error_code& __ec) noexcept { __permissions(__p, __prms, perm_options::replace, &__ec); }
-inline _LIBCPP_HIDE_FROM_ABI void permissions(const path& __p, perms __prms, perm_options __opts, error_code& __ec) { __permissions(__p, __prms, __opts, &__ec); }
-
-inline _LIBCPP_INLINE_VISIBILITY path proximate(const path& __p, const path& __base, error_code& __ec) {
+inline _LIBCUDACXX_HIDE_FROM_ABI uintmax_t file_size(const path& __p) { return __file_size(__p); }
+inline _LIBCUDACXX_HIDE_FROM_ABI uintmax_t file_size(const path& __p, error_code& __ec) noexcept { return __file_size(__p, &__ec); }
+inline _LIBCUDACXX_HIDE_FROM_ABI uintmax_t hard_link_count(const path& __p) { return __hard_link_count(__p); }
+inline _LIBCUDACXX_HIDE_FROM_ABI uintmax_t hard_link_count(const path& __p, error_code& __ec) noexcept { return __hard_link_count(__p, &__ec); }
+inline _LIBCUDACXX_HIDE_FROM_ABI bool is_block_file(file_status __s) noexcept { return __s.type() == file_type::block; }
+inline _LIBCUDACXX_HIDE_FROM_ABI bool is_block_file(const path& __p) { return is_block_file(__status(__p)); }
+inline _LIBCUDACXX_HIDE_FROM_ABI bool is_block_file(const path& __p, error_code& __ec) noexcept { return is_block_file(__status(__p, &__ec)); }
+inline _LIBCUDACXX_HIDE_FROM_ABI bool is_character_file(file_status __s) noexcept { return __s.type() == file_type::character; }
+inline _LIBCUDACXX_HIDE_FROM_ABI bool is_character_file(const path& __p) { return is_character_file(__status(__p)); }
+inline _LIBCUDACXX_HIDE_FROM_ABI bool is_character_file(const path& __p, error_code& __ec) noexcept { return is_character_file(__status(__p, &__ec)); }
+inline _LIBCUDACXX_HIDE_FROM_ABI bool is_directory(file_status __s) noexcept { return __s.type() == file_type::directory; }
+inline _LIBCUDACXX_HIDE_FROM_ABI bool is_directory(const path& __p) { return is_directory(__status(__p)); }
+inline _LIBCUDACXX_HIDE_FROM_ABI bool is_directory(const path& __p, error_code& __ec) noexcept { return is_directory(__status(__p, &__ec)); }
+_LIBCUDACXX_FUNC_VIS bool __fs_is_empty(const path& __p, error_code* __ec = nullptr);
+inline _LIBCUDACXX_HIDE_FROM_ABI bool is_empty(const path& __p) { return __fs_is_empty(__p); }
+inline _LIBCUDACXX_HIDE_FROM_ABI bool is_empty(const path& __p, error_code& __ec) { return __fs_is_empty(__p, &__ec); }
+inline _LIBCUDACXX_HIDE_FROM_ABI bool is_fifo(file_status __s) noexcept { return __s.type() == file_type::fifo; }
+inline _LIBCUDACXX_HIDE_FROM_ABI bool is_fifo(const path& __p) { return is_fifo(__status(__p)); }
+inline _LIBCUDACXX_HIDE_FROM_ABI bool is_fifo(const path& __p, error_code& __ec) noexcept { return is_fifo(__status(__p, &__ec)); }
+inline _LIBCUDACXX_HIDE_FROM_ABI bool is_regular_file(file_status __s) noexcept { return __s.type() == file_type::regular; }
+inline _LIBCUDACXX_HIDE_FROM_ABI bool is_regular_file(const path& __p) { return is_regular_file(__status(__p)); }
+inline _LIBCUDACXX_HIDE_FROM_ABI bool is_regular_file(const path& __p, error_code& __ec) noexcept { return is_regular_file(__status(__p, &__ec)); }
+inline _LIBCUDACXX_HIDE_FROM_ABI bool is_symlink(file_status __s) noexcept { return __s.type() == file_type::symlink; }
+inline _LIBCUDACXX_HIDE_FROM_ABI bool is_symlink(const path& __p) { return is_symlink(__symlink_status(__p)); }
+inline _LIBCUDACXX_HIDE_FROM_ABI bool is_symlink(const path& __p, error_code& __ec) noexcept { return is_symlink(__symlink_status(__p, &__ec)); }
+inline _LIBCUDACXX_HIDE_FROM_ABI bool is_other(file_status __s) noexcept { return exists(__s) && !is_regular_file(__s) && !is_directory(__s) && !is_symlink(__s); }
+inline _LIBCUDACXX_HIDE_FROM_ABI bool is_other(const path& __p) { return is_other(__status(__p)); }
+inline _LIBCUDACXX_HIDE_FROM_ABI bool is_other(const path& __p, error_code& __ec) noexcept { return is_other(__status(__p, &__ec)); }
+inline _LIBCUDACXX_HIDE_FROM_ABI bool is_socket(file_status __s) noexcept { return __s.type() == file_type::socket; }
+inline _LIBCUDACXX_HIDE_FROM_ABI bool is_socket(const path& __p) { return is_socket(__status(__p)); }
+inline _LIBCUDACXX_HIDE_FROM_ABI bool is_socket(const path& __p, error_code& __ec) noexcept { return is_socket(__status(__p, &__ec)); }
+inline _LIBCUDACXX_HIDE_FROM_ABI file_time_type last_write_time(const path& __p) { return __last_write_time(__p); }
+inline _LIBCUDACXX_HIDE_FROM_ABI file_time_type last_write_time(const path& __p, error_code& __ec) noexcept { return __last_write_time(__p, &__ec); }
+inline _LIBCUDACXX_HIDE_FROM_ABI void last_write_time(const path& __p, file_time_type __t) { __last_write_time(__p, __t); }
+inline _LIBCUDACXX_HIDE_FROM_ABI void last_write_time(const path& __p, file_time_type __t, error_code& __ec) noexcept { __last_write_time(__p, __t, &__ec); }
+_LIBCUDACXX_FUNC_VIS void __permissions(const path&, perms, perm_options, error_code* = nullptr);
+inline _LIBCUDACXX_HIDE_FROM_ABI void permissions(const path& __p, perms __prms, perm_options __opts = perm_options::replace) { __permissions(__p, __prms, __opts); }
+inline _LIBCUDACXX_HIDE_FROM_ABI void permissions(const path& __p, perms __prms, error_code& __ec) noexcept { __permissions(__p, __prms, perm_options::replace, &__ec); }
+inline _LIBCUDACXX_HIDE_FROM_ABI void permissions(const path& __p, perms __prms, perm_options __opts, error_code& __ec) { __permissions(__p, __prms, __opts, &__ec); }
+
+inline _LIBCUDACXX_INLINE_VISIBILITY path proximate(const path& __p, const path& __base, error_code& __ec) {
   path __tmp = __weakly_canonical(__p, &__ec);
   if (__ec)
     return {};
@@ -155,12 +155,12 @@ inline _LIBCPP_INLINE_VISIBILITY path proximate(const path& __p, const path& __b
   return __tmp.lexically_proximate(__tmp_base);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI path proximate(const path& __p, error_code& __ec) { return proximate(__p, current_path(), __ec); }
-inline _LIBCPP_HIDE_FROM_ABI path proximate(const path& __p, const path& __base = current_path()) { return __weakly_canonical(__p).lexically_proximate(__weakly_canonical(__base)); }
-inline _LIBCPP_HIDE_FROM_ABI path read_symlink(const path& __p) { return __read_symlink(__p); }
-inline _LIBCPP_HIDE_FROM_ABI path read_symlink(const path& __p, error_code& __ec) { return __read_symlink(__p, &__ec); }
+inline _LIBCUDACXX_HIDE_FROM_ABI path proximate(const path& __p, error_code& __ec) { return proximate(__p, current_path(), __ec); }
+inline _LIBCUDACXX_HIDE_FROM_ABI path proximate(const path& __p, const path& __base = current_path()) { return __weakly_canonical(__p).lexically_proximate(__weakly_canonical(__base)); }
+inline _LIBCUDACXX_HIDE_FROM_ABI path read_symlink(const path& __p) { return __read_symlink(__p); }
+inline _LIBCUDACXX_HIDE_FROM_ABI path read_symlink(const path& __p, error_code& __ec) { return __read_symlink(__p, &__ec); }
 
-inline _LIBCPP_INLINE_VISIBILITY path relative(const path& __p, const path& __base, error_code& __ec) {
+inline _LIBCUDACXX_INLINE_VISIBILITY path relative(const path& __p, const path& __base, error_code& __ec) {
   path __tmp = __weakly_canonical(__p, &__ec);
   if (__ec)
     return path();
@@ -170,32 +170,32 @@ inline _LIBCPP_INLINE_VISIBILITY path relative(const path& __p, const path& __ba
   return __tmp.lexically_relative(__tmpbase);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI path relative(const path& __p, error_code& __ec) { return relative(__p, current_path(), __ec); }
-inline _LIBCPP_HIDE_FROM_ABI path relative(const path& __p, const path& __base = current_path()) { return __weakly_canonical(__p).lexically_relative(__weakly_canonical(__base)); }
-inline _LIBCPP_HIDE_FROM_ABI uintmax_t remove_all(const path& __p) { return __remove_all(__p); }
-inline _LIBCPP_HIDE_FROM_ABI uintmax_t remove_all(const path& __p, error_code& __ec) { return __remove_all(__p, &__ec); }
-inline _LIBCPP_HIDE_FROM_ABI bool remove(const path& __p) { return __remove(__p); }
-inline _LIBCPP_HIDE_FROM_ABI bool remove(const path& __p, error_code& __ec) noexcept { return __remove(__p, &__ec); }
-inline _LIBCPP_HIDE_FROM_ABI void rename(const path& __from, const path& __to) { return __rename(__from, __to); }
-inline _LIBCPP_HIDE_FROM_ABI void rename(const path& __from, const path& __to, error_code& __ec) noexcept { return __rename(__from, __to, &__ec); }
-inline _LIBCPP_HIDE_FROM_ABI void resize_file(const path& __p, uintmax_t __ns) { return __resize_file(__p, __ns); }
-inline _LIBCPP_HIDE_FROM_ABI void resize_file(const path& __p, uintmax_t __ns, error_code& __ec) noexcept { return __resize_file(__p, __ns, &__ec); }
-_LIBCPP_FUNC_VIS space_info __space(const path&, error_code* __ec = nullptr);
-inline _LIBCPP_HIDE_FROM_ABI space_info space(const path& __p) { return __space(__p); }
-inline _LIBCPP_HIDE_FROM_ABI space_info space(const path& __p, error_code& __ec) noexcept { return __space(__p, &__ec); }
-inline _LIBCPP_HIDE_FROM_ABI file_status status(const path& __p) { return __status(__p); }
-inline _LIBCPP_HIDE_FROM_ABI file_status status(const path& __p, error_code& __ec) noexcept { return __status(__p, &__ec); }
-inline _LIBCPP_HIDE_FROM_ABI file_status symlink_status(const path& __p) { return __symlink_status(__p); }
-inline _LIBCPP_HIDE_FROM_ABI file_status symlink_status(const path& __p, error_code& __ec) noexcept { return __symlink_status(__p, &__ec); }
-inline _LIBCPP_HIDE_FROM_ABI path temp_directory_path() { return __temp_directory_path(); }
-inline _LIBCPP_HIDE_FROM_ABI path temp_directory_path(error_code& __ec) { return __temp_directory_path(&__ec); }
-inline _LIBCPP_HIDE_FROM_ABI path weakly_canonical(path const& __p) { return __weakly_canonical(__p); }
-inline _LIBCPP_HIDE_FROM_ABI path weakly_canonical(path const& __p, error_code& __ec) { return __weakly_canonical(__p, &__ec); }
-
-_LIBCPP_AVAILABILITY_FILESYSTEM_POP
-
-_LIBCPP_END_NAMESPACE_FILESYSTEM
-
-#endif // _LIBCPP_CXX03_LANG
-
-#endif // _LIBCPP___FILESYSTEM_OPERATIONS_H
+inline _LIBCUDACXX_HIDE_FROM_ABI path relative(const path& __p, error_code& __ec) { return relative(__p, current_path(), __ec); }
+inline _LIBCUDACXX_HIDE_FROM_ABI path relative(const path& __p, const path& __base = current_path()) { return __weakly_canonical(__p).lexically_relative(__weakly_canonical(__base)); }
+inline _LIBCUDACXX_HIDE_FROM_ABI uintmax_t remove_all(const path& __p) { return __remove_all(__p); }
+inline _LIBCUDACXX_HIDE_FROM_ABI uintmax_t remove_all(const path& __p, error_code& __ec) { return __remove_all(__p, &__ec); }
+inline _LIBCUDACXX_HIDE_FROM_ABI bool remove(const path& __p) { return __remove(__p); }
+inline _LIBCUDACXX_HIDE_FROM_ABI bool remove(const path& __p, error_code& __ec) noexcept { return __remove(__p, &__ec); }
+inline _LIBCUDACXX_HIDE_FROM_ABI void rename(const path& __from, const path& __to) { return __rename(__from, __to); }
+inline _LIBCUDACXX_HIDE_FROM_ABI void rename(const path& __from, const path& __to, error_code& __ec) noexcept { return __rename(__from, __to, &__ec); }
+inline _LIBCUDACXX_HIDE_FROM_ABI void resize_file(const path& __p, uintmax_t __ns) { return __resize_file(__p, __ns); }
+inline _LIBCUDACXX_HIDE_FROM_ABI void resize_file(const path& __p, uintmax_t __ns, error_code& __ec) noexcept { return __resize_file(__p, __ns, &__ec); }
+_LIBCUDACXX_FUNC_VIS space_info __space(const path&, error_code* __ec = nullptr);
+inline _LIBCUDACXX_HIDE_FROM_ABI space_info space(const path& __p) { return __space(__p); }
+inline _LIBCUDACXX_HIDE_FROM_ABI space_info space(const path& __p, error_code& __ec) noexcept { return __space(__p, &__ec); }
+inline _LIBCUDACXX_HIDE_FROM_ABI file_status status(const path& __p) { return __status(__p); }
+inline _LIBCUDACXX_HIDE_FROM_ABI file_status status(const path& __p, error_code& __ec) noexcept { return __status(__p, &__ec); }
+inline _LIBCUDACXX_HIDE_FROM_ABI file_status symlink_status(const path& __p) { return __symlink_status(__p); }
+inline _LIBCUDACXX_HIDE_FROM_ABI file_status symlink_status(const path& __p, error_code& __ec) noexcept { return __symlink_status(__p, &__ec); }
+inline _LIBCUDACXX_HIDE_FROM_ABI path temp_directory_path() { return __temp_directory_path(); }
+inline _LIBCUDACXX_HIDE_FROM_ABI path temp_directory_path(error_code& __ec) { return __temp_directory_path(&__ec); }
+inline _LIBCUDACXX_HIDE_FROM_ABI path weakly_canonical(path const& __p) { return __weakly_canonical(__p); }
+inline _LIBCUDACXX_HIDE_FROM_ABI path weakly_canonical(path const& __p, error_code& __ec) { return __weakly_canonical(__p, &__ec); }
+
+_LIBCUDACXX_AVAILABILITY_FILESYSTEM_POP
+
+_LIBCUDACXX_END_NAMESPACE_FILESYSTEM
+
+#endif // _LIBCUDACXX_CXX03_LANG
+
+#endif // _LIBCUDACXX___FILESYSTEM_OPERATIONS_H

diff  --git a/libcxx/include/__filesystem/path.h b/libcxx/include/__filesystem/path.h
index 8fafd72c7e4f..5e29b613774f 100644
--- a/libcxx/include/__filesystem/path.h
+++ b/libcxx/include/__filesystem/path.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FILESYSTEM_PATH_H
-#define _LIBCPP___FILESYSTEM_PATH_H
+#ifndef _LIBCUDACXX___FILESYSTEM_PATH_H
+#define _LIBCUDACXX___FILESYSTEM_PATH_H
 
 #include <__algorithm/replace.h>
 #include <__algorithm/replace_copy.h>
@@ -21,20 +21,20 @@
 #include <string_view>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
+#if !defined(_LIBCUDACXX_HAS_NO_LOCALIZATION)
 # include <iomanip> // for quoted
 # include <locale>
 #endif
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
-_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
+_LIBCUDACXX_BEGIN_NAMESPACE_FILESYSTEM
 
-_LIBCPP_AVAILABILITY_FILESYSTEM_PUSH
+_LIBCUDACXX_AVAILABILITY_FILESYSTEM_PUSH
 
 template <class _Tp>
 struct __can_convert_char {
@@ -52,7 +52,7 @@ struct __can_convert_char<wchar_t> {
   static const bool value = true;
   using __char_type = wchar_t;
 };
-#ifndef _LIBCPP_HAS_NO_CHAR8_T
+#ifndef _LIBCUDACXX_HAS_NO_CHAR8_T
 template <>
 struct __can_convert_char<char8_t> {
   static const bool value = true;
@@ -71,17 +71,17 @@ struct __can_convert_char<char32_t> {
 };
 
 template <class _ECharT>
-_LIBCPP_HIDE_FROM_ABI
+_LIBCUDACXX_HIDE_FROM_ABI
 typename enable_if<__can_convert_char<_ECharT>::value, bool>::type
 __is_separator(_ECharT __e) {
-#if defined(_LIBCPP_WIN32API)
+#if defined(_LIBCUDACXX_WIN32API)
   return __e == _ECharT('/') || __e == _ECharT('\\');
 #else
   return __e == _ECharT('/');
 #endif
 }
 
-#ifndef _LIBCPP_HAS_NO_CHAR8_T
+#ifndef _LIBCUDACXX_HAS_NO_CHAR8_T
 typedef u8string __u8_string;
 #else
 typedef string __u8_string;
@@ -103,15 +103,15 @@ struct __is_pathable_string<
   using _Str = basic_string<_ECharT, _Traits, _Alloc>;
   using _Base = __can_convert_char<_ECharT>;
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   static _ECharT const* __range_begin(_Str const& __s) { return __s.data(); }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   static _ECharT const* __range_end(_Str const& __s) {
     return __s.data() + __s.length();
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   static _ECharT __first_or_null(_Str const& __s) {
     return __s.empty() ? _ECharT{} : __s[0];
   }
@@ -125,15 +125,15 @@ struct __is_pathable_string<
   using _Str = basic_string_view<_ECharT, _Traits>;
   using _Base = __can_convert_char<_ECharT>;
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   static _ECharT const* __range_begin(_Str const& __s) { return __s.data(); }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   static _ECharT const* __range_end(_Str const& __s) {
     return __s.data() + __s.length();
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   static _ECharT __first_or_null(_Str const& __s) {
     return __s.empty() ? _ECharT{} : __s[0];
   }
@@ -151,10 +151,10 @@ struct __is_pathable_char_array<_Source, _ECharT*, _UPtr, true>
     : __can_convert_char<typename remove_const<_ECharT>::type> {
   using _Base = __can_convert_char<typename remove_const<_ECharT>::type>;
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   static _ECharT const* __range_begin(const _ECharT* __b) { return __b; }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   static _ECharT const* __range_end(const _ECharT* __b) {
     using _Iter = const _ECharT*;
     const _ECharT __sentinel = _ECharT{};
@@ -164,7 +164,7 @@ struct __is_pathable_char_array<_Source, _ECharT*, _UPtr, true>
     return __e;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   static _ECharT __first_or_null(const _ECharT* __b) { return *__b; }
 };
 
@@ -181,13 +181,13 @@ struct __is_pathable_iter<
   using _ECharT = typename iterator_traits<_Iter>::value_type;
   using _Base = __can_convert_char<_ECharT>;
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   static _Iter __range_begin(_Iter __b) { return __b; }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   static _NullSentinel __range_end(_Iter) { return _NullSentinel{}; }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   static _ECharT __first_or_null(_Iter __b) { return *__b; }
 };
 
@@ -208,7 +208,7 @@ struct __is_pathable<_Tp, false, true, false> : __is_pathable_char_array<_Tp> {
 template <class _Tp>
 struct __is_pathable<_Tp, false, false, true> : __is_pathable_iter<_Tp> {};
 
-#if defined(_LIBCPP_WIN32API)
+#if defined(_LIBCUDACXX_WIN32API)
 typedef wstring __path_string;
 typedef wchar_t __path_value;
 #else
@@ -216,31 +216,31 @@ typedef string __path_string;
 typedef char __path_value;
 #endif
 
-#if defined(_LIBCPP_WIN32API)
-_LIBCPP_FUNC_VIS
+#if defined(_LIBCUDACXX_WIN32API)
+_LIBCUDACXX_FUNC_VIS
 size_t __wide_to_char(const wstring&, char*, size_t);
-_LIBCPP_FUNC_VIS
+_LIBCUDACXX_FUNC_VIS
 size_t __char_to_wide(const string&, wchar_t*, size_t);
 #endif
 
 template <class _ECharT>
 struct _PathCVT;
 
-#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
+#if !defined(_LIBCUDACXX_HAS_NO_LOCALIZATION)
 template <class _ECharT>
 struct _PathCVT {
   static_assert(__can_convert_char<_ECharT>::value,
                 "Char type not convertible");
 
   typedef __narrow_to_utf8<sizeof(_ECharT) * __CHAR_BIT__> _Narrower;
-#if defined(_LIBCPP_WIN32API)
+#if defined(_LIBCUDACXX_WIN32API)
   typedef __widen_from_utf8<sizeof(wchar_t) * __CHAR_BIT__> _Widener;
 #endif
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   static void __append_range(__path_string& __dest, _ECharT const* __b,
                              _ECharT const* __e) {
-#if defined(_LIBCPP_WIN32API)
+#if defined(_LIBCUDACXX_WIN32API)
     string __utf8;
     _Narrower()(back_inserter(__utf8), __b, __e);
     _Widener()(back_inserter(__dest), __utf8.data(), __utf8.data() + __utf8.size());
@@ -250,13 +250,13 @@ struct _PathCVT {
   }
 
   template <class _Iter>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   static void __append_range(__path_string& __dest, _Iter __b, _Iter __e) {
     static_assert(!is_same<_Iter, _ECharT*>::value, "Call const overload");
     if (__b == __e)
       return;
     basic_string<_ECharT> __tmp(__b, __e);
-#if defined(_LIBCPP_WIN32API)
+#if defined(_LIBCUDACXX_WIN32API)
     string __utf8;
     _Narrower()(back_inserter(__utf8), __tmp.data(),
                 __tmp.data() + __tmp.length());
@@ -268,7 +268,7 @@ struct _PathCVT {
   }
 
   template <class _Iter>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   static void __append_range(__path_string& __dest, _Iter __b, _NullSentinel) {
     static_assert(!is_same<_Iter, _ECharT*>::value, "Call const overload");
     const _ECharT __sentinel = _ECharT{};
@@ -277,7 +277,7 @@ struct _PathCVT {
     basic_string<_ECharT> __tmp;
     for (; *__b != __sentinel; ++__b)
       __tmp.push_back(*__b);
-#if defined(_LIBCPP_WIN32API)
+#if defined(_LIBCUDACXX_WIN32API)
     string __utf8;
     _Narrower()(back_inserter(__utf8), __tmp.data(),
                 __tmp.data() + __tmp.length());
@@ -289,20 +289,20 @@ struct _PathCVT {
   }
 
   template <class _Source>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   static void __append_source(__path_string& __dest, _Source const& __s) {
     using _Traits = __is_pathable<_Source>;
     __append_range(__dest, _Traits::__range_begin(__s),
                    _Traits::__range_end(__s));
   }
 };
-#endif // !_LIBCPP_HAS_NO_LOCALIZATION
+#endif // !_LIBCUDACXX_HAS_NO_LOCALIZATION
 
 template <>
 struct _PathCVT<__path_value> {
 
   template <class _Iter>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   static typename enable_if<__is_exactly_cpp17_input_iterator<_Iter>::value>::type
   __append_range(__path_string& __dest, _Iter __b, _Iter __e) {
     for (; __b != __e; ++__b)
@@ -310,14 +310,14 @@ struct _PathCVT<__path_value> {
   }
 
   template <class _Iter>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   static typename enable_if<__is_cpp17_forward_iterator<_Iter>::value>::type
   __append_range(__path_string& __dest, _Iter __b, _Iter __e) {
     __dest.append(__b, __e);
   }
 
   template <class _Iter>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   static void __append_range(__path_string& __dest, _Iter __b, _NullSentinel) {
     const char __sentinel = char{};
     for (; *__b != __sentinel; ++__b)
@@ -325,7 +325,7 @@ struct _PathCVT<__path_value> {
   }
 
   template <class _Source>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   static void __append_source(__path_string& __dest, _Source const& __s) {
     using _Traits = __is_pathable<_Source>;
     __append_range(__dest, _Traits::__range_begin(__s),
@@ -333,11 +333,11 @@ struct _PathCVT<__path_value> {
   }
 };
 
-#if defined(_LIBCPP_WIN32API)
+#if defined(_LIBCUDACXX_WIN32API)
 template <>
 struct _PathCVT<char> {
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   static void
   __append_string(__path_string& __dest, const basic_string<char> &__str) {
       size_t __size = __char_to_wide(__str, nullptr, 0);
@@ -347,7 +347,7 @@ struct _PathCVT<char> {
   }
 
   template <class _Iter>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   static typename enable_if<__is_exactly_cpp17_input_iterator<_Iter>::value>::type
   __append_range(__path_string& __dest, _Iter __b, _Iter __e) {
     basic_string<char> __tmp(__b, __e);
@@ -355,7 +355,7 @@ struct _PathCVT<char> {
   }
 
   template <class _Iter>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   static typename enable_if<__is_cpp17_forward_iterator<_Iter>::value>::type
   __append_range(__path_string& __dest, _Iter __b, _Iter __e) {
     basic_string<char> __tmp(__b, __e);
@@ -363,7 +363,7 @@ struct _PathCVT<char> {
   }
 
   template <class _Iter>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   static void __append_range(__path_string& __dest, _Iter __b, _NullSentinel) {
     const char __sentinel = char{};
     basic_string<char> __tmp;
@@ -373,7 +373,7 @@ struct _PathCVT<char> {
   }
 
   template <class _Source>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   static void __append_source(__path_string& __dest, _Source const& __s) {
     using _Traits = __is_pathable<_Source>;
     __append_range(__dest, _Traits::__range_begin(__s),
@@ -387,7 +387,7 @@ struct _PathExport {
   typedef __widen_from_utf8<sizeof(_ECharT) * __CHAR_BIT__> _Widener;
 
   template <class _Str>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   static void __append(_Str& __dest, const __path_string& __src) {
     string __utf8;
     _Narrower()(back_inserter(__utf8), __src.data(), __src.data() + __src.size());
@@ -398,7 +398,7 @@ struct _PathExport {
 template <>
 struct _PathExport<char> {
   template <class _Str>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   static void __append(_Str& __dest, const __path_string& __src) {
     size_t __size = __wide_to_char(__src, nullptr, 0);
     size_t __pos = __dest.size();
@@ -410,7 +410,7 @@ struct _PathExport<char> {
 template <>
 struct _PathExport<wchar_t> {
   template <class _Str>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   static void __append(_Str& __dest, const __path_string& __src) {
     __dest.append(__src.begin(), __src.end());
   }
@@ -419,27 +419,27 @@ struct _PathExport<wchar_t> {
 template <>
 struct _PathExport<char16_t> {
   template <class _Str>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   static void __append(_Str& __dest, const __path_string& __src) {
     __dest.append(__src.begin(), __src.end());
   }
 };
 
-#ifndef _LIBCPP_HAS_NO_CHAR8_T
+#ifndef _LIBCUDACXX_HAS_NO_CHAR8_T
 template <>
 struct _PathExport<char8_t> {
   typedef __narrow_to_utf8<sizeof(wchar_t) * __CHAR_BIT__> _Narrower;
 
   template <class _Str>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   static void __append(_Str& __dest, const __path_string& __src) {
     _Narrower()(back_inserter(__dest), __src.data(), __src.data() + __src.size());
   }
 };
-#endif /* !_LIBCPP_HAS_NO_CHAR8_T */
-#endif /* _LIBCPP_WIN32API */
+#endif /* !_LIBCUDACXX_HAS_NO_CHAR8_T */
+#endif /* _LIBCUDACXX_WIN32API */
 
-class _LIBCPP_TYPE_VIS path {
+class _LIBCUDACXX_TYPE_VIS path {
   template <class _SourceOrIter, class _Tp = path&>
   using _EnableIfPathable =
       typename enable_if<__is_pathable<_SourceOrIter>::value, _Tp>::type;
@@ -451,7 +451,7 @@ class _LIBCPP_TYPE_VIS path {
   using _SourceCVT = _PathCVT<_SourceChar<_Tp> >;
 
 public:
-#if defined(_LIBCPP_WIN32API)
+#if defined(_LIBCUDACXX_WIN32API)
   typedef wchar_t value_type;
   static constexpr value_type preferred_separator = L'\\';
 #else
@@ -461,37 +461,37 @@ class _LIBCPP_TYPE_VIS path {
   typedef basic_string<value_type> string_type;
   typedef basic_string_view<value_type> __string_view;
 
-  enum _LIBCPP_ENUM_VIS format : unsigned char {
+  enum _LIBCUDACXX_ENUM_VIS format : unsigned char {
     auto_format,
     native_format,
     generic_format
   };
 
   // constructors and destructor
-  _LIBCPP_HIDE_FROM_ABI path() noexcept {}
-  _LIBCPP_HIDE_FROM_ABI path(const path& __p) : __pn_(__p.__pn_) {}
-  _LIBCPP_HIDE_FROM_ABI path(path&& __p) noexcept
-      : __pn_(_VSTD::move(__p.__pn_)) {}
+  _LIBCUDACXX_HIDE_FROM_ABI path() noexcept {}
+  _LIBCUDACXX_HIDE_FROM_ABI path(const path& __p) : __pn_(__p.__pn_) {}
+  _LIBCUDACXX_HIDE_FROM_ABI path(path&& __p) noexcept
+      : __pn_(_CUDA_VSTD::move(__p.__pn_)) {}
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   path(string_type&& __s, format = format::auto_format) noexcept
-      : __pn_(_VSTD::move(__s)) {}
+      : __pn_(_CUDA_VSTD::move(__s)) {}
 
   template <class _Source, class = _EnableIfPathable<_Source, void> >
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   path(const _Source& __src, format = format::auto_format) {
     _SourceCVT<_Source>::__append_source(__pn_, __src);
   }
 
   template <class _InputIt>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   path(_InputIt __first, _InputIt __last, format = format::auto_format) {
     typedef typename iterator_traits<_InputIt>::value_type _ItVal;
     _PathCVT<_ItVal>::__append_range(__pn_, __first, __last);
   }
 
 /*
-#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
+#if !defined(_LIBCUDACXX_HAS_NO_LOCALIZATION)
   // TODO Implement locale conversions.
   template <class _Source, class = _EnableIfPathable<_Source, void> >
   path(const _Source& __src, const locale& __loc, format = format::auto_format);
@@ -501,42 +501,42 @@ class _LIBCPP_TYPE_VIS path {
 #endif
 */
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   ~path() = default;
 
   // assignments
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   path& operator=(const path& __p) {
     __pn_ = __p.__pn_;
     return *this;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   path& operator=(path&& __p) noexcept {
-    __pn_ = _VSTD::move(__p.__pn_);
+    __pn_ = _CUDA_VSTD::move(__p.__pn_);
     return *this;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   path& operator=(string_type&& __s) noexcept {
-    __pn_ = _VSTD::move(__s);
+    __pn_ = _CUDA_VSTD::move(__s);
     return *this;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   path& assign(string_type&& __s) noexcept {
-    __pn_ = _VSTD::move(__s);
+    __pn_ = _CUDA_VSTD::move(__s);
     return *this;
   }
 
   template <class _Source>
-  _LIBCPP_HIDE_FROM_ABI _EnableIfPathable<_Source>
+  _LIBCUDACXX_HIDE_FROM_ABI _EnableIfPathable<_Source>
   operator=(const _Source& __src) {
     return this->assign(__src);
   }
 
   template <class _Source>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   _EnableIfPathable<_Source> assign(const _Source& __src) {
     __pn_.clear();
     _SourceCVT<_Source>::__append_source(__pn_, __src);
@@ -544,7 +544,7 @@ class _LIBCPP_TYPE_VIS path {
   }
 
   template <class _InputIt>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   path& assign(_InputIt __first, _InputIt __last) {
     typedef typename iterator_traits<_InputIt>::value_type _ItVal;
     __pn_.clear();
@@ -554,8 +554,8 @@ class _LIBCPP_TYPE_VIS path {
 
 public:
   // appends
-#if defined(_LIBCPP_WIN32API)
-  _LIBCPP_HIDE_FROM_ABI
+#if defined(_LIBCUDACXX_WIN32API)
+  _LIBCUDACXX_HIDE_FROM_ABI
   path& operator/=(const path& __p) {
     auto __p_root_name = __p.__root_name();
     auto __p_root_name_size = __p_root_name.size();
@@ -576,24 +576,24 @@ class _LIBCPP_TYPE_VIS path {
     return *this;
   }
   template <class _Source>
-  _LIBCPP_INLINE_VISIBILITY _EnableIfPathable<_Source>
+  _LIBCUDACXX_INLINE_VISIBILITY _EnableIfPathable<_Source>
   operator/=(const _Source& __src) {
     return operator/=(path(__src));
   }
 
   template <class _Source>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   _EnableIfPathable<_Source> append(const _Source& __src) {
     return operator/=(path(__src));
   }
 
   template <class _InputIt>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   path& append(_InputIt __first, _InputIt __last) {
     return operator/=(path(__first, __last));
   }
 #else
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   path& operator/=(const path& __p) {
     if (__p.is_absolute()) {
       __pn_ = __p.__pn_;
@@ -605,17 +605,17 @@ class _LIBCPP_TYPE_VIS path {
     return *this;
   }
 
-  // FIXME: Use _LIBCPP_DIAGNOSE_WARNING to produce a diagnostic when __src
+  // FIXME: Use _LIBCUDACXX_DIAGNOSE_WARNING to produce a diagnostic when __src
   // is known at compile time to be "/' since the user almost certainly intended
   // to append a separator instead of overwriting the path with "/"
   template <class _Source>
-  _LIBCPP_HIDE_FROM_ABI _EnableIfPathable<_Source>
+  _LIBCUDACXX_HIDE_FROM_ABI _EnableIfPathable<_Source>
   operator/=(const _Source& __src) {
     return this->append(__src);
   }
 
   template <class _Source>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   _EnableIfPathable<_Source> append(const _Source& __src) {
     using _Traits = __is_pathable<_Source>;
     using _CVT = _PathCVT<_SourceChar<_Source> >;
@@ -629,7 +629,7 @@ class _LIBCPP_TYPE_VIS path {
   }
 
   template <class _InputIt>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   path& append(_InputIt __first, _InputIt __last) {
     typedef typename iterator_traits<_InputIt>::value_type _ItVal;
     static_assert(__can_convert_char<_ItVal>::value, "Must convertible");
@@ -644,38 +644,38 @@ class _LIBCPP_TYPE_VIS path {
 #endif
 
   // concatenation
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   path& operator+=(const path& __x) {
     __pn_ += __x.__pn_;
     return *this;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   path& operator+=(const string_type& __x) {
     __pn_ += __x;
     return *this;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   path& operator+=(__string_view __x) {
     __pn_ += __x;
     return *this;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   path& operator+=(const value_type* __x) {
     __pn_ += __x;
     return *this;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   path& operator+=(value_type __x) {
     __pn_ += __x;
     return *this;
   }
 
   template <class _ECharT>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   typename enable_if<__can_convert_char<_ECharT>::value, path&>::type
   operator+=(_ECharT __x) {
     _PathCVT<_ECharT>::__append_source(__pn_,
@@ -684,20 +684,20 @@ class _LIBCPP_TYPE_VIS path {
   }
 
   template <class _Source>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   _EnableIfPathable<_Source> operator+=(const _Source& __x) {
     return this->concat(__x);
   }
 
   template <class _Source>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   _EnableIfPathable<_Source> concat(const _Source& __x) {
     _SourceCVT<_Source>::__append_source(__pn_, __x);
     return *this;
   }
 
   template <class _InputIt>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   path& concat(_InputIt __first, _InputIt __last) {
     typedef typename iterator_traits<_InputIt>::value_type _ItVal;
     _PathCVT<_ItVal>::__append_range(__pn_, __first, __last);
@@ -705,18 +705,18 @@ class _LIBCPP_TYPE_VIS path {
   }
 
   // modifiers
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   void clear() noexcept { __pn_.clear(); }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   path& make_preferred() {
-#if defined(_LIBCPP_WIN32API)
-    _VSTD::replace(__pn_.begin(), __pn_.end(), L'/', L'\\');
+#if defined(_LIBCUDACXX_WIN32API)
+    _CUDA_VSTD::replace(__pn_.begin(), __pn_.end(), L'/', L'\\');
 #endif
     return *this;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   path& remove_filename() {
     auto __fname = __filename();
     if (!__fname.empty())
@@ -724,7 +724,7 @@ class _LIBCPP_TYPE_VIS path {
     return *this;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   path& replace_filename(const path& __replacement) {
     remove_filename();
     return (*this /= __replacement);
@@ -732,37 +732,37 @@ class _LIBCPP_TYPE_VIS path {
 
   path& replace_extension(const path& __replacement = path());
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   void swap(path& __rhs) noexcept { __pn_.swap(__rhs.__pn_); }
 
   // private helper to allow reserving memory in the path
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   void __reserve(size_t __s) { __pn_.reserve(__s); }
 
   // native format observers
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   const string_type& native() const noexcept { return __pn_; }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   const value_type* c_str() const noexcept { return __pn_.c_str(); }
 
-  _LIBCPP_HIDE_FROM_ABI operator string_type() const { return __pn_; }
+  _LIBCUDACXX_HIDE_FROM_ABI operator string_type() const { return __pn_; }
 
-#if defined(_LIBCPP_WIN32API)
-  _LIBCPP_HIDE_FROM_ABI _VSTD::wstring wstring() const { return __pn_; }
+#if defined(_LIBCUDACXX_WIN32API)
+  _LIBCUDACXX_HIDE_FROM_ABI _CUDA_VSTD::wstring wstring() const { return __pn_; }
 
-  _LIBCPP_HIDE_FROM_ABI
-  _VSTD::wstring generic_wstring() const {
-    _VSTD::wstring __s;
+  _LIBCUDACXX_HIDE_FROM_ABI
+  _CUDA_VSTD::wstring generic_wstring() const {
+    _CUDA_VSTD::wstring __s;
     __s.resize(__pn_.size());
-    _VSTD::replace_copy(__pn_.begin(), __pn_.end(), __s.begin(), '\\', '/');
+    _CUDA_VSTD::replace_copy(__pn_.begin(), __pn_.end(), __s.begin(), '\\', '/');
     return __s;
   }
 
-#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
+#if !defined(_LIBCUDACXX_HAS_NO_LOCALIZATION)
   template <class _ECharT, class _Traits = char_traits<_ECharT>,
             class _Allocator = allocator<_ECharT> >
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   basic_string<_ECharT, _Traits, _Allocator>
   string(const _Allocator& __a = _Allocator()) const {
     using _Str = basic_string<_ECharT, _Traits, _Allocator>;
@@ -772,10 +772,10 @@ class _LIBCPP_TYPE_VIS path {
     return __s;
   }
 
-  _LIBCPP_HIDE_FROM_ABI _VSTD::string string() const {
+  _LIBCUDACXX_HIDE_FROM_ABI _CUDA_VSTD::string string() const {
     return string<char>();
   }
-  _LIBCPP_HIDE_FROM_ABI __u8_string u8string() const {
+  _LIBCUDACXX_HIDE_FROM_ABI __u8_string u8string() const {
     using _CVT = __narrow_to_utf8<sizeof(wchar_t) * __CHAR_BIT__>;
     __u8_string __s;
     __s.reserve(__pn_.size());
@@ -783,17 +783,17 @@ class _LIBCPP_TYPE_VIS path {
     return __s;
   }
 
-  _LIBCPP_HIDE_FROM_ABI _VSTD::u16string u16string() const {
+  _LIBCUDACXX_HIDE_FROM_ABI _CUDA_VSTD::u16string u16string() const {
     return string<char16_t>();
   }
-  _LIBCPP_HIDE_FROM_ABI _VSTD::u32string u32string() const {
+  _LIBCUDACXX_HIDE_FROM_ABI _CUDA_VSTD::u32string u32string() const {
     return string<char32_t>();
   }
 
   // generic format observers
   template <class _ECharT, class _Traits = char_traits<_ECharT>,
             class _Allocator = allocator<_ECharT> >
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   basic_string<_ECharT, _Traits, _Allocator>
   generic_string(const _Allocator& __a = _Allocator()) const {
     using _Str = basic_string<_ECharT, _Traits, _Allocator>;
@@ -801,34 +801,34 @@ class _LIBCPP_TYPE_VIS path {
     // Note: This (and generic_u8string below) is slightly suboptimal as
     // it iterates twice over the string; once to convert it to the right
     // character type, and once to replace path delimiters.
-    _VSTD::replace(__s.begin(), __s.end(),
+    _CUDA_VSTD::replace(__s.begin(), __s.end(),
                    static_cast<_ECharT>('\\'), static_cast<_ECharT>('/'));
     return __s;
   }
 
-  _LIBCPP_HIDE_FROM_ABI _VSTD::string generic_string() const { return generic_string<char>(); }
-  _LIBCPP_HIDE_FROM_ABI _VSTD::u16string generic_u16string() const { return generic_string<char16_t>(); }
-  _LIBCPP_HIDE_FROM_ABI _VSTD::u32string generic_u32string() const { return generic_string<char32_t>(); }
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI _CUDA_VSTD::string generic_string() const { return generic_string<char>(); }
+  _LIBCUDACXX_HIDE_FROM_ABI _CUDA_VSTD::u16string generic_u16string() const { return generic_string<char16_t>(); }
+  _LIBCUDACXX_HIDE_FROM_ABI _CUDA_VSTD::u32string generic_u32string() const { return generic_string<char32_t>(); }
+  _LIBCUDACXX_HIDE_FROM_ABI
   __u8_string generic_u8string() const {
     __u8_string __s = u8string();
-    _VSTD::replace(__s.begin(), __s.end(), '\\', '/');
+    _CUDA_VSTD::replace(__s.begin(), __s.end(), '\\', '/');
     return __s;
   }
-#endif /* !_LIBCPP_HAS_NO_LOCALIZATION */
-#else /* _LIBCPP_WIN32API */
+#endif /* !_LIBCUDACXX_HAS_NO_LOCALIZATION */
+#else /* _LIBCUDACXX_WIN32API */
 
-  _LIBCPP_HIDE_FROM_ABI _VSTD::string string() const { return __pn_; }
-#ifndef _LIBCPP_HAS_NO_CHAR8_T
-  _LIBCPP_HIDE_FROM_ABI _VSTD::u8string u8string() const { return _VSTD::u8string(__pn_.begin(), __pn_.end()); }
+  _LIBCUDACXX_HIDE_FROM_ABI _CUDA_VSTD::string string() const { return __pn_; }
+#ifndef _LIBCUDACXX_HAS_NO_CHAR8_T
+  _LIBCUDACXX_HIDE_FROM_ABI _CUDA_VSTD::u8string u8string() const { return _CUDA_VSTD::u8string(__pn_.begin(), __pn_.end()); }
 #else
-  _LIBCPP_HIDE_FROM_ABI _VSTD::string u8string() const { return __pn_; }
+  _LIBCUDACXX_HIDE_FROM_ABI _CUDA_VSTD::string u8string() const { return __pn_; }
 #endif
 
-#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
+#if !defined(_LIBCUDACXX_HAS_NO_LOCALIZATION)
   template <class _ECharT, class _Traits = char_traits<_ECharT>,
             class _Allocator = allocator<_ECharT> >
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   basic_string<_ECharT, _Traits, _Allocator>
   string(const _Allocator& __a = _Allocator()) const {
     using _CVT = __widen_from_utf8<sizeof(_ECharT) * __CHAR_BIT__>;
@@ -839,43 +839,43 @@ class _LIBCPP_TYPE_VIS path {
     return __s;
   }
 
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-  _LIBCPP_HIDE_FROM_ABI _VSTD::wstring wstring() const {
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
+  _LIBCUDACXX_HIDE_FROM_ABI _CUDA_VSTD::wstring wstring() const {
     return string<wchar_t>();
   }
 #endif
-  _LIBCPP_HIDE_FROM_ABI _VSTD::u16string u16string() const {
+  _LIBCUDACXX_HIDE_FROM_ABI _CUDA_VSTD::u16string u16string() const {
     return string<char16_t>();
   }
-  _LIBCPP_HIDE_FROM_ABI _VSTD::u32string u32string() const {
+  _LIBCUDACXX_HIDE_FROM_ABI _CUDA_VSTD::u32string u32string() const {
     return string<char32_t>();
   }
-#endif /* !_LIBCPP_HAS_NO_LOCALIZATION */
+#endif /* !_LIBCUDACXX_HAS_NO_LOCALIZATION */
 
   // generic format observers
-  _LIBCPP_HIDE_FROM_ABI _VSTD::string generic_string() const { return __pn_; }
-#ifndef _LIBCPP_HAS_NO_CHAR8_T
-  _LIBCPP_HIDE_FROM_ABI _VSTD::u8string generic_u8string() const { return _VSTD::u8string(__pn_.begin(), __pn_.end()); }
+  _LIBCUDACXX_HIDE_FROM_ABI _CUDA_VSTD::string generic_string() const { return __pn_; }
+#ifndef _LIBCUDACXX_HAS_NO_CHAR8_T
+  _LIBCUDACXX_HIDE_FROM_ABI _CUDA_VSTD::u8string generic_u8string() const { return _CUDA_VSTD::u8string(__pn_.begin(), __pn_.end()); }
 #else
-  _LIBCPP_HIDE_FROM_ABI _VSTD::string generic_u8string() const { return __pn_; }
+  _LIBCUDACXX_HIDE_FROM_ABI _CUDA_VSTD::string generic_u8string() const { return __pn_; }
 #endif
 
-#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
+#if !defined(_LIBCUDACXX_HAS_NO_LOCALIZATION)
   template <class _ECharT, class _Traits = char_traits<_ECharT>,
             class _Allocator = allocator<_ECharT> >
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   basic_string<_ECharT, _Traits, _Allocator>
   generic_string(const _Allocator& __a = _Allocator()) const {
     return string<_ECharT, _Traits, _Allocator>(__a);
   }
 
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-  _LIBCPP_HIDE_FROM_ABI _VSTD::wstring generic_wstring() const { return string<wchar_t>(); }
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
+  _LIBCUDACXX_HIDE_FROM_ABI _CUDA_VSTD::wstring generic_wstring() const { return string<wchar_t>(); }
 #endif
-  _LIBCPP_HIDE_FROM_ABI _VSTD::u16string generic_u16string() const { return string<char16_t>(); }
-  _LIBCPP_HIDE_FROM_ABI _VSTD::u32string generic_u32string() const { return string<char32_t>(); }
-#endif /* !_LIBCPP_HAS_NO_LOCALIZATION */
-#endif /* !_LIBCPP_WIN32API */
+  _LIBCUDACXX_HIDE_FROM_ABI _CUDA_VSTD::u16string generic_u16string() const { return string<char16_t>(); }
+  _LIBCUDACXX_HIDE_FROM_ABI _CUDA_VSTD::u32string generic_u32string() const { return string<char32_t>(); }
+#endif /* !_LIBCUDACXX_HAS_NO_LOCALIZATION */
+#endif /* !_LIBCUDACXX_WIN32API */
 
 private:
   int __compare(__string_view) const;
@@ -890,78 +890,78 @@ class _LIBCPP_TYPE_VIS path {
 
 public:
   // compare
-  _LIBCPP_HIDE_FROM_ABI int compare(const path& __p) const noexcept {
+  _LIBCUDACXX_HIDE_FROM_ABI int compare(const path& __p) const noexcept {
     return __compare(__p.__pn_);
   }
-  _LIBCPP_HIDE_FROM_ABI int compare(const string_type& __s) const {
+  _LIBCUDACXX_HIDE_FROM_ABI int compare(const string_type& __s) const {
     return __compare(__s);
   }
-  _LIBCPP_HIDE_FROM_ABI int compare(__string_view __s) const {
+  _LIBCUDACXX_HIDE_FROM_ABI int compare(__string_view __s) const {
     return __compare(__s);
   }
-  _LIBCPP_HIDE_FROM_ABI int compare(const value_type* __s) const {
+  _LIBCUDACXX_HIDE_FROM_ABI int compare(const value_type* __s) const {
     return __compare(__s);
   }
 
   // decomposition
-  _LIBCPP_HIDE_FROM_ABI path root_name() const {
+  _LIBCUDACXX_HIDE_FROM_ABI path root_name() const {
     return string_type(__root_name());
   }
-  _LIBCPP_HIDE_FROM_ABI path root_directory() const {
+  _LIBCUDACXX_HIDE_FROM_ABI path root_directory() const {
     return string_type(__root_directory());
   }
-  _LIBCPP_HIDE_FROM_ABI path root_path() const {
-#if defined(_LIBCPP_WIN32API)
+  _LIBCUDACXX_HIDE_FROM_ABI path root_path() const {
+#if defined(_LIBCUDACXX_WIN32API)
     return string_type(__root_path_raw());
 #else
     return root_name().append(string_type(__root_directory()));
 #endif
   }
-  _LIBCPP_HIDE_FROM_ABI path relative_path() const {
+  _LIBCUDACXX_HIDE_FROM_ABI path relative_path() const {
     return string_type(__relative_path());
   }
-  _LIBCPP_HIDE_FROM_ABI path parent_path() const {
+  _LIBCUDACXX_HIDE_FROM_ABI path parent_path() const {
     return string_type(__parent_path());
   }
-  _LIBCPP_HIDE_FROM_ABI path filename() const {
+  _LIBCUDACXX_HIDE_FROM_ABI path filename() const {
     return string_type(__filename());
   }
-  _LIBCPP_HIDE_FROM_ABI path stem() const { return string_type(__stem()); }
-  _LIBCPP_HIDE_FROM_ABI path extension() const {
+  _LIBCUDACXX_HIDE_FROM_ABI path stem() const { return string_type(__stem()); }
+  _LIBCUDACXX_HIDE_FROM_ABI path extension() const {
     return string_type(__extension());
   }
 
   // query
-  _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI bool
+  _LIBCUDACXX_NODISCARD_AFTER_CXX17 _LIBCUDACXX_HIDE_FROM_ABI bool
   empty() const noexcept {
     return __pn_.empty();
   }
 
-  _LIBCPP_HIDE_FROM_ABI bool has_root_name() const {
+  _LIBCUDACXX_HIDE_FROM_ABI bool has_root_name() const {
     return !__root_name().empty();
   }
-  _LIBCPP_HIDE_FROM_ABI bool has_root_directory() const {
+  _LIBCUDACXX_HIDE_FROM_ABI bool has_root_directory() const {
     return !__root_directory().empty();
   }
-  _LIBCPP_HIDE_FROM_ABI bool has_root_path() const {
+  _LIBCUDACXX_HIDE_FROM_ABI bool has_root_path() const {
     return !__root_path_raw().empty();
   }
-  _LIBCPP_HIDE_FROM_ABI bool has_relative_path() const {
+  _LIBCUDACXX_HIDE_FROM_ABI bool has_relative_path() const {
     return !__relative_path().empty();
   }
-  _LIBCPP_HIDE_FROM_ABI bool has_parent_path() const {
+  _LIBCUDACXX_HIDE_FROM_ABI bool has_parent_path() const {
     return !__parent_path().empty();
   }
-  _LIBCPP_HIDE_FROM_ABI bool has_filename() const {
+  _LIBCUDACXX_HIDE_FROM_ABI bool has_filename() const {
     return !__filename().empty();
   }
-  _LIBCPP_HIDE_FROM_ABI bool has_stem() const { return !__stem().empty(); }
-  _LIBCPP_HIDE_FROM_ABI bool has_extension() const {
+  _LIBCUDACXX_HIDE_FROM_ABI bool has_stem() const { return !__stem().empty(); }
+  _LIBCUDACXX_HIDE_FROM_ABI bool has_extension() const {
     return !__extension().empty();
   }
 
-  _LIBCPP_HIDE_FROM_ABI bool is_absolute() const {
-#if defined(_LIBCPP_WIN32API)
+  _LIBCUDACXX_HIDE_FROM_ABI bool is_absolute() const {
+#if defined(_LIBCUDACXX_WIN32API)
     __string_view __root_name_str = __root_name();
     __string_view __root_dir = __root_directory();
     if (__root_name_str.size() == 2 && __root_name_str[1] == ':') {
@@ -984,13 +984,13 @@ class _LIBCPP_TYPE_VIS path {
     return has_root_directory();
 #endif
   }
-  _LIBCPP_HIDE_FROM_ABI bool is_relative() const { return !is_absolute(); }
+  _LIBCUDACXX_HIDE_FROM_ABI bool is_relative() const { return !is_absolute(); }
 
   // relative paths
   path lexically_normal() const;
   path lexically_relative(const path& __base) const;
 
-  _LIBCPP_HIDE_FROM_ABI path lexically_proximate(const path& __base) const {
+  _LIBCUDACXX_HIDE_FROM_ABI path lexically_proximate(const path& __base) const {
     path __result = this->lexically_relative(__base);
     if (__result.native().empty())
       return *this;
@@ -998,69 +998,69 @@ class _LIBCPP_TYPE_VIS path {
   }
 
   // iterators
-  class _LIBCPP_TYPE_VIS iterator;
+  class _LIBCUDACXX_TYPE_VIS iterator;
   typedef iterator const_iterator;
 
   iterator begin() const;
   iterator end() const;
 
-#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
+#if !defined(_LIBCUDACXX_HAS_NO_LOCALIZATION)
   template <class _CharT, class _Traits>
-  _LIBCPP_HIDE_FROM_ABI friend
+  _LIBCUDACXX_HIDE_FROM_ABI friend
       typename enable_if<is_same<_CharT, value_type>::value &&
                              is_same<_Traits, char_traits<value_type> >::value,
                          basic_ostream<_CharT, _Traits>&>::type
       operator<<(basic_ostream<_CharT, _Traits>& __os, const path& __p) {
-    __os << _VSTD::__quoted(__p.native());
+    __os << _CUDA_VSTD::__quoted(__p.native());
     return __os;
   }
 
   template <class _CharT, class _Traits>
-  _LIBCPP_HIDE_FROM_ABI friend
+  _LIBCUDACXX_HIDE_FROM_ABI friend
       typename enable_if<!is_same<_CharT, value_type>::value ||
                              !is_same<_Traits, char_traits<value_type> >::value,
                          basic_ostream<_CharT, _Traits>&>::type
       operator<<(basic_ostream<_CharT, _Traits>& __os, const path& __p) {
-    __os << _VSTD::__quoted(__p.string<_CharT, _Traits>());
+    __os << _CUDA_VSTD::__quoted(__p.string<_CharT, _Traits>());
     return __os;
   }
 
   template <class _CharT, class _Traits>
-  _LIBCPP_HIDE_FROM_ABI friend basic_istream<_CharT, _Traits>&
+  _LIBCUDACXX_HIDE_FROM_ABI friend basic_istream<_CharT, _Traits>&
   operator>>(basic_istream<_CharT, _Traits>& __is, path& __p) {
     basic_string<_CharT, _Traits> __tmp;
-    __is >> _VSTD::__quoted(__tmp);
+    __is >> _CUDA_VSTD::__quoted(__tmp);
     __p = __tmp;
     return __is;
   }
-#endif // !_LIBCPP_HAS_NO_LOCALIZATION
+#endif // !_LIBCUDACXX_HAS_NO_LOCALIZATION
 
-  friend _LIBCPP_HIDE_FROM_ABI bool operator==(const path& __lhs, const path& __rhs) noexcept {
+  friend _LIBCUDACXX_HIDE_FROM_ABI bool operator==(const path& __lhs, const path& __rhs) noexcept {
     return __lhs.__compare(__rhs.__pn_) == 0;
   }
-  friend _LIBCPP_HIDE_FROM_ABI bool operator!=(const path& __lhs, const path& __rhs) noexcept {
+  friend _LIBCUDACXX_HIDE_FROM_ABI bool operator!=(const path& __lhs, const path& __rhs) noexcept {
     return __lhs.__compare(__rhs.__pn_) != 0;
   }
-  friend _LIBCPP_HIDE_FROM_ABI bool operator<(const path& __lhs, const path& __rhs) noexcept {
+  friend _LIBCUDACXX_HIDE_FROM_ABI bool operator<(const path& __lhs, const path& __rhs) noexcept {
     return __lhs.__compare(__rhs.__pn_) < 0;
   }
-  friend _LIBCPP_HIDE_FROM_ABI bool operator<=(const path& __lhs, const path& __rhs) noexcept {
+  friend _LIBCUDACXX_HIDE_FROM_ABI bool operator<=(const path& __lhs, const path& __rhs) noexcept {
     return __lhs.__compare(__rhs.__pn_) <= 0;
   }
-  friend _LIBCPP_HIDE_FROM_ABI bool operator>(const path& __lhs, const path& __rhs) noexcept {
+  friend _LIBCUDACXX_HIDE_FROM_ABI bool operator>(const path& __lhs, const path& __rhs) noexcept {
     return __lhs.__compare(__rhs.__pn_) > 0;
   }
-  friend _LIBCPP_HIDE_FROM_ABI bool operator>=(const path& __lhs, const path& __rhs) noexcept {
+  friend _LIBCUDACXX_HIDE_FROM_ABI bool operator>=(const path& __lhs, const path& __rhs) noexcept {
     return __lhs.__compare(__rhs.__pn_) >= 0;
   }
 
-  friend _LIBCPP_HIDE_FROM_ABI path operator/(const path& __lhs, const path& __rhs) {
+  friend _LIBCUDACXX_HIDE_FROM_ABI path operator/(const path& __lhs, const path& __rhs) {
     path __result(__lhs);
     __result /= __rhs;
     return __result;
   }
 private:
-  inline _LIBCPP_HIDE_FROM_ABI path&
+  inline _LIBCUDACXX_HIDE_FROM_ABI path&
   __assign_view(__string_view const& __s) noexcept {
     __pn_ = string_type(__s);
     return *this;
@@ -1068,17 +1068,17 @@ class _LIBCPP_TYPE_VIS path {
   string_type __pn_;
 };
 
-inline _LIBCPP_HIDE_FROM_ABI void swap(path& __lhs, path& __rhs) noexcept {
+inline _LIBCUDACXX_HIDE_FROM_ABI void swap(path& __lhs, path& __rhs) noexcept {
   __lhs.swap(__rhs);
 }
 
-_LIBCPP_FUNC_VIS
+_LIBCUDACXX_FUNC_VIS
 size_t hash_value(const path& __p) noexcept;
 
-_LIBCPP_AVAILABILITY_FILESYSTEM_POP
+_LIBCUDACXX_AVAILABILITY_FILESYSTEM_POP
 
-_LIBCPP_END_NAMESPACE_FILESYSTEM
+_LIBCUDACXX_END_NAMESPACE_FILESYSTEM
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
-#endif // _LIBCPP___FILESYSTEM_PATH_H
+#endif // _LIBCUDACXX___FILESYSTEM_PATH_H

diff  --git a/libcxx/include/__filesystem/path_iterator.h b/libcxx/include/__filesystem/path_iterator.h
index 6f2baf8f7a29..835ae975ea2f 100644
--- a/libcxx/include/__filesystem/path_iterator.h
+++ b/libcxx/include/__filesystem/path_iterator.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FILESYSTEM_PATH_ITERATOR_H
-#define _LIBCPP___FILESYSTEM_PATH_ITERATOR_H
+#ifndef _LIBCUDACXX___FILESYSTEM_PATH_ITERATOR_H
+#define _LIBCUDACXX___FILESYSTEM_PATH_ITERATOR_H
 
 #include <__assert>
 #include <__availability>
@@ -19,17 +19,17 @@
 #include <string>
 #include <string_view>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
-_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
+_LIBCUDACXX_BEGIN_NAMESPACE_FILESYSTEM
 
-_LIBCPP_AVAILABILITY_FILESYSTEM_PUSH
+_LIBCUDACXX_AVAILABILITY_FILESYSTEM_PUSH
 
-class _LIBCPP_TYPE_VIS path::iterator {
+class _LIBCUDACXX_TYPE_VIS path::iterator {
 public:
   enum _ParserState : unsigned char {
     _Singular,
@@ -51,7 +51,7 @@ class _LIBCPP_TYPE_VIS path::iterator {
   typedef path reference;
 
 public:
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   iterator()
       : __stashed_elem_(), __path_ptr_(nullptr), __entry_(),
         __state_(_Singular) {}
@@ -61,38 +61,38 @@ class _LIBCPP_TYPE_VIS path::iterator {
 
   iterator& operator=(const iterator&) = default;
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   reference operator*() const { return __stashed_elem_; }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   pointer operator->() const { return &__stashed_elem_; }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   iterator& operator++() {
-    _LIBCPP_ASSERT(__state_ != _Singular,
+    _LIBCUDACXX_ASSERT(__state_ != _Singular,
                    "attempting to increment a singular iterator");
-    _LIBCPP_ASSERT(__state_ != _AtEnd,
+    _LIBCUDACXX_ASSERT(__state_ != _AtEnd,
                    "attempting to increment the end iterator");
     return __increment();
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   iterator operator++(int) {
     iterator __it(*this);
     this->operator++();
     return __it;
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   iterator& operator--() {
-    _LIBCPP_ASSERT(__state_ != _Singular,
+    _LIBCUDACXX_ASSERT(__state_ != _Singular,
                    "attempting to decrement a singular iterator");
-    _LIBCPP_ASSERT(__entry_.data() != __path_ptr_->native().data(),
+    _LIBCUDACXX_ASSERT(__entry_.data() != __path_ptr_->native().data(),
                    "attempting to decrement the begin iterator");
     return __decrement();
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   iterator operator--(int) {
     iterator __it(*this);
     this->operator--();
@@ -102,7 +102,7 @@ class _LIBCPP_TYPE_VIS path::iterator {
 private:
   friend class path;
 
-  inline _LIBCPP_INLINE_VISIBILITY friend bool operator==(const iterator&,
+  inline _LIBCUDACXX_INLINE_VISIBILITY friend bool operator==(const iterator&,
                                                           const iterator&);
 
   iterator& __increment();
@@ -114,21 +114,21 @@ class _LIBCPP_TYPE_VIS path::iterator {
   _ParserState __state_;
 };
 
-inline _LIBCPP_INLINE_VISIBILITY bool operator==(const path::iterator& __lhs,
+inline _LIBCUDACXX_INLINE_VISIBILITY bool operator==(const path::iterator& __lhs,
                                                  const path::iterator& __rhs) {
   return __lhs.__path_ptr_ == __rhs.__path_ptr_ &&
          __lhs.__entry_.data() == __rhs.__entry_.data();
 }
 
-inline _LIBCPP_INLINE_VISIBILITY bool operator!=(const path::iterator& __lhs,
+inline _LIBCUDACXX_INLINE_VISIBILITY bool operator!=(const path::iterator& __lhs,
                                                  const path::iterator& __rhs) {
   return !(__lhs == __rhs);
 }
 
-_LIBCPP_AVAILABILITY_FILESYSTEM_POP
+_LIBCUDACXX_AVAILABILITY_FILESYSTEM_POP
 
-_LIBCPP_END_NAMESPACE_FILESYSTEM
+_LIBCUDACXX_END_NAMESPACE_FILESYSTEM
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
-#endif // _LIBCPP___FILESYSTEM_PATH_ITERATOR_H
+#endif // _LIBCUDACXX___FILESYSTEM_PATH_ITERATOR_H

diff  --git a/libcxx/include/__filesystem/perm_options.h b/libcxx/include/__filesystem/perm_options.h
index 4aba302edfbe..8a7f9ccf960c 100644
--- a/libcxx/include/__filesystem/perm_options.h
+++ b/libcxx/include/__filesystem/perm_options.h
@@ -7,71 +7,71 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FILESYSTEM_PERM_OPTIONS_H
-#define _LIBCPP___FILESYSTEM_PERM_OPTIONS_H
+#ifndef _LIBCUDACXX___FILESYSTEM_PERM_OPTIONS_H
+#define _LIBCUDACXX___FILESYSTEM_PERM_OPTIONS_H
 
 #include <__availability>
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
-_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
+_LIBCUDACXX_BEGIN_NAMESPACE_FILESYSTEM
 
-_LIBCPP_AVAILABILITY_FILESYSTEM_PUSH
+_LIBCUDACXX_AVAILABILITY_FILESYSTEM_PUSH
 
-enum class _LIBCPP_ENUM_VIS perm_options : unsigned char {
+enum class _LIBCUDACXX_ENUM_VIS perm_options : unsigned char {
   replace = 1,
   add = 2,
   remove = 4,
   nofollow = 8
 };
 
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 inline constexpr perm_options operator&(perm_options __lhs, perm_options __rhs) {
   return static_cast<perm_options>(static_cast<unsigned>(__lhs) &
                                    static_cast<unsigned>(__rhs));
 }
 
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 inline constexpr perm_options operator|(perm_options __lhs, perm_options __rhs) {
   return static_cast<perm_options>(static_cast<unsigned>(__lhs) |
                                    static_cast<unsigned>(__rhs));
 }
 
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 inline constexpr perm_options operator^(perm_options __lhs, perm_options __rhs) {
   return static_cast<perm_options>(static_cast<unsigned>(__lhs) ^
                                    static_cast<unsigned>(__rhs));
 }
 
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 inline constexpr perm_options operator~(perm_options __lhs) {
   return static_cast<perm_options>(~static_cast<unsigned>(__lhs));
 }
 
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 inline perm_options& operator&=(perm_options& __lhs, perm_options __rhs) {
   return __lhs = __lhs & __rhs;
 }
 
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 inline perm_options& operator|=(perm_options& __lhs, perm_options __rhs) {
   return __lhs = __lhs | __rhs;
 }
 
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 inline perm_options& operator^=(perm_options& __lhs, perm_options __rhs) {
   return __lhs = __lhs ^ __rhs;
 }
 
-_LIBCPP_AVAILABILITY_FILESYSTEM_POP
+_LIBCUDACXX_AVAILABILITY_FILESYSTEM_POP
 
-_LIBCPP_END_NAMESPACE_FILESYSTEM
+_LIBCUDACXX_END_NAMESPACE_FILESYSTEM
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
-#endif // _LIBCPP___FILESYSTEM_PERM_OPTIONS_H
+#endif // _LIBCUDACXX___FILESYSTEM_PERM_OPTIONS_H

diff  --git a/libcxx/include/__filesystem/perms.h b/libcxx/include/__filesystem/perms.h
index df4590057ee1..b3054678cd9a 100644
--- a/libcxx/include/__filesystem/perms.h
+++ b/libcxx/include/__filesystem/perms.h
@@ -7,27 +7,27 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FILESYSTEM_PERMS_H
-#define _LIBCPP___FILESYSTEM_PERMS_H
+#ifndef _LIBCUDACXX___FILESYSTEM_PERMS_H
+#define _LIBCUDACXX___FILESYSTEM_PERMS_H
 
 #include <__availability>
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
-_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
+_LIBCUDACXX_BEGIN_NAMESPACE_FILESYSTEM
 
-_LIBCPP_AVAILABILITY_FILESYSTEM_PUSH
+_LIBCUDACXX_AVAILABILITY_FILESYSTEM_PUSH
 
 // On Windows, these permission bits map to one single readonly flag per
 // file, and the executable bit is always returned as set. When setting
 // permissions, as long as the write bit is set for either owner, group or
 // others, the readonly flag is cleared.
-enum class _LIBCPP_ENUM_VIS perms : unsigned {
+enum class _LIBCUDACXX_ENUM_VIS perms : unsigned {
   none = 0,
 
   owner_read = 0400,
@@ -54,42 +54,42 @@ enum class _LIBCPP_ENUM_VIS perms : unsigned {
   unknown = 0xFFFF,
 };
 
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 inline constexpr perms operator&(perms __lhs, perms __rhs) {
   return static_cast<perms>(static_cast<unsigned>(__lhs) &
                             static_cast<unsigned>(__rhs));
 }
 
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 inline constexpr perms operator|(perms __lhs, perms __rhs) {
   return static_cast<perms>(static_cast<unsigned>(__lhs) |
                             static_cast<unsigned>(__rhs));
 }
 
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 inline constexpr perms operator^(perms __lhs, perms __rhs) {
   return static_cast<perms>(static_cast<unsigned>(__lhs) ^
                             static_cast<unsigned>(__rhs));
 }
 
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 inline constexpr perms operator~(perms __lhs) {
   return static_cast<perms>(~static_cast<unsigned>(__lhs));
 }
 
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 inline perms& operator&=(perms& __lhs, perms __rhs) { return __lhs = __lhs & __rhs; }
 
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 inline perms& operator|=(perms& __lhs, perms __rhs) { return __lhs = __lhs | __rhs; }
 
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 inline perms& operator^=(perms& __lhs, perms __rhs) { return __lhs = __lhs ^ __rhs; }
 
-_LIBCPP_AVAILABILITY_FILESYSTEM_POP
+_LIBCUDACXX_AVAILABILITY_FILESYSTEM_POP
 
-_LIBCPP_END_NAMESPACE_FILESYSTEM
+_LIBCUDACXX_END_NAMESPACE_FILESYSTEM
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
-#endif // _LIBCPP___FILESYSTEM_PERMS_H
+#endif // _LIBCUDACXX___FILESYSTEM_PERMS_H

diff  --git a/libcxx/include/__filesystem/recursive_directory_iterator.h b/libcxx/include/__filesystem/recursive_directory_iterator.h
index b20d201f5836..0fc2a613393b 100644
--- a/libcxx/include/__filesystem/recursive_directory_iterator.h
+++ b/libcxx/include/__filesystem/recursive_directory_iterator.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FILESYSTEM_RECURSIVE_DIRECTORY_ITERATOR_H
-#define _LIBCPP___FILESYSTEM_RECURSIVE_DIRECTORY_ITERATOR_H
+#ifndef _LIBCUDACXX___FILESYSTEM_RECURSIVE_DIRECTORY_ITERATOR_H
+#define _LIBCUDACXX___FILESYSTEM_RECURSIVE_DIRECTORY_ITERATOR_H
 
 #include <__availability>
 #include <__config>
@@ -22,15 +22,15 @@
 #include <cstddef>
 #include <system_error>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
-_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
+_LIBCUDACXX_BEGIN_NAMESPACE_FILESYSTEM
 
-_LIBCPP_AVAILABILITY_FILESYSTEM_PUSH
+_LIBCUDACXX_AVAILABILITY_FILESYSTEM_PUSH
 
 class recursive_directory_iterator {
 public:
@@ -42,20 +42,20 @@ class recursive_directory_iterator {
 
 public:
   // constructors and destructor
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   recursive_directory_iterator() noexcept : __rec_(false) {}
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   explicit recursive_directory_iterator(
       const path& __p, directory_options __xoptions = directory_options::none)
       : recursive_directory_iterator(__p, __xoptions, nullptr) {}
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   recursive_directory_iterator(const path& __p, directory_options __xoptions,
                                error_code& __ec)
       : recursive_directory_iterator(__p, __xoptions, &__ec) {}
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   recursive_directory_iterator(const path& __p, error_code& __ec)
       : recursive_directory_iterator(__p, directory_options::none, &__ec) {}
 
@@ -65,12 +65,12 @@ class recursive_directory_iterator {
   recursive_directory_iterator&
   operator=(const recursive_directory_iterator&) = default;
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   recursive_directory_iterator&
   operator=(recursive_directory_iterator&& __o) noexcept {
     // non-default implementation provided to support self-move assign.
     if (this != &__o) {
-      __imp_ = _VSTD::move(__o.__imp_);
+      __imp_ = _CUDA_VSTD::move(__o.__imp_);
       __rec_ = __o.__rec_;
     }
     return *this;
@@ -78,108 +78,108 @@ class recursive_directory_iterator {
 
   ~recursive_directory_iterator() = default;
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   const directory_entry& operator*() const { return __dereference(); }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   const directory_entry* operator->() const { return &__dereference(); }
 
   recursive_directory_iterator& operator++() { return __increment(); }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   __dir_element_proxy operator++(int) {
     __dir_element_proxy __p(**this);
     __increment();
     return __p;
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   recursive_directory_iterator& increment(error_code& __ec) {
     return __increment(&__ec);
   }
 
-  _LIBCPP_FUNC_VIS directory_options options() const;
-  _LIBCPP_FUNC_VIS int depth() const;
+  _LIBCUDACXX_FUNC_VIS directory_options options() const;
+  _LIBCUDACXX_FUNC_VIS int depth() const;
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   void pop() { __pop(); }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   void pop(error_code& __ec) { __pop(&__ec); }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   bool recursion_pending() const { return __rec_; }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   void disable_recursion_pending() { __rec_ = false; }
 
 private:
-  _LIBCPP_FUNC_VIS
+  _LIBCUDACXX_FUNC_VIS
   recursive_directory_iterator(const path& __p, directory_options __opt,
                                error_code* __ec);
 
-  _LIBCPP_FUNC_VIS
+  _LIBCUDACXX_FUNC_VIS
   const directory_entry& __dereference() const;
 
-  _LIBCPP_FUNC_VIS
+  _LIBCUDACXX_FUNC_VIS
   bool __try_recursion(error_code* __ec);
 
-  _LIBCPP_FUNC_VIS
+  _LIBCUDACXX_FUNC_VIS
   void __advance(error_code* __ec = nullptr);
 
-  _LIBCPP_FUNC_VIS
+  _LIBCUDACXX_FUNC_VIS
   recursive_directory_iterator& __increment(error_code* __ec = nullptr);
 
-  _LIBCPP_FUNC_VIS
+  _LIBCUDACXX_FUNC_VIS
   void __pop(error_code* __ec = nullptr);
 
-  inline _LIBCPP_INLINE_VISIBILITY friend bool
+  inline _LIBCUDACXX_INLINE_VISIBILITY friend bool
   operator==(const recursive_directory_iterator&,
              const recursive_directory_iterator&) noexcept;
 
-  struct _LIBCPP_HIDDEN __shared_imp;
+  struct _LIBCUDACXX_HIDDEN __shared_imp;
   shared_ptr<__shared_imp> __imp_;
   bool __rec_;
 }; // class recursive_directory_iterator
 
-inline _LIBCPP_INLINE_VISIBILITY bool
+inline _LIBCUDACXX_INLINE_VISIBILITY bool
 operator==(const recursive_directory_iterator& __lhs,
            const recursive_directory_iterator& __rhs) noexcept {
   return __lhs.__imp_ == __rhs.__imp_;
 }
 
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 inline bool operator!=(const recursive_directory_iterator& __lhs,
                        const recursive_directory_iterator& __rhs) noexcept {
   return !(__lhs == __rhs);
 }
 // enable recursive_directory_iterator range-based for statements
-inline _LIBCPP_INLINE_VISIBILITY recursive_directory_iterator
+inline _LIBCUDACXX_INLINE_VISIBILITY recursive_directory_iterator
 begin(recursive_directory_iterator __iter) noexcept {
   return __iter;
 }
 
-inline _LIBCPP_INLINE_VISIBILITY recursive_directory_iterator
+inline _LIBCUDACXX_INLINE_VISIBILITY recursive_directory_iterator
 end(recursive_directory_iterator) noexcept {
   return recursive_directory_iterator();
 }
 
-_LIBCPP_AVAILABILITY_FILESYSTEM_POP
+_LIBCUDACXX_AVAILABILITY_FILESYSTEM_POP
 
-_LIBCPP_END_NAMESPACE_FILESYSTEM
+_LIBCUDACXX_END_NAMESPACE_FILESYSTEM
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 template <>
-_LIBCPP_AVAILABILITY_FILESYSTEM
-inline constexpr bool _VSTD::ranges::enable_borrowed_range<_VSTD_FS::recursive_directory_iterator> = true;
+_LIBCUDACXX_AVAILABILITY_FILESYSTEM
+inline constexpr bool _CUDA_VSTD::ranges::enable_borrowed_range<_VSTD_FS::recursive_directory_iterator> = true;
 
 template <>
-_LIBCPP_AVAILABILITY_FILESYSTEM
-inline constexpr bool _VSTD::ranges::enable_view<_VSTD_FS::recursive_directory_iterator> = true;
+_LIBCUDACXX_AVAILABILITY_FILESYSTEM
+inline constexpr bool _CUDA_VSTD::ranges::enable_view<_VSTD_FS::recursive_directory_iterator> = true;
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
-#endif // _LIBCPP___FILESYSTEM_RECURSIVE_DIRECTORY_ITERATOR_H
+#endif // _LIBCUDACXX___FILESYSTEM_RECURSIVE_DIRECTORY_ITERATOR_H

diff  --git a/libcxx/include/__filesystem/space_info.h b/libcxx/include/__filesystem/space_info.h
index d7dc03af75a7..1d0c395545e6 100644
--- a/libcxx/include/__filesystem/space_info.h
+++ b/libcxx/include/__filesystem/space_info.h
@@ -7,33 +7,33 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FILESYSTEM_SPACE_INFO_H
-#define _LIBCPP___FILESYSTEM_SPACE_INFO_H
+#ifndef _LIBCUDACXX___FILESYSTEM_SPACE_INFO_H
+#define _LIBCUDACXX___FILESYSTEM_SPACE_INFO_H
 
 #include <__availability>
 #include <__config>
 #include <cstdint>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
-_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
+_LIBCUDACXX_BEGIN_NAMESPACE_FILESYSTEM
 
-_LIBCPP_AVAILABILITY_FILESYSTEM_PUSH
+_LIBCUDACXX_AVAILABILITY_FILESYSTEM_PUSH
 
-struct _LIBCPP_TYPE_VIS space_info {
+struct _LIBCUDACXX_TYPE_VIS space_info {
   uintmax_t capacity;
   uintmax_t free;
   uintmax_t available;
 };
 
-_LIBCPP_AVAILABILITY_FILESYSTEM_POP
+_LIBCUDACXX_AVAILABILITY_FILESYSTEM_POP
 
-_LIBCPP_END_NAMESPACE_FILESYSTEM
+_LIBCUDACXX_END_NAMESPACE_FILESYSTEM
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
-#endif // _LIBCPP___FILESYSTEM_SPACE_INFO_H
+#endif // _LIBCUDACXX___FILESYSTEM_SPACE_INFO_H

diff  --git a/libcxx/include/__filesystem/u8path.h b/libcxx/include/__filesystem/u8path.h
index d35faa14bb8a..66a33dfbdc02 100644
--- a/libcxx/include/__filesystem/u8path.h
+++ b/libcxx/include/__filesystem/u8path.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FILESYSTEM_U8PATH_H
-#define _LIBCPP___FILESYSTEM_U8PATH_H
+#ifndef _LIBCUDACXX___FILESYSTEM_U8PATH_H
+#define _LIBCUDACXX___FILESYSTEM_U8PATH_H
 
 #include <__algorithm/unwrap_iter.h>
 #include <__availability>
@@ -19,50 +19,50 @@
 
 // Only required on Windows for __widen_from_utf8, and included conservatively
 // because it requires support for localization.
-#if defined(_LIBCPP_WIN32API)
+#if defined(_LIBCUDACXX_WIN32API)
 # include <locale>
 #endif
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
-_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
+_LIBCUDACXX_BEGIN_NAMESPACE_FILESYSTEM
 
-_LIBCPP_AVAILABILITY_FILESYSTEM_PUSH
+_LIBCUDACXX_AVAILABILITY_FILESYSTEM_PUSH
 
 template <class _InputIt>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_DEPRECATED_WITH_CHAR8_T
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_DEPRECATED_WITH_CHAR8_T
     typename enable_if<__is_pathable<_InputIt>::value, path>::type
     u8path(_InputIt __f, _InputIt __l) {
   static_assert(
-#ifndef _LIBCPP_HAS_NO_CHAR8_T
+#ifndef _LIBCUDACXX_HAS_NO_CHAR8_T
       is_same<typename __is_pathable<_InputIt>::__char_type, char8_t>::value ||
 #endif
       is_same<typename __is_pathable<_InputIt>::__char_type, char>::value,
       "u8path(Iter, Iter) requires Iter have a value_type of type 'char'"
       " or 'char8_t'");
-#if defined(_LIBCPP_WIN32API)
+#if defined(_LIBCUDACXX_WIN32API)
   string __tmp(__f, __l);
   using _CVT = __widen_from_utf8<sizeof(wchar_t) * __CHAR_BIT__>;
-  _VSTD::wstring __w;
+  _CUDA_VSTD::wstring __w;
   __w.reserve(__tmp.size());
   _CVT()(back_inserter(__w), __tmp.data(), __tmp.data() + __tmp.size());
   return path(__w);
 #else
   return path(__f, __l);
-#endif /* !_LIBCPP_WIN32API */
+#endif /* !_LIBCUDACXX_WIN32API */
 }
 
-#if defined(_LIBCPP_WIN32API)
+#if defined(_LIBCUDACXX_WIN32API)
 template <class _InputIt>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_DEPRECATED_WITH_CHAR8_T
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_DEPRECATED_WITH_CHAR8_T
     typename enable_if<__is_pathable<_InputIt>::value, path>::type
     u8path(_InputIt __f, _NullSentinel) {
   static_assert(
-#ifndef _LIBCPP_HAS_NO_CHAR8_T
+#ifndef _LIBCUDACXX_HAS_NO_CHAR8_T
       is_same<typename __is_pathable<_InputIt>::__char_type, char8_t>::value ||
 #endif
       is_same<typename __is_pathable<_InputIt>::__char_type, char>::value,
@@ -73,36 +73,36 @@ _LIBCPP_INLINE_VISIBILITY _LIBCPP_DEPRECATED_WITH_CHAR8_T
   for (; *__f != __sentinel; ++__f)
     __tmp.push_back(*__f);
   using _CVT = __widen_from_utf8<sizeof(wchar_t) * __CHAR_BIT__>;
-  _VSTD::wstring __w;
+  _CUDA_VSTD::wstring __w;
   __w.reserve(__tmp.size());
   _CVT()(back_inserter(__w), __tmp.data(), __tmp.data() + __tmp.size());
   return path(__w);
 }
-#endif /* _LIBCPP_WIN32API */
+#endif /* _LIBCUDACXX_WIN32API */
 
 template <class _Source>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_DEPRECATED_WITH_CHAR8_T
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_DEPRECATED_WITH_CHAR8_T
     typename enable_if<__is_pathable<_Source>::value, path>::type
     u8path(const _Source& __s) {
   static_assert(
-#ifndef _LIBCPP_HAS_NO_CHAR8_T
+#ifndef _LIBCUDACXX_HAS_NO_CHAR8_T
       is_same<typename __is_pathable<_Source>::__char_type, char8_t>::value ||
 #endif
       is_same<typename __is_pathable<_Source>::__char_type, char>::value,
       "u8path(Source const&) requires Source have a character type of type "
       "'char' or 'char8_t'");
-#if defined(_LIBCPP_WIN32API)
+#if defined(_LIBCUDACXX_WIN32API)
   using _Traits = __is_pathable<_Source>;
-  return u8path(_VSTD::__unwrap_iter(_Traits::__range_begin(__s)), _VSTD::__unwrap_iter(_Traits::__range_end(__s)));
+  return u8path(_CUDA_VSTD::__unwrap_iter(_Traits::__range_begin(__s)), _CUDA_VSTD::__unwrap_iter(_Traits::__range_end(__s)));
 #else
   return path(__s);
 #endif
 }
 
-_LIBCPP_AVAILABILITY_FILESYSTEM_POP
+_LIBCUDACXX_AVAILABILITY_FILESYSTEM_POP
 
-_LIBCPP_END_NAMESPACE_FILESYSTEM
+_LIBCUDACXX_END_NAMESPACE_FILESYSTEM
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
-#endif // _LIBCPP___FILESYSTEM_U8PATH_H
+#endif // _LIBCUDACXX___FILESYSTEM_U8PATH_H

diff  --git a/libcxx/include/__format/buffer.h b/libcxx/include/__format/buffer.h
index d9b08064dfb3..58acd2ae9369 100644
--- a/libcxx/include/__format/buffer.h
+++ b/libcxx/include/__format/buffer.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FORMAT_BUFFER_H
-#define _LIBCPP___FORMAT_BUFFER_H
+#ifndef _LIBCUDACXX___FORMAT_BUFFER_H
+#define _LIBCUDACXX___FORMAT_BUFFER_H
 
 #include <__algorithm/copy_n.h>
 #include <__algorithm/max.h>
@@ -28,16 +28,16 @@
 #include <cstddef>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 namespace __format {
 
@@ -47,12 +47,12 @@ namespace __format {
 /// type-erasure for the formatting functions. This reduces the number to
 /// template instantiations.
 template <__formatter::__char_type _CharT>
-class _LIBCPP_TEMPLATE_VIS __output_buffer {
+class _LIBCUDACXX_TEMPLATE_VIS __output_buffer {
 public:
   using value_type = _CharT;
 
   template <class _Tp>
-  _LIBCPP_HIDE_FROM_ABI explicit __output_buffer(_CharT* __ptr,
+  _LIBCUDACXX_HIDE_FROM_ABI explicit __output_buffer(_CharT* __ptr,
                                                  size_t __capacity, _Tp* __obj)
       : __ptr_(__ptr), __capacity_(__capacity),
         __flush_([](_CharT* __p, size_t __size, void* __o) {
@@ -60,18 +60,18 @@ class _LIBCPP_TEMPLATE_VIS __output_buffer {
         }),
         __obj_(__obj) {}
 
-  _LIBCPP_HIDE_FROM_ABI void reset(_CharT* __ptr, size_t __capacity) {
+  _LIBCUDACXX_HIDE_FROM_ABI void reset(_CharT* __ptr, size_t __capacity) {
     __ptr_ = __ptr;
     __capacity_ = __capacity;
   }
 
-  _LIBCPP_HIDE_FROM_ABI auto make_output_iterator() {
+  _LIBCUDACXX_HIDE_FROM_ABI auto make_output_iterator() {
     return back_insert_iterator{*this};
   }
 
   // TODO FMT It would be nice to have an overload taking a
   // basic_string_view<_CharT> and append it directly.
-  _LIBCPP_HIDE_FROM_ABI void push_back(_CharT __c) {
+  _LIBCUDACXX_HIDE_FROM_ABI void push_back(_CharT __c) {
     __ptr_[__size_++] = __c;
 
     // Profiling showed flushing after adding is more efficient than flushing
@@ -80,7 +80,7 @@ class _LIBCPP_TEMPLATE_VIS __output_buffer {
       flush();
   }
 
-  _LIBCPP_HIDE_FROM_ABI void flush() {
+  _LIBCUDACXX_HIDE_FROM_ABI void flush() {
     __flush_(__ptr_, __size_, __obj_);
     __size_ = 0;
   }
@@ -98,9 +98,9 @@ class _LIBCPP_TEMPLATE_VIS __output_buffer {
 /// This storage is used when writing a single element to the output iterator
 /// is expensive.
 template <__formatter::__char_type _CharT>
-class _LIBCPP_TEMPLATE_VIS __internal_storage {
+class _LIBCUDACXX_TEMPLATE_VIS __internal_storage {
 public:
-  _LIBCPP_HIDE_FROM_ABI _CharT* begin() { return __buffer_; }
+  _LIBCUDACXX_HIDE_FROM_ABI _CharT* begin() { return __buffer_; }
 
   static constexpr size_t __buffer_size = 256 / sizeof(_CharT);
 
@@ -114,26 +114,26 @@ class _LIBCPP_TEMPLATE_VIS __internal_storage {
 /// Since the output is directly written to the underlying storage this class
 /// is just an empty class.
 template <__formatter::__char_type _CharT>
-class _LIBCPP_TEMPLATE_VIS __direct_storage {};
+class _LIBCUDACXX_TEMPLATE_VIS __direct_storage {};
 
 template <class _OutIt, class _CharT>
 concept __enable_direct_output = __formatter::__char_type<_CharT> &&
     (same_as<_OutIt, _CharT*>
-#ifndef _LIBCPP_ENABLE_DEBUG_MODE
+#ifndef _LIBCUDACXX_ENABLE_DEBUG_MODE
      || same_as<_OutIt, __wrap_iter<_CharT*>>
 #endif
     );
 
 /// Write policy for directly writing to the underlying output.
 template <class _OutIt, __formatter::__char_type _CharT>
-class _LIBCPP_TEMPLATE_VIS __writer_direct {
+class _LIBCUDACXX_TEMPLATE_VIS __writer_direct {
 public:
-  _LIBCPP_HIDE_FROM_ABI explicit __writer_direct(_OutIt __out_it)
+  _LIBCUDACXX_HIDE_FROM_ABI explicit __writer_direct(_OutIt __out_it)
       : __out_it_(__out_it) {}
 
-  _LIBCPP_HIDE_FROM_ABI auto out() { return __out_it_; }
+  _LIBCUDACXX_HIDE_FROM_ABI auto out() { return __out_it_; }
 
-  _LIBCPP_HIDE_FROM_ABI void flush(_CharT*, size_t __size) {
+  _LIBCUDACXX_HIDE_FROM_ABI void flush(_CharT*, size_t __size) {
     // _OutIt can be a __wrap_iter<CharT*>. Therefore the original iterator
     // is adjusted.
     __out_it_ += __size;
@@ -145,15 +145,15 @@ class _LIBCPP_TEMPLATE_VIS __writer_direct {
 
 /// Write policy for copying the buffer to the output.
 template <class _OutIt, __formatter::__char_type _CharT>
-class _LIBCPP_TEMPLATE_VIS __writer_iterator {
+class _LIBCUDACXX_TEMPLATE_VIS __writer_iterator {
 public:
-  _LIBCPP_HIDE_FROM_ABI explicit __writer_iterator(_OutIt __out_it)
-      : __out_it_{_VSTD::move(__out_it)} {}
+  _LIBCUDACXX_HIDE_FROM_ABI explicit __writer_iterator(_OutIt __out_it)
+      : __out_it_{_CUDA_VSTD::move(__out_it)} {}
 
-  _LIBCPP_HIDE_FROM_ABI auto out() { return __out_it_; }
+  _LIBCUDACXX_HIDE_FROM_ABI auto out() { return __out_it_; }
 
-  _LIBCPP_HIDE_FROM_ABI void flush(_CharT* __ptr, size_t __size) {
-    __out_it_ = _VSTD::copy_n(__ptr, __size, _VSTD::move(__out_it_));
+  _LIBCUDACXX_HIDE_FROM_ABI void flush(_CharT* __ptr, size_t __size) {
+    __out_it_ = _CUDA_VSTD::copy_n(__ptr, __size, _CUDA_VSTD::move(__out_it_));
   }
 
 private:
@@ -175,27 +175,27 @@ concept __insertable =
 
 /// Extract the container type of a \ref back_insert_iterator.
 template <class _It>
-struct _LIBCPP_TEMPLATE_VIS __back_insert_iterator_container {
+struct _LIBCUDACXX_TEMPLATE_VIS __back_insert_iterator_container {
   using type = void;
 };
 
 template <__insertable _Container>
-struct _LIBCPP_TEMPLATE_VIS __back_insert_iterator_container<back_insert_iterator<_Container>> {
+struct _LIBCUDACXX_TEMPLATE_VIS __back_insert_iterator_container<back_insert_iterator<_Container>> {
   using type = _Container;
 };
 
 /// Write policy for inserting the buffer in a container.
 template <class _Container>
-class _LIBCPP_TEMPLATE_VIS __writer_container {
+class _LIBCUDACXX_TEMPLATE_VIS __writer_container {
 public:
   using _CharT = typename _Container::value_type;
 
-  _LIBCPP_HIDE_FROM_ABI explicit __writer_container(back_insert_iterator<_Container> __out_it)
+  _LIBCUDACXX_HIDE_FROM_ABI explicit __writer_container(back_insert_iterator<_Container> __out_it)
       : __container_{__out_it.__get_container()} {}
 
-  _LIBCPP_HIDE_FROM_ABI auto out() { return back_inserter(*__container_); }
+  _LIBCUDACXX_HIDE_FROM_ABI auto out() { return back_inserter(*__container_); }
 
-  _LIBCPP_HIDE_FROM_ABI void flush(_CharT* __ptr, size_t __size) {
+  _LIBCUDACXX_HIDE_FROM_ABI void flush(_CharT* __ptr, size_t __size) {
     __container_->insert(__container_->end(), __ptr, __ptr + __size);
   }
 
@@ -205,7 +205,7 @@ class _LIBCPP_TEMPLATE_VIS __writer_container {
 
 /// Selects the type of the writer used for the output iterator.
 template <class _OutIt, class _CharT>
-class _LIBCPP_TEMPLATE_VIS __writer_selector {
+class _LIBCUDACXX_TEMPLATE_VIS __writer_selector {
   using _Container = typename __back_insert_iterator_container<_OutIt>::type;
 
 public:
@@ -216,37 +216,37 @@ class _LIBCPP_TEMPLATE_VIS __writer_selector {
 
 /// The generic formatting buffer.
 template <class _OutIt, __formatter::__char_type _CharT>
-requires(output_iterator<_OutIt, const _CharT&>) class _LIBCPP_TEMPLATE_VIS
+requires(output_iterator<_OutIt, const _CharT&>) class _LIBCUDACXX_TEMPLATE_VIS
     __format_buffer {
   using _Storage =
       conditional_t<__enable_direct_output<_OutIt, _CharT>,
                     __direct_storage<_CharT>, __internal_storage<_CharT>>;
 
 public:
-  _LIBCPP_HIDE_FROM_ABI explicit __format_buffer(_OutIt __out_it)
+  _LIBCUDACXX_HIDE_FROM_ABI explicit __format_buffer(_OutIt __out_it)
     requires(same_as<_Storage, __internal_storage<_CharT>>)
-  : __output_(__storage_.begin(), __storage_.__buffer_size, this), __writer_(_VSTD::move(__out_it)) {}
+  : __output_(__storage_.begin(), __storage_.__buffer_size, this), __writer_(_CUDA_VSTD::move(__out_it)) {}
 
-  _LIBCPP_HIDE_FROM_ABI explicit __format_buffer(_OutIt __out_it) requires(
+  _LIBCUDACXX_HIDE_FROM_ABI explicit __format_buffer(_OutIt __out_it) requires(
       same_as<_Storage, __direct_storage<_CharT>>)
-      : __output_(_VSTD::__unwrap_iter(__out_it), size_t(-1), this),
-        __writer_(_VSTD::move(__out_it)) {}
+      : __output_(_CUDA_VSTD::__unwrap_iter(__out_it), size_t(-1), this),
+        __writer_(_CUDA_VSTD::move(__out_it)) {}
 
-  _LIBCPP_HIDE_FROM_ABI auto make_output_iterator() {
+  _LIBCUDACXX_HIDE_FROM_ABI auto make_output_iterator() {
     return __output_.make_output_iterator();
   }
 
-  _LIBCPP_HIDE_FROM_ABI void flush(_CharT* __ptr, size_t __size) {
+  _LIBCUDACXX_HIDE_FROM_ABI void flush(_CharT* __ptr, size_t __size) {
     __writer_.flush(__ptr, __size);
   }
 
-  _LIBCPP_HIDE_FROM_ABI _OutIt out() && {
+  _LIBCUDACXX_HIDE_FROM_ABI _OutIt out() && {
     __output_.flush();
-    return _VSTD::move(__writer_).out();
+    return _CUDA_VSTD::move(__writer_).out();
   }
 
 private:
-  _LIBCPP_NO_UNIQUE_ADDRESS _Storage __storage_;
+  _LIBCUDACXX_NO_UNIQUE_ADDRESS _Storage __storage_;
   __output_buffer<_CharT> __output_;
   typename __writer_selector<_OutIt, _CharT>::type __writer_;
 };
@@ -256,13 +256,13 @@ requires(output_iterator<_OutIt, const _CharT&>) class _LIBCPP_TEMPLATE_VIS
 /// Since \ref formatted_size only needs to know the size, the output itself is
 /// discarded.
 template <__formatter::__char_type _CharT>
-class _LIBCPP_TEMPLATE_VIS __formatted_size_buffer {
+class _LIBCUDACXX_TEMPLATE_VIS __formatted_size_buffer {
 public:
-  _LIBCPP_HIDE_FROM_ABI auto make_output_iterator() { return __output_.make_output_iterator(); }
+  _LIBCUDACXX_HIDE_FROM_ABI auto make_output_iterator() { return __output_.make_output_iterator(); }
 
-  _LIBCPP_HIDE_FROM_ABI void flush(const _CharT*, size_t __size) { __size_ += __size; }
+  _LIBCUDACXX_HIDE_FROM_ABI void flush(const _CharT*, size_t __size) { __size_ += __size; }
 
-  _LIBCPP_HIDE_FROM_ABI size_t result() && {
+  _LIBCUDACXX_HIDE_FROM_ABI size_t result() && {
     __output_.flush();
     return __size_;
   }
@@ -276,16 +276,16 @@ class _LIBCPP_TEMPLATE_VIS __formatted_size_buffer {
 /// The base of a buffer that counts and limits the number of insertions.
 template <class _OutIt, __formatter::__char_type _CharT, bool>
   requires(output_iterator<_OutIt, const _CharT&>)
-struct _LIBCPP_TEMPLATE_VIS __format_to_n_buffer_base {
+struct _LIBCUDACXX_TEMPLATE_VIS __format_to_n_buffer_base {
   using _Size = iter_
diff erence_t<_OutIt>;
 
 public:
-  _LIBCPP_HIDE_FROM_ABI explicit __format_to_n_buffer_base(_OutIt __out_it, _Size __n)
-      : __writer_(_VSTD::move(__out_it)), __n_(_VSTD::max(_Size(0), __n)) {}
+  _LIBCUDACXX_HIDE_FROM_ABI explicit __format_to_n_buffer_base(_OutIt __out_it, _Size __n)
+      : __writer_(_CUDA_VSTD::move(__out_it)), __n_(_CUDA_VSTD::max(_Size(0), __n)) {}
 
-  _LIBCPP_HIDE_FROM_ABI void flush(_CharT* __ptr, size_t __size) {
+  _LIBCUDACXX_HIDE_FROM_ABI void flush(_CharT* __ptr, size_t __size) {
     if (_Size(__size_) <= __n_)
-      __writer_.flush(__ptr, _VSTD::min(_Size(__size), __n_ - __size_));
+      __writer_.flush(__ptr, _CUDA_VSTD::min(_Size(__size), __n_ - __size_));
     __size_ += __size;
   }
 
@@ -306,17 +306,17 @@ struct _LIBCPP_TEMPLATE_VIS __format_to_n_buffer_base {
 /// exceed the maximum number of code units.
 template <class _OutIt, __formatter::__char_type _CharT>
   requires(output_iterator<_OutIt, const _CharT&>)
-class _LIBCPP_TEMPLATE_VIS __format_to_n_buffer_base<_OutIt, _CharT, true> {
+class _LIBCUDACXX_TEMPLATE_VIS __format_to_n_buffer_base<_OutIt, _CharT, true> {
   using _Size = iter_
diff erence_t<_OutIt>;
 
 public:
-  _LIBCPP_HIDE_FROM_ABI explicit __format_to_n_buffer_base(_OutIt __out_it, _Size __n)
-      : __output_(_VSTD::__unwrap_iter(__out_it), __n, this), __writer_(_VSTD::move(__out_it)) {
+  _LIBCUDACXX_HIDE_FROM_ABI explicit __format_to_n_buffer_base(_OutIt __out_it, _Size __n)
+      : __output_(_CUDA_VSTD::__unwrap_iter(__out_it), __n, this), __writer_(_CUDA_VSTD::move(__out_it)) {
     if (__n <= 0) [[unlikely]]
       __output_.reset(__storage_.begin(), __storage_.__buffer_size);
   }
 
-  _LIBCPP_HIDE_FROM_ABI void flush(_CharT* __ptr, size_t __size) {
+  _LIBCUDACXX_HIDE_FROM_ABI void flush(_CharT* __ptr, size_t __size) {
     // A flush to the direct writer happens in two occasions:
     // - The format function has written the maximum number of allowed code
     //   units. At this point it's no longer valid to write to this writer. So
@@ -344,26 +344,26 @@ class _LIBCPP_TEMPLATE_VIS __format_to_n_buffer_base<_OutIt, _CharT, true> {
 /// The buffer that counts and limits the number of insertions.
 template <class _OutIt, __formatter::__char_type _CharT>
   requires(output_iterator<_OutIt, const _CharT&>)
-struct _LIBCPP_TEMPLATE_VIS __format_to_n_buffer final
+struct _LIBCUDACXX_TEMPLATE_VIS __format_to_n_buffer final
     : public __format_to_n_buffer_base< _OutIt, _CharT, __enable_direct_output<_OutIt, _CharT>> {
   using _Base = __format_to_n_buffer_base<_OutIt, _CharT, __enable_direct_output<_OutIt, _CharT>>;
   using _Size = iter_
diff erence_t<_OutIt>;
 
 public:
-  _LIBCPP_HIDE_FROM_ABI explicit __format_to_n_buffer(_OutIt __out_it, _Size __n) : _Base(_VSTD::move(__out_it), __n) {}
-  _LIBCPP_HIDE_FROM_ABI auto make_output_iterator() { return this->__output_.make_output_iterator(); }
+  _LIBCUDACXX_HIDE_FROM_ABI explicit __format_to_n_buffer(_OutIt __out_it, _Size __n) : _Base(_CUDA_VSTD::move(__out_it), __n) {}
+  _LIBCUDACXX_HIDE_FROM_ABI auto make_output_iterator() { return this->__output_.make_output_iterator(); }
 
-  _LIBCPP_HIDE_FROM_ABI format_to_n_result<_OutIt> result() && {
+  _LIBCUDACXX_HIDE_FROM_ABI format_to_n_result<_OutIt> result() && {
     this->__output_.flush();
-    return {_VSTD::move(this->__writer_).out(), this->__size_};
+    return {_CUDA_VSTD::move(this->__writer_).out(), this->__size_};
   }
 };
 } // namespace __format
 
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___FORMAT_BUFFER_H
+#endif // _LIBCUDACXX___FORMAT_BUFFER_H

diff  --git a/libcxx/include/__format/concepts.h b/libcxx/include/__format/concepts.h
index 8df6493b0aed..07b95e33b383 100644
--- a/libcxx/include/__format/concepts.h
+++ b/libcxx/include/__format/concepts.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FORMAT_CONCEPTS_H
-#define _LIBCPP___FORMAT_CONCEPTS_H
+#ifndef _LIBCUDACXX___FORMAT_CONCEPTS_H
+#define _LIBCUDACXX___FORMAT_CONCEPTS_H
 
 #include <__concepts/same_as.h>
 #include <__concepts/semiregular.h>
@@ -17,13 +17,13 @@
 #include <__format/format_parse_context.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 // The output iterator isn't specified. A formatter should accept any
 // output_iterator. This iterator is a minimal iterator to test the concept.
@@ -46,8 +46,8 @@ concept __formattable = (semiregular<formatter<remove_cvref_t<_Tp>, _CharT>>) &&
                           { __cf.format(__t, __fc) } -> same_as<__fmt_iter_for<_CharT>>;
                         };
 
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___FORMAT_CONCEPTS_H
+#endif // _LIBCUDACXX___FORMAT_CONCEPTS_H

diff  --git a/libcxx/include/__format/enable_insertable.h b/libcxx/include/__format/enable_insertable.h
index 71b4252930de..289ee513dd80 100644
--- a/libcxx/include/__format/enable_insertable.h
+++ b/libcxx/include/__format/enable_insertable.h
@@ -7,18 +7,18 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FORMAT_ENABLE_INSERTABLE_H
-#define _LIBCPP___FORMAT_ENABLE_INSERTABLE_H
+#ifndef _LIBCUDACXX___FORMAT_ENABLE_INSERTABLE_H
+#define _LIBCUDACXX___FORMAT_ENABLE_INSERTABLE_H
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 namespace __format {
 
@@ -28,8 +28,8 @@ inline constexpr bool __enable_insertable = false;
 
 } // namespace __format
 
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___FORMAT_ENABLE_INSERTABLE_H
+#endif // _LIBCUDACXX___FORMAT_ENABLE_INSERTABLE_H

diff  --git a/libcxx/include/__format/extended_grapheme_cluster_table.h b/libcxx/include/__format/extended_grapheme_cluster_table.h
index 00cd0e91cd15..27645e21f05a 100644
--- a/libcxx/include/__format/extended_grapheme_cluster_table.h
+++ b/libcxx/include/__format/extended_grapheme_cluster_table.h
@@ -58,8 +58,8 @@
 // use or other dealings in these Data Files or Software without prior
 // written authorization of the copyright holder.
 
-#ifndef _LIBCPP___FORMAT_EXTENDED_GRAPHEME_CLUSTER_TABLE_H
-#define _LIBCPP___FORMAT_EXTENDED_GRAPHEME_CLUSTER_TABLE_H
+#ifndef _LIBCUDACXX___FORMAT_EXTENDED_GRAPHEME_CLUSTER_TABLE_H
+#define _LIBCUDACXX___FORMAT_EXTENDED_GRAPHEME_CLUSTER_TABLE_H
 
 #include <__algorithm/upper_bound.h>
 #include <__config>
@@ -67,13 +67,13 @@
 #include <cstddef>
 #include <cstdint>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 namespace __extended_grapheme_custer_property_boundary {
 
@@ -292,7 +292,7 @@ inline constexpr uint32_t __entries[1480] = {
     0x707387f1, 0x707787f1, 0x707b87f1, 0x707f80f1};
 
 /// Returns the extended grapheme cluster bondary property of a code point.
-[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr __property __get_property(const char32_t __code_point) noexcept {
+[[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI constexpr __property __get_property(const char32_t __code_point) noexcept {
   // TODO FMT use std::ranges::upper_bound.
 
   // The algorithm searches for the upper bound of the range and, when found,
@@ -325,8 +325,8 @@ inline constexpr uint32_t __entries[1480] = {
 
 } // namespace __extended_grapheme_custer_property_boundary
 
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___FORMAT_EXTENDED_GRAPHEME_CLUSTER_TABLE_H
+#endif // _LIBCUDACXX___FORMAT_EXTENDED_GRAPHEME_CLUSTER_TABLE_H

diff  --git a/libcxx/include/__format/format_arg.h b/libcxx/include/__format/format_arg.h
index 4f93024b7c69..c3e87a571a73 100644
--- a/libcxx/include/__format/format_arg.h
+++ b/libcxx/include/__format/format_arg.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FORMAT_FORMAT_ARG_H
-#define _LIBCPP___FORMAT_FORMAT_ARG_H
+#ifndef _LIBCUDACXX___FORMAT_FORMAT_ARG_H
+#define _LIBCUDACXX___FORMAT_FORMAT_ARG_H
 
 #include <__assert>
 #include <__concepts/arithmetic.h>
@@ -24,13 +24,13 @@
 #include <string>
 #include <string_view>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 namespace __format {
 /// The type stored in @ref basic_format_arg.
@@ -45,7 +45,7 @@ namespace __format {
 /// It could be packed in 4-bits but that means a new type directly becomes an
 /// ABI break. The packed type is 64-bit so this reduces the maximum number of
 /// packed elements from 16 to 12.
-enum class _LIBCPP_ENUM_VIS __arg_t : uint8_t {
+enum class _LIBCUDACXX_ENUM_VIS __arg_t : uint8_t {
   __none,
   __boolean,
   __char_type,
@@ -70,12 +70,12 @@ inline constexpr uint8_t __packed_arg_t_mask = 0x1f;
 inline constexpr unsigned __packed_types_storage_bits = 64;
 inline constexpr unsigned __packed_types_max = __packed_types_storage_bits / __packed_arg_t_bits;
 
-_LIBCPP_HIDE_FROM_ABI
+_LIBCUDACXX_HIDE_FROM_ABI
 constexpr bool __use_packed_format_arg_store(size_t __size) { return __size <= __packed_types_max; }
 
-_LIBCPP_HIDE_FROM_ABI
+_LIBCUDACXX_HIDE_FROM_ABI
 constexpr __arg_t __get_packed_type(uint64_t __types, size_t __id) {
-  _LIBCPP_ASSERT(__id <= __packed_types_max, "");
+  _LIBCUDACXX_ASSERT(__id <= __packed_types_max, "");
 
   if (__id > 0)
     __types >>= __id * __packed_arg_t_bits;
@@ -86,53 +86,53 @@ constexpr __arg_t __get_packed_type(uint64_t __types, size_t __id) {
 } // namespace __format
 
 template <class _Visitor, class _Context>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT decltype(auto) visit_format_arg(_Visitor&& __vis,
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_AVAILABILITY_FORMAT decltype(auto) visit_format_arg(_Visitor&& __vis,
                                                                                   basic_format_arg<_Context> __arg) {
   switch (__arg.__type_) {
   case __format::__arg_t::__none:
-    return _VSTD::invoke(_VSTD::forward<_Visitor>(__vis), __arg.__value_.__monostate_);
+    return _CUDA_VSTD::invoke(_CUDA_VSTD::forward<_Visitor>(__vis), __arg.__value_.__monostate_);
   case __format::__arg_t::__boolean:
-    return _VSTD::invoke(_VSTD::forward<_Visitor>(__vis), __arg.__value_.__boolean_);
+    return _CUDA_VSTD::invoke(_CUDA_VSTD::forward<_Visitor>(__vis), __arg.__value_.__boolean_);
   case __format::__arg_t::__char_type:
-    return _VSTD::invoke(_VSTD::forward<_Visitor>(__vis), __arg.__value_.__char_type_);
+    return _CUDA_VSTD::invoke(_CUDA_VSTD::forward<_Visitor>(__vis), __arg.__value_.__char_type_);
   case __format::__arg_t::__int:
-    return _VSTD::invoke(_VSTD::forward<_Visitor>(__vis), __arg.__value_.__int_);
+    return _CUDA_VSTD::invoke(_CUDA_VSTD::forward<_Visitor>(__vis), __arg.__value_.__int_);
   case __format::__arg_t::__long_long:
-    return _VSTD::invoke(_VSTD::forward<_Visitor>(__vis), __arg.__value_.__long_long_);
+    return _CUDA_VSTD::invoke(_CUDA_VSTD::forward<_Visitor>(__vis), __arg.__value_.__long_long_);
   case __format::__arg_t::__i128:
-#  ifndef _LIBCPP_HAS_NO_INT128
-    return _VSTD::invoke(_VSTD::forward<_Visitor>(__vis), __arg.__value_.__i128_);
+#  ifndef _LIBCUDACXX_HAS_NO_INT128
+    return _CUDA_VSTD::invoke(_CUDA_VSTD::forward<_Visitor>(__vis), __arg.__value_.__i128_);
 #  else
-    __libcpp_unreachable();
+    __LIBCUDACXX_unreachable();
 #  endif
   case __format::__arg_t::__unsigned:
-    return _VSTD::invoke(_VSTD::forward<_Visitor>(__vis), __arg.__value_.__unsigned_);
+    return _CUDA_VSTD::invoke(_CUDA_VSTD::forward<_Visitor>(__vis), __arg.__value_.__unsigned_);
   case __format::__arg_t::__unsigned_long_long:
-    return _VSTD::invoke(_VSTD::forward<_Visitor>(__vis), __arg.__value_.__unsigned_long_long_);
+    return _CUDA_VSTD::invoke(_CUDA_VSTD::forward<_Visitor>(__vis), __arg.__value_.__unsigned_long_long_);
   case __format::__arg_t::__u128:
-#  ifndef _LIBCPP_HAS_NO_INT128
-    return _VSTD::invoke(_VSTD::forward<_Visitor>(__vis), __arg.__value_.__u128_);
+#  ifndef _LIBCUDACXX_HAS_NO_INT128
+    return _CUDA_VSTD::invoke(_CUDA_VSTD::forward<_Visitor>(__vis), __arg.__value_.__u128_);
 #  else
-    __libcpp_unreachable();
+    __LIBCUDACXX_unreachable();
 #  endif
   case __format::__arg_t::__float:
-    return _VSTD::invoke(_VSTD::forward<_Visitor>(__vis), __arg.__value_.__float_);
+    return _CUDA_VSTD::invoke(_CUDA_VSTD::forward<_Visitor>(__vis), __arg.__value_.__float_);
   case __format::__arg_t::__double:
-    return _VSTD::invoke(_VSTD::forward<_Visitor>(__vis), __arg.__value_.__double_);
+    return _CUDA_VSTD::invoke(_CUDA_VSTD::forward<_Visitor>(__vis), __arg.__value_.__double_);
   case __format::__arg_t::__long_double:
-    return _VSTD::invoke(_VSTD::forward<_Visitor>(__vis), __arg.__value_.__long_double_);
+    return _CUDA_VSTD::invoke(_CUDA_VSTD::forward<_Visitor>(__vis), __arg.__value_.__long_double_);
   case __format::__arg_t::__const_char_type_ptr:
-    return _VSTD::invoke(_VSTD::forward<_Visitor>(__vis), __arg.__value_.__const_char_type_ptr_);
+    return _CUDA_VSTD::invoke(_CUDA_VSTD::forward<_Visitor>(__vis), __arg.__value_.__const_char_type_ptr_);
   case __format::__arg_t::__string_view:
-    return _VSTD::invoke(_VSTD::forward<_Visitor>(__vis), __arg.__value_.__string_view_);
+    return _CUDA_VSTD::invoke(_CUDA_VSTD::forward<_Visitor>(__vis), __arg.__value_.__string_view_);
   case __format::__arg_t::__ptr:
-    return _VSTD::invoke(_VSTD::forward<_Visitor>(__vis), __arg.__value_.__ptr_);
+    return _CUDA_VSTD::invoke(_CUDA_VSTD::forward<_Visitor>(__vis), __arg.__value_.__ptr_);
   case __format::__arg_t::__handle:
-    return _VSTD::invoke(_VSTD::forward<_Visitor>(__vis),
+    return _CUDA_VSTD::invoke(_CUDA_VSTD::forward<_Visitor>(__vis),
                          typename basic_format_arg<_Context>::handle{__arg.__value_.__handle_});
   }
 
-  __libcpp_unreachable();
+  __LIBCUDACXX_unreachable();
 }
 
 /// Contains the values used in basic_format_arg.
@@ -147,8 +147,8 @@ class __basic_format_arg_value {
   /// Contains the implementation for basic_format_arg::handle.
   struct __handle {
     template <class _Tp>
-    _LIBCPP_HIDE_FROM_ABI explicit __handle(_Tp&& __v) noexcept
-        : __ptr_(_VSTD::addressof(__v)),
+    _LIBCUDACXX_HIDE_FROM_ABI explicit __handle(_Tp&& __v) noexcept
+        : __ptr_(_CUDA_VSTD::addressof(__v)),
           __format_([](basic_format_parse_context<_CharT>& __parse_ctx, _Context& __ctx, const void* __ptr) {
             using _Dp = remove_cvref_t<_Tp>;
             using _Formatter = typename _Context::template formatter_type<_Dp>;
@@ -175,7 +175,7 @@ class __basic_format_arg_value {
     unsigned __unsigned_;
     long long __long_long_;
     unsigned long long __unsigned_long_long_;
-#  ifndef _LIBCPP_HAS_NO_INT128
+#  ifndef _LIBCUDACXX_HAS_NO_INT128
     __int128_t __i128_;
     __uint128_t __u128_;
 #  endif
@@ -191,39 +191,39 @@ class __basic_format_arg_value {
   // These constructors contain the exact storage type used. If adjustments are
   // required, these will be done in __create_format_arg.
 
-  _LIBCPP_HIDE_FROM_ABI __basic_format_arg_value() noexcept : __monostate_() {}
-  _LIBCPP_HIDE_FROM_ABI __basic_format_arg_value(bool __value) noexcept : __boolean_(__value) {}
-  _LIBCPP_HIDE_FROM_ABI __basic_format_arg_value(_CharT __value) noexcept : __char_type_(__value) {}
-  _LIBCPP_HIDE_FROM_ABI __basic_format_arg_value(int __value) noexcept : __int_(__value) {}
-  _LIBCPP_HIDE_FROM_ABI __basic_format_arg_value(unsigned __value) noexcept : __unsigned_(__value) {}
-  _LIBCPP_HIDE_FROM_ABI __basic_format_arg_value(long long __value) noexcept : __long_long_(__value) {}
-  _LIBCPP_HIDE_FROM_ABI __basic_format_arg_value(unsigned long long __value) noexcept
+  _LIBCUDACXX_HIDE_FROM_ABI __basic_format_arg_value() noexcept : __monostate_() {}
+  _LIBCUDACXX_HIDE_FROM_ABI __basic_format_arg_value(bool __value) noexcept : __boolean_(__value) {}
+  _LIBCUDACXX_HIDE_FROM_ABI __basic_format_arg_value(_CharT __value) noexcept : __char_type_(__value) {}
+  _LIBCUDACXX_HIDE_FROM_ABI __basic_format_arg_value(int __value) noexcept : __int_(__value) {}
+  _LIBCUDACXX_HIDE_FROM_ABI __basic_format_arg_value(unsigned __value) noexcept : __unsigned_(__value) {}
+  _LIBCUDACXX_HIDE_FROM_ABI __basic_format_arg_value(long long __value) noexcept : __long_long_(__value) {}
+  _LIBCUDACXX_HIDE_FROM_ABI __basic_format_arg_value(unsigned long long __value) noexcept
       : __unsigned_long_long_(__value) {}
-#  ifndef _LIBCPP_HAS_NO_INT128
-  _LIBCPP_HIDE_FROM_ABI __basic_format_arg_value(__int128_t __value) noexcept : __i128_(__value) {}
-  _LIBCPP_HIDE_FROM_ABI __basic_format_arg_value(__uint128_t __value) noexcept : __u128_(__value) {}
+#  ifndef _LIBCUDACXX_HAS_NO_INT128
+  _LIBCUDACXX_HIDE_FROM_ABI __basic_format_arg_value(__int128_t __value) noexcept : __i128_(__value) {}
+  _LIBCUDACXX_HIDE_FROM_ABI __basic_format_arg_value(__uint128_t __value) noexcept : __u128_(__value) {}
 #  endif
-  _LIBCPP_HIDE_FROM_ABI __basic_format_arg_value(float __value) noexcept : __float_(__value) {}
-  _LIBCPP_HIDE_FROM_ABI __basic_format_arg_value(double __value) noexcept : __double_(__value) {}
-  _LIBCPP_HIDE_FROM_ABI __basic_format_arg_value(long double __value) noexcept : __long_double_(__value) {}
-  _LIBCPP_HIDE_FROM_ABI __basic_format_arg_value(const _CharT* __value) noexcept : __const_char_type_ptr_(__value) {}
-  _LIBCPP_HIDE_FROM_ABI __basic_format_arg_value(basic_string_view<_CharT> __value) noexcept
+  _LIBCUDACXX_HIDE_FROM_ABI __basic_format_arg_value(float __value) noexcept : __float_(__value) {}
+  _LIBCUDACXX_HIDE_FROM_ABI __basic_format_arg_value(double __value) noexcept : __double_(__value) {}
+  _LIBCUDACXX_HIDE_FROM_ABI __basic_format_arg_value(long double __value) noexcept : __long_double_(__value) {}
+  _LIBCUDACXX_HIDE_FROM_ABI __basic_format_arg_value(const _CharT* __value) noexcept : __const_char_type_ptr_(__value) {}
+  _LIBCUDACXX_HIDE_FROM_ABI __basic_format_arg_value(basic_string_view<_CharT> __value) noexcept
       : __string_view_(__value) {}
-  _LIBCPP_HIDE_FROM_ABI __basic_format_arg_value(const void* __value) noexcept : __ptr_(__value) {}
-  _LIBCPP_HIDE_FROM_ABI __basic_format_arg_value(__handle __value) noexcept
+  _LIBCUDACXX_HIDE_FROM_ABI __basic_format_arg_value(const void* __value) noexcept : __ptr_(__value) {}
+  _LIBCUDACXX_HIDE_FROM_ABI __basic_format_arg_value(__handle __value) noexcept
       // TODO FMT Investigate why it doesn't work without the forward.
       : __handle_(std::forward<__handle>(__value)) {}
 };
 
 template <class _Context>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT basic_format_arg {
+class _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_AVAILABILITY_FORMAT basic_format_arg {
 public:
-  class _LIBCPP_TEMPLATE_VIS handle;
+  class _LIBCUDACXX_TEMPLATE_VIS handle;
 
-  _LIBCPP_HIDE_FROM_ABI basic_format_arg() noexcept
+  _LIBCUDACXX_HIDE_FROM_ABI basic_format_arg() noexcept
       : __type_{__format::__arg_t::__none} {}
 
-  _LIBCPP_HIDE_FROM_ABI explicit operator bool() const noexcept {
+  _LIBCUDACXX_HIDE_FROM_ABI explicit operator bool() const noexcept {
     return __type_ != __format::__arg_t::__none;
   }
 
@@ -245,28 +245,28 @@ class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT basic_format_arg {
   __basic_format_arg_value<_Context> __value_;
   __format::__arg_t __type_;
 
-  _LIBCPP_HIDE_FROM_ABI explicit basic_format_arg(__format::__arg_t __type,
+  _LIBCUDACXX_HIDE_FROM_ABI explicit basic_format_arg(__format::__arg_t __type,
                                                   __basic_format_arg_value<_Context> __value) noexcept
       : __value_(__value), __type_(__type) {}
 };
 
 template <class _Context>
-class _LIBCPP_TEMPLATE_VIS basic_format_arg<_Context>::handle {
+class _LIBCUDACXX_TEMPLATE_VIS basic_format_arg<_Context>::handle {
 public:
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   void format(basic_format_parse_context<char_type>& __parse_ctx, _Context& __ctx) const {
     __handle_.__format_(__parse_ctx, __ctx, __handle_.__ptr_);
   }
 
-  _LIBCPP_HIDE_FROM_ABI explicit handle(typename __basic_format_arg_value<_Context>::__handle& __handle) noexcept
+  _LIBCUDACXX_HIDE_FROM_ABI explicit handle(typename __basic_format_arg_value<_Context>::__handle& __handle) noexcept
       : __handle_(__handle) {}
 
 private:
   typename __basic_format_arg_value<_Context>::__handle& __handle_;
 };
 
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___FORMAT_FORMAT_ARG_H
+#endif // _LIBCUDACXX___FORMAT_FORMAT_ARG_H

diff  --git a/libcxx/include/__format/format_arg_store.h b/libcxx/include/__format/format_arg_store.h
index 26a5e71b93af..c29df9ffbe32 100644
--- a/libcxx/include/__format/format_arg_store.h
+++ b/libcxx/include/__format/format_arg_store.h
@@ -7,10 +7,10 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FORMAT_FORMAT_ARG_STORE_H
-#define _LIBCPP___FORMAT_FORMAT_ARG_STORE_H
+#ifndef _LIBCUDACXX___FORMAT_FORMAT_ARG_STORE_H
+#define _LIBCUDACXX___FORMAT_FORMAT_ARG_STORE_H
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
@@ -24,9 +24,9 @@
 #include <string_view>
 #include <type_traits>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 namespace __format {
 
@@ -47,7 +47,7 @@ template <class _Context, same_as<typename _Context::char_type> _Tp>
 consteval __arg_t __determine_arg_t() {
   return __arg_t::__char_type;
 }
-#  ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#  ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 template <class _Context, class _CharT>
   requires(same_as<typename _Context::char_type, wchar_t> && same_as<_CharT, char>)
 consteval __arg_t __determine_arg_t() {
@@ -56,13 +56,13 @@ consteval __arg_t __determine_arg_t() {
 #  endif
 
 // Signed integers
-template <class, __libcpp_signed_integer _Tp>
+template <class, __LIBCUDACXX_signed_integer _Tp>
 consteval __arg_t __determine_arg_t() {
   if constexpr (sizeof(_Tp) <= sizeof(int))
     return __arg_t::__int;
   else if constexpr (sizeof(_Tp) <= sizeof(long long))
     return __arg_t::__long_long;
-#  ifndef _LIBCPP_HAS_NO_INT128
+#  ifndef _LIBCUDACXX_HAS_NO_INT128
   else if constexpr (sizeof(_Tp) == sizeof(__int128_t))
     return __arg_t::__i128;
 #  endif
@@ -71,13 +71,13 @@ consteval __arg_t __determine_arg_t() {
 }
 
 // Unsigned integers
-template <class, __libcpp_unsigned_integer _Tp>
+template <class, __LIBCUDACXX_unsigned_integer _Tp>
 consteval __arg_t __determine_arg_t() {
   if constexpr (sizeof(_Tp) <= sizeof(unsigned))
     return __arg_t::__unsigned;
   else if constexpr (sizeof(_Tp) <= sizeof(unsigned long long))
     return __arg_t::__unsigned_long_long;
-#  ifndef _LIBCPP_HAS_NO_INT128
+#  ifndef _LIBCUDACXX_HAS_NO_INT128
   else if constexpr (sizeof(_Tp) == sizeof(__uint128_t))
     return __arg_t::__u128;
 #  endif
@@ -153,7 +153,7 @@ template <class _Context, class _Tp>
 consteval __arg_t __determine_arg_t() = delete;
 
 template <class _Context, class _Tp>
-_LIBCPP_HIDE_FROM_ABI basic_format_arg<_Context> __create_format_arg(_Tp&& __value) noexcept {
+_LIBCUDACXX_HIDE_FROM_ABI basic_format_arg<_Context> __create_format_arg(_Tp&& __value) noexcept {
   constexpr __arg_t __arg = __determine_arg_t<_Context, remove_cvref_t<_Tp>>();
   static_assert(__arg != __arg_t::__none);
 
@@ -186,13 +186,13 @@ _LIBCPP_HIDE_FROM_ABI basic_format_arg<_Context> __create_format_arg(_Tp&& __val
     return basic_format_arg<_Context>{__arg, static_cast<const void*>(__value)};
   else if constexpr (__arg == __arg_t::__handle)
     return basic_format_arg<_Context>{
-        __arg, typename __basic_format_arg_value<_Context>::__handle{_VSTD::forward<_Tp>(__value)}};
+        __arg, typename __basic_format_arg_value<_Context>::__handle{_CUDA_VSTD::forward<_Tp>(__value)}};
   else
     return basic_format_arg<_Context>{__arg, __value};
 }
 
 template <class _Context, class... _Args>
-_LIBCPP_HIDE_FROM_ABI void __create_packed_storage(uint64_t& __types, __basic_format_arg_value<_Context>* __values,
+_LIBCUDACXX_HIDE_FROM_ABI void __create_packed_storage(uint64_t& __types, __basic_format_arg_value<_Context>* __values,
                                                    _Args&&... __args) noexcept {
   int __shift = 0;
   (
@@ -210,7 +210,7 @@ _LIBCPP_HIDE_FROM_ABI void __create_packed_storage(uint64_t& __types, __basic_fo
 }
 
 template <class _Context, class... _Args>
-_LIBCPP_HIDE_FROM_ABI void __store_basic_format_arg(basic_format_arg<_Context>* __data, _Args&&... __args) noexcept {
+_LIBCUDACXX_HIDE_FROM_ABI void __store_basic_format_arg(basic_format_arg<_Context>* __data, _Args&&... __args) noexcept {
   ([&] { *__data++ = __create_format_arg<_Context>(__args); }(), ...);
 }
 
@@ -228,8 +228,8 @@ struct __unpacked_format_arg_store {
 } // namespace __format
 
 template <class _Context, class... _Args>
-struct _LIBCPP_TEMPLATE_VIS __format_arg_store {
-  _LIBCPP_HIDE_FROM_ABI
+struct _LIBCUDACXX_TEMPLATE_VIS __format_arg_store {
+  _LIBCUDACXX_HIDE_FROM_ABI
   __format_arg_store(_Args&... __args) noexcept {
     if constexpr (sizeof...(_Args) != 0) {
       if constexpr (__format::__use_packed_format_arg_store(sizeof...(_Args)))
@@ -246,8 +246,8 @@ struct _LIBCPP_TEMPLATE_VIS __format_arg_store {
   _Storage __storage;
 };
 
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___FORMAT_FORMAT_ARG_STORE_H
+#endif // _LIBCUDACXX___FORMAT_FORMAT_ARG_STORE_H

diff  --git a/libcxx/include/__format/format_args.h b/libcxx/include/__format/format_args.h
index d90dc50acbd1..ee4a7541f6e7 100644
--- a/libcxx/include/__format/format_args.h
+++ b/libcxx/include/__format/format_args.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FORMAT_FORMAT_ARGS_H
-#define _LIBCPP___FORMAT_FORMAT_ARGS_H
+#ifndef _LIBCUDACXX___FORMAT_FORMAT_ARGS_H
+#define _LIBCUDACXX___FORMAT_FORMAT_ARGS_H
 
 #include <__availability>
 #include <__config>
@@ -18,21 +18,21 @@
 #include <cstddef>
 #include <cstdint>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 template <class _Context>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT basic_format_args {
+class _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_AVAILABILITY_FORMAT basic_format_args {
 public:
-  _LIBCPP_HIDE_FROM_ABI basic_format_args() noexcept = default;
+  _LIBCUDACXX_HIDE_FROM_ABI basic_format_args() noexcept = default;
 
   template <class... _Args>
-  _LIBCPP_HIDE_FROM_ABI basic_format_args(const __format_arg_store<_Context, _Args...>& __store) noexcept
+  _LIBCUDACXX_HIDE_FROM_ABI basic_format_args(const __format_arg_store<_Context, _Args...>& __store) noexcept
       : __size_(sizeof...(_Args)) {
     if constexpr (sizeof...(_Args) != 0) {
       if constexpr (__format::__use_packed_format_arg_store(sizeof...(_Args))) {
@@ -43,7 +43,7 @@ class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT basic_format_args {
     }
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   basic_format_arg<_Context> get(size_t __id) const noexcept {
     if (__id >= __size_)
       return basic_format_arg<_Context>{};
@@ -54,7 +54,7 @@ class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT basic_format_args {
     return __args_[__id];
   }
 
-  _LIBCPP_HIDE_FROM_ABI size_t __size() const noexcept { return __size_; }
+  _LIBCUDACXX_HIDE_FROM_ABI size_t __size() const noexcept { return __size_; }
 
 private:
   size_t __size_{0};
@@ -72,8 +72,8 @@ class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT basic_format_args {
   };
 };
 
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___FORMAT_FORMAT_ARGS_H
+#endif // _LIBCUDACXX___FORMAT_FORMAT_ARGS_H

diff  --git a/libcxx/include/__format/format_context.h b/libcxx/include/__format/format_context.h
index b9a41db05d51..272632941054 100644
--- a/libcxx/include/__format/format_context.h
+++ b/libcxx/include/__format/format_context.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FORMAT_FORMAT_CONTEXT_H
-#define _LIBCPP___FORMAT_FORMAT_CONTEXT_H
+#ifndef _LIBCUDACXX___FORMAT_FORMAT_CONTEXT_H
+#define _LIBCUDACXX___FORMAT_FORMAT_CONTEXT_H
 
 #include <__availability>
 #include <__config>
@@ -21,52 +21,52 @@
 #include <concepts>
 #include <cstddef>
 
-#ifndef _LIBCPP_HAS_NO_LOCALIZATION
+#ifndef _LIBCUDACXX_HAS_NO_LOCALIZATION
 #include <locale>
 #include <optional>
 #endif
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 template <class _OutIt, class _CharT>
 requires output_iterator<_OutIt, const _CharT&>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT basic_format_context;
+class _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_AVAILABILITY_FORMAT basic_format_context;
 
-#ifndef _LIBCPP_HAS_NO_LOCALIZATION
+#ifndef _LIBCUDACXX_HAS_NO_LOCALIZATION
 /**
  * Helper to create a basic_format_context.
  *
  * This is needed since the constructor is private.
  */
 template <class _OutIt, class _CharT>
-_LIBCPP_HIDE_FROM_ABI basic_format_context<_OutIt, _CharT>
+_LIBCUDACXX_HIDE_FROM_ABI basic_format_context<_OutIt, _CharT>
 __format_context_create(
     _OutIt __out_it,
     basic_format_args<basic_format_context<_OutIt, _CharT>> __args,
-    optional<_VSTD::locale>&& __loc = nullopt) {
-  return _VSTD::basic_format_context(_VSTD::move(__out_it), __args,
-                                     _VSTD::move(__loc));
+    optional<_CUDA_VSTD::locale>&& __loc = nullopt) {
+  return _CUDA_VSTD::basic_format_context(_CUDA_VSTD::move(__out_it), __args,
+                                     _CUDA_VSTD::move(__loc));
 }
 #else
 template <class _OutIt, class _CharT>
-_LIBCPP_HIDE_FROM_ABI basic_format_context<_OutIt, _CharT>
+_LIBCUDACXX_HIDE_FROM_ABI basic_format_context<_OutIt, _CharT>
 __format_context_create(
     _OutIt __out_it,
     basic_format_args<basic_format_context<_OutIt, _CharT>> __args) {
-  return _VSTD::basic_format_context(_VSTD::move(__out_it), __args);
+  return _CUDA_VSTD::basic_format_context(_CUDA_VSTD::move(__out_it), __args);
 }
 #endif
 
 using format_context =
     basic_format_context<back_insert_iterator<__format::__output_buffer<char>>,
                          char>;
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 using wformat_context = basic_format_context<
     back_insert_iterator<__format::__output_buffer<wchar_t>>, wchar_t>;
 #endif
@@ -75,10 +75,10 @@ template <class _OutIt, class _CharT>
 requires output_iterator<_OutIt, const _CharT&>
 class
     // clang-format off
-    _LIBCPP_TEMPLATE_VIS
-    _LIBCPP_AVAILABILITY_FORMAT
-    _LIBCPP_PREFERRED_NAME(format_context)
-    _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wformat_context))
+    _LIBCUDACXX_TEMPLATE_VIS
+    _LIBCUDACXX_AVAILABILITY_FORMAT
+    _LIBCUDACXX_PREFERRED_NAME(format_context)
+    _LIBCUDACXX_IF_WIDE_CHARACTERS(_LIBCUDACXX_PREFERRED_NAME(wformat_context))
     // clang-format on
     basic_format_context {
 public:
@@ -90,24 +90,24 @@ class
   basic_format_context(const basic_format_context&) = delete;
   basic_format_context& operator=(const basic_format_context&) = delete;
 
-  _LIBCPP_HIDE_FROM_ABI basic_format_arg<basic_format_context>
+  _LIBCUDACXX_HIDE_FROM_ABI basic_format_arg<basic_format_context>
   arg(size_t __id) const noexcept {
     return __args_.get(__id);
   }
-#ifndef _LIBCPP_HAS_NO_LOCALIZATION
-  _LIBCPP_HIDE_FROM_ABI _VSTD::locale locale() {
+#ifndef _LIBCUDACXX_HAS_NO_LOCALIZATION
+  _LIBCUDACXX_HIDE_FROM_ABI _CUDA_VSTD::locale locale() {
     if (!__loc_)
-      __loc_ = _VSTD::locale{};
+      __loc_ = _CUDA_VSTD::locale{};
     return *__loc_;
   }
 #endif
-  _LIBCPP_HIDE_FROM_ABI iterator out() { return __out_it_; }
-  _LIBCPP_HIDE_FROM_ABI void advance_to(iterator __it) { __out_it_ = __it; }
+  _LIBCUDACXX_HIDE_FROM_ABI iterator out() { return __out_it_; }
+  _LIBCUDACXX_HIDE_FROM_ABI void advance_to(iterator __it) { __out_it_ = __it; }
 
 private:
   iterator __out_it_;
   basic_format_args<basic_format_context> __args_;
-#ifndef _LIBCPP_HAS_NO_LOCALIZATION
+#ifndef _LIBCUDACXX_HAS_NO_LOCALIZATION
 
   // The Standard doesn't specify how the locale is stored.
   // [format.context]/6
@@ -118,34 +118,34 @@ class
   // locale() is called and the optional has no value the value will be created.
   // This allows the implementation to lazily create the locale.
   // TODO FMT Validate whether lazy creation is the best solution.
-  optional<_VSTD::locale> __loc_;
+  optional<_CUDA_VSTD::locale> __loc_;
 
   template <class __OutIt, class __CharT>
-  friend _LIBCPP_HIDE_FROM_ABI basic_format_context<__OutIt, __CharT>
+  friend _LIBCUDACXX_HIDE_FROM_ABI basic_format_context<__OutIt, __CharT>
   __format_context_create(__OutIt, basic_format_args<basic_format_context<__OutIt, __CharT>>,
-                          optional<_VSTD::locale>&&);
+                          optional<_CUDA_VSTD::locale>&&);
 
   // Note: the Standard doesn't specify the required constructors.
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   explicit basic_format_context(_OutIt __out_it,
                                 basic_format_args<basic_format_context> __args,
-                                optional<_VSTD::locale>&& __loc)
-      : __out_it_(_VSTD::move(__out_it)), __args_(__args),
-        __loc_(_VSTD::move(__loc)) {}
+                                optional<_CUDA_VSTD::locale>&& __loc)
+      : __out_it_(_CUDA_VSTD::move(__out_it)), __args_(__args),
+        __loc_(_CUDA_VSTD::move(__loc)) {}
 #else
   template <class __OutIt, class __CharT>
-  friend _LIBCPP_HIDE_FROM_ABI basic_format_context<__OutIt, __CharT>
+  friend _LIBCUDACXX_HIDE_FROM_ABI basic_format_context<__OutIt, __CharT>
       __format_context_create(__OutIt, basic_format_args<basic_format_context<__OutIt, __CharT>>);
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   explicit basic_format_context(_OutIt __out_it,
                                 basic_format_args<basic_format_context> __args)
-      : __out_it_(_VSTD::move(__out_it)), __args_(__args) {}
+      : __out_it_(_CUDA_VSTD::move(__out_it)), __args_(__args) {}
 #endif
 };
 
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___FORMAT_FORMAT_CONTEXT_H
+#endif // _LIBCUDACXX___FORMAT_FORMAT_CONTEXT_H

diff  --git a/libcxx/include/__format/format_error.h b/libcxx/include/__format/format_error.h
index 67ff41cbc3d8..d96a095d972e 100644
--- a/libcxx/include/__format/format_error.h
+++ b/libcxx/include/__format/format_error.h
@@ -7,45 +7,45 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FORMAT_FORMAT_ERROR_H
-#define _LIBCPP___FORMAT_FORMAT_ERROR_H
+#ifndef _LIBCUDACXX___FORMAT_FORMAT_ERROR_H
+#define _LIBCUDACXX___FORMAT_FORMAT_ERROR_H
 
 #include <__config>
 #include <stdexcept>
 
-#ifdef _LIBCPP_NO_EXCEPTIONS
+#ifdef _LIBCUDACXX_NO_EXCEPTIONS
 #include <cstdlib>
 #endif
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
-class _LIBCPP_EXCEPTION_ABI format_error : public runtime_error {
+class _LIBCUDACXX_EXCEPTION_ABI format_error : public runtime_error {
 public:
-  _LIBCPP_HIDE_FROM_ABI explicit format_error(const string& __s)
+  _LIBCUDACXX_HIDE_FROM_ABI explicit format_error(const string& __s)
       : runtime_error(__s) {}
-  _LIBCPP_HIDE_FROM_ABI explicit format_error(const char* __s)
+  _LIBCUDACXX_HIDE_FROM_ABI explicit format_error(const char* __s)
       : runtime_error(__s) {}
   virtual ~format_error() noexcept;
 };
 
-_LIBCPP_NORETURN inline _LIBCPP_HIDE_FROM_ABI void
+_LIBCUDACXX_NORETURN inline _LIBCUDACXX_HIDE_FROM_ABI void
 __throw_format_error(const char* __s) {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
   throw format_error(__s);
 #else
   (void)__s;
-  _VSTD::abort();
+  _CUDA_VSTD::abort();
 #endif
 }
 
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___FORMAT_FORMAT_ERROR_H
+#endif // _LIBCUDACXX___FORMAT_FORMAT_ERROR_H

diff  --git a/libcxx/include/__format/format_fwd.h b/libcxx/include/__format/format_fwd.h
index f7c72e21211a..8b146d64743b 100644
--- a/libcxx/include/__format/format_fwd.h
+++ b/libcxx/include/__format/format_fwd.h
@@ -7,33 +7,33 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FORMAT_FORMAT_FWD_H
-#define _LIBCPP___FORMAT_FORMAT_FWD_H
+#ifndef _LIBCUDACXX___FORMAT_FORMAT_FWD_H
+#define _LIBCUDACXX___FORMAT_FORMAT_FWD_H
 
 #include <__availability>
 #include <__config>
 #include <__iterator/concepts.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 template <class _Context>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT basic_format_arg;
+class _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_AVAILABILITY_FORMAT basic_format_arg;
 
 template <class _OutIt, class _CharT>
   requires output_iterator<_OutIt, const _CharT&>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT basic_format_context;
+class _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_AVAILABILITY_FORMAT basic_format_context;
 
 template <class _Tp, class _CharT = char>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter;
+struct _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_AVAILABILITY_FORMAT formatter;
 
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___FORMAT_FORMAT_FWD_H
+#endif // _LIBCUDACXX___FORMAT_FORMAT_FWD_H

diff  --git a/libcxx/include/__format/format_parse_context.h b/libcxx/include/__format/format_parse_context.h
index 272b615d1048..8274225d8bf8 100644
--- a/libcxx/include/__format/format_parse_context.h
+++ b/libcxx/include/__format/format_parse_context.h
@@ -7,29 +7,29 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FORMAT_FORMAT_PARSE_CONTEXT_H
-#define _LIBCPP___FORMAT_FORMAT_PARSE_CONTEXT_H
+#ifndef _LIBCUDACXX___FORMAT_FORMAT_PARSE_CONTEXT_H
+#define _LIBCUDACXX___FORMAT_FORMAT_PARSE_CONTEXT_H
 
 #include <__config>
 #include <__format/format_error.h>
 #include <string_view>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 template <class _CharT>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT basic_format_parse_context {
+class _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_AVAILABILITY_FORMAT basic_format_parse_context {
 public:
   using char_type = _CharT;
   using const_iterator = typename basic_string_view<_CharT>::const_iterator;
   using iterator = const_iterator;
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr explicit basic_format_parse_context(basic_string_view<_CharT> __fmt,
                                                 size_t __num_args = 0) noexcept
       : __begin_(__fmt.begin()),
@@ -42,17 +42,17 @@ class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT basic_format_parse_contex
   basic_format_parse_context&
   operator=(const basic_format_parse_context&) = delete;
 
-  _LIBCPP_HIDE_FROM_ABI constexpr const_iterator begin() const noexcept {
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr const_iterator begin() const noexcept {
     return __begin_;
   }
-  _LIBCPP_HIDE_FROM_ABI constexpr const_iterator end() const noexcept {
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr const_iterator end() const noexcept {
     return __end_;
   }
-  _LIBCPP_HIDE_FROM_ABI constexpr void advance_to(const_iterator __it) {
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr void advance_to(const_iterator __it) {
     __begin_ = __it;
   }
 
-  _LIBCPP_HIDE_FROM_ABI constexpr size_t next_arg_id() {
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr size_t next_arg_id() {
     if (__indexing_ == __manual)
       __throw_format_error("Using automatic argument numbering in manual "
                            "argument numbering mode");
@@ -61,7 +61,7 @@ class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT basic_format_parse_contex
       __indexing_ = __automatic;
     return __next_arg_id_++;
   }
-  _LIBCPP_HIDE_FROM_ABI constexpr void check_arg_id(size_t __id) {
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr void check_arg_id(size_t __id) {
     if (__indexing_ == __automatic)
       __throw_format_error("Using manual argument numbering in automatic "
                            "argument numbering mode");
@@ -90,12 +90,12 @@ class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT basic_format_parse_contex
 };
 
 using format_parse_context = basic_format_parse_context<char>;
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 using wformat_parse_context = basic_format_parse_context<wchar_t>;
 #endif
 
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___FORMAT_FORMAT_PARSE_CONTEXT_H
+#endif // _LIBCUDACXX___FORMAT_FORMAT_PARSE_CONTEXT_H

diff  --git a/libcxx/include/__format/format_string.h b/libcxx/include/__format/format_string.h
index 51c3c7a1a6d8..7a8820bc7daf 100644
--- a/libcxx/include/__format/format_string.h
+++ b/libcxx/include/__format/format_string.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FORMAT_FORMAT_STRING_H
-#define _LIBCPP___FORMAT_FORMAT_STRING_H
+#ifndef _LIBCUDACXX___FORMAT_FORMAT_STRING_H
+#define _LIBCUDACXX___FORMAT_FORMAT_STRING_H
 
 #include <__assert>
 #include <__config>
@@ -16,24 +16,24 @@
 #include <cstddef>
 #include <cstdint>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 namespace __format {
 
 template <class _CharT>
-struct _LIBCPP_TEMPLATE_VIS __parse_number_result {
+struct _LIBCUDACXX_TEMPLATE_VIS __parse_number_result {
   const _CharT* __ptr;
   uint32_t __value;
 };
 
 template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI constexpr __parse_number_result<_CharT>
+_LIBCUDACXX_HIDE_FROM_ABI constexpr __parse_number_result<_CharT>
 __parse_number(const _CharT* __begin, const _CharT* __end);
 
 /**
@@ -51,24 +51,24 @@ inline constexpr uint32_t __number_max = INT32_MAX;
 
 namespace __detail {
 template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI constexpr __parse_number_result<_CharT>
+_LIBCUDACXX_HIDE_FROM_ABI constexpr __parse_number_result<_CharT>
 __parse_zero(const _CharT* __begin, const _CharT*, auto& __parse_ctx) {
   __parse_ctx.check_arg_id(0);
   return {++__begin, 0}; // can never be larger than the maximum.
 }
 
 template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI constexpr __parse_number_result<_CharT>
+_LIBCUDACXX_HIDE_FROM_ABI constexpr __parse_number_result<_CharT>
 __parse_automatic(const _CharT* __begin, const _CharT*, auto& __parse_ctx) {
   size_t __value = __parse_ctx.next_arg_id();
-  _LIBCPP_ASSERT(__value <= __number_max,
+  _LIBCUDACXX_ASSERT(__value <= __number_max,
                  "Compilers don't support this number of arguments");
 
   return {__begin, uint32_t(__value)};
 }
 
 template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI constexpr __parse_number_result<_CharT>
+_LIBCUDACXX_HIDE_FROM_ABI constexpr __parse_number_result<_CharT>
 __parse_manual(const _CharT* __begin, const _CharT* __end, auto& __parse_ctx) {
   __parse_number_result<_CharT> __r = __parse_number(__begin, __end);
   __parse_ctx.check_arg_id(__r.__value);
@@ -84,7 +84,7 @@ __parse_manual(const _CharT* __begin, const _CharT* __end, auto& __parse_ctx) {
  * allows a maximum value of 2147483647.
  */
 template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI constexpr __parse_number_result<_CharT>
+_LIBCUDACXX_HIDE_FROM_ABI constexpr __parse_number_result<_CharT>
 __parse_number(const _CharT* __begin, const _CharT* __end_input) {
   static_assert(__format::__number_max == INT32_MAX,
                 "The algorithm is implemented based on this value.");
@@ -132,7 +132,7 @@ __parse_number(const _CharT* __begin, const _CharT* __end_input) {
  * should be the closing '}' of the arg-id.
  */
 template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI constexpr __parse_number_result<_CharT>
+_LIBCUDACXX_HIDE_FROM_ABI constexpr __parse_number_result<_CharT>
 __parse_arg_id(const _CharT* __begin, const _CharT* __end, auto& __parse_ctx) {
   switch (*__begin) {
   case _CharT('0'):
@@ -154,8 +154,8 @@ __parse_arg_id(const _CharT* __begin, const _CharT* __end, auto& __parse_ctx) {
 
 } // namespace __format
 
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___FORMAT_FORMAT_STRING_H
+#endif // _LIBCUDACXX___FORMAT_FORMAT_STRING_H

diff  --git a/libcxx/include/__format/format_to_n_result.h b/libcxx/include/__format/format_to_n_result.h
index 25caa1c9e98d..4e1c2344f977 100644
--- a/libcxx/include/__format/format_to_n_result.h
+++ b/libcxx/include/__format/format_to_n_result.h
@@ -7,28 +7,28 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FORMAT_FORMAT_TO_N_RESULT_H
-#define _LIBCPP___FORMAT_FORMAT_TO_N_RESULT_H
+#ifndef _LIBCUDACXX___FORMAT_FORMAT_TO_N_RESULT_H
+#define _LIBCUDACXX___FORMAT_FORMAT_TO_N_RESULT_H
 
 #include <__config>
 #include <__iterator/incrementable_traits.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 template <class _OutIt>
-struct _LIBCPP_TEMPLATE_VIS format_to_n_result {
+struct _LIBCUDACXX_TEMPLATE_VIS format_to_n_result {
   _OutIt out;
   iter_
diff erence_t<_OutIt> size;
 };
 
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___FORMAT_FORMAT_TO_N_RESULT_H
+#endif // _LIBCUDACXX___FORMAT_FORMAT_TO_N_RESULT_H

diff  --git a/libcxx/include/__format/formatter.h b/libcxx/include/__format/formatter.h
index 4816f961c445..3a42fac01d11 100644
--- a/libcxx/include/__format/formatter.h
+++ b/libcxx/include/__format/formatter.h
@@ -7,21 +7,21 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FORMAT_FORMATTER_H
-#define _LIBCPP___FORMAT_FORMATTER_H
+#ifndef _LIBCUDACXX___FORMAT_FORMATTER_H
+#define _LIBCUDACXX___FORMAT_FORMATTER_H
 
 #include <__availability>
 #include <__concepts/same_as.h>
 #include <__config>
 #include <__format/format_fwd.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 /// The default formatter template.
 ///
@@ -33,7 +33,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 /// - is_copy_assignable<F>, and
 /// - is_move_assignable<F>.
 template <class _Tp, class _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter {
+struct _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_AVAILABILITY_FORMAT formatter {
   formatter() = delete;
   formatter(const formatter&) = delete;
   formatter& operator=(const formatter&) = delete;
@@ -47,8 +47,8 @@ concept __char_type = same_as<_CharT, char> || same_as<_CharT, wchar_t>;
 
 } // namespace __formatter
 
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___FORMAT_FORMATTER_H
+#endif // _LIBCUDACXX___FORMAT_FORMATTER_H

diff  --git a/libcxx/include/__format/formatter_bool.h b/libcxx/include/__format/formatter_bool.h
index cdb0631f87d4..66bd7310961a 100644
--- a/libcxx/include/__format/formatter_bool.h
+++ b/libcxx/include/__format/formatter_bool.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FORMAT_FORMATTER_BOOL_H
-#define _LIBCPP___FORMAT_FORMATTER_BOOL_H
+#ifndef _LIBCUDACXX___FORMAT_FORMATTER_BOOL_H
+#define _LIBCUDACXX___FORMAT_FORMATTER_BOOL_H
 
 #include <__algorithm/copy.h>
 #include <__availability>
@@ -23,29 +23,29 @@
 #include <__utility/unreachable.h>
 #include <string_view>
 
-#ifndef _LIBCPP_HAS_NO_LOCALIZATION
+#ifndef _LIBCUDACXX_HAS_NO_LOCALIZATION
 #  include <locale>
 #endif
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 template <__formatter::__char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<bool, _CharT> {
+struct _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_AVAILABILITY_FORMAT formatter<bool, _CharT> {
 public:
-  _LIBCPP_HIDE_FROM_ABI constexpr auto
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr auto
   parse(basic_format_parse_context<_CharT>& __parse_ctx) -> decltype(__parse_ctx.begin()) {
     auto __result = __parser_.__parse(__parse_ctx, __format_spec::__fields_integral);
     __format_spec::__process_parsed_bool(__parser_);
     return __result;
   }
 
-  _LIBCPP_HIDE_FROM_ABI auto format(bool __value, auto& __ctx) const -> decltype(__ctx.out()) {
+  _LIBCUDACXX_HIDE_FROM_ABI auto format(bool __value, auto& __ctx) const -> decltype(__ctx.out()) {
     switch (__parser_.__type_) {
     case __format_spec::__type::__default:
     case __format_spec::__type::__string:
@@ -63,16 +63,16 @@ struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<bool, _CharT>
           static_cast<unsigned>(__value), __ctx, __parser_.__get_parsed_std_specifications(__ctx));
 
     default:
-      _LIBCPP_ASSERT(false, "The parse function should have validated the type");
-      __libcpp_unreachable();
+      _LIBCUDACXX_ASSERT(false, "The parse function should have validated the type");
+      __LIBCUDACXX_unreachable();
     }
   }
 
   __format_spec::__parser<_CharT> __parser_;
 };
 
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___FORMAT_FORMATTER_BOOL_H
+#endif // _LIBCUDACXX___FORMAT_FORMATTER_BOOL_H

diff  --git a/libcxx/include/__format/formatter_char.h b/libcxx/include/__format/formatter_char.h
index a3ca36ec0a62..cffa9806a88d 100644
--- a/libcxx/include/__format/formatter_char.h
+++ b/libcxx/include/__format/formatter_char.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FORMAT_FORMATTER_CHAR_H
-#define _LIBCPP___FORMAT_FORMATTER_CHAR_H
+#ifndef _LIBCUDACXX___FORMAT_FORMATTER_CHAR_H
+#define _LIBCUDACXX___FORMAT_FORMATTER_CHAR_H
 
 #include <__availability>
 #include <__concepts/same_as.h>
@@ -22,25 +22,25 @@
 #include <__type_traits/conditional.h>
 #include <__type_traits/is_signed.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 template <__formatter::__char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT __formatter_char {
+struct _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_AVAILABILITY_FORMAT __formatter_char {
 public:
-  _LIBCPP_HIDE_FROM_ABI constexpr auto
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr auto
   parse(basic_format_parse_context<_CharT>& __parse_ctx) -> decltype(__parse_ctx.begin()) {
     auto __result = __parser_.__parse(__parse_ctx, __format_spec::__fields_integral);
     __format_spec::__process_parsed_char(__parser_);
     return __result;
   }
 
-  _LIBCPP_HIDE_FROM_ABI auto format(_CharT __value, auto& __ctx) const -> decltype(__ctx.out()) {
+  _LIBCUDACXX_HIDE_FROM_ABI auto format(_CharT __value, auto& __ctx) const -> decltype(__ctx.out()) {
     if (__parser_.__type_ == __format_spec::__type::__default || __parser_.__type_ == __format_spec::__type::__char)
       return __formatter::__format_char(__value, __ctx.out(), __parser_.__get_parsed_std_specifications(__ctx));
 
@@ -55,7 +55,7 @@ struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT __formatter_char {
       return __formatter::__format_integer(__value, __ctx, __parser_.__get_parsed_std_specifications(__ctx));
   }
 
-  _LIBCPP_HIDE_FROM_ABI auto format(char __value, auto& __ctx) const -> decltype(__ctx.out())
+  _LIBCUDACXX_HIDE_FROM_ABI auto format(char __value, auto& __ctx) const -> decltype(__ctx.out())
     requires(same_as<_CharT, wchar_t>)
   {
     return format(static_cast<wchar_t>(__value), __ctx);
@@ -65,20 +65,20 @@ struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT __formatter_char {
 };
 
 template <>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<char, char> : public __formatter_char<char> {};
+struct _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_AVAILABILITY_FORMAT formatter<char, char> : public __formatter_char<char> {};
 
-#  ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#  ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 template <>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<char, wchar_t> : public __formatter_char<wchar_t> {};
+struct _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_AVAILABILITY_FORMAT formatter<char, wchar_t> : public __formatter_char<wchar_t> {};
 
 template <>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<wchar_t, wchar_t> : public __formatter_char<wchar_t> {
+struct _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_AVAILABILITY_FORMAT formatter<wchar_t, wchar_t> : public __formatter_char<wchar_t> {
 };
 
-#  endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#  endif // _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___FORMAT_FORMATTER_CHAR_H
+#endif // _LIBCUDACXX___FORMAT_FORMATTER_CHAR_H

diff  --git a/libcxx/include/__format/formatter_floating_point.h b/libcxx/include/__format/formatter_floating_point.h
index 90a76193196e..41d91619bb49 100644
--- a/libcxx/include/__format/formatter_floating_point.h
+++ b/libcxx/include/__format/formatter_floating_point.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FORMAT_FORMATTER_FLOATING_POINT_H
-#define _LIBCPP___FORMAT_FORMATTER_FLOATING_POINT_H
+#ifndef _LIBCUDACXX___FORMAT_FORMATTER_FLOATING_POINT_H
+#define _LIBCUDACXX___FORMAT_FORMATTER_FLOATING_POINT_H
 
 #include <__algorithm/copy.h>
 #include <__algorithm/copy_n.h>
@@ -31,41 +31,41 @@
 #include <__utility/unreachable.h>
 #include <charconv>
 
-#ifndef _LIBCPP_HAS_NO_LOCALIZATION
+#ifndef _LIBCUDACXX_HAS_NO_LOCALIZATION
 #  include <locale>
 #endif
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 namespace __formatter {
 
 template <floating_point _Tp>
-_LIBCPP_HIDE_FROM_ABI char* __to_buffer(char* __first, char* __last, _Tp __value) {
-  to_chars_result __r = _VSTD::to_chars(__first, __last, __value);
-  _LIBCPP_ASSERT(__r.ec == errc(0), "Internal buffer too small");
+_LIBCUDACXX_HIDE_FROM_ABI char* __to_buffer(char* __first, char* __last, _Tp __value) {
+  to_chars_result __r = _CUDA_VSTD::to_chars(__first, __last, __value);
+  _LIBCUDACXX_ASSERT(__r.ec == errc(0), "Internal buffer too small");
   return __r.ptr;
 }
 
 template <floating_point _Tp>
-_LIBCPP_HIDE_FROM_ABI char* __to_buffer(char* __first, char* __last, _Tp __value, chars_format __fmt) {
-  to_chars_result __r = _VSTD::to_chars(__first, __last, __value, __fmt);
-  _LIBCPP_ASSERT(__r.ec == errc(0), "Internal buffer too small");
+_LIBCUDACXX_HIDE_FROM_ABI char* __to_buffer(char* __first, char* __last, _Tp __value, chars_format __fmt) {
+  to_chars_result __r = _CUDA_VSTD::to_chars(__first, __last, __value, __fmt);
+  _LIBCUDACXX_ASSERT(__r.ec == errc(0), "Internal buffer too small");
   return __r.ptr;
 }
 
 template <floating_point _Tp>
-_LIBCPP_HIDE_FROM_ABI char* __to_buffer(char* __first, char* __last, _Tp __value, chars_format __fmt, int __precision) {
-  to_chars_result __r = _VSTD::to_chars(__first, __last, __value, __fmt, __precision);
-  _LIBCPP_ASSERT(__r.ec == errc(0), "Internal buffer too small");
+_LIBCUDACXX_HIDE_FROM_ABI char* __to_buffer(char* __first, char* __last, _Tp __value, chars_format __fmt, int __precision) {
+  to_chars_result __r = _CUDA_VSTD::to_chars(__first, __last, __value, __fmt, __precision);
+  _LIBCUDACXX_ASSERT(__r.ec == errc(0), "Internal buffer too small");
   return __r.ptr;
 }
 
@@ -133,7 +133,7 @@ struct __traits<double> {
 /// Depending on the maxium size required for a value, the buffer is allocated
 /// on the stack or the heap.
 template <floating_point _Fp>
-class _LIBCPP_TEMPLATE_VIS __float_buffer {
+class _LIBCUDACXX_TEMPLATE_VIS __float_buffer {
   using _Traits = __traits<_Fp>;
 
 public:
@@ -145,7 +145,7 @@ class _LIBCPP_TEMPLATE_VIS __float_buffer {
   // When supporting long doubles the __max_integral part becomes 4932 which
   // may be too much for some platforms. For these cases a better estimate is
   // required.
-  explicit _LIBCPP_HIDE_FROM_ABI __float_buffer(int __precision)
+  explicit _LIBCUDACXX_HIDE_FROM_ABI __float_buffer(int __precision)
       : __precision_(__precision != -1 ? __precision : _Traits::__max_fractional) {
 
     // When the precision is larger than _Traits::__max_fractional the digits in
@@ -170,19 +170,19 @@ class _LIBCPP_TEMPLATE_VIS __float_buffer {
       __begin_ = __buffer_;
   }
 
-  _LIBCPP_HIDE_FROM_ABI ~__float_buffer() {
+  _LIBCUDACXX_HIDE_FROM_ABI ~__float_buffer() {
     if (__size_ > _Traits::__stack_buffer_size)
       allocator<char>{}.deallocate(__begin_, __size_);
   }
-  _LIBCPP_HIDE_FROM_ABI __float_buffer(const __float_buffer&) = delete;
-  _LIBCPP_HIDE_FROM_ABI __float_buffer& operator=(const __float_buffer&) = delete;
+  _LIBCUDACXX_HIDE_FROM_ABI __float_buffer(const __float_buffer&) = delete;
+  _LIBCUDACXX_HIDE_FROM_ABI __float_buffer& operator=(const __float_buffer&) = delete;
 
-  _LIBCPP_HIDE_FROM_ABI char* begin() const { return __begin_; }
-  _LIBCPP_HIDE_FROM_ABI char* end() const { return __begin_ + __size_; }
+  _LIBCUDACXX_HIDE_FROM_ABI char* begin() const { return __begin_; }
+  _LIBCUDACXX_HIDE_FROM_ABI char* end() const { return __begin_ + __size_; }
 
-  _LIBCPP_HIDE_FROM_ABI int __precision() const { return __precision_; }
-  _LIBCPP_HIDE_FROM_ABI int __num_trailing_zeros() const { return __num_trailing_zeros_; }
-  _LIBCPP_HIDE_FROM_ABI void __remove_trailing_zeros() { __num_trailing_zeros_ = 0; }
+  _LIBCUDACXX_HIDE_FROM_ABI int __precision() const { return __precision_; }
+  _LIBCUDACXX_HIDE_FROM_ABI int __num_trailing_zeros() const { return __num_trailing_zeros_; }
+  _LIBCUDACXX_HIDE_FROM_ABI void __remove_trailing_zeros() { __num_trailing_zeros_ = 0; }
 
 private:
   int __precision_;
@@ -214,10 +214,10 @@ struct __float_result {
 /// eSdd and eSdddd (S = sign, d = digit)
 ///
 /// \returns a pointer to the exponent or __last when not found.
-constexpr inline _LIBCPP_HIDE_FROM_ABI char* __find_exponent(char* __first, char* __last) {
+constexpr inline _LIBCUDACXX_HIDE_FROM_ABI char* __find_exponent(char* __first, char* __last) {
   ptr
diff _t __size = __last - __first;
   if (__size > 4) {
-    __first = __last - _VSTD::min(__size, ptr
diff _t(6));
+    __first = __last - _CUDA_VSTD::min(__size, ptr
diff _t(6));
     for (; __first != __last - 3; ++__first) {
       if (*__first == 'e')
         return __first;
@@ -227,7 +227,7 @@ constexpr inline _LIBCPP_HIDE_FROM_ABI char* __find_exponent(char* __first, char
 }
 
 template <class _Fp, class _Tp>
-_LIBCPP_HIDE_FROM_ABI __float_result __format_buffer_default(const __float_buffer<_Fp>& __buffer, _Tp __value,
+_LIBCUDACXX_HIDE_FROM_ABI __float_result __format_buffer_default(const __float_buffer<_Fp>& __buffer, _Tp __value,
                                                              char* __integral) {
   __float_result __result;
   __result.__integral = __integral;
@@ -238,7 +238,7 @@ _LIBCPP_HIDE_FROM_ABI __float_result __format_buffer_default(const __float_buffe
   // Constrains:
   // - There's at least one decimal digit before the radix point.
   // - The radix point, when present, is placed before the exponent.
-  __result.__radix_point = _VSTD::find(__result.__integral + 1, __result.__exponent, '.');
+  __result.__radix_point = _CUDA_VSTD::find(__result.__integral + 1, __result.__exponent, '.');
 
   // When the radix point isn't found its position is the exponent instead of
   // __result.__last.
@@ -246,7 +246,7 @@ _LIBCPP_HIDE_FROM_ABI __float_result __format_buffer_default(const __float_buffe
     __result.__radix_point = __result.__last;
 
   // clang-format off
-  _LIBCPP_ASSERT((__result.__integral != __result.__last) &&
+  _LIBCUDACXX_ASSERT((__result.__integral != __result.__last) &&
                  (__result.__radix_point == __result.__last || *__result.__radix_point == '.') &&
                  (__result.__exponent == __result.__last || *__result.__exponent == 'e'),
                  "Post-condition failure.");
@@ -256,7 +256,7 @@ _LIBCPP_HIDE_FROM_ABI __float_result __format_buffer_default(const __float_buffe
 }
 
 template <class _Fp, class _Tp>
-_LIBCPP_HIDE_FROM_ABI __float_result __format_buffer_hexadecimal_lower_case(const __float_buffer<_Fp>& __buffer,
+_LIBCUDACXX_HIDE_FROM_ABI __float_result __format_buffer_hexadecimal_lower_case(const __float_buffer<_Fp>& __buffer,
                                                                             _Tp __value, int __precision,
                                                                             char* __integral) {
   __float_result __result;
@@ -292,14 +292,14 @@ _LIBCPP_HIDE_FROM_ABI __float_result __format_buffer_hexadecimal_lower_case(cons
 
     char* __last = __result.__last - 2;
     __first = __last - __traits<_Fp>::__hex_precision_digits;
-    __result.__exponent = _VSTD::find(__first, __last, 'p');
+    __result.__exponent = _CUDA_VSTD::find(__first, __last, 'p');
   } else {
     __result.__radix_point = __result.__last;
     __result.__exponent = __first;
   }
 
   // clang-format off
-  _LIBCPP_ASSERT((__result.__integral != __result.__last) &&
+  _LIBCUDACXX_ASSERT((__result.__integral != __result.__last) &&
                  (__result.__radix_point == __result.__last || *__result.__radix_point == '.') &&
                  (__result.__exponent != __result.__last && *__result.__exponent == 'p'),
                  "Post-condition failure.");
@@ -309,18 +309,18 @@ _LIBCPP_HIDE_FROM_ABI __float_result __format_buffer_hexadecimal_lower_case(cons
 }
 
 template <class _Fp, class _Tp>
-_LIBCPP_HIDE_FROM_ABI __float_result __format_buffer_hexadecimal_upper_case(const __float_buffer<_Fp>& __buffer,
+_LIBCUDACXX_HIDE_FROM_ABI __float_result __format_buffer_hexadecimal_upper_case(const __float_buffer<_Fp>& __buffer,
                                                                             _Tp __value, int __precision,
                                                                             char* __integral) {
   __float_result __result =
       __formatter::__format_buffer_hexadecimal_lower_case(__buffer, __value, __precision, __integral);
-  _VSTD::transform(__result.__integral, __result.__exponent, __result.__integral, __hex_to_upper);
+  _CUDA_VSTD::transform(__result.__integral, __result.__exponent, __result.__integral, __hex_to_upper);
   *__result.__exponent = 'P';
   return __result;
 }
 
 template <class _Fp, class _Tp>
-_LIBCPP_HIDE_FROM_ABI __float_result __format_buffer_scientific_lower_case(const __float_buffer<_Fp>& __buffer,
+_LIBCUDACXX_HIDE_FROM_ABI __float_result __format_buffer_scientific_lower_case(const __float_buffer<_Fp>& __buffer,
                                                                            _Tp __value, int __precision,
                                                                            char* __integral) {
   __float_result __result;
@@ -329,7 +329,7 @@ _LIBCPP_HIDE_FROM_ABI __float_result __format_buffer_scientific_lower_case(const
       __formatter::__to_buffer(__integral, __buffer.end(), __value, chars_format::scientific, __precision);
 
   char* __first = __integral + 1;
-  _LIBCPP_ASSERT(__first != __result.__last, "No exponent present");
+  _LIBCUDACXX_ASSERT(__first != __result.__last, "No exponent present");
   if (*__first == '.') {
     __result.__radix_point = __first;
     __result.__exponent    = __formatter::__find_exponent(__first + 1, __result.__last);
@@ -339,7 +339,7 @@ _LIBCPP_HIDE_FROM_ABI __float_result __format_buffer_scientific_lower_case(const
   }
 
   // clang-format off
-  _LIBCPP_ASSERT((__result.__integral != __result.__last) &&
+  _LIBCUDACXX_ASSERT((__result.__integral != __result.__last) &&
                  (__result.__radix_point == __result.__last || *__result.__radix_point == '.') &&
                  (__result.__exponent != __result.__last && *__result.__exponent == 'e'),
                  "Post-condition failure.");
@@ -348,7 +348,7 @@ _LIBCPP_HIDE_FROM_ABI __float_result __format_buffer_scientific_lower_case(const
 }
 
 template <class _Fp, class _Tp>
-_LIBCPP_HIDE_FROM_ABI __float_result __format_buffer_scientific_upper_case(const __float_buffer<_Fp>& __buffer,
+_LIBCUDACXX_HIDE_FROM_ABI __float_result __format_buffer_scientific_upper_case(const __float_buffer<_Fp>& __buffer,
                                                                            _Tp __value, int __precision,
                                                                            char* __integral) {
   __float_result __result =
@@ -358,7 +358,7 @@ _LIBCPP_HIDE_FROM_ABI __float_result __format_buffer_scientific_upper_case(const
 }
 
 template <class _Fp, class _Tp>
-_LIBCPP_HIDE_FROM_ABI __float_result __format_buffer_fixed(const __float_buffer<_Fp>& __buffer, _Tp __value,
+_LIBCUDACXX_HIDE_FROM_ABI __float_result __format_buffer_fixed(const __float_buffer<_Fp>& __buffer, _Tp __value,
                                                            int __precision, char* __integral) {
   __float_result __result;
   __result.__integral = __integral;
@@ -372,7 +372,7 @@ _LIBCPP_HIDE_FROM_ABI __float_result __format_buffer_fixed(const __float_buffer<
   __result.__exponent = __result.__last;
 
   // clang-format off
-  _LIBCPP_ASSERT((__result.__integral != __result.__last) &&
+  _LIBCUDACXX_ASSERT((__result.__integral != __result.__last) &&
                  (__result.__radix_point == __result.__last || *__result.__radix_point == '.') &&
                  (__result.__exponent == __result.__last),
                  "Post-condition failure.");
@@ -381,7 +381,7 @@ _LIBCPP_HIDE_FROM_ABI __float_result __format_buffer_fixed(const __float_buffer<
 }
 
 template <class _Fp, class _Tp>
-_LIBCPP_HIDE_FROM_ABI __float_result __format_buffer_general_lower_case(__float_buffer<_Fp>& __buffer, _Tp __value,
+_LIBCUDACXX_HIDE_FROM_ABI __float_result __format_buffer_general_lower_case(__float_buffer<_Fp>& __buffer, _Tp __value,
                                                                         int __precision, char* __integral) {
 
   __buffer.__remove_trailing_zeros();
@@ -404,12 +404,12 @@ _LIBCPP_HIDE_FROM_ABI __float_result __format_buffer_general_lower_case(__float_
       // In fixed mode the algorithm truncates trailing spaces and possibly the
       // radix point. There's no good guess for the position of the radix point
       // therefore scan the output after the first digit.
-      __result.__radix_point = _VSTD::find(__first, __result.__last, '.');
+      __result.__radix_point = _CUDA_VSTD::find(__first, __result.__last, '.');
     }
   }
 
   // clang-format off
-  _LIBCPP_ASSERT((__result.__integral != __result.__last) &&
+  _LIBCUDACXX_ASSERT((__result.__integral != __result.__last) &&
                  (__result.__radix_point == __result.__last || *__result.__radix_point == '.') &&
                  (__result.__exponent == __result.__last || *__result.__exponent == 'e'),
                  "Post-condition failure.");
@@ -419,7 +419,7 @@ _LIBCPP_HIDE_FROM_ABI __float_result __format_buffer_general_lower_case(__float_
 }
 
 template <class _Fp, class _Tp>
-_LIBCPP_HIDE_FROM_ABI __float_result __format_buffer_general_upper_case(__float_buffer<_Fp>& __buffer, _Tp __value,
+_LIBCUDACXX_HIDE_FROM_ABI __float_result __format_buffer_general_upper_case(__float_buffer<_Fp>& __buffer, _Tp __value,
                                                                         int __precision, char* __integral) {
   __float_result __result = __formatter::__format_buffer_general_lower_case(__buffer, __value, __precision, __integral);
   if (__result.__exponent != __result.__last)
@@ -444,7 +444,7 @@ _LIBCPP_HIDE_FROM_ABI __float_result __format_buffer_general_upper_case(__float_
 /// - localization needs to do grouping in the integral part.
 template <class _Fp, class _Tp>
 // TODO FMT _Fp should just be _Tp when to_chars has proper long double support.
-_LIBCPP_HIDE_FROM_ABI __float_result __format_buffer(
+_LIBCUDACXX_HIDE_FROM_ABI __float_result __format_buffer(
     __float_buffer<_Fp>& __buffer,
     _Tp __value,
     bool __negative,
@@ -481,24 +481,24 @@ _LIBCPP_HIDE_FROM_ABI __float_result __format_buffer(
     return __formatter::__format_buffer_general_upper_case(__buffer, __value, __buffer.__precision(), __first);
 
   default:
-    _LIBCPP_ASSERT(false, "The parser should have validated the type");
-    __libcpp_unreachable();
+    _LIBCUDACXX_ASSERT(false, "The parser should have validated the type");
+    __LIBCUDACXX_unreachable();
   }
 }
 
-#  ifndef _LIBCPP_HAS_NO_LOCALIZATION
+#  ifndef _LIBCUDACXX_HAS_NO_LOCALIZATION
 template <class _OutIt, class _Fp, class _CharT>
-_LIBCPP_HIDE_FROM_ABI _OutIt __format_locale_specific_form(
+_LIBCUDACXX_HIDE_FROM_ABI _OutIt __format_locale_specific_form(
     _OutIt __out_it,
     const __float_buffer<_Fp>& __buffer,
     const __float_result& __result,
-    _VSTD::locale __loc,
+    _CUDA_VSTD::locale __loc,
     __format_spec::__parsed_specifications<_CharT> __specs) {
   const auto& __np = use_facet<numpunct<_CharT>>(__loc);
   string __grouping = __np.grouping();
   char* __first = __result.__integral;
   // When no radix point or exponent are present __last will be __result.__last.
-  char* __last = _VSTD::min(__result.__radix_point, __result.__exponent);
+  char* __last = _CUDA_VSTD::min(__result.__radix_point, __result.__exponent);
 
   ptr
diff _t __digits = __last - __first;
   if (!__grouping.empty()) {
@@ -528,13 +528,13 @@ _LIBCPP_HIDE_FROM_ABI _OutIt __format_locale_specific_form(
   // sign and (zero padding or alignment)
   if (__zero_padding && __first != __buffer.begin())
     *__out_it++ = *__buffer.begin();
-  __out_it = _VSTD::fill_n(_VSTD::move(__out_it), __padding.__before_, __specs.__fill_);
+  __out_it = _CUDA_VSTD::fill_n(_CUDA_VSTD::move(__out_it), __padding.__before_, __specs.__fill_);
   if (!__zero_padding && __first != __buffer.begin())
     *__out_it++ = *__buffer.begin();
 
   // integral part
   if (__grouping.empty()) {
-    __out_it = _VSTD::copy_n(__first, __digits, _VSTD::move(__out_it));
+    __out_it = _CUDA_VSTD::copy_n(__first, __digits, _CUDA_VSTD::move(__out_it));
   } else {
     auto __r = __grouping.rbegin();
     auto __e = __grouping.rend() - 1;
@@ -546,7 +546,7 @@ _LIBCPP_HIDE_FROM_ABI _OutIt __format_locale_specific_form(
     // This loop achieves that process by testing the termination condition
     // midway in the loop.
     while (true) {
-      __out_it = _VSTD::copy_n(__first, *__r, _VSTD::move(__out_it));
+      __out_it = _CUDA_VSTD::copy_n(__first, *__r, _CUDA_VSTD::move(__out_it));
       __first += *__r;
 
       if (__r == __e)
@@ -560,21 +560,21 @@ _LIBCPP_HIDE_FROM_ABI _OutIt __format_locale_specific_form(
   // fractional part
   if (__result.__radix_point != __result.__last) {
     *__out_it++ = __np.decimal_point();
-    __out_it = _VSTD::copy(__result.__radix_point + 1, __result.__exponent, _VSTD::move(__out_it));
-    __out_it = _VSTD::fill_n(_VSTD::move(__out_it), __buffer.__num_trailing_zeros(), _CharT('0'));
+    __out_it = _CUDA_VSTD::copy(__result.__radix_point + 1, __result.__exponent, _CUDA_VSTD::move(__out_it));
+    __out_it = _CUDA_VSTD::fill_n(_CUDA_VSTD::move(__out_it), __buffer.__num_trailing_zeros(), _CharT('0'));
   }
 
   // exponent
   if (__result.__exponent != __result.__last)
-    __out_it = _VSTD::copy(__result.__exponent, __result.__last, _VSTD::move(__out_it));
+    __out_it = _CUDA_VSTD::copy(__result.__exponent, __result.__last, _CUDA_VSTD::move(__out_it));
 
   // alignment
-  return _VSTD::fill_n(_VSTD::move(__out_it), __padding.__after_, __specs.__fill_);
+  return _CUDA_VSTD::fill_n(_CUDA_VSTD::move(__out_it), __padding.__after_, __specs.__fill_);
 }
-#  endif // _LIBCPP_HAS_NO_LOCALIZATION
+#  endif // _LIBCUDACXX_HAS_NO_LOCALIZATION
 
 template <class _OutIt, class _CharT>
-_LIBCPP_HIDE_FROM_ABI _OutIt __format_floating_point_non_finite(
+_LIBCUDACXX_HIDE_FROM_ABI _OutIt __format_floating_point_non_finite(
     _OutIt __out_it, __format_spec::__parsed_specifications<_CharT> __specs, bool __negative, bool __isnan) {
   char __buffer[4];
   char* __last = __formatter::__insert_sign(__buffer, __negative, __specs.__std_.__sign_);
@@ -587,7 +587,7 @@ _LIBCPP_HIDE_FROM_ABI _OutIt __format_floating_point_non_finite(
       __specs.__std_.__type_ == __format_spec::__type::__scientific_upper_case ||
       __specs.__std_.__type_ == __format_spec::__type::__fixed_upper_case ||
       __specs.__std_.__type_ == __format_spec::__type::__general_upper_case;
-  __last = _VSTD::copy_n(&("infnanINFNAN"[6 * __upper_case + 3 * __isnan]), 3, __last);
+  __last = _CUDA_VSTD::copy_n(&("infnanINFNAN"[6 * __upper_case + 3 * __isnan]), 3, __last);
 
   // [format.string.std]/13
   // A zero (0) character preceding the width field pads the field with
@@ -596,17 +596,17 @@ _LIBCPP_HIDE_FROM_ABI _OutIt __format_floating_point_non_finite(
   if (__specs.__alignment_ == __format_spec::__alignment::__zero_padding)
     __specs.__alignment_ = __format_spec::__alignment::__right;
 
-  return __formatter::__write(__buffer, __last, _VSTD::move(__out_it), __specs);
+  return __formatter::__write(__buffer, __last, _CUDA_VSTD::move(__out_it), __specs);
 }
 
 template <floating_point _Tp, class _CharT>
-_LIBCPP_HIDE_FROM_ABI auto
+_LIBCUDACXX_HIDE_FROM_ABI auto
 __format_floating_point(_Tp __value, auto& __ctx, __format_spec::__parsed_specifications<_CharT> __specs)
     -> decltype(__ctx.out()) {
-  bool __negative = _VSTD::signbit(__value);
+  bool __negative = _CUDA_VSTD::signbit(__value);
 
-  if (!_VSTD::isfinite(__value)) [[unlikely]]
-    return __formatter::__format_floating_point_non_finite(__ctx.out(), __specs, __negative, _VSTD::isnan(__value));
+  if (!_CUDA_VSTD::isfinite(__value)) [[unlikely]]
+    return __formatter::__format_floating_point_non_finite(__ctx.out(), __specs, __negative, _CUDA_VSTD::isnan(__value));
 
   // Depending on the std-format-spec string the sign and the value
   // might not be outputted together:
@@ -631,7 +631,7 @@ __format_floating_point(_Tp __value, auto& __ctx, __format_spec::__parsed_specif
     // When there is an exponent the point needs to be moved before the
     // exponent. When there's no exponent the rotate does nothing. Since
     // rotate tests whether the operation is a nop, call it unconditionally.
-    _VSTD::rotate(__result.__exponent, __result.__last - 1, __result.__last);
+    _CUDA_VSTD::rotate(__result.__exponent, __result.__last - 1, __result.__last);
     __result.__radix_point = __result.__exponent;
 
     // The radix point is always placed before the exponent.
@@ -641,7 +641,7 @@ __format_floating_point(_Tp __value, auto& __ctx, __format_spec::__parsed_specif
     ++__result.__exponent;
   }
 
-#  ifndef _LIBCPP_HAS_NO_LOCALIZATION
+#  ifndef _LIBCUDACXX_HAS_NO_LOCALIZATION
   if (__specs.__std_.__locale_specific_form_)
     return __formatter::__format_locale_specific_form(__ctx.out(), __buffer, __result, __ctx.locale(), __specs);
 #  endif
@@ -651,14 +651,14 @@ __format_floating_point(_Tp __value, auto& __ctx, __format_spec::__parsed_specif
   if (__size + __num_trailing_zeros >= __specs.__width_) {
     if (__num_trailing_zeros && __result.__exponent != __result.__last)
       // Insert trailing zeros before exponent character.
-      return _VSTD::copy(
+      return _CUDA_VSTD::copy(
           __result.__exponent,
           __result.__last,
-          _VSTD::fill_n(
-              _VSTD::copy(__buffer.begin(), __result.__exponent, __ctx.out()), __num_trailing_zeros, _CharT('0')));
+          _CUDA_VSTD::fill_n(
+              _CUDA_VSTD::copy(__buffer.begin(), __result.__exponent, __ctx.out()), __num_trailing_zeros, _CharT('0')));
 
-    return _VSTD::fill_n(
-        _VSTD::copy(__buffer.begin(), __result.__last, __ctx.out()), __num_trailing_zeros, _CharT('0'));
+    return _CUDA_VSTD::fill_n(
+        _CUDA_VSTD::copy(__buffer.begin(), __result.__last, __ctx.out()), __num_trailing_zeros, _CharT('0'));
   }
 
   auto __out_it = __ctx.out();
@@ -677,17 +677,17 @@ __format_floating_point(_Tp __value, auto& __ctx, __format_spec::__parsed_specif
 
   if (__num_trailing_zeros)
     return __formatter::__write_using_trailing_zeros(
-        __first, __result.__last, _VSTD::move(__out_it), __specs, __size, __result.__exponent, __num_trailing_zeros);
+        __first, __result.__last, _CUDA_VSTD::move(__out_it), __specs, __size, __result.__exponent, __num_trailing_zeros);
 
-  return __formatter::__write(__first, __result.__last, _VSTD::move(__out_it), __specs, __size);
+  return __formatter::__write(__first, __result.__last, _CUDA_VSTD::move(__out_it), __specs, __size);
 }
 
 } // namespace __formatter
 
 template <__formatter::__char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS __formatter_floating_point {
+struct _LIBCUDACXX_TEMPLATE_VIS __formatter_floating_point {
 public:
-  _LIBCPP_HIDE_FROM_ABI constexpr auto
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr auto
   parse(basic_format_parse_context<_CharT>& __parse_ctx) -> decltype(__parse_ctx.begin()) {
     auto __result = __parser_.__parse(__parse_ctx, __format_spec::__fields_floating_point);
     __format_spec::__process_parsed_floating_point(__parser_);
@@ -695,7 +695,7 @@ struct _LIBCPP_TEMPLATE_VIS __formatter_floating_point {
   }
 
   template <floating_point _Tp>
-  _LIBCPP_HIDE_FROM_ABI auto format(_Tp __value, auto& __ctx) const -> decltype(__ctx.out()) {
+  _LIBCUDACXX_HIDE_FROM_ABI auto format(_Tp __value, auto& __ctx) const -> decltype(__ctx.out()) {
     return __formatter::__format_floating_point(__value, __ctx, __parser_.__get_parsed_std_specifications(__ctx));
   }
 
@@ -703,19 +703,19 @@ struct _LIBCPP_TEMPLATE_VIS __formatter_floating_point {
 };
 
 template <__formatter::__char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<float, _CharT>
+struct _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_AVAILABILITY_FORMAT formatter<float, _CharT>
     : public __formatter_floating_point<_CharT> {};
 template <__formatter::__char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<double, _CharT>
+struct _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_AVAILABILITY_FORMAT formatter<double, _CharT>
     : public __formatter_floating_point<_CharT> {};
 template <__formatter::__char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<long double, _CharT>
+struct _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_AVAILABILITY_FORMAT formatter<long double, _CharT>
     : public __formatter_floating_point<_CharT> {};
 
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___FORMAT_FORMATTER_FLOATING_POINT_H
+#endif // _LIBCUDACXX___FORMAT_FORMATTER_FLOATING_POINT_H

diff  --git a/libcxx/include/__format/formatter_integer.h b/libcxx/include/__format/formatter_integer.h
index 3139c9efdf80..ac32331295dc 100644
--- a/libcxx/include/__format/formatter_integer.h
+++ b/libcxx/include/__format/formatter_integer.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FORMAT_FORMATTER_INTEGER_H
-#define _LIBCPP___FORMAT_FORMATTER_INTEGER_H
+#ifndef _LIBCUDACXX___FORMAT_FORMATTER_INTEGER_H
+#define _LIBCUDACXX___FORMAT_FORMATTER_INTEGER_H
 
 #include <__availability>
 #include <__concepts/arithmetic.h>
@@ -22,19 +22,19 @@
 #include <__type_traits/make_32_64_or_128_bit.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-    _LIBCPP_BEGIN_NAMESPACE_STD
+    _LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
     template <__formatter::__char_type _CharT>
-    struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT __formatter_integer {
+    struct _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_AVAILABILITY_FORMAT __formatter_integer {
 
 public:
-  _LIBCPP_HIDE_FROM_ABI constexpr auto
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr auto
   parse(basic_format_parse_context<_CharT>& __parse_ctx) -> decltype(__parse_ctx.begin()) {
     auto __result = __parser_.__parse(__parse_ctx, __format_spec::__fields_integral);
     __format_spec::__process_parsed_integer(__parser_);
@@ -42,7 +42,7 @@
   }
 
   template <integral _Tp>
-  _LIBCPP_HIDE_FROM_ABI auto format(_Tp __value, auto& __ctx) const -> decltype(__ctx.out()) {
+  _LIBCUDACXX_HIDE_FROM_ABI auto format(_Tp __value, auto& __ctx) const -> decltype(__ctx.out()) {
     __format_spec::__parsed_specifications<_CharT> __specs = __parser_.__get_parsed_std_specifications(__ctx);
 
     if (__specs.__std_.__type_ == __format_spec::__type::__char)
@@ -60,48 +60,48 @@
 
 // Signed integral types.
 template <__formatter::__char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<signed char, _CharT>
+struct _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_AVAILABILITY_FORMAT formatter<signed char, _CharT>
     : public __formatter_integer<_CharT> {};
 template <__formatter::__char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<short, _CharT> : public __formatter_integer<_CharT> {
+struct _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_AVAILABILITY_FORMAT formatter<short, _CharT> : public __formatter_integer<_CharT> {
 };
 template <__formatter::__char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<int, _CharT> : public __formatter_integer<_CharT> {};
+struct _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_AVAILABILITY_FORMAT formatter<int, _CharT> : public __formatter_integer<_CharT> {};
 template <__formatter::__char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<long, _CharT> : public __formatter_integer<_CharT> {};
+struct _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_AVAILABILITY_FORMAT formatter<long, _CharT> : public __formatter_integer<_CharT> {};
 template <__formatter::__char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<long long, _CharT>
+struct _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_AVAILABILITY_FORMAT formatter<long long, _CharT>
     : public __formatter_integer<_CharT> {};
-#  ifndef _LIBCPP_HAS_NO_INT128
+#  ifndef _LIBCUDACXX_HAS_NO_INT128
 template <__formatter::__char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<__int128_t, _CharT>
+struct _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_AVAILABILITY_FORMAT formatter<__int128_t, _CharT>
     : public __formatter_integer<_CharT> {};
 #  endif
 
 // Unsigned integral types.
 template <__formatter::__char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<unsigned char, _CharT>
+struct _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_AVAILABILITY_FORMAT formatter<unsigned char, _CharT>
     : public __formatter_integer<_CharT> {};
 template <__formatter::__char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<unsigned short, _CharT>
+struct _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_AVAILABILITY_FORMAT formatter<unsigned short, _CharT>
     : public __formatter_integer<_CharT> {};
 template <__formatter::__char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<unsigned, _CharT>
+struct _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_AVAILABILITY_FORMAT formatter<unsigned, _CharT>
     : public __formatter_integer<_CharT> {};
 template <__formatter::__char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<unsigned long, _CharT>
+struct _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_AVAILABILITY_FORMAT formatter<unsigned long, _CharT>
     : public __formatter_integer<_CharT> {};
 template <__formatter::__char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<unsigned long long, _CharT>
+struct _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_AVAILABILITY_FORMAT formatter<unsigned long long, _CharT>
     : public __formatter_integer<_CharT> {};
-#  ifndef _LIBCPP_HAS_NO_INT128
+#  ifndef _LIBCUDACXX_HAS_NO_INT128
 template <__formatter::__char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<__uint128_t, _CharT>
+struct _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_AVAILABILITY_FORMAT formatter<__uint128_t, _CharT>
     : public __formatter_integer<_CharT> {};
 #  endif
 
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___FORMAT_FORMATTER_INTEGER_H
+#endif // _LIBCUDACXX___FORMAT_FORMATTER_INTEGER_H

diff  --git a/libcxx/include/__format/formatter_integral.h b/libcxx/include/__format/formatter_integral.h
index b9ed5fe80f7f..efd3da835c3d 100644
--- a/libcxx/include/__format/formatter_integral.h
+++ b/libcxx/include/__format/formatter_integral.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FORMAT_FORMATTER_INTEGRAL_H
-#define _LIBCPP___FORMAT_FORMATTER_INTEGRAL_H
+#ifndef _LIBCUDACXX___FORMAT_FORMATTER_INTEGRAL_H
+#define _LIBCUDACXX___FORMAT_FORMATTER_INTEGRAL_H
 
 #include <__concepts/arithmetic.h>
 #include <__concepts/same_as.h>
@@ -22,20 +22,20 @@
 #include <limits>
 #include <string>
 
-#ifndef _LIBCPP_HAS_NO_LOCALIZATION
+#ifndef _LIBCUDACXX_HAS_NO_LOCALIZATION
 #  include <locale>
 #endif
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 namespace __formatter {
 
@@ -43,7 +43,7 @@ namespace __formatter {
 // Generic
 //
 
-_LIBCPP_HIDE_FROM_ABI inline char* __insert_sign(char* __buf, bool __negative, __format_spec::__sign __sign) {
+_LIBCUDACXX_HIDE_FROM_ABI inline char* __insert_sign(char* __buf, bool __negative, __format_spec::__sign __sign) {
   if (__negative)
     *__buf++ = '-';
   else
@@ -78,8 +78,8 @@ _LIBCPP_HIDE_FROM_ABI inline char* __insert_sign(char* __buf, bool __negative, _
  * @note The grouping field of the locale is always a @c std::string,
  * regardless whether the @c std::numpunct's type is @c char or @c wchar_t.
  */
-_LIBCPP_HIDE_FROM_ABI inline string __determine_grouping(ptr
diff _t __size, const string& __grouping) {
-  _LIBCPP_ASSERT(!__grouping.empty() && __size > __grouping[0],
+_LIBCUDACXX_HIDE_FROM_ABI inline string __determine_grouping(ptr
diff _t __size, const string& __grouping) {
+  _LIBCUDACXX_ASSERT(!__grouping.empty() && __size > __grouping[0],
                  "The slow grouping formatting is used while there will be no "
                  "separators written");
   string __r;
@@ -105,7 +105,7 @@ _LIBCPP_HIDE_FROM_ABI inline string __determine_grouping(ptr
diff _t __size, const
     }
   }
 
-  __libcpp_unreachable();
+  __LIBCUDACXX_unreachable();
 }
 
 //
@@ -113,7 +113,7 @@ _LIBCPP_HIDE_FROM_ABI inline string __determine_grouping(ptr
diff _t __size, const
 //
 
 template <__formatter::__char_type _CharT>
-_LIBCPP_HIDE_FROM_ABI auto __format_char(
+_LIBCUDACXX_HIDE_FROM_ABI auto __format_char(
     integral auto __value,
     output_iterator<const _CharT&> auto __out_it,
     __format_spec::__parsed_specifications<_CharT> __specs) -> decltype(__out_it) {
@@ -135,7 +135,7 @@ _LIBCPP_HIDE_FROM_ABI auto __format_char(
   }
 
   const auto __c = static_cast<_CharT>(__value);
-  return __formatter::__write(_VSTD::addressof(__c), _VSTD::addressof(__c) + 1, _VSTD::move(__out_it), __specs);
+  return __formatter::__write(_CUDA_VSTD::addressof(__c), _CUDA_VSTD::addressof(__c) + 1, _CUDA_VSTD::move(__out_it), __specs);
 }
 
 //
@@ -144,11 +144,11 @@ _LIBCPP_HIDE_FROM_ABI auto __format_char(
 
 /** Wrapper around @ref to_chars, returning the output pointer. */
 template <integral _Tp>
-_LIBCPP_HIDE_FROM_ABI char* __to_buffer(char* __first, char* __last, _Tp __value, int __base) {
+_LIBCUDACXX_HIDE_FROM_ABI char* __to_buffer(char* __first, char* __last, _Tp __value, int __base) {
   // TODO FMT Evaluate code overhead due to not calling the internal function
   // directly. (Should be zero overhead.)
-  to_chars_result __r = _VSTD::to_chars(__first, __last, __value, __base);
-  _LIBCPP_ASSERT(__r.ec == errc(0), "Internal buffer too small");
+  to_chars_result __r = _CUDA_VSTD::to_chars(__first, __last, __value, __base);
+  _LIBCUDACXX_ASSERT(__r.ec == errc(0), "Internal buffer too small");
   return __r.ptr;
 }
 
@@ -198,7 +198,7 @@ consteval size_t __buffer_size() noexcept
 }
 
 template <unsigned_integral _Tp, class _CharT>
-_LIBCPP_HIDE_FROM_ABI auto __format_integer(
+_LIBCUDACXX_HIDE_FROM_ABI auto __format_integer(
     _Tp __value,
     auto& __ctx,
     __format_spec::__parsed_specifications<_CharT> __specs,
@@ -214,7 +214,7 @@ _LIBCPP_HIDE_FROM_ABI auto __format_integer(
 
   char* __last = __formatter::__to_buffer(__first, __end, __value, __base);
 
-#  ifndef _LIBCPP_HAS_NO_LOCALIZATION
+#  ifndef _LIBCUDACXX_HAS_NO_LOCALIZATION
   if (__specs.__std_.__locale_specific_form_) {
     const auto& __np  = use_facet<numpunct<_CharT>>(__ctx.locale());
     string __grouping = __np.grouping();
@@ -243,12 +243,12 @@ _LIBCPP_HIDE_FROM_ABI auto __format_integer(
     // The zero padding is done like:
     // - Write [sign][prefix]
     // - Write data right aligned with '0' as fill character.
-    __out_it             = _VSTD::copy(__begin, __first, _VSTD::move(__out_it));
+    __out_it             = _CUDA_VSTD::copy(__begin, __first, _CUDA_VSTD::move(__out_it));
     __specs.__alignment_ = __format_spec::__alignment::__right;
     __specs.__fill_      = _CharT('0');
     int32_t __size       = __first - __begin;
 
-    __specs.__width_ -= _VSTD::min(__size, __specs.__width_);
+    __specs.__width_ -= _CUDA_VSTD::min(__size, __specs.__width_);
   }
 
   if (__specs.__std_.__type_ != __format_spec::__type::__hexadecimal_upper_case) [[likely]]
@@ -258,7 +258,7 @@ _LIBCPP_HIDE_FROM_ABI auto __format_integer(
 }
 
 template <unsigned_integral _Tp, class _CharT>
-_LIBCPP_HIDE_FROM_ABI auto __format_integer(
+_LIBCUDACXX_HIDE_FROM_ABI auto __format_integer(
     _Tp __value, auto& __ctx, __format_spec::__parsed_specifications<_CharT> __specs, bool __negative = false)
     -> decltype(__ctx.out()) {
   switch (__specs.__std_.__type_) {
@@ -291,13 +291,13 @@ _LIBCPP_HIDE_FROM_ABI auto __format_integer(
     return __formatter::__format_integer(__value, __ctx, __specs, __negative, __array.begin(), __array.end(), "0X", 16);
   }
   default:
-    _LIBCPP_ASSERT(false, "The parse function should have validated the type");
-    __libcpp_unreachable();
+    _LIBCUDACXX_ASSERT(false, "The parse function should have validated the type");
+    __LIBCUDACXX_unreachable();
   }
 }
 
 template <signed_integral _Tp, class _CharT>
-_LIBCPP_HIDE_FROM_ABI auto
+_LIBCUDACXX_HIDE_FROM_ABI auto
 __format_integer(_Tp __value, auto& __ctx, __format_spec::__parsed_specifications<_CharT> __specs)
     -> decltype(__ctx.out()) {
   // Depending on the std-format-spec string the sign and the value
@@ -319,27 +319,27 @@ __format_integer(_Tp __value, auto& __ctx, __format_spec::__parsed_specification
 //
 
 template <class _CharT>
-struct _LIBCPP_TEMPLATE_VIS __bool_strings;
+struct _LIBCUDACXX_TEMPLATE_VIS __bool_strings;
 
 template <>
-struct _LIBCPP_TEMPLATE_VIS __bool_strings<char> {
+struct _LIBCUDACXX_TEMPLATE_VIS __bool_strings<char> {
   static constexpr string_view __true{"true"};
   static constexpr string_view __false{"false"};
 };
 
-#  ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#  ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 template <>
-struct _LIBCPP_TEMPLATE_VIS __bool_strings<wchar_t> {
+struct _LIBCUDACXX_TEMPLATE_VIS __bool_strings<wchar_t> {
   static constexpr wstring_view __true{L"true"};
   static constexpr wstring_view __false{L"false"};
 };
 #  endif
 
 template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI auto
+_LIBCUDACXX_HIDE_FROM_ABI auto
 __format_bool(bool __value, auto& __ctx, __format_spec::__parsed_specifications<_CharT> __specs)
     -> decltype(__ctx.out()) {
-#  ifndef _LIBCPP_HAS_NO_LOCALIZATION
+#  ifndef _LIBCUDACXX_HAS_NO_LOCALIZATION
   if (__specs.__std_.__locale_specific_form_) {
     const auto& __np           = use_facet<numpunct<_CharT>>(__ctx.locale());
     basic_string<_CharT> __str = __value ? __np.truename() : __np.falsename();
@@ -353,10 +353,10 @@ __format_bool(bool __value, auto& __ctx, __format_spec::__parsed_specifications<
 
 } // namespace __formatter
 
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___FORMAT_FORMATTER_INTEGRAL_H
+#endif // _LIBCUDACXX___FORMAT_FORMATTER_INTEGRAL_H

diff  --git a/libcxx/include/__format/formatter_output.h b/libcxx/include/__format/formatter_output.h
index e09534c41dff..5db352fc7ca9 100644
--- a/libcxx/include/__format/formatter_output.h
+++ b/libcxx/include/__format/formatter_output.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FORMAT_FORMATTER_OUTPUT_H
-#define _LIBCPP___FORMAT_FORMATTER_OUTPUT_H
+#ifndef _LIBCUDACXX___FORMAT_FORMATTER_OUTPUT_H
+#define _LIBCUDACXX___FORMAT_FORMATTER_OUTPUT_H
 
 #include <__algorithm/copy.h>
 #include <__algorithm/copy_n.h>
@@ -24,17 +24,17 @@
 #include <string>
 #include <string_view>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 namespace __formatter {
 
-_LIBCPP_HIDE_FROM_ABI constexpr char __hex_to_upper(char __c) {
+_LIBCUDACXX_HIDE_FROM_ABI constexpr char __hex_to_upper(char __c) {
   switch (__c) {
   case 'a':
     return 'A';
@@ -52,21 +52,21 @@ _LIBCPP_HIDE_FROM_ABI constexpr char __hex_to_upper(char __c) {
   return __c;
 }
 
-struct _LIBCPP_TYPE_VIS __padding_size_result {
+struct _LIBCUDACXX_TYPE_VIS __padding_size_result {
   size_t __before_;
   size_t __after_;
 };
 
-_LIBCPP_HIDE_FROM_ABI constexpr __padding_size_result
+_LIBCUDACXX_HIDE_FROM_ABI constexpr __padding_size_result
 __padding_size(size_t __size, size_t __width, __format_spec::__alignment __align) {
-  _LIBCPP_ASSERT(__width > __size, "don't call this function when no padding is required");
-  _LIBCPP_ASSERT(
+  _LIBCUDACXX_ASSERT(__width > __size, "don't call this function when no padding is required");
+  _LIBCUDACXX_ASSERT(
       __align != __format_spec::__alignment::__zero_padding, "the caller should have handled the zero-padding");
 
   size_t __fill = __width - __size;
   switch (__align) {
   case __format_spec::__alignment::__zero_padding:
-    __libcpp_unreachable();
+    __LIBCUDACXX_unreachable();
 
   case __format_spec::__alignment::__left:
     return {0, __fill};
@@ -83,11 +83,11 @@ __padding_size(size_t __size, size_t __width, __format_spec::__alignment __align
   case __format_spec::__alignment::__right:
     return {__fill, 0};
   }
-  __libcpp_unreachable();
+  __LIBCUDACXX_unreachable();
 }
 
 template <class _OutIt, class _CharT>
-_LIBCPP_HIDE_FROM_ABI _OutIt __write_using_decimal_separators(_OutIt __out_it, const char* __begin, const char* __first,
+_LIBCUDACXX_HIDE_FROM_ABI _OutIt __write_using_decimal_separators(_OutIt __out_it, const char* __begin, const char* __first,
                                                               const char* __last, string&& __grouping, _CharT __sep,
                                                               __format_spec::__parsed_specifications<_CharT> __specs) {
   int __size = (__first - __begin) +    // [sign][prefix]
@@ -97,27 +97,27 @@ _LIBCPP_HIDE_FROM_ABI _OutIt __write_using_decimal_separators(_OutIt __out_it, c
   __padding_size_result __padding = {0, 0};
   if (__specs.__alignment_ == __format_spec::__alignment::__zero_padding) {
     // Write [sign][prefix].
-    __out_it = _VSTD::copy(__begin, __first, _VSTD::move(__out_it));
+    __out_it = _CUDA_VSTD::copy(__begin, __first, _CUDA_VSTD::move(__out_it));
 
     if (__specs.__width_ > __size) {
       // Write zero padding.
       __padding.__before_ = __specs.__width_ - __size;
-      __out_it = _VSTD::fill_n(_VSTD::move(__out_it), __specs.__width_ - __size, _CharT('0'));
+      __out_it = _CUDA_VSTD::fill_n(_CUDA_VSTD::move(__out_it), __specs.__width_ - __size, _CharT('0'));
     }
   } else {
     if (__specs.__width_ > __size) {
       // Determine padding and write padding.
       __padding = __padding_size(__size, __specs.__width_, __specs.__alignment_);
 
-      __out_it = _VSTD::fill_n(_VSTD::move(__out_it), __padding.__before_, __specs.__fill_);
+      __out_it = _CUDA_VSTD::fill_n(_CUDA_VSTD::move(__out_it), __padding.__before_, __specs.__fill_);
     }
     // Write [sign][prefix].
-    __out_it = _VSTD::copy(__begin, __first, _VSTD::move(__out_it));
+    __out_it = _CUDA_VSTD::copy(__begin, __first, _CUDA_VSTD::move(__out_it));
   }
 
   auto __r = __grouping.rbegin();
   auto __e = __grouping.rend() - 1;
-  _LIBCPP_ASSERT(__r != __e, "The slow grouping formatting is used while "
+  _LIBCUDACXX_ASSERT(__r != __e, "The slow grouping formatting is used while "
                              "there will be no separators written.");
   // The output is divided in small groups of numbers to write:
   // - A group before the first separator.
@@ -133,10 +133,10 @@ _LIBCPP_HIDE_FROM_ABI _OutIt __write_using_decimal_separators(_OutIt __out_it, c
   while (true) {
     if (__specs.__std_.__type_ == __format_spec::__type::__hexadecimal_upper_case) {
       __last = __first + *__r;
-      __out_it = _VSTD::transform(__first, __last, _VSTD::move(__out_it), __hex_to_upper);
+      __out_it = _CUDA_VSTD::transform(__first, __last, _CUDA_VSTD::move(__out_it), __hex_to_upper);
       __first = __last;
     } else {
-      __out_it = _VSTD::copy_n(__first, *__r, _VSTD::move(__out_it));
+      __out_it = _CUDA_VSTD::copy_n(__first, *__r, _CUDA_VSTD::move(__out_it));
       __first += *__r;
     }
 
@@ -147,7 +147,7 @@ _LIBCPP_HIDE_FROM_ABI _OutIt __write_using_decimal_separators(_OutIt __out_it, c
     *__out_it++ = __sep;
   }
 
-  return _VSTD::fill_n(_VSTD::move(__out_it), __padding.__after_, __specs.__fill_);
+  return _CUDA_VSTD::fill_n(_CUDA_VSTD::move(__out_it), __padding.__after_, __specs.__fill_);
 }
 
 /// Writes the input to the output with the required padding.
@@ -174,48 +174,48 @@ _LIBCPP_HIDE_FROM_ABI _OutIt __write_using_decimal_separators(_OutIt __out_it, c
 /// conversion, which means the [\a __first, \a __last) always contains elements
 /// of the type \c char.
 template <class _CharT, class _ParserCharT>
-_LIBCPP_HIDE_FROM_ABI auto __write(
+_LIBCUDACXX_HIDE_FROM_ABI auto __write(
     const _CharT* __first,
     const _CharT* __last,
     output_iterator<const _CharT&> auto __out_it,
     __format_spec::__parsed_specifications<_ParserCharT> __specs,
     ptr
diff _t __size) -> decltype(__out_it) {
-  _LIBCPP_ASSERT(__first <= __last, "Not a valid range");
+  _LIBCUDACXX_ASSERT(__first <= __last, "Not a valid range");
 
   if (__size >= __specs.__width_)
-    return _VSTD::copy(__first, __last, _VSTD::move(__out_it));
+    return _CUDA_VSTD::copy(__first, __last, _CUDA_VSTD::move(__out_it));
 
   __padding_size_result __padding = __formatter::__padding_size(__size, __specs.__width_, __specs.__std_.__alignment_);
-  __out_it = _VSTD::fill_n(_VSTD::move(__out_it), __padding.__before_, __specs.__fill_);
-  __out_it = _VSTD::copy(__first, __last, _VSTD::move(__out_it));
-  return _VSTD::fill_n(_VSTD::move(__out_it), __padding.__after_, __specs.__fill_);
+  __out_it = _CUDA_VSTD::fill_n(_CUDA_VSTD::move(__out_it), __padding.__before_, __specs.__fill_);
+  __out_it = _CUDA_VSTD::copy(__first, __last, _CUDA_VSTD::move(__out_it));
+  return _CUDA_VSTD::fill_n(_CUDA_VSTD::move(__out_it), __padding.__after_, __specs.__fill_);
 }
 
 /// \overload
 ///
 /// Calls the function above where \a __size = \a __last - \a __first.
 template <class _CharT, class _ParserCharT>
-_LIBCPP_HIDE_FROM_ABI auto __write(const _CharT* __first, const _CharT* __last,
+_LIBCUDACXX_HIDE_FROM_ABI auto __write(const _CharT* __first, const _CharT* __last,
                                    output_iterator<const _CharT&> auto __out_it,
                                    __format_spec::__parsed_specifications<_ParserCharT> __specs) -> decltype(__out_it) {
-  return __write(__first, __last, _VSTD::move(__out_it), __specs, __last - __first);
+  return __write(__first, __last, _CUDA_VSTD::move(__out_it), __specs, __last - __first);
 }
 
 template <class _CharT, class _ParserCharT, class _UnaryOperation>
-_LIBCPP_HIDE_FROM_ABI auto __write_transformed(const _CharT* __first, const _CharT* __last,
+_LIBCUDACXX_HIDE_FROM_ABI auto __write_transformed(const _CharT* __first, const _CharT* __last,
                                                output_iterator<const _CharT&> auto __out_it,
                                                __format_spec::__parsed_specifications<_ParserCharT> __specs,
                                                _UnaryOperation __op) -> decltype(__out_it) {
-  _LIBCPP_ASSERT(__first <= __last, "Not a valid range");
+  _LIBCUDACXX_ASSERT(__first <= __last, "Not a valid range");
 
   ptr
diff _t __size = __last - __first;
   if (__size >= __specs.__width_)
-    return _VSTD::transform(__first, __last, _VSTD::move(__out_it), __op);
+    return _CUDA_VSTD::transform(__first, __last, _CUDA_VSTD::move(__out_it), __op);
 
   __padding_size_result __padding = __padding_size(__size, __specs.__width_, __specs.__alignment_);
-  __out_it = _VSTD::fill_n(_VSTD::move(__out_it), __padding.__before_, __specs.__fill_);
-  __out_it = _VSTD::transform(__first, __last, _VSTD::move(__out_it), __op);
-  return _VSTD::fill_n(_VSTD::move(__out_it), __padding.__after_, __specs.__fill_);
+  __out_it = _CUDA_VSTD::fill_n(_CUDA_VSTD::move(__out_it), __padding.__before_, __specs.__fill_);
+  __out_it = _CUDA_VSTD::transform(__first, __last, _CUDA_VSTD::move(__out_it), __op);
+  return _CUDA_VSTD::fill_n(_CUDA_VSTD::move(__out_it), __padding.__after_, __specs.__fill_);
 }
 
 /// Writes additional zero's for the precision before the exponent.
@@ -227,7 +227,7 @@ _LIBCPP_HIDE_FROM_ABI auto __write_transformed(const _CharT* __first, const _Cha
 /// \param __num_trailing_zeros The number of 0's to write before the exponent
 ///                             character.
 template <class _CharT, class _ParserCharT>
-_LIBCPP_HIDE_FROM_ABI auto __write_using_trailing_zeros(
+_LIBCUDACXX_HIDE_FROM_ABI auto __write_using_trailing_zeros(
     const _CharT* __first,
     const _CharT* __last,
     output_iterator<const _CharT&> auto __out_it,
@@ -235,34 +235,34 @@ _LIBCPP_HIDE_FROM_ABI auto __write_using_trailing_zeros(
     size_t __size,
     const _CharT* __exponent,
     size_t __num_trailing_zeros) -> decltype(__out_it) {
-  _LIBCPP_ASSERT(__first <= __last, "Not a valid range");
-  _LIBCPP_ASSERT(__num_trailing_zeros > 0, "The overload not writing trailing zeros should have been used");
+  _LIBCUDACXX_ASSERT(__first <= __last, "Not a valid range");
+  _LIBCUDACXX_ASSERT(__num_trailing_zeros > 0, "The overload not writing trailing zeros should have been used");
 
   __padding_size_result __padding =
       __padding_size(__size + __num_trailing_zeros, __specs.__width_, __specs.__alignment_);
-  __out_it = _VSTD::fill_n(_VSTD::move(__out_it), __padding.__before_, __specs.__fill_);
-  __out_it = _VSTD::copy(__first, __exponent, _VSTD::move(__out_it));
-  __out_it = _VSTD::fill_n(_VSTD::move(__out_it), __num_trailing_zeros, _CharT('0'));
-  __out_it = _VSTD::copy(__exponent, __last, _VSTD::move(__out_it));
-  return _VSTD::fill_n(_VSTD::move(__out_it), __padding.__after_, __specs.__fill_);
+  __out_it = _CUDA_VSTD::fill_n(_CUDA_VSTD::move(__out_it), __padding.__before_, __specs.__fill_);
+  __out_it = _CUDA_VSTD::copy(__first, __exponent, _CUDA_VSTD::move(__out_it));
+  __out_it = _CUDA_VSTD::fill_n(_CUDA_VSTD::move(__out_it), __num_trailing_zeros, _CharT('0'));
+  __out_it = _CUDA_VSTD::copy(__exponent, __last, _CUDA_VSTD::move(__out_it));
+  return _CUDA_VSTD::fill_n(_CUDA_VSTD::move(__out_it), __padding.__after_, __specs.__fill_);
 }
 
 /// Writes a string using format's width estimation algorithm.
 ///
 /// \pre !__specs.__has_precision()
 ///
-/// \note When \c _LIBCPP_HAS_NO_UNICODE is defined the function assumes the
+/// \note When \c _LIBCUDACXX_HAS_NO_UNICODE is defined the function assumes the
 /// input is ASCII.
 template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI auto __write_string_no_precision(
+_LIBCUDACXX_HIDE_FROM_ABI auto __write_string_no_precision(
     basic_string_view<_CharT> __str,
     output_iterator<const _CharT&> auto __out_it,
     __format_spec::__parsed_specifications<_CharT> __specs) -> decltype(__out_it) {
-  _LIBCPP_ASSERT(!__specs.__has_precision(), "use __write_string");
+  _LIBCUDACXX_ASSERT(!__specs.__has_precision(), "use __write_string");
 
   // No padding -> copy the string
   if (!__specs.__has_width())
-    return _VSTD::copy(__str.begin(), __str.end(), _VSTD::move(__out_it));
+    return _CUDA_VSTD::copy(__str.begin(), __str.end(), _CUDA_VSTD::move(__out_it));
 
   // Note when the estimated width is larger than size there's no padding. So
   // there's no reason to get the real size when the estimate is larger than or
@@ -271,11 +271,11 @@ _LIBCPP_HIDE_FROM_ABI auto __write_string_no_precision(
       __format_spec::__estimate_column_width(__str, __specs.__width_, __format_spec::__column_width_rounding::__up)
           .__width_;
 
-  return __formatter::__write(__str.begin(), __str.end(), _VSTD::move(__out_it), __specs, __size);
+  return __formatter::__write(__str.begin(), __str.end(), _CUDA_VSTD::move(__out_it), __specs, __size);
 }
 
 template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI int __truncate(basic_string_view<_CharT>& __str, int __precision) {
+_LIBCUDACXX_HIDE_FROM_ABI int __truncate(basic_string_view<_CharT>& __str, int __precision) {
   __format_spec::__column_width_result<_CharT> __result =
       __format_spec::__estimate_column_width(__str, __precision, __format_spec::__column_width_rounding::__down);
   __str = basic_string_view<_CharT>{__str.begin(), __result.__last_};
@@ -284,25 +284,25 @@ _LIBCPP_HIDE_FROM_ABI int __truncate(basic_string_view<_CharT>& __str, int __pre
 
 /// Writes a string using format's width estimation algorithm.
 ///
-/// \note When \c _LIBCPP_HAS_NO_UNICODE is defined the function assumes the
+/// \note When \c _LIBCUDACXX_HAS_NO_UNICODE is defined the function assumes the
 /// input is ASCII.
 template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI auto __write_string(
+_LIBCUDACXX_HIDE_FROM_ABI auto __write_string(
     basic_string_view<_CharT> __str,
     output_iterator<const _CharT&> auto __out_it,
     __format_spec::__parsed_specifications<_CharT> __specs) -> decltype(__out_it) {
   if (!__specs.__has_precision())
-    return __formatter::__write_string_no_precision(__str, _VSTD::move(__out_it), __specs);
+    return __formatter::__write_string_no_precision(__str, _CUDA_VSTD::move(__out_it), __specs);
 
   int __size = __formatter::__truncate(__str, __specs.__precision_);
 
-  return __write(__str.begin(), __str.end(), _VSTD::move(__out_it), __specs, __size);
+  return __write(__str.begin(), __str.end(), _CUDA_VSTD::move(__out_it), __specs, __size);
 }
 
 } // namespace __formatter
 
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___FORMAT_FORMATTER_OUTPUT_H
+#endif // _LIBCUDACXX___FORMAT_FORMATTER_OUTPUT_H

diff  --git a/libcxx/include/__format/formatter_pointer.h b/libcxx/include/__format/formatter_pointer.h
index 3cd4c9bba960..e4926e8acc03 100644
--- a/libcxx/include/__format/formatter_pointer.h
+++ b/libcxx/include/__format/formatter_pointer.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FORMAT_FORMATTER_POINTER_H
-#define _LIBCPP___FORMAT_FORMATTER_POINTER_H
+#ifndef _LIBCUDACXX___FORMAT_FORMATTER_POINTER_H
+#define _LIBCUDACXX___FORMAT_FORMATTER_POINTER_H
 
 #include <__availability>
 #include <__config>
@@ -21,27 +21,27 @@
 #include <cstddef>
 #include <cstdint>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 template <__formatter::__char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS __formatter_pointer {
+struct _LIBCUDACXX_TEMPLATE_VIS __formatter_pointer {
 public:
   constexpr __formatter_pointer() { __parser_.__alignment_ = __format_spec::__alignment::__right; }
 
-  _LIBCPP_HIDE_FROM_ABI constexpr auto
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr auto
   parse(basic_format_parse_context<_CharT>& __parse_ctx) -> decltype(__parse_ctx.begin()) {
     auto __result = __parser_.__parse(__parse_ctx, __format_spec::__fields_pointer);
     __format_spec::__process_display_type_pointer(__parser_.__type_);
     return __result;
   }
 
-  _LIBCPP_HIDE_FROM_ABI auto format(const void* __ptr, auto& __ctx) const -> decltype(__ctx.out()) {
+  _LIBCUDACXX_HIDE_FROM_ABI auto format(const void* __ptr, auto& __ctx) const -> decltype(__ctx.out()) {
     __format_spec::__parsed_specifications<_CharT> __specs = __parser_.__get_parsed_std_specifications(__ctx);
     __specs.__std_.__alternate_form_                       = true;
     __specs.__std_.__type_                                 = __format_spec::__type::__hexadecimal_lower_case;
@@ -57,17 +57,17 @@ struct _LIBCPP_TEMPLATE_VIS __formatter_pointer {
 // - template<> struct formatter<void*, charT>;
 // - template<> struct formatter<const void*, charT>;
 template <__formatter::__char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<nullptr_t, _CharT>
+struct _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_AVAILABILITY_FORMAT formatter<nullptr_t, _CharT>
     : public __formatter_pointer<_CharT> {};
 template <__formatter::__char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<void*, _CharT> : public __formatter_pointer<_CharT> {
+struct _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_AVAILABILITY_FORMAT formatter<void*, _CharT> : public __formatter_pointer<_CharT> {
 };
 template <__formatter::__char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<const void*, _CharT>
+struct _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_AVAILABILITY_FORMAT formatter<const void*, _CharT>
     : public __formatter_pointer<_CharT> {};
 
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___FORMAT_FORMATTER_POINTER_H
+#endif // _LIBCUDACXX___FORMAT_FORMATTER_POINTER_H

diff  --git a/libcxx/include/__format/formatter_string.h b/libcxx/include/__format/formatter_string.h
index 71bda4fcded1..12be748e047a 100644
--- a/libcxx/include/__format/formatter_string.h
+++ b/libcxx/include/__format/formatter_string.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FORMAT_FORMATTER_STRING_H
-#define _LIBCPP___FORMAT_FORMATTER_STRING_H
+#ifndef _LIBCUDACXX___FORMAT_FORMATTER_STRING_H
+#define _LIBCUDACXX___FORMAT_FORMATTER_STRING_H
 
 #include <__availability>
 #include <__config>
@@ -21,25 +21,25 @@
 #include <string>
 #include <string_view>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 template <__formatter::__char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS __formatter_string {
+struct _LIBCUDACXX_TEMPLATE_VIS __formatter_string {
 public:
-  _LIBCPP_HIDE_FROM_ABI constexpr auto parse(basic_format_parse_context<_CharT>& __parse_ctx)
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr auto parse(basic_format_parse_context<_CharT>& __parse_ctx)
       -> decltype(__parse_ctx.begin()) {
     auto __result = __parser_.__parse(__parse_ctx, __format_spec::__fields_string);
     __format_spec::__process_display_type_string(__parser_.__type_);
     return __result;
   }
 
-  _LIBCPP_HIDE_FROM_ABI auto format(basic_string_view<_CharT> __str, auto& __ctx) const -> decltype(__ctx.out()) {
+  _LIBCUDACXX_HIDE_FROM_ABI auto format(basic_string_view<_CharT> __str, auto& __ctx) const -> decltype(__ctx.out()) {
     return __formatter::__write_string(__str, __ctx.out(), __parser_.__get_parsed_std_specifications(__ctx));
   }
 
@@ -48,12 +48,12 @@ struct _LIBCPP_TEMPLATE_VIS __formatter_string {
 
 // Formatter const char*.
 template <__formatter::__char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<const _CharT*, _CharT>
+struct _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_AVAILABILITY_FORMAT formatter<const _CharT*, _CharT>
     : public __formatter_string<_CharT> {
   using _Base = __formatter_string<_CharT>;
 
-  _LIBCPP_HIDE_FROM_ABI auto format(const _CharT* __str, auto& __ctx) const -> decltype(__ctx.out()) {
-    _LIBCPP_ASSERT(__str, "The basic_format_arg constructor should have "
+  _LIBCUDACXX_HIDE_FROM_ABI auto format(const _CharT* __str, auto& __ctx) const -> decltype(__ctx.out()) {
+    _LIBCUDACXX_ASSERT(__str, "The basic_format_arg constructor should have "
                           "prevented an invalid pointer.");
 
     // When using a center or right alignment and the width option the length
@@ -81,44 +81,44 @@ struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<const _CharT*,
 
 // Formatter char*.
 template <__formatter::__char_type _CharT>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<_CharT*, _CharT>
+struct _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_AVAILABILITY_FORMAT formatter<_CharT*, _CharT>
     : public formatter<const _CharT*, _CharT> {
   using _Base = formatter<const _CharT*, _CharT>;
 
-  _LIBCPP_HIDE_FROM_ABI auto format(_CharT* __str, auto& __ctx) const -> decltype(__ctx.out()) {
+  _LIBCUDACXX_HIDE_FROM_ABI auto format(_CharT* __str, auto& __ctx) const -> decltype(__ctx.out()) {
     return _Base::format(__str, __ctx);
   }
 };
 
 // Formatter char[].
 template <__formatter::__char_type _CharT, size_t _Size>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<_CharT[_Size], _CharT>
+struct _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_AVAILABILITY_FORMAT formatter<_CharT[_Size], _CharT>
     : public __formatter_string<_CharT> {
   using _Base = __formatter_string<_CharT>;
 
-  _LIBCPP_HIDE_FROM_ABI auto format(_CharT __str[_Size], auto& __ctx) const -> decltype(__ctx.out()) {
+  _LIBCUDACXX_HIDE_FROM_ABI auto format(_CharT __str[_Size], auto& __ctx) const -> decltype(__ctx.out()) {
     return _Base::format(basic_string_view<_CharT>(__str, _Size), __ctx);
   }
 };
 
 // Formatter const char[].
 template <__formatter::__char_type _CharT, size_t _Size>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<const _CharT[_Size], _CharT>
+struct _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_AVAILABILITY_FORMAT formatter<const _CharT[_Size], _CharT>
     : public __formatter_string<_CharT> {
   using _Base = __formatter_string<_CharT>;
 
-  _LIBCPP_HIDE_FROM_ABI auto format(const _CharT __str[_Size], auto& __ctx) const -> decltype(__ctx.out()) {
+  _LIBCUDACXX_HIDE_FROM_ABI auto format(const _CharT __str[_Size], auto& __ctx) const -> decltype(__ctx.out()) {
     return _Base::format(basic_string_view<_CharT>(__str, _Size), __ctx);
   }
 };
 
 // Formatter std::string.
 template <__formatter::__char_type _CharT, class _Traits, class _Allocator>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<basic_string<_CharT, _Traits, _Allocator>, _CharT>
+struct _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_AVAILABILITY_FORMAT formatter<basic_string<_CharT, _Traits, _Allocator>, _CharT>
     : public __formatter_string<_CharT> {
   using _Base = __formatter_string<_CharT>;
 
-  _LIBCPP_HIDE_FROM_ABI auto format(const basic_string<_CharT, _Traits, _Allocator>& __str, auto& __ctx) const
+  _LIBCUDACXX_HIDE_FROM_ABI auto format(const basic_string<_CharT, _Traits, _Allocator>& __str, auto& __ctx) const
       -> decltype(__ctx.out()) {
     // Drop _Traits and _Allocator to have one std::basic_string formatter.
     return _Base::format(basic_string_view<_CharT>(__str.data(), __str.size()), __ctx);
@@ -127,19 +127,19 @@ struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<basic_string<_
 
 // Formatter std::string_view.
 template <__formatter::__char_type _CharT, class _Traits>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<basic_string_view<_CharT, _Traits>, _CharT>
+struct _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_AVAILABILITY_FORMAT formatter<basic_string_view<_CharT, _Traits>, _CharT>
     : public __formatter_string<_CharT> {
   using _Base = __formatter_string<_CharT>;
 
-  _LIBCPP_HIDE_FROM_ABI auto format(basic_string_view<_CharT, _Traits> __str, auto& __ctx) const
+  _LIBCUDACXX_HIDE_FROM_ABI auto format(basic_string_view<_CharT, _Traits> __str, auto& __ctx) const
       -> decltype(__ctx.out()) {
     // Drop _Traits to have one std::basic_string_view formatter.
     return _Base::format(basic_string_view<_CharT>(__str.data(), __str.size()), __ctx);
   }
 };
 
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___FORMAT_FORMATTER_STRING_H
+#endif // _LIBCUDACXX___FORMAT_FORMATTER_STRING_H

diff  --git a/libcxx/include/__format/parser_std_format_spec.h b/libcxx/include/__format/parser_std_format_spec.h
index 1425a953ebaa..eaa6185f03dc 100644
--- a/libcxx/include/__format/parser_std_format_spec.h
+++ b/libcxx/include/__format/parser_std_format_spec.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FORMAT_PARSER_STD_FORMAT_SPEC_H
-#define _LIBCPP___FORMAT_PARSER_STD_FORMAT_SPEC_H
+#ifndef _LIBCUDACXX___FORMAT_PARSER_STD_FORMAT_SPEC_H
+#define _LIBCUDACXX___FORMAT_PARSER_STD_FORMAT_SPEC_H
 
 /// \file Contains the std-format-spec parser.
 ///
@@ -33,21 +33,21 @@
 #include <string_view>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 namespace __format_spec {
 
 template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI constexpr __format::__parse_number_result< _CharT>
+_LIBCUDACXX_HIDE_FROM_ABI constexpr __format::__parse_number_result< _CharT>
 __parse_arg_id(const _CharT* __begin, const _CharT* __end, auto& __parse_ctx) {
   // This function is a wrapper to call the real parser. But it does the
   // validation for the pre-conditions and post-conditions.
@@ -65,7 +65,7 @@ __parse_arg_id(const _CharT* __begin, const _CharT* __end, auto& __parse_ctx) {
 }
 
 template <class _Context>
-_LIBCPP_HIDE_FROM_ABI constexpr uint32_t
+_LIBCUDACXX_HIDE_FROM_ABI constexpr uint32_t
 __substitute_arg_id(basic_format_arg<_Context> __format_arg) {
   return visit_format_arg(
       [](auto __arg) -> uint32_t {
@@ -124,7 +124,7 @@ inline constexpr __fields __fields_floating_point{
 inline constexpr __fields __fields_string{.__precision_ = true, .__type_ = true};
 inline constexpr __fields __fields_pointer{.__type_ = true};
 
-enum class _LIBCPP_ENUM_VIS __alignment : uint8_t {
+enum class _LIBCUDACXX_ENUM_VIS __alignment : uint8_t {
   /// No alignment is set in the format string.
   __default,
   __left,
@@ -133,7 +133,7 @@ enum class _LIBCPP_ENUM_VIS __alignment : uint8_t {
   __zero_padding
 };
 
-enum class _LIBCPP_ENUM_VIS __sign : uint8_t {
+enum class _LIBCUDACXX_ENUM_VIS __sign : uint8_t {
   /// No sign is set in the format string.
   ///
   /// The sign isn't allowed for certain format-types. By using this value
@@ -145,7 +145,7 @@ enum class _LIBCPP_ENUM_VIS __sign : uint8_t {
   __space
 };
 
-enum class _LIBCPP_ENUM_VIS __type : uint8_t {
+enum class _LIBCUDACXX_ENUM_VIS __type : uint8_t {
   __default,
   __string,
   __binary_lower_case,
@@ -217,16 +217,16 @@ struct __parsed_specifications {
 
   _CharT __fill_;
 
-  _LIBCPP_HIDE_FROM_ABI constexpr bool __has_width() const { return __width_ > 0; }
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr bool __has_width() const { return __width_ > 0; }
 
-  _LIBCPP_HIDE_FROM_ABI constexpr bool __has_precision() const { return __precision_ >= 0; }
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr bool __has_precision() const { return __precision_ >= 0; }
 };
 
 // Validate the struct is small and cheap to copy since the struct is passed by
 // value in formatting functions.
 static_assert(sizeof(__parsed_specifications<char>) == 16);
 static_assert(is_trivially_copyable_v<__parsed_specifications<char>>);
-#  ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#  ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 static_assert(sizeof(__parsed_specifications<wchar_t>) == 16);
 static_assert(is_trivially_copyable_v<__parsed_specifications<wchar_t>>);
 #  endif
@@ -240,9 +240,9 @@ static_assert(is_trivially_copyable_v<__parsed_specifications<wchar_t>>);
 /// set to zero. That way they can be repurposed if a future revision of the
 /// Standards adds new fields to std-format-spec.
 template <class _CharT>
-class _LIBCPP_TEMPLATE_VIS __parser {
+class _LIBCUDACXX_TEMPLATE_VIS __parser {
 public:
-  _LIBCPP_HIDE_FROM_ABI constexpr auto __parse(basic_format_parse_context<_CharT>& __parse_ctx, __fields __fields)
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr auto __parse(basic_format_parse_context<_CharT>& __parse_ctx, __fields __fields)
       -> decltype(__parse_ctx.begin()) {
 
     const _CharT* __begin = __parse_ctx.begin();
@@ -285,7 +285,7 @@ class _LIBCPP_TEMPLATE_VIS __parser {
   }
 
   /// \returns the `__parsed_specifications` with the resolved dynamic sizes..
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   __parsed_specifications<_CharT> __get_parsed_std_specifications(auto& __ctx) const {
     return __parsed_specifications<_CharT>{
         .__std_ =
@@ -331,7 +331,7 @@ class _LIBCPP_TEMPLATE_VIS __parser {
   _CharT __fill_{_CharT(' ')};
 
 private:
-  _LIBCPP_HIDE_FROM_ABI constexpr bool __parse_alignment(_CharT __c) {
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr bool __parse_alignment(_CharT __c) {
     switch (__c) {
     case _CharT('<'):
       __alignment_ = __alignment::__left;
@@ -348,8 +348,8 @@ class _LIBCPP_TEMPLATE_VIS __parser {
     return false;
   }
 
-  _LIBCPP_HIDE_FROM_ABI constexpr bool __parse_fill_align(const _CharT*& __begin, const _CharT* __end) {
-    _LIBCPP_ASSERT(__begin != __end, "when called with an empty input the function will cause "
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr bool __parse_fill_align(const _CharT*& __begin, const _CharT* __end) {
+    _LIBCUDACXX_ASSERT(__begin != __end, "when called with an empty input the function will cause "
                                      "undefined behavior by evaluating data not in the input");
     if (__begin + 1 != __end) {
       if (__parse_alignment(*(__begin + 1))) {
@@ -369,7 +369,7 @@ class _LIBCPP_TEMPLATE_VIS __parser {
     return true;
   }
 
-  _LIBCPP_HIDE_FROM_ABI constexpr bool __parse_sign(const _CharT*& __begin) {
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr bool __parse_sign(const _CharT*& __begin) {
     switch (*__begin) {
     case _CharT('-'):
       __sign_ = __sign::__minus;
@@ -387,7 +387,7 @@ class _LIBCPP_TEMPLATE_VIS __parser {
     return true;
   }
 
-  _LIBCPP_HIDE_FROM_ABI constexpr bool __parse_alternate_form(const _CharT*& __begin) {
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr bool __parse_alternate_form(const _CharT*& __begin) {
     if (*__begin != _CharT('#'))
       return false;
 
@@ -396,7 +396,7 @@ class _LIBCPP_TEMPLATE_VIS __parser {
     return true;
   }
 
-  _LIBCPP_HIDE_FROM_ABI constexpr bool __parse_zero_padding(const _CharT*& __begin) {
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr bool __parse_zero_padding(const _CharT*& __begin) {
     if (*__begin != _CharT('0'))
       return false;
 
@@ -406,7 +406,7 @@ class _LIBCPP_TEMPLATE_VIS __parser {
     return true;
   }
 
-  _LIBCPP_HIDE_FROM_ABI constexpr bool __parse_width(const _CharT*& __begin, const _CharT* __end, auto& __parse_ctx) {
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr bool __parse_width(const _CharT*& __begin, const _CharT* __end, auto& __parse_ctx) {
     if (*__begin == _CharT('0'))
       __throw_format_error("A format-spec width field shouldn't have a leading zero");
 
@@ -423,13 +423,13 @@ class _LIBCPP_TEMPLATE_VIS __parser {
 
     __format::__parse_number_result __r = __format::__parse_number(__begin, __end);
     __width_ = __r.__value;
-    _LIBCPP_ASSERT(__width_ != 0, "A zero value isn't allowed and should be impossible, "
+    _LIBCUDACXX_ASSERT(__width_ != 0, "A zero value isn't allowed and should be impossible, "
                                   "due to validations in this function");
     __begin = __r.__ptr;
     return true;
   }
 
-  _LIBCPP_HIDE_FROM_ABI constexpr bool __parse_precision(const _CharT*& __begin, const _CharT* __end,
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr bool __parse_precision(const _CharT*& __begin, const _CharT* __end,
                                                          auto& __parse_ctx) {
     if (*__begin != _CharT('.'))
       return false;
@@ -456,7 +456,7 @@ class _LIBCPP_TEMPLATE_VIS __parser {
     return true;
   }
 
-  _LIBCPP_HIDE_FROM_ABI constexpr bool __parse_locale_specific_form(const _CharT*& __begin) {
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr bool __parse_locale_specific_form(const _CharT*& __begin) {
     if (*__begin != _CharT('L'))
       return false;
 
@@ -465,7 +465,7 @@ class _LIBCPP_TEMPLATE_VIS __parser {
     return true;
   }
 
-  _LIBCPP_HIDE_FROM_ABI constexpr void __parse_type(const _CharT*& __begin) {
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr void __parse_type(const _CharT*& __begin) {
     // Determines the type. It does not validate whether the selected type is
     // valid. Most formatters have optional fields that are only allowed for
     // certain types. These parsers need to do validation after the type has
@@ -529,7 +529,7 @@ class _LIBCPP_TEMPLATE_VIS __parser {
     ++__begin;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   int32_t __get_width(auto& __ctx) const {
     if (!__width_as_arg_)
       return __width_;
@@ -540,7 +540,7 @@ class _LIBCPP_TEMPLATE_VIS __parser {
     return __result;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   int32_t __get_precision(auto& __ctx) const {
     if (!__precision_as_arg_)
       return __precision_;
@@ -551,11 +551,11 @@ class _LIBCPP_TEMPLATE_VIS __parser {
 
 // Validates whether the reserved bitfields don't change the size.
 static_assert(sizeof(__parser<char>) == 16);
-#  ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#  ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 static_assert(sizeof(__parser<wchar_t>) == 16);
 #  endif
 
-_LIBCPP_HIDE_FROM_ABI constexpr void __process_display_type_string(__format_spec::__type __type) {
+_LIBCUDACXX_HIDE_FROM_ABI constexpr void __process_display_type_string(__format_spec::__type __type) {
   switch (__type) {
   case __format_spec::__type::__default:
   case __format_spec::__type::__string:
@@ -567,7 +567,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr void __process_display_type_string(__format_spec
 }
 
 template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI constexpr void __process_display_type_bool_string(__parser<_CharT>& __parser) {
+_LIBCUDACXX_HIDE_FROM_ABI constexpr void __process_display_type_bool_string(__parser<_CharT>& __parser) {
   if (__parser.__sign_ != __sign::__default)
     std::__throw_format_error("A sign field isn't allowed in this format-spec");
 
@@ -582,12 +582,12 @@ _LIBCPP_HIDE_FROM_ABI constexpr void __process_display_type_bool_string(__parser
 }
 
 template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI constexpr void __process_display_type_char(__parser<_CharT>& __parser) {
+_LIBCUDACXX_HIDE_FROM_ABI constexpr void __process_display_type_char(__parser<_CharT>& __parser) {
   __format_spec::__process_display_type_bool_string(__parser);
 }
 
 template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI constexpr void __process_parsed_bool(__parser<_CharT>& __parser) {
+_LIBCUDACXX_HIDE_FROM_ABI constexpr void __process_parsed_bool(__parser<_CharT>& __parser) {
   switch (__parser.__type_) {
   case __format_spec::__type::__default:
   case __format_spec::__type::__string:
@@ -608,7 +608,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr void __process_parsed_bool(__parser<_CharT>& __p
 }
 
 template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI constexpr void __process_parsed_char(__parser<_CharT>& __parser) {
+_LIBCUDACXX_HIDE_FROM_ABI constexpr void __process_parsed_char(__parser<_CharT>& __parser) {
   switch (__parser.__type_) {
   case __format_spec::__type::__default:
   case __format_spec::__type::__char:
@@ -629,7 +629,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr void __process_parsed_char(__parser<_CharT>& __p
 }
 
 template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI constexpr void __process_parsed_integer(__parser<_CharT>& __parser) {
+_LIBCUDACXX_HIDE_FROM_ABI constexpr void __process_parsed_integer(__parser<_CharT>& __parser) {
   switch (__parser.__type_) {
   case __format_spec::__type::__default:
   case __format_spec::__type::__binary_lower_case:
@@ -650,7 +650,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr void __process_parsed_integer(__parser<_CharT>&
 }
 
 template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI constexpr void __process_parsed_floating_point(__parser<_CharT>& __parser) {
+_LIBCUDACXX_HIDE_FROM_ABI constexpr void __process_parsed_floating_point(__parser<_CharT>& __parser) {
   switch (__parser.__type_) {
   case __format_spec::__type::__default:
     // When no precision specified then it keeps default since that
@@ -678,7 +678,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr void __process_parsed_floating_point(__parser<_C
   }
 }
 
-_LIBCPP_HIDE_FROM_ABI constexpr void __process_display_type_pointer(__format_spec::__type __type) {
+_LIBCUDACXX_HIDE_FROM_ABI constexpr void __process_display_type_pointer(__format_spec::__type __type) {
   switch (__type) {
   case __format_spec::__type::__default:
   case __format_spec::__type::__pointer:
@@ -710,7 +710,7 @@ struct __column_width_result {
 ///   "rounded up".
 enum class __column_width_rounding { __down, __up };
 
-#  ifndef _LIBCPP_HAS_NO_UNICODE
+#  ifndef _LIBCUDACXX_HAS_NO_UNICODE
 
 namespace __detail {
 
@@ -720,8 +720,8 @@ namespace __detail {
 ///
 /// This version expects a value less than 0x1'0000, which is a 3-byte UTF-8
 /// character.
-_LIBCPP_HIDE_FROM_ABI constexpr int __column_width_3(uint32_t __c) noexcept {
-  _LIBCPP_ASSERT(__c < 0x10000, "Use __column_width_4 or __column_width for larger values");
+_LIBCUDACXX_HIDE_FROM_ABI constexpr int __column_width_3(uint32_t __c) noexcept {
+  _LIBCUDACXX_ASSERT(__c < 0x10000, "Use __column_width_4 or __column_width for larger values");
 
   // clang-format off
   return 1 + (__c >= 0x1100 && (__c <= 0x115f ||
@@ -742,8 +742,8 @@ _LIBCPP_HIDE_FROM_ABI constexpr int __column_width_3(uint32_t __c) noexcept {
 ///
 /// This version expects a value greater than or equal to 0x1'0000, which is a
 /// 4-byte UTF-8 character.
-_LIBCPP_HIDE_FROM_ABI constexpr int __column_width_4(uint32_t __c) noexcept {
-  _LIBCPP_ASSERT(__c >= 0x10000, "Use __column_width_3 or __column_width for smaller values");
+_LIBCUDACXX_HIDE_FROM_ABI constexpr int __column_width_4(uint32_t __c) noexcept {
+  _LIBCUDACXX_ASSERT(__c >= 0x10000, "Use __column_width_3 or __column_width for smaller values");
 
   // clang-format off
   return 1 + (__c >= 0x1'f300 && (__c <= 0x1'f64f ||
@@ -757,7 +757,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr int __column_width_4(uint32_t __c) noexcept {
 /// @overload
 ///
 /// The general case, accepting all values.
-_LIBCPP_HIDE_FROM_ABI constexpr int __column_width(uint32_t __c) noexcept {
+_LIBCUDACXX_HIDE_FROM_ABI constexpr int __column_width(uint32_t __c) noexcept {
   if (__c < 0x10000)
     return __detail::__column_width_3(__c);
 
@@ -765,7 +765,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr int __column_width(uint32_t __c) noexcept {
 }
 
 template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI constexpr __column_width_result<_CharT> __estimate_column_width_grapheme_clustering(
+_LIBCUDACXX_HIDE_FROM_ABI constexpr __column_width_result<_CharT> __estimate_column_width_grapheme_clustering(
     const _CharT* __first, const _CharT* __last, size_t __maximum, __column_width_rounding __rounding) noexcept {
   __unicode::__extended_grapheme_cluster_view<_CharT> __view{__first, __last};
 
@@ -820,7 +820,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr __column_width_result<_CharT> __estimate_column_
 // - https://en.wikipedia.org/wiki/UTF-8#Encoding
 // - https://en.wikipedia.org/wiki/UTF-16#U+D800_to_U+DFFF
 
-_LIBCPP_HIDE_FROM_ABI constexpr bool __is_ascii(char32_t __c) { return __c < 0x80; }
+_LIBCUDACXX_HIDE_FROM_ABI constexpr bool __is_ascii(char32_t __c) { return __c < 0x80; }
 
 /// Determines the number of output columns needed to render the input.
 ///
@@ -837,7 +837,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool __is_ascii(char32_t __c) { return __c < 0x8
 ///                   \c __down result.__width_ <= __maximum
 ///                   \c __up result.__width_ <= __maximum + 1
 template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI constexpr __column_width_result<_CharT> __estimate_column_width(
+_LIBCUDACXX_HIDE_FROM_ABI constexpr __column_width_result<_CharT> __estimate_column_width(
     basic_string_view<_CharT> __str, size_t __maximum, __column_width_rounding __rounding) noexcept {
   // The width estimation is done in two steps:
   // - Quickly process for the ASCII part. ASCII has the following properties
@@ -882,25 +882,25 @@ _LIBCPP_HIDE_FROM_ABI constexpr __column_width_result<_CharT> __estimate_column_
   __result.__width_ += __ascii_size;
   return __result;
 }
-#  else // !defined(_LIBCPP_HAS_NO_UNICODE)
+#  else // !defined(_LIBCUDACXX_HAS_NO_UNICODE)
 template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI constexpr __column_width_result<_CharT>
+_LIBCUDACXX_HIDE_FROM_ABI constexpr __column_width_result<_CharT>
 __estimate_column_width(basic_string_view<_CharT> __str, size_t __maximum, __column_width_rounding) noexcept {
   // When Unicode isn't supported assume ASCII and every code unit is one code
   // point. In ASCII the estimated column width is always one. Thus there's no
   // need for rounding.
-  size_t __width_ = _VSTD::min(__str.size(), __maximum);
+  size_t __width_ = _CUDA_VSTD::min(__str.size(), __maximum);
   return {__width_, __str.begin() + __width_};
 }
 
-#  endif // !defined(_LIBCPP_HAS_NO_UNICODE)
+#  endif // !defined(_LIBCUDACXX_HAS_NO_UNICODE)
 
 } // namespace __format_spec
 
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___FORMAT_PARSER_STD_FORMAT_SPEC_H
+#endif // _LIBCUDACXX___FORMAT_PARSER_STD_FORMAT_SPEC_H

diff  --git a/libcxx/include/__format/unicode.h b/libcxx/include/__format/unicode.h
index 3316217f4a1e..280d9912fc5a 100644
--- a/libcxx/include/__format/unicode.h
+++ b/libcxx/include/__format/unicode.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FORMAT_UNICODE_H
-#define _LIBCPP___FORMAT_UNICODE_H
+#ifndef _LIBCUDACXX___FORMAT_UNICODE_H
+#define _LIBCUDACXX___FORMAT_UNICODE_H
 
 #include <__assert>
 #include <__config>
@@ -16,15 +16,15 @@
 #include <__utility/unreachable.h>
 #include <bit>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
-#  ifndef _LIBCPP_HAS_NO_UNICODE
+#  ifndef _LIBCUDACXX_HAS_NO_UNICODE
 
 /// Implements the grapheme cluster boundary rules
 ///
@@ -43,7 +43,7 @@ namespace __unicode {
 
 inline constexpr char32_t __replacement_character = U'\ufffd';
 
-_LIBCPP_HIDE_FROM_ABI constexpr bool __is_continuation(const char* __char, int __count) {
+_LIBCUDACXX_HIDE_FROM_ABI constexpr bool __is_continuation(const char* __char, int __count) {
   do {
     if ((*__char & 0b1000'0000) != 0b1000'0000)
       return false;
@@ -64,19 +64,19 @@ class __code_point_view;
 template <>
 class __code_point_view<char> {
 public:
-  _LIBCPP_HIDE_FROM_ABI constexpr explicit __code_point_view(const char* __first, const char* __last)
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit __code_point_view(const char* __first, const char* __last)
       : __first_(__first), __last_(__last) {}
 
-  _LIBCPP_HIDE_FROM_ABI constexpr bool __at_end() const noexcept { return __first_ == __last_; }
-  _LIBCPP_HIDE_FROM_ABI constexpr const char* __position() const noexcept { return __first_; }
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr bool __at_end() const noexcept { return __first_ == __last_; }
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr const char* __position() const noexcept { return __first_; }
 
-  _LIBCPP_HIDE_FROM_ABI constexpr char32_t __consume() noexcept {
-    _LIBCPP_ASSERT(__first_ != __last_, "can't move beyond the end of input");
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr char32_t __consume() noexcept {
+    _LIBCUDACXX_ASSERT(__first_ != __last_, "can't move beyond the end of input");
 
     // Based on the number of leading 1 bits the number of code units in the
     // code point can be determined. See
     // https://en.wikipedia.org/wiki/UTF-8#Encoding
-    switch (_VSTD::countl_one(static_cast<unsigned char>(*__first_))) {
+    switch (_CUDA_VSTD::countl_one(static_cast<unsigned char>(*__first_))) {
     case 0:
       return *__first_++;
 
@@ -135,14 +135,14 @@ class __code_point_view<char> {
 template <>
 class __code_point_view<wchar_t> {
 public:
-  _LIBCPP_HIDE_FROM_ABI constexpr explicit __code_point_view(const wchar_t* __first, const wchar_t* __last)
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit __code_point_view(const wchar_t* __first, const wchar_t* __last)
       : __first_(__first), __last_(__last) {}
 
-  _LIBCPP_HIDE_FROM_ABI constexpr const wchar_t* __position() const noexcept { return __first_; }
-  _LIBCPP_HIDE_FROM_ABI constexpr bool __at_end() const noexcept { return __first_ == __last_; }
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr const wchar_t* __position() const noexcept { return __first_; }
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr bool __at_end() const noexcept { return __first_ == __last_; }
 
-  _LIBCPP_HIDE_FROM_ABI constexpr char32_t __consume() noexcept {
-    _LIBCPP_ASSERT(__first_ != __last_, "can't move beyond the end of input");
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr char32_t __consume() noexcept {
+    _LIBCUDACXX_ASSERT(__first_ != __last_, "can't move beyond the end of input");
 
     if constexpr (sizeof(wchar_t) == 2) {
       char32_t __result = *__first_++;
@@ -167,8 +167,8 @@ class __code_point_view<wchar_t> {
       return __result;
     } else {
       // TODO FMT P2593R0 Use static_assert(false, "sizeof(wchar_t) has a not implemented value");
-      _LIBCPP_ASSERT(sizeof(wchar_t) == 0, "sizeof(wchar_t) has a not implemented value");
-      __libcpp_unreachable();
+      _LIBCUDACXX_ASSERT(sizeof(wchar_t) == 0, "sizeof(wchar_t) has a not implemented value");
+      __LIBCUDACXX_unreachable();
     }
   }
 
@@ -178,7 +178,7 @@ class __code_point_view<wchar_t> {
 };
 #    endif
 
-_LIBCPP_HIDE_FROM_ABI constexpr bool __at_extended_grapheme_cluster_break(
+_LIBCUDACXX_HIDE_FROM_ABI constexpr bool __at_extended_grapheme_cluster_break(
     bool& __ri_break_allowed,
     bool __has_extened_pictographic,
     __extended_grapheme_custer_property_boundary::__property __prev,
@@ -191,8 +191,8 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool __at_extended_grapheme_cluster_break(
 
   // *** Break at the start and end of text, unless the text is empty. ***
 
-  _LIBCPP_ASSERT(__prev != __property::__sot, "should be handled in the constructor"); // GB1
-  _LIBCPP_ASSERT(__prev != __property::__eot, "should be handled by our caller");      // GB2
+  _LIBCUDACXX_ASSERT(__prev != __property::__sot, "should be handled in the constructor"); // GB1
+  _LIBCUDACXX_ASSERT(__prev != __property::__eot, "should be handled by our caller");      // GB2
 
   // *** Do not break between a CR and LF. Otherwise, break before and after controls. ***
   if (__prev == __property::__CR && __next == __property::__LF) // GB3
@@ -269,7 +269,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool __at_extended_grapheme_cluster_break(
 template <class _CharT>
 class __extended_grapheme_cluster_view {
 public:
-  _LIBCPP_HIDE_FROM_ABI constexpr explicit __extended_grapheme_cluster_view(const _CharT* __first, const _CharT* __last)
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit __extended_grapheme_cluster_view(const _CharT* __first, const _CharT* __last)
       : __code_point_view_(__first, __last),
         __next_code_point_(__code_point_view_.__consume()),
         __next_prop_(__extended_grapheme_custer_property_boundary::__get_property(__next_code_point_)) {}
@@ -288,8 +288,8 @@ class __extended_grapheme_cluster_view {
     const _CharT* __last_;
   };
 
-  _LIBCPP_HIDE_FROM_ABI constexpr __cluster __consume() {
-    _LIBCPP_ASSERT(
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr __cluster __consume() {
+    _LIBCUDACXX_ASSERT(
         __next_prop_ != __extended_grapheme_custer_property_boundary::__property::__eot,
         "can't move beyond the end of input");
     char32_t __code_point = __next_code_point_;
@@ -306,7 +306,7 @@ class __extended_grapheme_cluster_view {
   char32_t __next_code_point_;
   __extended_grapheme_custer_property_boundary::__property __next_prop_;
 
-  _LIBCPP_HIDE_FROM_ABI constexpr const _CharT* __get_break() {
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr const _CharT* __get_break() {
     bool __ri_break_allowed         = true;
     bool __has_extened_pictographic = false;
     while (true) {
@@ -330,10 +330,10 @@ class __extended_grapheme_cluster_view {
 
 } // namespace __unicode
 
-#  endif //  _LIBCPP_HAS_NO_UNICODE
+#  endif //  _LIBCUDACXX_HAS_NO_UNICODE
 
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___FORMAT_UNICODE_H
+#endif // _LIBCUDACXX___FORMAT_UNICODE_H

diff  --git a/libcxx/include/__functional/binary_function.h b/libcxx/include/__functional/binary_function.h
index fdedb8b177da..3ee21f151ba8 100644
--- a/libcxx/include/__functional/binary_function.h
+++ b/libcxx/include/__functional/binary_function.h
@@ -7,48 +7,48 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FUNCTIONAL_BINARY_FUNCTION_H
-#define _LIBCPP___FUNCTIONAL_BINARY_FUNCTION_H
+#ifndef _LIBCUDACXX___FUNCTIONAL_BINARY_FUNCTION_H
+#define _LIBCUDACXX___FUNCTIONAL_BINARY_FUNCTION_H
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION)
+#if _LIBCUDACXX_STD_VER <= 14 || defined(_LIBCUDACXX_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION)
 
 template <class _Arg1, class _Arg2, class _Result>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 binary_function
+struct _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_DEPRECATED_IN_CXX11 binary_function
 {
     typedef _Arg1   first_argument_type;
     typedef _Arg2   second_argument_type;
     typedef _Result result_type;
 };
 
-#endif // _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION)
+#endif // _LIBCUDACXX_STD_VER <= 14 || defined(_LIBCUDACXX_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION)
 
 template <class _Arg1, class _Arg2, class _Result> struct __binary_function_keep_layout_base {
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
-  using first_argument_type _LIBCPP_DEPRECATED_IN_CXX17 = _Arg1;
-  using second_argument_type _LIBCPP_DEPRECATED_IN_CXX17 = _Arg2;
-  using result_type _LIBCPP_DEPRECATED_IN_CXX17 = _Result;
+#if _LIBCUDACXX_STD_VER <= 17 || defined(_LIBCUDACXX_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+  using first_argument_type _LIBCUDACXX_DEPRECATED_IN_CXX17 = _Arg1;
+  using second_argument_type _LIBCUDACXX_DEPRECATED_IN_CXX17 = _Arg2;
+  using result_type _LIBCUDACXX_DEPRECATED_IN_CXX17 = _Result;
 #endif
 };
 
-#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION)
-_LIBCPP_DIAGNOSTIC_PUSH
-_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wdeprecated-declarations")
+#if _LIBCUDACXX_STD_VER <= 14 || defined(_LIBCUDACXX_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION)
+_LIBCUDACXX_DIAGNOSTIC_PUSH
+_LIBCUDACXX_CLANG_DIAGNOSTIC_IGNORED("-Wdeprecated-declarations")
 template <class _Arg1, class _Arg2, class _Result>
 using __binary_function = binary_function<_Arg1, _Arg2, _Result>;
-_LIBCPP_DIAGNOSTIC_POP
+_LIBCUDACXX_DIAGNOSTIC_POP
 #else
 template <class _Arg1, class _Arg2, class _Result>
 using __binary_function = __binary_function_keep_layout_base<_Arg1, _Arg2, _Result>;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___FUNCTIONAL_BINARY_FUNCTION_H
+#endif // _LIBCUDACXX___FUNCTIONAL_BINARY_FUNCTION_H

diff  --git a/libcxx/include/__functional/binary_negate.h b/libcxx/include/__functional/binary_negate.h
index c4977f4ebe12..18023dbef5b5 100644
--- a/libcxx/include/__functional/binary_negate.h
+++ b/libcxx/include/__functional/binary_negate.h
@@ -7,44 +7,44 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FUNCTIONAL_BINARY_NEGATE_H
-#define _LIBCPP___FUNCTIONAL_BINARY_NEGATE_H
+#ifndef _LIBCUDACXX___FUNCTIONAL_BINARY_NEGATE_H
+#define _LIBCUDACXX___FUNCTIONAL_BINARY_NEGATE_H
 
 #include <__config>
 #include <__functional/binary_function.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_NEGATORS)
+#if _LIBCUDACXX_STD_VER <= 17 || defined(_LIBCUDACXX_ENABLE_CXX20_REMOVED_NEGATORS)
 
 template <class _Predicate>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 binary_negate
+class _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_DEPRECATED_IN_CXX17 binary_negate
     : public __binary_function<typename _Predicate::first_argument_type,
                                typename _Predicate::second_argument_type,
                                bool>
 {
     _Predicate __pred_;
 public:
-    _LIBCPP_INLINE_VISIBILITY explicit _LIBCPP_CONSTEXPR_AFTER_CXX11
+    _LIBCUDACXX_INLINE_VISIBILITY explicit _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
     binary_negate(const _Predicate& __pred) : __pred_(__pred) {}
 
-    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
     bool operator()(const typename _Predicate::first_argument_type& __x,
                     const typename _Predicate::second_argument_type& __y) const
         {return !__pred_(__x, __y);}
 };
 
 template <class _Predicate>
-_LIBCPP_DEPRECATED_IN_CXX17 inline _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_DEPRECATED_IN_CXX17 inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
 binary_negate<_Predicate>
 not2(const _Predicate& __pred) {return binary_negate<_Predicate>(__pred);}
 
-#endif // _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_NEGATORS)
+#endif // _LIBCUDACXX_STD_VER <= 17 || defined(_LIBCUDACXX_ENABLE_CXX20_REMOVED_NEGATORS)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___FUNCTIONAL_BINARY_NEGATE_H
+#endif // _LIBCUDACXX___FUNCTIONAL_BINARY_NEGATE_H

diff  --git a/libcxx/include/__functional/bind.h b/libcxx/include/__functional/bind.h
index d1cbbb3d916e..cba2682eff0c 100644
--- a/libcxx/include/__functional/bind.h
+++ b/libcxx/include/__functional/bind.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FUNCTIONAL_BIND_H
-#define _LIBCPP___FUNCTIONAL_BIND_H
+#ifndef _LIBCUDACXX___FUNCTIONAL_BIND_H
+#define _LIBCUDACXX___FUNCTIONAL_BIND_H
 
 #include <__config>
 #include <__functional/invoke.h>
@@ -17,11 +17,11 @@
 #include <tuple>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template<class _Tp>
 struct is_bind_expression : _If<
@@ -30,7 +30,7 @@ struct is_bind_expression : _If<
     is_bind_expression<__uncvref_t<_Tp> >
 > {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr size_t is_bind_expression_v = is_bind_expression<_Tp>::value;
 #endif
@@ -42,7 +42,7 @@ struct is_placeholder : _If<
     is_placeholder<__uncvref_t<_Tp> >
 > {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr size_t is_placeholder_v = is_placeholder<_Tp>::value;
 #endif
@@ -52,17 +52,17 @@ namespace placeholders
 
 template <int _Np> struct __ph {};
 
-#if defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_LIBRARY)
-_LIBCPP_FUNC_VIS extern const __ph<1>   _1;
-_LIBCPP_FUNC_VIS extern const __ph<2>   _2;
-_LIBCPP_FUNC_VIS extern const __ph<3>   _3;
-_LIBCPP_FUNC_VIS extern const __ph<4>   _4;
-_LIBCPP_FUNC_VIS extern const __ph<5>   _5;
-_LIBCPP_FUNC_VIS extern const __ph<6>   _6;
-_LIBCPP_FUNC_VIS extern const __ph<7>   _7;
-_LIBCPP_FUNC_VIS extern const __ph<8>   _8;
-_LIBCPP_FUNC_VIS extern const __ph<9>   _9;
-_LIBCPP_FUNC_VIS extern const __ph<10> _10;
+#if defined(_LIBCUDACXX_CXX03_LANG) || defined(_LIBCUDACXX_BUILDING_LIBRARY)
+_LIBCUDACXX_FUNC_VIS extern const __ph<1>   _1;
+_LIBCUDACXX_FUNC_VIS extern const __ph<2>   _2;
+_LIBCUDACXX_FUNC_VIS extern const __ph<3>   _3;
+_LIBCUDACXX_FUNC_VIS extern const __ph<4>   _4;
+_LIBCUDACXX_FUNC_VIS extern const __ph<5>   _5;
+_LIBCUDACXX_FUNC_VIS extern const __ph<6>   _6;
+_LIBCUDACXX_FUNC_VIS extern const __ph<7>   _7;
+_LIBCUDACXX_FUNC_VIS extern const __ph<8>   _8;
+_LIBCUDACXX_FUNC_VIS extern const __ph<9>   _9;
+_LIBCUDACXX_FUNC_VIS extern const __ph<10> _10;
 #else
 /* inline */ constexpr __ph<1>   _1{};
 /* inline */ constexpr __ph<2>   _2{};
@@ -74,7 +74,7 @@ _LIBCPP_FUNC_VIS extern const __ph<10> _10;
 /* inline */ constexpr __ph<8>   _8{};
 /* inline */ constexpr __ph<9>   _9{};
 /* inline */ constexpr __ph<10> _10{};
-#endif // defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_LIBRARY)
+#endif // defined(_LIBCUDACXX_CXX03_LANG) || defined(_LIBCUDACXX_BUILDING_LIBRARY)
 
 } // namespace placeholders
 
@@ -83,10 +83,10 @@ struct is_placeholder<placeholders::__ph<_Np> >
     : public integral_constant<int, _Np> {};
 
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
 template <class _Tp, class _Uj>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 _Tp&
 __mu(reference_wrapper<_Tp> __t, _Uj&)
 {
@@ -94,15 +94,15 @@ __mu(reference_wrapper<_Tp> __t, _Uj&)
 }
 
 template <class _Ti, class ..._Uj, size_t ..._Indx>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename __invoke_of<_Ti&, _Uj...>::type
 __mu_expand(_Ti& __ti, tuple<_Uj...>& __uj, __tuple_indices<_Indx...>)
 {
-    return __ti(_VSTD::forward<_Uj>(_VSTD::get<_Indx>(__uj))...);
+    return __ti(_CUDA_VSTD::forward<_Uj>(_CUDA_VSTD::get<_Indx>(__uj))...);
 }
 
 template <class _Ti, class ..._Uj>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename __enable_if_t
 <
     is_bind_expression<_Ti>::value,
@@ -111,7 +111,7 @@ typename __enable_if_t
 __mu(_Ti& __ti, tuple<_Uj...>& __uj)
 {
     typedef typename __make_tuple_indices<sizeof...(_Uj)>::type __indices;
-    return _VSTD::__mu_expand(__ti, __uj, __indices());
+    return _CUDA_VSTD::__mu_expand(__ti, __uj, __indices());
 }
 
 template <bool IsPh, class _Ti, class _Uj>
@@ -124,7 +124,7 @@ struct __mu_return2<true, _Ti, _Uj>
 };
 
 template <class _Ti, class _Uj>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename enable_if
 <
     0 < is_placeholder<_Ti>::value,
@@ -133,11 +133,11 @@ typename enable_if
 __mu(_Ti&, _Uj& __uj)
 {
     const size_t _Indx = is_placeholder<_Ti>::value - 1;
-    return _VSTD::forward<typename tuple_element<_Indx, _Uj>::type>(_VSTD::get<_Indx>(__uj));
+    return _CUDA_VSTD::forward<typename tuple_element<_Indx, _Uj>::type>(_CUDA_VSTD::get<_Indx>(__uj));
 }
 
 template <class _Ti, class _Uj>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename enable_if
 <
     !is_bind_expression<_Ti>::value &&
@@ -255,12 +255,12 @@ struct __bind_return<_Fp, const tuple<_BoundArgs...>, _TupleUj, true>
 };
 
 template <class _Fp, class _BoundArgs, size_t ..._Indx, class _Args>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename __bind_return<_Fp, _BoundArgs, _Args>::type
 __apply_functor(_Fp& __f, _BoundArgs& __bound_args, __tuple_indices<_Indx...>,
                 _Args&& __args)
 {
-    return _VSTD::__invoke(__f, _VSTD::__mu(_VSTD::get<_Indx>(__bound_args), __args)...);
+    return _CUDA_VSTD::__invoke(__f, _CUDA_VSTD::__mu(_CUDA_VSTD::get<_Indx>(__bound_args), __args)...);
 }
 
 template<class _Fp, class ..._BoundArgs>
@@ -282,27 +282,27 @@ class __bind : public __weak_result_type<typename decay<_Fp>::type>
                                   !is_same<typename remove_reference<_Gp>::type,
                                            __bind>::value
                                >::type>
-      _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+      _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
       explicit __bind(_Gp&& __f, _BA&& ...__bound_args)
-        : __f_(_VSTD::forward<_Gp>(__f)),
-          __bound_args_(_VSTD::forward<_BA>(__bound_args)...) {}
+        : __f_(_CUDA_VSTD::forward<_Gp>(__f)),
+          __bound_args_(_CUDA_VSTD::forward<_BA>(__bound_args)...) {}
 
     template <class ..._Args>
-        _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+        _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
         typename __bind_return<_Fd, _Td, tuple<_Args&&...> >::type
         operator()(_Args&& ...__args)
         {
-            return _VSTD::__apply_functor(__f_, __bound_args_, __indices(),
-                                  tuple<_Args&&...>(_VSTD::forward<_Args>(__args)...));
+            return _CUDA_VSTD::__apply_functor(__f_, __bound_args_, __indices(),
+                                  tuple<_Args&&...>(_CUDA_VSTD::forward<_Args>(__args)...));
         }
 
     template <class ..._Args>
-        _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+        _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
         typename __bind_return<const _Fd, const _Td, tuple<_Args&&...> >::type
         operator()(_Args&& ...__args) const
         {
-            return _VSTD::__apply_functor(__f_, __bound_args_, __indices(),
-                                   tuple<_Args&&...>(_VSTD::forward<_Args>(__args)...));
+            return _CUDA_VSTD::__apply_functor(__f_, __bound_args_, __indices(),
+                                   tuple<_Args&&...>(_CUDA_VSTD::forward<_Args>(__args)...));
         }
 };
 
@@ -327,13 +327,13 @@ class __bind_r
                                   !is_same<typename remove_reference<_Gp>::type,
                                            __bind_r>::value
                                >::type>
-      _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+      _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
       explicit __bind_r(_Gp&& __f, _BA&& ...__bound_args)
-        : base(_VSTD::forward<_Gp>(__f),
-               _VSTD::forward<_BA>(__bound_args)...) {}
+        : base(_CUDA_VSTD::forward<_Gp>(__f),
+               _CUDA_VSTD::forward<_BA>(__bound_args)...) {}
 
     template <class ..._Args>
-        _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+        _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
         typename enable_if
         <
             is_convertible<typename __bind_return<_Fd, _Td, tuple<_Args&&...> >::type,
@@ -343,11 +343,11 @@ class __bind_r
         operator()(_Args&& ...__args)
         {
             typedef __invoke_void_return_wrapper<_Rp> _Invoker;
-            return _Invoker::__call(static_cast<base&>(*this), _VSTD::forward<_Args>(__args)...);
+            return _Invoker::__call(static_cast<base&>(*this), _CUDA_VSTD::forward<_Args>(__args)...);
         }
 
     template <class ..._Args>
-        _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+        _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
         typename enable_if
         <
             is_convertible<typename __bind_return<const _Fd, const _Td, tuple<_Args&&...> >::type,
@@ -357,7 +357,7 @@ class __bind_r
         operator()(_Args&& ...__args) const
         {
             typedef __invoke_void_return_wrapper<_Rp> _Invoker;
-            return _Invoker::__call(static_cast<base const&>(*this), _VSTD::forward<_Args>(__args)...);
+            return _Invoker::__call(static_cast<base const&>(*this), _CUDA_VSTD::forward<_Args>(__args)...);
         }
 };
 
@@ -365,25 +365,25 @@ template<class _Rp, class _Fp, class ..._BoundArgs>
 struct is_bind_expression<__bind_r<_Rp, _Fp, _BoundArgs...> > : public true_type {};
 
 template<class _Fp, class ..._BoundArgs>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 __bind<_Fp, _BoundArgs...>
 bind(_Fp&& __f, _BoundArgs&&... __bound_args)
 {
     typedef __bind<_Fp, _BoundArgs...> type;
-    return type(_VSTD::forward<_Fp>(__f), _VSTD::forward<_BoundArgs>(__bound_args)...);
+    return type(_CUDA_VSTD::forward<_Fp>(__f), _CUDA_VSTD::forward<_BoundArgs>(__bound_args)...);
 }
 
 template<class _Rp, class _Fp, class ..._BoundArgs>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 __bind_r<_Rp, _Fp, _BoundArgs...>
 bind(_Fp&& __f, _BoundArgs&&... __bound_args)
 {
     typedef __bind_r<_Rp, _Fp, _BoundArgs...> type;
-    return type(_VSTD::forward<_Fp>(__f), _VSTD::forward<_BoundArgs>(__bound_args)...);
+    return type(_CUDA_VSTD::forward<_Fp>(__f), _CUDA_VSTD::forward<_BoundArgs>(__bound_args)...);
 }
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___FUNCTIONAL_BIND_H
+#endif // _LIBCUDACXX___FUNCTIONAL_BIND_H

diff  --git a/libcxx/include/__functional/bind_back.h b/libcxx/include/__functional/bind_back.h
index f0a6e49875a3..5f0e58d2fc97 100644
--- a/libcxx/include/__functional/bind_back.h
+++ b/libcxx/include/__functional/bind_back.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FUNCTIONAL_BIND_BACK_H
-#define _LIBCPP___FUNCTIONAL_BIND_BACK_H
+#ifndef _LIBCUDACXX___FUNCTIONAL_BIND_BACK_H
+#define _LIBCUDACXX___FUNCTIONAL_BIND_BACK_H
 
 #include <__config>
 #include <__functional/invoke.h>
@@ -18,13 +18,13 @@
 #include <tuple>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 template <size_t _NBound, class = make_index_sequence<_NBound>>
 struct __bind_back_op;
@@ -32,10 +32,10 @@ struct __bind_back_op;
 template <size_t _NBound, size_t ..._Ip>
 struct __bind_back_op<_NBound, index_sequence<_Ip...>> {
     template <class _Fn, class _BoundArgs, class... _Args>
-    _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Fn&& __f, _BoundArgs&& __bound_args, _Args&&... __args) const
-        noexcept(noexcept(_VSTD::invoke(_VSTD::forward<_Fn>(__f), _VSTD::forward<_Args>(__args)..., _VSTD::get<_Ip>(_VSTD::forward<_BoundArgs>(__bound_args))...)))
-        -> decltype(      _VSTD::invoke(_VSTD::forward<_Fn>(__f), _VSTD::forward<_Args>(__args)..., _VSTD::get<_Ip>(_VSTD::forward<_BoundArgs>(__bound_args))...))
-        { return          _VSTD::invoke(_VSTD::forward<_Fn>(__f), _VSTD::forward<_Args>(__args)..., _VSTD::get<_Ip>(_VSTD::forward<_BoundArgs>(__bound_args))...); }
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Fn&& __f, _BoundArgs&& __bound_args, _Args&&... __args) const
+        noexcept(noexcept(_CUDA_VSTD::invoke(_CUDA_VSTD::forward<_Fn>(__f), _CUDA_VSTD::forward<_Args>(__args)..., _CUDA_VSTD::get<_Ip>(_CUDA_VSTD::forward<_BoundArgs>(__bound_args))...)))
+        -> decltype(      _CUDA_VSTD::invoke(_CUDA_VSTD::forward<_Fn>(__f), _CUDA_VSTD::forward<_Args>(__args)..., _CUDA_VSTD::get<_Ip>(_CUDA_VSTD::forward<_BoundArgs>(__bound_args))...))
+        { return          _CUDA_VSTD::invoke(_CUDA_VSTD::forward<_Fn>(__f), _CUDA_VSTD::forward<_Args>(__args)..., _CUDA_VSTD::get<_Ip>(_CUDA_VSTD::forward<_BoundArgs>(__bound_args))...); }
 };
 
 template <class _Fn, class _BoundArgs>
@@ -51,14 +51,14 @@ template <class _Fn, class ..._Args, class = enable_if_t<
         is_move_constructible<decay_t<_Args>>...
     >::value
 >>
-_LIBCPP_HIDE_FROM_ABI
+_LIBCUDACXX_HIDE_FROM_ABI
 constexpr auto __bind_back(_Fn&& __f, _Args&&... __args)
-    noexcept(noexcept(__bind_back_t<decay_t<_Fn>, tuple<decay_t<_Args>...>>(_VSTD::forward<_Fn>(__f), _VSTD::forward_as_tuple(_VSTD::forward<_Args>(__args)...))))
-    -> decltype(      __bind_back_t<decay_t<_Fn>, tuple<decay_t<_Args>...>>(_VSTD::forward<_Fn>(__f), _VSTD::forward_as_tuple(_VSTD::forward<_Args>(__args)...)))
-    { return          __bind_back_t<decay_t<_Fn>, tuple<decay_t<_Args>...>>(_VSTD::forward<_Fn>(__f), _VSTD::forward_as_tuple(_VSTD::forward<_Args>(__args)...)); }
+    noexcept(noexcept(__bind_back_t<decay_t<_Fn>, tuple<decay_t<_Args>...>>(_CUDA_VSTD::forward<_Fn>(__f), _CUDA_VSTD::forward_as_tuple(_CUDA_VSTD::forward<_Args>(__args)...))))
+    -> decltype(      __bind_back_t<decay_t<_Fn>, tuple<decay_t<_Args>...>>(_CUDA_VSTD::forward<_Fn>(__f), _CUDA_VSTD::forward_as_tuple(_CUDA_VSTD::forward<_Args>(__args)...)))
+    { return          __bind_back_t<decay_t<_Fn>, tuple<decay_t<_Args>...>>(_CUDA_VSTD::forward<_Fn>(__f), _CUDA_VSTD::forward_as_tuple(_CUDA_VSTD::forward<_Args>(__args)...)); }
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___FUNCTIONAL_BIND_BACK_H
+#endif // _LIBCUDACXX___FUNCTIONAL_BIND_BACK_H

diff  --git a/libcxx/include/__functional/bind_front.h b/libcxx/include/__functional/bind_front.h
index 22fb3a69dc75..48065079dfba 100644
--- a/libcxx/include/__functional/bind_front.h
+++ b/libcxx/include/__functional/bind_front.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FUNCTIONAL_BIND_FRONT_H
-#define _LIBCPP___FUNCTIONAL_BIND_FRONT_H
+#ifndef _LIBCUDACXX___FUNCTIONAL_BIND_FRONT_H
+#define _LIBCUDACXX___FUNCTIONAL_BIND_FRONT_H
 
 #include <__config>
 #include <__functional/invoke.h>
@@ -16,21 +16,21 @@
 #include <__utility/forward.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 struct __bind_front_op {
     template <class ..._Args>
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr auto operator()(_Args&& ...__args) const
-        noexcept(noexcept(_VSTD::invoke(_VSTD::forward<_Args>(__args)...)))
-        -> decltype(      _VSTD::invoke(_VSTD::forward<_Args>(__args)...))
-        { return          _VSTD::invoke(_VSTD::forward<_Args>(__args)...); }
+        noexcept(noexcept(_CUDA_VSTD::invoke(_CUDA_VSTD::forward<_Args>(__args)...)))
+        -> decltype(      _CUDA_VSTD::invoke(_CUDA_VSTD::forward<_Args>(__args)...))
+        { return          _CUDA_VSTD::invoke(_CUDA_VSTD::forward<_Args>(__args)...); }
 };
 
 template <class _Fn, class ..._BoundArgs>
@@ -46,13 +46,13 @@ template <class _Fn, class... _Args, class = enable_if_t<
         is_move_constructible<decay_t<_Args>>...
     >::value
 >>
-_LIBCPP_HIDE_FROM_ABI
+_LIBCUDACXX_HIDE_FROM_ABI
 constexpr auto bind_front(_Fn&& __f, _Args&&... __args) {
-    return __bind_front_t<decay_t<_Fn>, decay_t<_Args>...>(_VSTD::forward<_Fn>(__f), _VSTD::forward<_Args>(__args)...);
+    return __bind_front_t<decay_t<_Fn>, decay_t<_Args>...>(_CUDA_VSTD::forward<_Fn>(__f), _CUDA_VSTD::forward<_Args>(__args)...);
 }
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___FUNCTIONAL_BIND_FRONT_H
+#endif // _LIBCUDACXX___FUNCTIONAL_BIND_FRONT_H

diff  --git a/libcxx/include/__functional/binder1st.h b/libcxx/include/__functional/binder1st.h
index dea22c70e1f2..7fc0606bfcb8 100644
--- a/libcxx/include/__functional/binder1st.h
+++ b/libcxx/include/__functional/binder1st.h
@@ -7,47 +7,47 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FUNCTIONAL_BINDER1ST_H
-#define _LIBCPP___FUNCTIONAL_BINDER1ST_H
+#ifndef _LIBCUDACXX___FUNCTIONAL_BINDER1ST_H
+#define _LIBCUDACXX___FUNCTIONAL_BINDER1ST_H
 
 #include <__config>
 #include <__functional/unary_function.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
+#if _LIBCUDACXX_STD_VER <= 14 || defined(_LIBCUDACXX_ENABLE_CXX17_REMOVED_BINDERS)
 
 template <class __Operation>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 binder1st
+class _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_DEPRECATED_IN_CXX11 binder1st
     : public __unary_function<typename __Operation::second_argument_type, typename __Operation::result_type>
 {
 protected:
     __Operation                               op;
     typename __Operation::first_argument_type value;
 public:
-    _LIBCPP_INLINE_VISIBILITY binder1st(const __Operation& __x,
+    _LIBCUDACXX_INLINE_VISIBILITY binder1st(const __Operation& __x,
                                const typename __Operation::first_argument_type __y)
         : op(__x), value(__y) {}
-    _LIBCPP_INLINE_VISIBILITY typename __Operation::result_type operator()
+    _LIBCUDACXX_INLINE_VISIBILITY typename __Operation::result_type operator()
         (typename __Operation::second_argument_type& __x) const
             {return op(value, __x);}
-    _LIBCPP_INLINE_VISIBILITY typename __Operation::result_type operator()
+    _LIBCUDACXX_INLINE_VISIBILITY typename __Operation::result_type operator()
         (const typename __Operation::second_argument_type& __x) const
             {return op(value, __x);}
 };
 
 template <class __Operation, class _Tp>
-_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_DEPRECATED_IN_CXX11 inline _LIBCUDACXX_INLINE_VISIBILITY
 binder1st<__Operation>
 bind1st(const __Operation& __op, const _Tp& __x)
     {return binder1st<__Operation>(__op, __x);}
 
-#endif // _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
+#endif // _LIBCUDACXX_STD_VER <= 14 || defined(_LIBCUDACXX_ENABLE_CXX17_REMOVED_BINDERS)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___FUNCTIONAL_BINDER1ST_H
+#endif // _LIBCUDACXX___FUNCTIONAL_BINDER1ST_H

diff  --git a/libcxx/include/__functional/binder2nd.h b/libcxx/include/__functional/binder2nd.h
index c98a146b6a66..eacebf4b1001 100644
--- a/libcxx/include/__functional/binder2nd.h
+++ b/libcxx/include/__functional/binder2nd.h
@@ -7,47 +7,47 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FUNCTIONAL_BINDER2ND_H
-#define _LIBCPP___FUNCTIONAL_BINDER2ND_H
+#ifndef _LIBCUDACXX___FUNCTIONAL_BINDER2ND_H
+#define _LIBCUDACXX___FUNCTIONAL_BINDER2ND_H
 
 #include <__config>
 #include <__functional/unary_function.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
+#if _LIBCUDACXX_STD_VER <= 14 || defined(_LIBCUDACXX_ENABLE_CXX17_REMOVED_BINDERS)
 
 template <class __Operation>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 binder2nd
+class _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_DEPRECATED_IN_CXX11 binder2nd
     : public __unary_function<typename __Operation::first_argument_type, typename __Operation::result_type>
 {
 protected:
     __Operation                                op;
     typename __Operation::second_argument_type value;
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     binder2nd(const __Operation& __x, const typename __Operation::second_argument_type __y)
         : op(__x), value(__y) {}
-    _LIBCPP_INLINE_VISIBILITY typename __Operation::result_type operator()
+    _LIBCUDACXX_INLINE_VISIBILITY typename __Operation::result_type operator()
         (      typename __Operation::first_argument_type& __x) const
             {return op(__x, value);}
-    _LIBCPP_INLINE_VISIBILITY typename __Operation::result_type operator()
+    _LIBCUDACXX_INLINE_VISIBILITY typename __Operation::result_type operator()
         (const typename __Operation::first_argument_type& __x) const
             {return op(__x, value);}
 };
 
 template <class __Operation, class _Tp>
-_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_DEPRECATED_IN_CXX11 inline _LIBCUDACXX_INLINE_VISIBILITY
 binder2nd<__Operation>
 bind2nd(const __Operation& __op, const _Tp& __x)
     {return binder2nd<__Operation>(__op, __x);}
 
-#endif // _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
+#endif // _LIBCUDACXX_STD_VER <= 14 || defined(_LIBCUDACXX_ENABLE_CXX17_REMOVED_BINDERS)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___FUNCTIONAL_BINDER2ND_H
+#endif // _LIBCUDACXX___FUNCTIONAL_BINDER2ND_H

diff  --git a/libcxx/include/__functional/boyer_moore_searcher.h b/libcxx/include/__functional/boyer_moore_searcher.h
index 20e554408ff0..33eb5a9acb19 100644
--- a/libcxx/include/__functional/boyer_moore_searcher.h
+++ b/libcxx/include/__functional/boyer_moore_searcher.h
@@ -6,10 +6,10 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FUNCTIONAL_BOYER_MOORE_SEARCHER_H
-#define _LIBCPP___FUNCTIONAL_BOYER_MOORE_SEARCHER_H
+#ifndef _LIBCUDACXX___FUNCTIONAL_BOYER_MOORE_SEARCHER_H
+#define _LIBCUDACXX___FUNCTIONAL_BOYER_MOORE_SEARCHER_H
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
@@ -25,12 +25,12 @@
 #include <unordered_map>
 #include <vector>
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Key,
           class _Value,
@@ -53,16 +53,16 @@ class _BMSkipTable<_Key, _Value, _Hash, _BinaryPredicate, false> {
   unordered_map<_Key, _Value, _Hash, _BinaryPredicate> __table_;
 
 public:
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   explicit _BMSkipTable(size_t __sz, value_type __default_value, _Hash __hash, _BinaryPredicate __pred)
       : __default_value_(__default_value),
         __table_(__sz, __hash, __pred) {}
 
-  _LIBCPP_HIDE_FROM_ABI void insert(const key_type& __key, value_type __val) {
+  _LIBCUDACXX_HIDE_FROM_ABI void insert(const key_type& __key, value_type __val) {
     __table_[__key] = __val;
   }
 
-  _LIBCPP_HIDE_FROM_ABI value_type operator[](const key_type& __key) const {
+  _LIBCUDACXX_HIDE_FROM_ABI value_type operator[](const key_type& __key) const {
     auto __it = __table_.find(__key);
     return __it == __table_.end() ? __default_value_ : __it->second;
   }
@@ -83,15 +83,15 @@ class _BMSkipTable<_Key, _Value, _Hash, _BinaryPredicate, true> {
   static_assert(numeric_limits<unsigned_key_type>::max() < 256);
 
 public:
-  _LIBCPP_HIDE_FROM_ABI explicit _BMSkipTable(size_t, value_type __default_value, _Hash, _BinaryPredicate) {
+  _LIBCUDACXX_HIDE_FROM_ABI explicit _BMSkipTable(size_t, value_type __default_value, _Hash, _BinaryPredicate) {
     std::fill_n(__table_.data(), __table_.size(), __default_value);
   }
 
-  _LIBCPP_HIDE_FROM_ABI void insert(key_type __key, value_type __val) {
+  _LIBCUDACXX_HIDE_FROM_ABI void insert(key_type __key, value_type __val) {
     __table_[static_cast<unsigned_key_type>(__key)] = __val;
   }
 
-  _LIBCPP_HIDE_FROM_ABI value_type operator[](key_type __key) const {
+  _LIBCUDACXX_HIDE_FROM_ABI value_type operator[](key_type __key) const {
     return __table_[static_cast<unsigned_key_type>(__key)];
   }
 };
@@ -99,7 +99,7 @@ class _BMSkipTable<_Key, _Value, _Hash, _BinaryPredicate, true> {
 template <class _RandomAccessIterator1,
           class _Hash = hash<typename iterator_traits<_RandomAccessIterator1>::value_type>,
           class _BinaryPredicate = equal_to<>>
-class _LIBCPP_TEMPLATE_VIS boyer_moore_searcher {
+class _LIBCUDACXX_TEMPLATE_VIS boyer_moore_searcher {
 private:
   using 
diff erence_type = typename std::iterator_traits<_RandomAccessIterator1>::
diff erence_type;
   using value_type = typename std::iterator_traits<_RandomAccessIterator1>::value_type;
@@ -227,7 +227,7 @@ class _LIBCPP_TEMPLATE_VIS boyer_moore_searcher {
 template <class _RandomAccessIterator1,
           class _Hash = hash<typename iterator_traits<_RandomAccessIterator1>::value_type>,
           class _BinaryPredicate = equal_to<>>
-class _LIBCPP_TEMPLATE_VIS boyer_moore_horspool_searcher {
+class _LIBCUDACXX_TEMPLATE_VIS boyer_moore_horspool_searcher {
 private:
   using 
diff erence_type = typename iterator_traits<_RandomAccessIterator1>::
diff erence_type;
   using value_type = typename iterator_traits<_RandomAccessIterator1>::value_type;
@@ -304,10 +304,10 @@ class _LIBCPP_TEMPLATE_VIS boyer_moore_horspool_searcher {
   }
 };
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCUDACXX_STD_VER > 14
 
-#endif // _LIBCPP___FUNCTIONAL_BOYER_MOORE_SEARCHER_H
+#endif // _LIBCUDACXX___FUNCTIONAL_BOYER_MOORE_SEARCHER_H

diff  --git a/libcxx/include/__functional/compose.h b/libcxx/include/__functional/compose.h
index 25213f28b1f2..960bc7cde506 100644
--- a/libcxx/include/__functional/compose.h
+++ b/libcxx/include/__functional/compose.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FUNCTIONAL_COMPOSE_H
-#define _LIBCPP___FUNCTIONAL_COMPOSE_H
+#ifndef _LIBCUDACXX___FUNCTIONAL_COMPOSE_H
+#define _LIBCUDACXX___FUNCTIONAL_COMPOSE_H
 
 #include <__config>
 #include <__functional/invoke.h>
@@ -16,21 +16,21 @@
 #include <__utility/forward.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 struct __compose_op {
     template<class _Fn1, class _Fn2, class ..._Args>
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr auto operator()(_Fn1&& __f1, _Fn2&& __f2, _Args&&... __args) const
-        noexcept(noexcept(_VSTD::invoke(_VSTD::forward<_Fn1>(__f1), _VSTD::invoke(_VSTD::forward<_Fn2>(__f2), _VSTD::forward<_Args>(__args)...))))
-        -> decltype(      _VSTD::invoke(_VSTD::forward<_Fn1>(__f1), _VSTD::invoke(_VSTD::forward<_Fn2>(__f2), _VSTD::forward<_Args>(__args)...)))
-        { return          _VSTD::invoke(_VSTD::forward<_Fn1>(__f1), _VSTD::invoke(_VSTD::forward<_Fn2>(__f2), _VSTD::forward<_Args>(__args)...)); }
+        noexcept(noexcept(_CUDA_VSTD::invoke(_CUDA_VSTD::forward<_Fn1>(__f1), _CUDA_VSTD::invoke(_CUDA_VSTD::forward<_Fn2>(__f2), _CUDA_VSTD::forward<_Args>(__args)...))))
+        -> decltype(      _CUDA_VSTD::invoke(_CUDA_VSTD::forward<_Fn1>(__f1), _CUDA_VSTD::invoke(_CUDA_VSTD::forward<_Fn2>(__f2), _CUDA_VSTD::forward<_Args>(__args)...)))
+        { return          _CUDA_VSTD::invoke(_CUDA_VSTD::forward<_Fn1>(__f1), _CUDA_VSTD::invoke(_CUDA_VSTD::forward<_Fn2>(__f2), _CUDA_VSTD::forward<_Args>(__args)...)); }
 };
 
 template <class _Fn1, class _Fn2>
@@ -39,14 +39,14 @@ struct __compose_t : __perfect_forward<__compose_op, _Fn1, _Fn2> {
 };
 
 template <class _Fn1, class _Fn2>
-_LIBCPP_HIDE_FROM_ABI
+_LIBCUDACXX_HIDE_FROM_ABI
 constexpr auto __compose(_Fn1&& __f1, _Fn2&& __f2)
-    noexcept(noexcept(__compose_t<decay_t<_Fn1>, decay_t<_Fn2>>(_VSTD::forward<_Fn1>(__f1), _VSTD::forward<_Fn2>(__f2))))
-    -> decltype(      __compose_t<decay_t<_Fn1>, decay_t<_Fn2>>(_VSTD::forward<_Fn1>(__f1), _VSTD::forward<_Fn2>(__f2)))
-    { return          __compose_t<decay_t<_Fn1>, decay_t<_Fn2>>(_VSTD::forward<_Fn1>(__f1), _VSTD::forward<_Fn2>(__f2)); }
+    noexcept(noexcept(__compose_t<decay_t<_Fn1>, decay_t<_Fn2>>(_CUDA_VSTD::forward<_Fn1>(__f1), _CUDA_VSTD::forward<_Fn2>(__f2))))
+    -> decltype(      __compose_t<decay_t<_Fn1>, decay_t<_Fn2>>(_CUDA_VSTD::forward<_Fn1>(__f1), _CUDA_VSTD::forward<_Fn2>(__f2)))
+    { return          __compose_t<decay_t<_Fn1>, decay_t<_Fn2>>(_CUDA_VSTD::forward<_Fn1>(__f1), _CUDA_VSTD::forward<_Fn2>(__f2)); }
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___FUNCTIONAL_COMPOSE_H
+#endif // _LIBCUDACXX___FUNCTIONAL_COMPOSE_H

diff  --git a/libcxx/include/__functional/default_searcher.h b/libcxx/include/__functional/default_searcher.h
index 8e37082b6bed..505699a1806a 100644
--- a/libcxx/include/__functional/default_searcher.h
+++ b/libcxx/include/__functional/default_searcher.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FUNCTIONAL_DEFAULT_SEARCHER_H
-#define _LIBCPP___FUNCTIONAL_DEFAULT_SEARCHER_H
+#ifndef _LIBCUDACXX___FUNCTIONAL_DEFAULT_SEARCHER_H
+#define _LIBCUDACXX___FUNCTIONAL_DEFAULT_SEARCHER_H
 
 #include <__algorithm/search.h>
 #include <__config>
@@ -17,25 +17,25 @@
 #include <__iterator/iterator_traits.h>
 #include <__utility/pair.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 
 // default searcher
 template<class _ForwardIterator, class _BinaryPredicate = equal_to<>>
-class _LIBCPP_TEMPLATE_VIS default_searcher {
+class _LIBCUDACXX_TEMPLATE_VIS default_searcher {
 public:
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     default_searcher(_ForwardIterator __f, _ForwardIterator __l,
                        _BinaryPredicate __p = _BinaryPredicate())
         : __first_(__f), __last_(__l), __pred_(__p) {}
 
     template <typename _ForwardIterator2>
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     pair<_ForwardIterator2, _ForwardIterator2>
     operator () (_ForwardIterator2 __f, _ForwardIterator2 __l) const
     {
@@ -49,8 +49,8 @@ class _LIBCPP_TEMPLATE_VIS default_searcher {
     _BinaryPredicate __pred_;
 };
 
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCUDACXX_STD_VER > 14
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___FUNCTIONAL_DEFAULT_SEARCHER_H
+#endif // _LIBCUDACXX___FUNCTIONAL_DEFAULT_SEARCHER_H

diff  --git a/libcxx/include/__functional/function.h b/libcxx/include/__functional/function.h
index db3af6e24101..fa6d26639469 100644
--- a/libcxx/include/__functional/function.h
+++ b/libcxx/include/__functional/function.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FUNCTIONAL_FUNCTION_H
-#define _LIBCPP___FUNCTIONAL_FUNCTION_H
+#ifndef _LIBCUDACXX___FUNCTIONAL_FUNCTION_H
+#define _LIBCUDACXX___FUNCTIONAL_FUNCTION_H
 
 #include <__assert>
 #include <__config>
@@ -27,53 +27,53 @@
 #include <memory> // TODO: replace with <__memory/__builtin_new_allocator.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 // bad_function_call
 
-_LIBCPP_DIAGNOSTIC_PUSH
-_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wweak-vtables")
-class _LIBCPP_EXCEPTION_ABI bad_function_call
+_LIBCUDACXX_DIAGNOSTIC_PUSH
+_LIBCUDACXX_CLANG_DIAGNOSTIC_IGNORED("-Wweak-vtables")
+class _LIBCUDACXX_EXCEPTION_ABI bad_function_call
     : public exception
 {
 public:
 // Note that when a key function is not used, every translation unit that uses
 // bad_function_call will end up containing a weak definition of the vtable and
 // typeinfo.
-#ifdef _LIBCPP_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION
+#ifdef _LIBCUDACXX_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION
     virtual ~bad_function_call() _NOEXCEPT;
 #else
     virtual ~bad_function_call() _NOEXCEPT {}
 #endif
 
-#ifdef _LIBCPP_ABI_BAD_FUNCTION_CALL_GOOD_WHAT_MESSAGE
+#ifdef _LIBCUDACXX_ABI_BAD_FUNCTION_CALL_GOOD_WHAT_MESSAGE
     virtual const char* what() const _NOEXCEPT;
 #endif
 };
-_LIBCPP_DIAGNOSTIC_POP
+_LIBCUDACXX_DIAGNOSTIC_POP
 
-_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_NORETURN inline _LIBCUDACXX_INLINE_VISIBILITY
 void __throw_bad_function_call()
 {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     throw bad_function_call();
 #else
-    _VSTD::abort();
+    _CUDA_VSTD::abort();
 #endif
 }
 
-#if defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_DISABLE_DEPRECATION_WARNINGS) && __has_attribute(deprecated)
-#   define _LIBCPP_DEPRECATED_CXX03_FUNCTION \
+#if defined(_LIBCUDACXX_CXX03_LANG) && !defined(_LIBCUDACXX_DISABLE_DEPRECATION_WARNINGS) && __has_attribute(deprecated)
+#   define _LIBCUDACXX_DEPRECATED_CXX03_FUNCTION \
         __attribute__((deprecated("Using std::function in C++03 is not supported anymore. Please upgrade to C++11 or later, or use a 
diff erent type")))
 #else
-#   define _LIBCPP_DEPRECATED_CXX03_FUNCTION /* nothing */
+#   define _LIBCUDACXX_DEPRECATED_CXX03_FUNCTION /* nothing */
 #endif
 
-template<class _Fp> class _LIBCPP_DEPRECATED_CXX03_FUNCTION _LIBCPP_TEMPLATE_VIS function; // undefined
+template<class _Fp> class _LIBCUDACXX_DEPRECATED_CXX03_FUNCTION _LIBCUDACXX_TEMPLATE_VIS function; // undefined
 
 namespace __function
 {
@@ -101,30 +101,30 @@ struct __maybe_derive_from_binary_function<_Rp(_A1, _A2)>
 };
 
 template <class _Fp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 bool __not_null(_Fp const&) { return true; }
 
 template <class _Fp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 bool __not_null(_Fp* __ptr) { return __ptr; }
 
 template <class _Ret, class _Class>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 bool __not_null(_Ret _Class::*__ptr) { return __ptr; }
 
 template <class _Fp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 bool __not_null(function<_Fp> const& __f) { return !!__f; }
 
-#ifdef _LIBCPP_HAS_EXTENSION_BLOCKS
+#ifdef _LIBCUDACXX_HAS_EXTENSION_BLOCKS
 template <class _Rp, class ..._Args>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 bool __not_null(_Rp (^__p)(_Args...)) { return __p; }
 #endif
 
 } // namespace __function
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
 namespace __function {
 
@@ -140,53 +140,53 @@ class __alloc_func<_Fp, _Ap, _Rp(_ArgTypes...)>
     __compressed_pair<_Fp, _Ap> __f_;
 
   public:
-    typedef _LIBCPP_NODEBUG _Fp _Target;
-    typedef _LIBCPP_NODEBUG _Ap _Alloc;
+    typedef _LIBCUDACXX_NODEBUG _Fp _Target;
+    typedef _LIBCUDACXX_NODEBUG _Ap _Alloc;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const _Target& __target() const { return __f_.first(); }
 
     // WIN32 APIs may define __allocator, so use __get_allocator instead.
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const _Alloc& __get_allocator() const { return __f_.second(); }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __alloc_func(_Target&& __f)
-        : __f_(piecewise_construct, _VSTD::forward_as_tuple(_VSTD::move(__f)),
-               _VSTD::forward_as_tuple())
+        : __f_(piecewise_construct, _CUDA_VSTD::forward_as_tuple(_CUDA_VSTD::move(__f)),
+               _CUDA_VSTD::forward_as_tuple())
     {
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __alloc_func(const _Target& __f, const _Alloc& __a)
-        : __f_(piecewise_construct, _VSTD::forward_as_tuple(__f),
-               _VSTD::forward_as_tuple(__a))
+        : __f_(piecewise_construct, _CUDA_VSTD::forward_as_tuple(__f),
+               _CUDA_VSTD::forward_as_tuple(__a))
     {
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __alloc_func(const _Target& __f, _Alloc&& __a)
-        : __f_(piecewise_construct, _VSTD::forward_as_tuple(__f),
-               _VSTD::forward_as_tuple(_VSTD::move(__a)))
+        : __f_(piecewise_construct, _CUDA_VSTD::forward_as_tuple(__f),
+               _CUDA_VSTD::forward_as_tuple(_CUDA_VSTD::move(__a)))
     {
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __alloc_func(_Target&& __f, _Alloc&& __a)
-        : __f_(piecewise_construct, _VSTD::forward_as_tuple(_VSTD::move(__f)),
-               _VSTD::forward_as_tuple(_VSTD::move(__a)))
+        : __f_(piecewise_construct, _CUDA_VSTD::forward_as_tuple(_CUDA_VSTD::move(__f)),
+               _CUDA_VSTD::forward_as_tuple(_CUDA_VSTD::move(__a)))
     {
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Rp operator()(_ArgTypes&&... __arg)
     {
         typedef __invoke_void_return_wrapper<_Rp> _Invoker;
         return _Invoker::__call(__f_.first(),
-                                _VSTD::forward<_ArgTypes>(__arg)...);
+                                _CUDA_VSTD::forward<_ArgTypes>(__arg)...);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __alloc_func* __clone() const
     {
         typedef allocator_traits<_Alloc> __alloc_traits;
@@ -200,7 +200,7 @@ class __alloc_func<_Fp, _Ap, _Rp(_ArgTypes...)>
         return __hold.release();
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void destroy() _NOEXCEPT { __f_.~__compressed_pair<_Target, _Alloc>(); }
 
     static void __destroy_and_delete(__alloc_func* __f) {
@@ -218,24 +218,24 @@ class __default_alloc_func<_Fp, _Rp(_ArgTypes...)> {
   _Fp __f_;
 
 public:
-  typedef _LIBCPP_NODEBUG _Fp _Target;
+  typedef _LIBCUDACXX_NODEBUG _Fp _Target;
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   const _Target& __target() const { return __f_; }
 
-  _LIBCPP_INLINE_VISIBILITY
-  explicit __default_alloc_func(_Target&& __f) : __f_(_VSTD::move(__f)) {}
+  _LIBCUDACXX_INLINE_VISIBILITY
+  explicit __default_alloc_func(_Target&& __f) : __f_(_CUDA_VSTD::move(__f)) {}
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   explicit __default_alloc_func(const _Target& __f) : __f_(__f) {}
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   _Rp operator()(_ArgTypes&&... __arg) {
     typedef __invoke_void_return_wrapper<_Rp> _Invoker;
-    return _Invoker::__call(__f_, _VSTD::forward<_ArgTypes>(__arg)...);
+    return _Invoker::__call(__f_, _CUDA_VSTD::forward<_ArgTypes>(__arg)...);
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   __default_alloc_func* __clone() const {
       __builtin_new_allocator::__holder_t __hold =
         __builtin_new_allocator::__allocate_type<__default_alloc_func>(1);
@@ -245,7 +245,7 @@ class __default_alloc_func<_Fp, _Rp(_ArgTypes...)> {
     return __res;
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   void destroy() _NOEXCEPT { __f_.~_Target(); }
 
   static void __destroy_and_delete(__default_alloc_func* __f) {
@@ -256,7 +256,7 @@ class __default_alloc_func<_Fp, _Rp(_ArgTypes...)> {
 
 // __base provides an abstract interface for copyable functors.
 
-template<class _Fp> class _LIBCPP_TEMPLATE_VIS __base;
+template<class _Fp> class _LIBCUDACXX_TEMPLATE_VIS __base;
 
 template<class _Rp, class ..._ArgTypes>
 class __base<_Rp(_ArgTypes...)>
@@ -264,17 +264,17 @@ class __base<_Rp(_ArgTypes...)>
     __base(const __base&);
     __base& operator=(const __base&);
 public:
-    _LIBCPP_INLINE_VISIBILITY __base() {}
-    _LIBCPP_INLINE_VISIBILITY virtual ~__base() {}
+    _LIBCUDACXX_INLINE_VISIBILITY __base() {}
+    _LIBCUDACXX_INLINE_VISIBILITY virtual ~__base() {}
     virtual __base* __clone() const = 0;
     virtual void __clone(__base*) const = 0;
     virtual void destroy() _NOEXCEPT = 0;
     virtual void destroy_deallocate() _NOEXCEPT = 0;
     virtual _Rp operator()(_ArgTypes&& ...) = 0;
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCUDACXX_NO_RTTI
     virtual const void* target(const type_info&) const _NOEXCEPT = 0;
     virtual const std::type_info& target_type() const _NOEXCEPT = 0;
-#endif // _LIBCPP_NO_RTTI
+#endif // _LIBCUDACXX_NO_RTTI
 };
 
 // __func implements __base for a given functor type.
@@ -287,31 +287,31 @@ class __func<_Fp, _Alloc, _Rp(_ArgTypes...)>
 {
     __alloc_func<_Fp, _Alloc, _Rp(_ArgTypes...)> __f_;
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __func(_Fp&& __f)
-        : __f_(_VSTD::move(__f)) {}
+        : __f_(_CUDA_VSTD::move(__f)) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __func(const _Fp& __f, const _Alloc& __a)
         : __f_(__f, __a) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __func(const _Fp& __f, _Alloc&& __a)
-        : __f_(__f, _VSTD::move(__a)) {}
+        : __f_(__f, _CUDA_VSTD::move(__a)) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __func(_Fp&& __f, _Alloc&& __a)
-        : __f_(_VSTD::move(__f), _VSTD::move(__a)) {}
+        : __f_(_CUDA_VSTD::move(__f), _CUDA_VSTD::move(__a)) {}
 
     virtual __base<_Rp(_ArgTypes...)>* __clone() const;
     virtual void __clone(__base<_Rp(_ArgTypes...)>*) const;
     virtual void destroy() _NOEXCEPT;
     virtual void destroy_deallocate() _NOEXCEPT;
     virtual _Rp operator()(_ArgTypes&&... __arg);
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCUDACXX_NO_RTTI
     virtual const void* target(const type_info&) const _NOEXCEPT;
     virtual const std::type_info& target_type() const _NOEXCEPT;
-#endif // _LIBCPP_NO_RTTI
+#endif // _LIBCUDACXX_NO_RTTI
 };
 
 template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
@@ -356,17 +356,17 @@ template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
 _Rp
 __func<_Fp, _Alloc, _Rp(_ArgTypes...)>::operator()(_ArgTypes&& ... __arg)
 {
-    return __f_(_VSTD::forward<_ArgTypes>(__arg)...);
+    return __f_(_CUDA_VSTD::forward<_ArgTypes>(__arg)...);
 }
 
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCUDACXX_NO_RTTI
 
 template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
 const void*
 __func<_Fp, _Alloc, _Rp(_ArgTypes...)>::target(const type_info& __ti) const _NOEXCEPT
 {
     if (__ti == typeid(_Fp))
-        return _VSTD::addressof(__f_.__target());
+        return _CUDA_VSTD::addressof(__f_.__target());
     return nullptr;
 }
 
@@ -377,7 +377,7 @@ __func<_Fp, _Alloc, _Rp(_ArgTypes...)>::target_type() const _NOEXCEPT
     return typeid(_Fp);
 }
 
-#endif // _LIBCPP_NO_RTTI
+#endif // _LIBCUDACXX_NO_RTTI
 
 // __value_func creates a value-type from a __func.
 
@@ -390,17 +390,17 @@ template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)>
     typedef __base<_Rp(_ArgTypes...)> __func;
     __func* __f_;
 
-    _LIBCPP_NO_CFI static __func* __as_base(void* __p)
+    _LIBCUDACXX_NO_CFI static __func* __as_base(void* __p)
     {
         return reinterpret_cast<__func*>(__p);
     }
 
   public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __value_func() _NOEXCEPT : __f_(nullptr) {}
 
     template <class _Fp, class _Alloc>
-    _LIBCPP_INLINE_VISIBILITY __value_func(_Fp&& __f, const _Alloc& __a)
+    _LIBCUDACXX_INLINE_VISIBILITY __value_func(_Fp&& __f, const _Alloc& __a)
         : __f_(nullptr)
     {
         typedef allocator_traits<_Alloc> __alloc_traits;
@@ -416,13 +416,13 @@ template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)>
                 is_nothrow_copy_constructible<_FunAlloc>::value)
             {
                 __f_ =
-                    ::new ((void*)&__buf_) _Fun(_VSTD::move(__f), _Alloc(__af));
+                    ::new ((void*)&__buf_) _Fun(_CUDA_VSTD::move(__f), _Alloc(__af));
             }
             else
             {
                 typedef __allocator_destructor<_FunAlloc> _Dp;
                 unique_ptr<__func, _Dp> __hold(__af.allocate(1), _Dp(__af, 1));
-                ::new ((void*)__hold.get()) _Fun(_VSTD::move(__f), _Alloc(__a));
+                ::new ((void*)__hold.get()) _Fun(_CUDA_VSTD::move(__f), _Alloc(__a));
                 __f_ = __hold.release();
             }
         }
@@ -430,10 +430,10 @@ template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)>
 
     template <class _Fp,
         class = typename enable_if<!is_same<typename decay<_Fp>::type, __value_func>::value>::type>
-    _LIBCPP_INLINE_VISIBILITY explicit __value_func(_Fp&& __f)
-        : __value_func(_VSTD::forward<_Fp>(__f), allocator<_Fp>()) {}
+    _LIBCUDACXX_INLINE_VISIBILITY explicit __value_func(_Fp&& __f)
+        : __value_func(_CUDA_VSTD::forward<_Fp>(__f), allocator<_Fp>()) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __value_func(const __value_func& __f)
     {
         if (__f.__f_ == nullptr)
@@ -447,7 +447,7 @@ template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)>
             __f_ = __f.__f_->__clone();
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __value_func(__value_func&& __f) _NOEXCEPT
     {
         if (__f.__f_ == nullptr)
@@ -464,7 +464,7 @@ template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)>
         }
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     ~__value_func()
     {
         if ((void*)__f_ == &__buf_)
@@ -473,7 +473,7 @@ template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)>
             __f_->destroy_deallocate();
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __value_func& operator=(__value_func&& __f)
     {
         *this = nullptr;
@@ -492,7 +492,7 @@ template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)>
         return *this;
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __value_func& operator=(nullptr_t)
     {
         __func* __f = __f_;
@@ -504,15 +504,15 @@ template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)>
         return *this;
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Rp operator()(_ArgTypes&&... __args) const
     {
         if (__f_ == nullptr)
             __throw_bad_function_call();
-        return (*__f_)(_VSTD::forward<_ArgTypes>(__args)...);
+        return (*__f_)(_CUDA_VSTD::forward<_ArgTypes>(__args)...);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void swap(__value_func& __f) _NOEXCEPT
     {
         if (&__f == this)
@@ -547,14 +547,14 @@ template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)>
             __f_ = __as_base(&__buf_);
         }
         else
-            _VSTD::swap(__f_, __f.__f_);
+            _CUDA_VSTD::swap(__f_, __f.__f_);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit operator bool() const _NOEXCEPT { return __f_ != nullptr; }
 
-#ifndef _LIBCPP_NO_RTTI
-    _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_NO_RTTI
+    _LIBCUDACXX_INLINE_VISIBILITY
     const std::type_info& target_type() const _NOEXCEPT
     {
         if (__f_ == nullptr)
@@ -563,13 +563,13 @@ template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)>
     }
 
     template <typename _Tp>
-    _LIBCPP_INLINE_VISIBILITY const _Tp* target() const _NOEXCEPT
+    _LIBCUDACXX_INLINE_VISIBILITY const _Tp* target() const _NOEXCEPT
     {
         if (__f_ == nullptr)
             return nullptr;
         return (const _Tp*)__f_->target(typeid(_Tp));
     }
-#endif // _LIBCPP_NO_RTTI
+#endif // _LIBCUDACXX_NO_RTTI
 };
 
 // Storage for a functor object, to be used with __policy to manage copy and
@@ -585,7 +585,7 @@ template <typename _Fun>
 struct __use_small_storage
     : public integral_constant<
           bool, sizeof(_Fun) <= sizeof(__policy_storage) &&
-                    _LIBCPP_ALIGNOF(_Fun) <= _LIBCPP_ALIGNOF(__policy_storage) &&
+                    _LIBCUDACXX_ALIGNOF(_Fun) <= _LIBCUDACXX_ALIGNOF(__policy_storage) &&
                     is_trivially_copy_constructible<_Fun>::value &&
                     is_trivially_destructible<_Fun>::value> {};
 
@@ -606,17 +606,17 @@ struct __policy
     // Returns a pointer to a static policy object suitable for the functor
     // type.
     template <typename _Fun>
-    _LIBCPP_INLINE_VISIBILITY static const __policy* __create()
+    _LIBCUDACXX_INLINE_VISIBILITY static const __policy* __create()
     {
         return __choose_policy<_Fun>(__use_small_storage<_Fun>());
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     static const __policy* __create_empty()
     {
-        static const _LIBCPP_CONSTEXPR __policy __policy_ = {nullptr, nullptr,
+        static const _LIBCUDACXX_CONSTEXPR __policy __policy_ = {nullptr, nullptr,
                                                              true,
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCUDACXX_NO_RTTI
                                                              &typeid(void)
 #else
                                                              nullptr
@@ -638,11 +638,11 @@ struct __policy
     }
 
     template <typename _Fun>
-    _LIBCPP_INLINE_VISIBILITY static const __policy*
+    _LIBCUDACXX_INLINE_VISIBILITY static const __policy*
     __choose_policy(/* is_small = */ false_type) {
-      static const _LIBCPP_CONSTEXPR __policy __policy_ = {
+      static const _LIBCUDACXX_CONSTEXPR __policy __policy_ = {
           &__large_clone<_Fun>, &__large_destroy<_Fun>, false,
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCUDACXX_NO_RTTI
           &typeid(typename _Fun::_Target)
 #else
           nullptr
@@ -652,12 +652,12 @@ struct __policy
     }
 
     template <typename _Fun>
-    _LIBCPP_INLINE_VISIBILITY static const __policy*
+    _LIBCUDACXX_INLINE_VISIBILITY static const __policy*
         __choose_policy(/* is_small = */ true_type)
     {
-        static const _LIBCPP_CONSTEXPR __policy __policy_ = {
+        static const _LIBCUDACXX_CONSTEXPR __policy __policy_ = {
             nullptr, nullptr, false,
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCUDACXX_NO_RTTI
             &typeid(typename _Fun::_Target)
 #else
             nullptr
@@ -686,18 +686,18 @@ struct __policy_invoker<_Rp(_ArgTypes...)>
     __Call __call_;
 
     // Creates an invoker that throws bad_function_call.
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __policy_invoker() : __call_(&__call_empty) {}
 
     // Creates an invoker that calls the given instance of __func.
     template <typename _Fun>
-    _LIBCPP_INLINE_VISIBILITY static __policy_invoker __create()
+    _LIBCUDACXX_INLINE_VISIBILITY static __policy_invoker __create()
     {
         return __policy_invoker(&__call_impl<_Fun>);
     }
 
   private:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __policy_invoker(__Call __c) : __call_(__c) {}
 
     static _Rp __call_empty(const __policy_storage*,
@@ -713,7 +713,7 @@ struct __policy_invoker<_Rp(_ArgTypes...)>
         _Fun* __f = reinterpret_cast<_Fun*>(__use_small_storage<_Fun>::value
                                                 ? &__buf->__small
                                                 : __buf->__large);
-        return (*__f)(_VSTD::forward<_ArgTypes>(__args)...);
+        return (*__f)(_CUDA_VSTD::forward<_ArgTypes>(__args)...);
     }
 };
 
@@ -738,11 +738,11 @@ template <class _Rp, class... _ArgTypes> class __policy_func<_Rp(_ArgTypes...)>
     const __policy* __policy_;
 
   public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __policy_func() : __policy_(__policy::__create_empty()) {}
 
     template <class _Fp, class _Alloc>
-    _LIBCPP_INLINE_VISIBILITY __policy_func(_Fp&& __f, const _Alloc& __a)
+    _LIBCUDACXX_INLINE_VISIBILITY __policy_func(_Fp&& __f, const _Alloc& __a)
         : __policy_(__policy::__create_empty())
     {
         typedef __alloc_func<_Fp, _Alloc, _Rp(_ArgTypes...)> _Fun;
@@ -759,21 +759,21 @@ template <class _Rp, class... _ArgTypes> class __policy_func<_Rp(_ArgTypes...)>
             if (__use_small_storage<_Fun>())
             {
                 ::new ((void*)&__buf_.__small)
-                    _Fun(_VSTD::move(__f), _Alloc(__af));
+                    _Fun(_CUDA_VSTD::move(__f), _Alloc(__af));
             }
             else
             {
                 typedef __allocator_destructor<_FunAlloc> _Dp;
                 unique_ptr<_Fun, _Dp> __hold(__af.allocate(1), _Dp(__af, 1));
                 ::new ((void*)__hold.get())
-                    _Fun(_VSTD::move(__f), _Alloc(__af));
+                    _Fun(_CUDA_VSTD::move(__f), _Alloc(__af));
                 __buf_.__large = __hold.release();
             }
         }
     }
 
     template <class _Fp, class = typename enable_if<!is_same<typename decay<_Fp>::type, __policy_func>::value>::type>
-    _LIBCPP_INLINE_VISIBILITY explicit __policy_func(_Fp&& __f)
+    _LIBCUDACXX_INLINE_VISIBILITY explicit __policy_func(_Fp&& __f)
         : __policy_(__policy::__create_empty()) {
       typedef __default_alloc_func<_Fp, _Rp(_ArgTypes...)> _Fun;
 
@@ -781,17 +781,17 @@ template <class _Rp, class... _ArgTypes> class __policy_func<_Rp(_ArgTypes...)>
         __invoker_ = __invoker::template __create<_Fun>();
         __policy_ = __policy::__create<_Fun>();
         if (__use_small_storage<_Fun>()) {
-          ::new ((void*)&__buf_.__small) _Fun(_VSTD::move(__f));
+          ::new ((void*)&__buf_.__small) _Fun(_CUDA_VSTD::move(__f));
         } else {
           __builtin_new_allocator::__holder_t __hold =
               __builtin_new_allocator::__allocate_type<_Fun>(1);
-          __buf_.__large = ::new ((void*)__hold.get()) _Fun(_VSTD::move(__f));
+          __buf_.__large = ::new ((void*)__hold.get()) _Fun(_CUDA_VSTD::move(__f));
           (void)__hold.release();
         }
       }
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __policy_func(const __policy_func& __f)
         : __buf_(__f.__buf_), __invoker_(__f.__invoker_),
           __policy_(__f.__policy_)
@@ -800,7 +800,7 @@ template <class _Rp, class... _ArgTypes> class __policy_func<_Rp(_ArgTypes...)>
             __buf_.__large = __policy_->__clone(__f.__buf_.__large);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __policy_func(__policy_func&& __f)
         : __buf_(__f.__buf_), __invoker_(__f.__invoker_),
           __policy_(__f.__policy_)
@@ -812,14 +812,14 @@ template <class _Rp, class... _ArgTypes> class __policy_func<_Rp(_ArgTypes...)>
         }
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     ~__policy_func()
     {
         if (__policy_->__destroy)
             __policy_->__destroy(__buf_.__large);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __policy_func& operator=(__policy_func&& __f)
     {
         *this = nullptr;
@@ -831,7 +831,7 @@ template <class _Rp, class... _ArgTypes> class __policy_func<_Rp(_ArgTypes...)>
         return *this;
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __policy_func& operator=(nullptr_t)
     {
         const __policy* __p = __policy_;
@@ -842,36 +842,36 @@ template <class _Rp, class... _ArgTypes> class __policy_func<_Rp(_ArgTypes...)>
         return *this;
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Rp operator()(_ArgTypes&&... __args) const
     {
-        return __invoker_.__call_(_VSTD::addressof(__buf_),
-                                  _VSTD::forward<_ArgTypes>(__args)...);
+        return __invoker_.__call_(_CUDA_VSTD::addressof(__buf_),
+                                  _CUDA_VSTD::forward<_ArgTypes>(__args)...);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void swap(__policy_func& __f)
     {
-        _VSTD::swap(__invoker_, __f.__invoker_);
-        _VSTD::swap(__policy_, __f.__policy_);
-        _VSTD::swap(__buf_, __f.__buf_);
+        _CUDA_VSTD::swap(__invoker_, __f.__invoker_);
+        _CUDA_VSTD::swap(__policy_, __f.__policy_);
+        _CUDA_VSTD::swap(__buf_, __f.__buf_);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit operator bool() const _NOEXCEPT
     {
         return !__policy_->__is_null;
     }
 
-#ifndef _LIBCPP_NO_RTTI
-    _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_NO_RTTI
+    _LIBCUDACXX_INLINE_VISIBILITY
     const std::type_info& target_type() const _NOEXCEPT
     {
         return *__policy_->__type_info;
     }
 
     template <typename _Tp>
-    _LIBCPP_INLINE_VISIBILITY const _Tp* target() const _NOEXCEPT
+    _LIBCUDACXX_INLINE_VISIBILITY const _Tp* target() const _NOEXCEPT
     {
         if (__policy_->__is_null || typeid(_Tp) != *__policy_->__type_info)
             return nullptr;
@@ -880,10 +880,10 @@ template <class _Rp, class... _ArgTypes> class __policy_func<_Rp(_ArgTypes...)>
         else
             return reinterpret_cast<const _Tp*>(&__buf_.__small);
     }
-#endif // _LIBCPP_NO_RTTI
+#endif // _LIBCUDACXX_NO_RTTI
 };
 
-#if defined(_LIBCPP_HAS_BLOCKS_RUNTIME) && !defined(_LIBCPP_HAS_OBJC_ARC)
+#if defined(_LIBCUDACXX_HAS_BLOCKS_RUNTIME) && !defined(_LIBCUDACXX_HAS_OBJC_ARC)
 
 extern "C" void *_Block_copy(const void *);
 extern "C" void _Block_release(const void *);
@@ -896,20 +896,20 @@ class __func<_Rp1(^)(_ArgTypes1...), _Alloc, _Rp(_ArgTypes...)>
     __block_type __f_;
 
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __func(__block_type const& __f)
         : __f_(reinterpret_cast<__block_type>(__f ? _Block_copy(__f) : nullptr))
     { }
 
     // [TODO] add && to save on a retain
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __func(__block_type __f, const _Alloc& /* unused */)
         : __f_(reinterpret_cast<__block_type>(__f ? _Block_copy(__f) : nullptr))
     { }
 
     virtual __base<_Rp(_ArgTypes...)>* __clone() const {
-        _LIBCPP_ASSERT(false,
+        _LIBCUDACXX_ASSERT(false,
             "Block pointers are just pointers, so they should always fit into "
             "std::function's small buffer optimization. This function should "
             "never be invoked.");
@@ -927,17 +927,17 @@ class __func<_Rp1(^)(_ArgTypes1...), _Alloc, _Rp(_ArgTypes...)>
     }
 
     virtual void destroy_deallocate() _NOEXCEPT {
-        _LIBCPP_ASSERT(false,
+        _LIBCUDACXX_ASSERT(false,
             "Block pointers are just pointers, so they should always fit into "
             "std::function's small buffer optimization. This function should "
             "never be invoked.");
     }
 
     virtual _Rp operator()(_ArgTypes&& ... __arg) {
-        return _VSTD::__invoke(__f_, _VSTD::forward<_ArgTypes>(__arg)...);
+        return _CUDA_VSTD::__invoke(__f_, _CUDA_VSTD::forward<_ArgTypes>(__arg)...);
     }
 
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCUDACXX_NO_RTTI
     virtual const void* target(type_info const& __ti) const _NOEXCEPT {
         if (__ti == typeid(__func::__block_type))
             return &__f_;
@@ -947,19 +947,19 @@ class __func<_Rp1(^)(_ArgTypes1...), _Alloc, _Rp(_ArgTypes...)>
     virtual const std::type_info& target_type() const _NOEXCEPT {
         return typeid(__func::__block_type);
     }
-#endif // _LIBCPP_NO_RTTI
+#endif // _LIBCUDACXX_NO_RTTI
 };
 
-#endif // _LIBCPP_HAS_EXTENSION_BLOCKS && !_LIBCPP_HAS_OBJC_ARC
+#endif // _LIBCUDACXX_HAS_EXTENSION_BLOCKS && !_LIBCUDACXX_HAS_OBJC_ARC
 
 } // namespace __function
 
 template<class _Rp, class ..._ArgTypes>
-class _LIBCPP_TEMPLATE_VIS function<_Rp(_ArgTypes...)>
+class _LIBCUDACXX_TEMPLATE_VIS function<_Rp(_ArgTypes...)>
     : public __function::__maybe_derive_from_unary_function<_Rp(_ArgTypes...)>,
       public __function::__maybe_derive_from_binary_function<_Rp(_ArgTypes...)>
 {
-#ifndef _LIBCPP_ABI_OPTIMIZED_FUNCTION
+#ifndef _LIBCUDACXX_ABI_OPTIMIZED_FUNCTION
     typedef __function::__value_func<_Rp(_ArgTypes...)> __func;
 #else
     typedef __function::__policy_func<_Rp(_ArgTypes...)> __func;
@@ -991,21 +991,21 @@ class _LIBCPP_TEMPLATE_VIS function<_Rp(_ArgTypes...)>
     typedef _Rp result_type;
 
     // construct/copy/destroy:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     function() _NOEXCEPT { }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     function(nullptr_t) _NOEXCEPT {}
     function(const function&);
     function(function&&) _NOEXCEPT;
     template<class _Fp, class = _EnableIfLValueCallable<_Fp>>
     function(_Fp);
 
-#if _LIBCPP_STD_VER <= 14
+#if _LIBCUDACXX_STD_VER <= 14
     template<class _Alloc>
-      _LIBCPP_INLINE_VISIBILITY
+      _LIBCUDACXX_INLINE_VISIBILITY
       function(allocator_arg_t, const _Alloc&) _NOEXCEPT {}
     template<class _Alloc>
-      _LIBCPP_INLINE_VISIBILITY
+      _LIBCUDACXX_INLINE_VISIBILITY
       function(allocator_arg_t, const _Alloc&, nullptr_t) _NOEXCEPT {}
     template<class _Alloc>
       function(allocator_arg_t, const _Alloc&, const function&);
@@ -1026,15 +1026,15 @@ class _LIBCPP_TEMPLATE_VIS function<_Rp(_ArgTypes...)>
     // function modifiers:
     void swap(function&) _NOEXCEPT;
 
-#if _LIBCPP_STD_VER <= 14
+#if _LIBCUDACXX_STD_VER <= 14
     template<class _Fp, class _Alloc>
-      _LIBCPP_INLINE_VISIBILITY
+      _LIBCUDACXX_INLINE_VISIBILITY
       void assign(_Fp&& __f, const _Alloc& __a)
-        {function(allocator_arg, __a, _VSTD::forward<_Fp>(__f)).swap(*this);}
+        {function(allocator_arg, __a, _CUDA_VSTD::forward<_Fp>(__f)).swap(*this);}
 #endif
 
     // function capacity:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit operator bool() const _NOEXCEPT {
       return static_cast<bool>(__f_);
     }
@@ -1048,15 +1048,15 @@ class _LIBCPP_TEMPLATE_VIS function<_Rp(_ArgTypes...)>
     // function invocation:
     _Rp operator()(_ArgTypes...) const;
 
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCUDACXX_NO_RTTI
     // function target access:
     const std::type_info& target_type() const _NOEXCEPT;
     template <typename _Tp> _Tp* target() _NOEXCEPT;
     template <typename _Tp> const _Tp* target() const _NOEXCEPT;
-#endif // _LIBCPP_NO_RTTI
+#endif // _LIBCUDACXX_NO_RTTI
 };
 
-#if _LIBCPP_STD_VER >= 17
+#if _LIBCUDACXX_STD_VER >= 17
 template<class _Rp, class ..._Ap>
 function(_Rp(*)(_Ap...)) -> function<_Rp(_Ap...)>;
 
@@ -1101,12 +1101,12 @@ struct __strip_signature<_Rp (_Gp::*) (_Ap...) const volatile & noexcept> { usin
 
 template<class _Fp, class _Stripped = typename __strip_signature<decltype(&_Fp::operator())>::type>
 function(_Fp) -> function<_Stripped>;
-#endif // _LIBCPP_STD_VER >= 17
+#endif // _LIBCUDACXX_STD_VER >= 17
 
 template<class _Rp, class ..._ArgTypes>
 function<_Rp(_ArgTypes...)>::function(const function& __f) : __f_(__f.__f_) {}
 
-#if _LIBCPP_STD_VER <= 14
+#if _LIBCUDACXX_STD_VER <= 14
 template<class _Rp, class ..._ArgTypes>
 template <class _Alloc>
 function<_Rp(_ArgTypes...)>::function(allocator_arg_t, const _Alloc&,
@@ -1115,26 +1115,26 @@ function<_Rp(_ArgTypes...)>::function(allocator_arg_t, const _Alloc&,
 
 template <class _Rp, class... _ArgTypes>
 function<_Rp(_ArgTypes...)>::function(function&& __f) _NOEXCEPT
-    : __f_(_VSTD::move(__f.__f_)) {}
+    : __f_(_CUDA_VSTD::move(__f.__f_)) {}
 
-#if _LIBCPP_STD_VER <= 14
+#if _LIBCUDACXX_STD_VER <= 14
 template<class _Rp, class ..._ArgTypes>
 template <class _Alloc>
 function<_Rp(_ArgTypes...)>::function(allocator_arg_t, const _Alloc&,
                                       function&& __f)
-    : __f_(_VSTD::move(__f.__f_)) {}
+    : __f_(_CUDA_VSTD::move(__f.__f_)) {}
 #endif
 
 template <class _Rp, class... _ArgTypes>
 template <class _Fp, class>
-function<_Rp(_ArgTypes...)>::function(_Fp __f) : __f_(_VSTD::move(__f)) {}
+function<_Rp(_ArgTypes...)>::function(_Fp __f) : __f_(_CUDA_VSTD::move(__f)) {}
 
-#if _LIBCPP_STD_VER <= 14
+#if _LIBCUDACXX_STD_VER <= 14
 template <class _Rp, class... _ArgTypes>
 template <class _Fp, class _Alloc, class>
 function<_Rp(_ArgTypes...)>::function(allocator_arg_t, const _Alloc& __a,
                                       _Fp __f)
-    : __f_(_VSTD::move(__f), __a) {}
+    : __f_(_CUDA_VSTD::move(__f), __a) {}
 #endif
 
 template<class _Rp, class ..._ArgTypes>
@@ -1149,7 +1149,7 @@ template<class _Rp, class ..._ArgTypes>
 function<_Rp(_ArgTypes...)>&
 function<_Rp(_ArgTypes...)>::operator=(function&& __f) _NOEXCEPT
 {
-    __f_ = _VSTD::move(__f.__f_);
+    __f_ = _CUDA_VSTD::move(__f.__f_);
     return *this;
 }
 
@@ -1166,7 +1166,7 @@ template <class _Fp, class>
 function<_Rp(_ArgTypes...)>&
 function<_Rp(_ArgTypes...)>::operator=(_Fp&& __f)
 {
-    function(_VSTD::forward<_Fp>(__f)).swap(*this);
+    function(_CUDA_VSTD::forward<_Fp>(__f)).swap(*this);
     return *this;
 }
 
@@ -1184,10 +1184,10 @@ template<class _Rp, class ..._ArgTypes>
 _Rp
 function<_Rp(_ArgTypes...)>::operator()(_ArgTypes... __arg) const
 {
-    return __f_(_VSTD::forward<_ArgTypes>(__arg)...);
+    return __f_(_CUDA_VSTD::forward<_ArgTypes>(__arg)...);
 }
 
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCUDACXX_NO_RTTI
 
 template<class _Rp, class ..._ArgTypes>
 const std::type_info&
@@ -1212,35 +1212,35 @@ function<_Rp(_ArgTypes...)>::target() const _NOEXCEPT
     return __f_.template target<_Tp>();
 }
 
-#endif // _LIBCPP_NO_RTTI
+#endif // _LIBCUDACXX_NO_RTTI
 
 template <class _Rp, class... _ArgTypes>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator==(const function<_Rp(_ArgTypes...)>& __f, nullptr_t) _NOEXCEPT {return !__f;}
 
 template <class _Rp, class... _ArgTypes>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator==(nullptr_t, const function<_Rp(_ArgTypes...)>& __f) _NOEXCEPT {return !__f;}
 
 template <class _Rp, class... _ArgTypes>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator!=(const function<_Rp(_ArgTypes...)>& __f, nullptr_t) _NOEXCEPT {return (bool)__f;}
 
 template <class _Rp, class... _ArgTypes>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator!=(nullptr_t, const function<_Rp(_ArgTypes...)>& __f) _NOEXCEPT {return (bool)__f;}
 
 template <class _Rp, class... _ArgTypes>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 swap(function<_Rp(_ArgTypes...)>& __x, function<_Rp(_ArgTypes...)>& __y) _NOEXCEPT
 {return __x.swap(__y);}
 
-#elif defined(_LIBCPP_ENABLE_CXX03_FUNCTION)
+#elif defined(_LIBCUDACXX_ENABLE_CXX03_FUNCTION)
 
 namespace __function {
 
@@ -1259,10 +1259,10 @@ class __base<_Rp()>
     virtual void destroy() = 0;
     virtual void destroy_deallocate() = 0;
     virtual _Rp operator()() = 0;
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCUDACXX_NO_RTTI
     virtual const void* target(const type_info&) const = 0;
     virtual const std::type_info& target_type() const = 0;
-#endif // _LIBCPP_NO_RTTI
+#endif // _LIBCUDACXX_NO_RTTI
 };
 
 template<class _Rp, class _A0>
@@ -1278,10 +1278,10 @@ class __base<_Rp(_A0)>
     virtual void destroy() = 0;
     virtual void destroy_deallocate() = 0;
     virtual _Rp operator()(_A0) = 0;
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCUDACXX_NO_RTTI
     virtual const void* target(const type_info&) const = 0;
     virtual const std::type_info& target_type() const = 0;
-#endif // _LIBCPP_NO_RTTI
+#endif // _LIBCUDACXX_NO_RTTI
 };
 
 template<class _Rp, class _A0, class _A1>
@@ -1297,10 +1297,10 @@ class __base<_Rp(_A0, _A1)>
     virtual void destroy() = 0;
     virtual void destroy_deallocate() = 0;
     virtual _Rp operator()(_A0, _A1) = 0;
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCUDACXX_NO_RTTI
     virtual const void* target(const type_info&) const = 0;
     virtual const std::type_info& target_type() const = 0;
-#endif // _LIBCPP_NO_RTTI
+#endif // _LIBCUDACXX_NO_RTTI
 };
 
 template<class _Rp, class _A0, class _A1, class _A2>
@@ -1316,10 +1316,10 @@ class __base<_Rp(_A0, _A1, _A2)>
     virtual void destroy() = 0;
     virtual void destroy_deallocate() = 0;
     virtual _Rp operator()(_A0, _A1, _A2) = 0;
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCUDACXX_NO_RTTI
     virtual const void* target(const type_info&) const = 0;
     virtual const std::type_info& target_type() const = 0;
-#endif // _LIBCPP_NO_RTTI
+#endif // _LIBCUDACXX_NO_RTTI
 };
 
 template<class _FD, class _Alloc, class _FB> class __func;
@@ -1330,17 +1330,17 @@ class __func<_Fp, _Alloc, _Rp()>
 {
     __compressed_pair<_Fp, _Alloc> __f_;
 public:
-    explicit __func(_Fp __f) : __f_(_VSTD::move(__f), __default_init_tag()) {}
-    explicit __func(_Fp __f, _Alloc __a) : __f_(_VSTD::move(__f), _VSTD::move(__a)) {}
+    explicit __func(_Fp __f) : __f_(_CUDA_VSTD::move(__f), __default_init_tag()) {}
+    explicit __func(_Fp __f, _Alloc __a) : __f_(_CUDA_VSTD::move(__f), _CUDA_VSTD::move(__a)) {}
     virtual __base<_Rp()>* __clone() const;
     virtual void __clone(__base<_Rp()>*) const;
     virtual void destroy();
     virtual void destroy_deallocate();
     virtual _Rp operator()();
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCUDACXX_NO_RTTI
     virtual const void* target(const type_info&) const;
     virtual const std::type_info& target_type() const;
-#endif // _LIBCPP_NO_RTTI
+#endif // _LIBCUDACXX_NO_RTTI
 };
 
 template<class _Fp, class _Alloc, class _Rp>
@@ -1389,14 +1389,14 @@ __func<_Fp, _Alloc, _Rp()>::operator()()
     return _Invoker::__call(__f_.first());
 }
 
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCUDACXX_NO_RTTI
 
 template<class _Fp, class _Alloc, class _Rp>
 const void*
 __func<_Fp, _Alloc, _Rp()>::target(const type_info& __ti) const
 {
     if (__ti == typeid(_Fp))
-        return _VSTD::addressof(__f_.first());
+        return _CUDA_VSTD::addressof(__f_.first());
     return (const void*)0;
 }
 
@@ -1407,7 +1407,7 @@ __func<_Fp, _Alloc, _Rp()>::target_type() const
     return typeid(_Fp);
 }
 
-#endif // _LIBCPP_NO_RTTI
+#endif // _LIBCUDACXX_NO_RTTI
 
 template<class _Fp, class _Alloc, class _Rp, class _A0>
 class __func<_Fp, _Alloc, _Rp(_A0)>
@@ -1415,18 +1415,18 @@ class __func<_Fp, _Alloc, _Rp(_A0)>
 {
     __compressed_pair<_Fp, _Alloc> __f_;
 public:
-    _LIBCPP_INLINE_VISIBILITY explicit __func(_Fp __f) : __f_(_VSTD::move(__f), __default_init_tag()) {}
-    _LIBCPP_INLINE_VISIBILITY explicit __func(_Fp __f, _Alloc __a)
-        : __f_(_VSTD::move(__f), _VSTD::move(__a)) {}
+    _LIBCUDACXX_INLINE_VISIBILITY explicit __func(_Fp __f) : __f_(_CUDA_VSTD::move(__f), __default_init_tag()) {}
+    _LIBCUDACXX_INLINE_VISIBILITY explicit __func(_Fp __f, _Alloc __a)
+        : __f_(_CUDA_VSTD::move(__f), _CUDA_VSTD::move(__a)) {}
     virtual __base<_Rp(_A0)>* __clone() const;
     virtual void __clone(__base<_Rp(_A0)>*) const;
     virtual void destroy();
     virtual void destroy_deallocate();
     virtual _Rp operator()(_A0);
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCUDACXX_NO_RTTI
     virtual const void* target(const type_info&) const;
     virtual const std::type_info& target_type() const;
-#endif // _LIBCPP_NO_RTTI
+#endif // _LIBCUDACXX_NO_RTTI
 };
 
 template<class _Fp, class _Alloc, class _Rp, class _A0>
@@ -1475,7 +1475,7 @@ __func<_Fp, _Alloc, _Rp(_A0)>::operator()(_A0 __a0)
     return _Invoker::__call(__f_.first(), __a0);
 }
 
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCUDACXX_NO_RTTI
 
 template<class _Fp, class _Alloc, class _Rp, class _A0>
 const void*
@@ -1493,7 +1493,7 @@ __func<_Fp, _Alloc, _Rp(_A0)>::target_type() const
     return typeid(_Fp);
 }
 
-#endif // _LIBCPP_NO_RTTI
+#endif // _LIBCUDACXX_NO_RTTI
 
 template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1>
 class __func<_Fp, _Alloc, _Rp(_A0, _A1)>
@@ -1501,18 +1501,18 @@ class __func<_Fp, _Alloc, _Rp(_A0, _A1)>
 {
     __compressed_pair<_Fp, _Alloc> __f_;
 public:
-    _LIBCPP_INLINE_VISIBILITY explicit __func(_Fp __f) : __f_(_VSTD::move(__f), __default_init_tag()) {}
-    _LIBCPP_INLINE_VISIBILITY explicit __func(_Fp __f, _Alloc __a)
-        : __f_(_VSTD::move(__f), _VSTD::move(__a)) {}
+    _LIBCUDACXX_INLINE_VISIBILITY explicit __func(_Fp __f) : __f_(_CUDA_VSTD::move(__f), __default_init_tag()) {}
+    _LIBCUDACXX_INLINE_VISIBILITY explicit __func(_Fp __f, _Alloc __a)
+        : __f_(_CUDA_VSTD::move(__f), _CUDA_VSTD::move(__a)) {}
     virtual __base<_Rp(_A0, _A1)>* __clone() const;
     virtual void __clone(__base<_Rp(_A0, _A1)>*) const;
     virtual void destroy();
     virtual void destroy_deallocate();
     virtual _Rp operator()(_A0, _A1);
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCUDACXX_NO_RTTI
     virtual const void* target(const type_info&) const;
     virtual const std::type_info& target_type() const;
-#endif // _LIBCPP_NO_RTTI
+#endif // _LIBCUDACXX_NO_RTTI
 };
 
 template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1>
@@ -1561,7 +1561,7 @@ __func<_Fp, _Alloc, _Rp(_A0, _A1)>::operator()(_A0 __a0, _A1 __a1)
     return _Invoker::__call(__f_.first(), __a0, __a1);
 }
 
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCUDACXX_NO_RTTI
 
 template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1>
 const void*
@@ -1579,7 +1579,7 @@ __func<_Fp, _Alloc, _Rp(_A0, _A1)>::target_type() const
     return typeid(_Fp);
 }
 
-#endif // _LIBCPP_NO_RTTI
+#endif // _LIBCUDACXX_NO_RTTI
 
 template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1, class _A2>
 class __func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)>
@@ -1587,18 +1587,18 @@ class __func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)>
 {
     __compressed_pair<_Fp, _Alloc> __f_;
 public:
-    _LIBCPP_INLINE_VISIBILITY explicit __func(_Fp __f) : __f_(_VSTD::move(__f), __default_init_tag()) {}
-    _LIBCPP_INLINE_VISIBILITY explicit __func(_Fp __f, _Alloc __a)
-        : __f_(_VSTD::move(__f), _VSTD::move(__a)) {}
+    _LIBCUDACXX_INLINE_VISIBILITY explicit __func(_Fp __f) : __f_(_CUDA_VSTD::move(__f), __default_init_tag()) {}
+    _LIBCUDACXX_INLINE_VISIBILITY explicit __func(_Fp __f, _Alloc __a)
+        : __f_(_CUDA_VSTD::move(__f), _CUDA_VSTD::move(__a)) {}
     virtual __base<_Rp(_A0, _A1, _A2)>* __clone() const;
     virtual void __clone(__base<_Rp(_A0, _A1, _A2)>*) const;
     virtual void destroy();
     virtual void destroy_deallocate();
     virtual _Rp operator()(_A0, _A1, _A2);
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCUDACXX_NO_RTTI
     virtual const void* target(const type_info&) const;
     virtual const std::type_info& target_type() const;
-#endif // _LIBCPP_NO_RTTI
+#endif // _LIBCUDACXX_NO_RTTI
 };
 
 template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1, class _A2>
@@ -1647,7 +1647,7 @@ __func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)>::operator()(_A0 __a0, _A1 __a1, _A2 __a2
     return _Invoker::__call(__f_.first(), __a0, __a1, __a2);
 }
 
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCUDACXX_NO_RTTI
 
 template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1, class _A2>
 const void*
@@ -1665,12 +1665,12 @@ __func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)>::target_type() const
     return typeid(_Fp);
 }
 
-#endif // _LIBCPP_NO_RTTI
+#endif // _LIBCUDACXX_NO_RTTI
 
 } // namespace __function
 
 template<class _Rp>
-class _LIBCPP_TEMPLATE_VIS function<_Rp()>
+class _LIBCUDACXX_TEMPLATE_VIS function<_Rp()>
 {
     typedef __function::__base<_Rp()> __base;
     aligned_storage<3*sizeof(void*)>::type __buf_;
@@ -1680,18 +1680,18 @@ class _LIBCPP_TEMPLATE_VIS function<_Rp()>
     typedef _Rp result_type;
 
     // 20.7.16.2.1, construct/copy/destroy:
-    _LIBCPP_INLINE_VISIBILITY explicit function() : __f_(0) {}
-    _LIBCPP_INLINE_VISIBILITY function(nullptr_t) : __f_(0) {}
+    _LIBCUDACXX_INLINE_VISIBILITY explicit function() : __f_(0) {}
+    _LIBCUDACXX_INLINE_VISIBILITY function(nullptr_t) : __f_(0) {}
     function(const function&);
     template<class _Fp>
       function(_Fp,
                typename enable_if<!is_integral<_Fp>::value>::type* = 0);
 
     template<class _Alloc>
-      _LIBCPP_INLINE_VISIBILITY
+      _LIBCUDACXX_INLINE_VISIBILITY
       function(allocator_arg_t, const _Alloc&) : __f_(0) {}
     template<class _Alloc>
-      _LIBCPP_INLINE_VISIBILITY
+      _LIBCUDACXX_INLINE_VISIBILITY
       function(allocator_arg_t, const _Alloc&, nullptr_t) : __f_(0) {}
     template<class _Alloc>
       function(allocator_arg_t, const _Alloc&, const function&);
@@ -1714,12 +1714,12 @@ class _LIBCPP_TEMPLATE_VIS function<_Rp()>
     // 20.7.16.2.2, function modifiers:
     void swap(function&);
     template<class _Fp, class _Alloc>
-      _LIBCPP_INLINE_VISIBILITY
+      _LIBCUDACXX_INLINE_VISIBILITY
       void assign(_Fp __f, const _Alloc& __a)
         {function(allocator_arg, __a, __f).swap(*this);}
 
     // 20.7.16.2.3, function capacity:
-    _LIBCPP_INLINE_VISIBILITY explicit operator bool() const {return __f_;}
+    _LIBCUDACXX_INLINE_VISIBILITY explicit operator bool() const {return __f_;}
 
     template<class _R2>
       bool operator==(const function<_R2()>&) const = delete;
@@ -1729,12 +1729,12 @@ class _LIBCPP_TEMPLATE_VIS function<_Rp()>
     // 20.7.16.2.4, function invocation:
     _Rp operator()() const;
 
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCUDACXX_NO_RTTI
     // 20.7.16.2.5, function target access:
     const std::type_info& target_type() const;
     template <typename _Tp> _Tp* target();
     template <typename _Tp> const _Tp* target() const;
-#endif // _LIBCPP_NO_RTTI
+#endif // _LIBCUDACXX_NO_RTTI
 };
 
 template<class _Rp>
@@ -1852,7 +1852,7 @@ typename enable_if
 >::type
 function<_Rp()>::operator=(_Fp __f)
 {
-    function(_VSTD::move(__f)).swap(*this);
+    function(_CUDA_VSTD::move(__f)).swap(*this);
     return *this;
 }
 
@@ -1869,7 +1869,7 @@ template<class _Rp>
 void
 function<_Rp()>::swap(function& __f)
 {
-    if (_VSTD::addressof(__f) == this)
+    if (_CUDA_VSTD::addressof(__f) == this)
       return;
     if (__f_ == (__base*)&__buf_ && __f.__f_ == (__base*)&__f.__buf_)
     {
@@ -1901,7 +1901,7 @@ function<_Rp()>::swap(function& __f)
         __f_ = (__base*)&__buf_;
     }
     else
-        _VSTD::swap(__f_, __f.__f_);
+        _CUDA_VSTD::swap(__f_, __f.__f_);
 }
 
 template<class _Rp>
@@ -1913,7 +1913,7 @@ function<_Rp()>::operator()() const
     return (*__f_)();
 }
 
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCUDACXX_NO_RTTI
 
 template<class _Rp>
 const std::type_info&
@@ -1944,10 +1944,10 @@ function<_Rp()>::target() const
     return (const _Tp*)__f_->target(typeid(_Tp));
 }
 
-#endif // _LIBCPP_NO_RTTI
+#endif // _LIBCUDACXX_NO_RTTI
 
 template<class _Rp, class _A0>
-class _LIBCPP_TEMPLATE_VIS function<_Rp(_A0)>
+class _LIBCUDACXX_TEMPLATE_VIS function<_Rp(_A0)>
     : public unary_function<_A0, _Rp>
 {
     typedef __function::__base<_Rp(_A0)> __base;
@@ -1958,18 +1958,18 @@ class _LIBCPP_TEMPLATE_VIS function<_Rp(_A0)>
     typedef _Rp result_type;
 
     // 20.7.16.2.1, construct/copy/destroy:
-    _LIBCPP_INLINE_VISIBILITY explicit function() : __f_(0) {}
-    _LIBCPP_INLINE_VISIBILITY function(nullptr_t) : __f_(0) {}
+    _LIBCUDACXX_INLINE_VISIBILITY explicit function() : __f_(0) {}
+    _LIBCUDACXX_INLINE_VISIBILITY function(nullptr_t) : __f_(0) {}
     function(const function&);
     template<class _Fp>
       function(_Fp,
                typename enable_if<!is_integral<_Fp>::value>::type* = 0);
 
     template<class _Alloc>
-      _LIBCPP_INLINE_VISIBILITY
+      _LIBCUDACXX_INLINE_VISIBILITY
       function(allocator_arg_t, const _Alloc&) : __f_(0) {}
     template<class _Alloc>
-      _LIBCPP_INLINE_VISIBILITY
+      _LIBCUDACXX_INLINE_VISIBILITY
       function(allocator_arg_t, const _Alloc&, nullptr_t) : __f_(0) {}
     template<class _Alloc>
       function(allocator_arg_t, const _Alloc&, const function&);
@@ -1992,12 +1992,12 @@ class _LIBCPP_TEMPLATE_VIS function<_Rp(_A0)>
     // 20.7.16.2.2, function modifiers:
     void swap(function&);
     template<class _Fp, class _Alloc>
-      _LIBCPP_INLINE_VISIBILITY
+      _LIBCUDACXX_INLINE_VISIBILITY
       void assign(_Fp __f, const _Alloc& __a)
         {function(allocator_arg, __a, __f).swap(*this);}
 
     // 20.7.16.2.3, function capacity:
-    _LIBCPP_INLINE_VISIBILITY explicit operator bool() const {return __f_;}
+    _LIBCUDACXX_INLINE_VISIBILITY explicit operator bool() const {return __f_;}
 
     template<class _R2, class _B0>
       bool operator==(const function<_R2(_B0)>&) const = delete;
@@ -2007,12 +2007,12 @@ class _LIBCPP_TEMPLATE_VIS function<_Rp(_A0)>
     // 20.7.16.2.4, function invocation:
     _Rp operator()(_A0) const;
 
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCUDACXX_NO_RTTI
     // 20.7.16.2.5, function target access:
     const std::type_info& target_type() const;
     template <typename _Tp> _Tp* target();
     template <typename _Tp> const _Tp* target() const;
-#endif // _LIBCPP_NO_RTTI
+#endif // _LIBCUDACXX_NO_RTTI
 };
 
 template<class _Rp, class _A0>
@@ -2130,7 +2130,7 @@ typename enable_if
 >::type
 function<_Rp(_A0)>::operator=(_Fp __f)
 {
-    function(_VSTD::move(__f)).swap(*this);
+    function(_CUDA_VSTD::move(__f)).swap(*this);
     return *this;
 }
 
@@ -2147,7 +2147,7 @@ template<class _Rp, class _A0>
 void
 function<_Rp(_A0)>::swap(function& __f)
 {
-    if (_VSTD::addressof(__f) == this)
+    if (_CUDA_VSTD::addressof(__f) == this)
       return;
     if (__f_ == (__base*)&__buf_ && __f.__f_ == (__base*)&__f.__buf_)
     {
@@ -2179,7 +2179,7 @@ function<_Rp(_A0)>::swap(function& __f)
         __f_ = (__base*)&__buf_;
     }
     else
-        _VSTD::swap(__f_, __f.__f_);
+        _CUDA_VSTD::swap(__f_, __f.__f_);
 }
 
 template<class _Rp, class _A0>
@@ -2191,7 +2191,7 @@ function<_Rp(_A0)>::operator()(_A0 __a0) const
     return (*__f_)(__a0);
 }
 
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCUDACXX_NO_RTTI
 
 template<class _Rp, class _A0>
 const std::type_info&
@@ -2222,10 +2222,10 @@ function<_Rp(_A0)>::target() const
     return (const _Tp*)__f_->target(typeid(_Tp));
 }
 
-#endif // _LIBCPP_NO_RTTI
+#endif // _LIBCUDACXX_NO_RTTI
 
 template<class _Rp, class _A0, class _A1>
-class _LIBCPP_TEMPLATE_VIS function<_Rp(_A0, _A1)>
+class _LIBCUDACXX_TEMPLATE_VIS function<_Rp(_A0, _A1)>
     : public binary_function<_A0, _A1, _Rp>
 {
     typedef __function::__base<_Rp(_A0, _A1)> __base;
@@ -2236,18 +2236,18 @@ class _LIBCPP_TEMPLATE_VIS function<_Rp(_A0, _A1)>
     typedef _Rp result_type;
 
     // 20.7.16.2.1, construct/copy/destroy:
-    _LIBCPP_INLINE_VISIBILITY explicit function() : __f_(0) {}
-    _LIBCPP_INLINE_VISIBILITY function(nullptr_t) : __f_(0) {}
+    _LIBCUDACXX_INLINE_VISIBILITY explicit function() : __f_(0) {}
+    _LIBCUDACXX_INLINE_VISIBILITY function(nullptr_t) : __f_(0) {}
     function(const function&);
     template<class _Fp>
       function(_Fp,
                typename enable_if<!is_integral<_Fp>::value>::type* = 0);
 
     template<class _Alloc>
-      _LIBCPP_INLINE_VISIBILITY
+      _LIBCUDACXX_INLINE_VISIBILITY
       function(allocator_arg_t, const _Alloc&) : __f_(0) {}
     template<class _Alloc>
-      _LIBCPP_INLINE_VISIBILITY
+      _LIBCUDACXX_INLINE_VISIBILITY
       function(allocator_arg_t, const _Alloc&, nullptr_t) : __f_(0) {}
     template<class _Alloc>
       function(allocator_arg_t, const _Alloc&, const function&);
@@ -2270,12 +2270,12 @@ class _LIBCPP_TEMPLATE_VIS function<_Rp(_A0, _A1)>
     // 20.7.16.2.2, function modifiers:
     void swap(function&);
     template<class _Fp, class _Alloc>
-      _LIBCPP_INLINE_VISIBILITY
+      _LIBCUDACXX_INLINE_VISIBILITY
       void assign(_Fp __f, const _Alloc& __a)
         {function(allocator_arg, __a, __f).swap(*this);}
 
     // 20.7.16.2.3, function capacity:
-    _LIBCPP_INLINE_VISIBILITY explicit operator bool() const {return __f_;}
+    _LIBCUDACXX_INLINE_VISIBILITY explicit operator bool() const {return __f_;}
 
     template<class _R2, class _B0, class _B1>
       bool operator==(const function<_R2(_B0, _B1)>&) const = delete;
@@ -2285,12 +2285,12 @@ class _LIBCPP_TEMPLATE_VIS function<_Rp(_A0, _A1)>
     // 20.7.16.2.4, function invocation:
     _Rp operator()(_A0, _A1) const;
 
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCUDACXX_NO_RTTI
     // 20.7.16.2.5, function target access:
     const std::type_info& target_type() const;
     template <typename _Tp> _Tp* target();
     template <typename _Tp> const _Tp* target() const;
-#endif // _LIBCPP_NO_RTTI
+#endif // _LIBCUDACXX_NO_RTTI
 };
 
 template<class _Rp, class _A0, class _A1>
@@ -2408,7 +2408,7 @@ typename enable_if
 >::type
 function<_Rp(_A0, _A1)>::operator=(_Fp __f)
 {
-    function(_VSTD::move(__f)).swap(*this);
+    function(_CUDA_VSTD::move(__f)).swap(*this);
     return *this;
 }
 
@@ -2425,7 +2425,7 @@ template<class _Rp, class _A0, class _A1>
 void
 function<_Rp(_A0, _A1)>::swap(function& __f)
 {
-    if (_VSTD::addressof(__f) == this)
+    if (_CUDA_VSTD::addressof(__f) == this)
       return;
     if (__f_ == (__base*)&__buf_ && __f.__f_ == (__base*)&__f.__buf_)
     {
@@ -2457,7 +2457,7 @@ function<_Rp(_A0, _A1)>::swap(function& __f)
         __f_ = (__base*)&__buf_;
     }
     else
-        _VSTD::swap(__f_, __f.__f_);
+        _CUDA_VSTD::swap(__f_, __f.__f_);
 }
 
 template<class _Rp, class _A0, class _A1>
@@ -2469,7 +2469,7 @@ function<_Rp(_A0, _A1)>::operator()(_A0 __a0, _A1 __a1) const
     return (*__f_)(__a0, __a1);
 }
 
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCUDACXX_NO_RTTI
 
 template<class _Rp, class _A0, class _A1>
 const std::type_info&
@@ -2500,10 +2500,10 @@ function<_Rp(_A0, _A1)>::target() const
     return (const _Tp*)__f_->target(typeid(_Tp));
 }
 
-#endif // _LIBCPP_NO_RTTI
+#endif // _LIBCUDACXX_NO_RTTI
 
 template<class _Rp, class _A0, class _A1, class _A2>
-class _LIBCPP_TEMPLATE_VIS function<_Rp(_A0, _A1, _A2)>
+class _LIBCUDACXX_TEMPLATE_VIS function<_Rp(_A0, _A1, _A2)>
 {
     typedef __function::__base<_Rp(_A0, _A1, _A2)> __base;
     aligned_storage<3*sizeof(void*)>::type __buf_;
@@ -2513,18 +2513,18 @@ class _LIBCPP_TEMPLATE_VIS function<_Rp(_A0, _A1, _A2)>
     typedef _Rp result_type;
 
     // 20.7.16.2.1, construct/copy/destroy:
-    _LIBCPP_INLINE_VISIBILITY explicit function() : __f_(0) {}
-    _LIBCPP_INLINE_VISIBILITY function(nullptr_t) : __f_(0) {}
+    _LIBCUDACXX_INLINE_VISIBILITY explicit function() : __f_(0) {}
+    _LIBCUDACXX_INLINE_VISIBILITY function(nullptr_t) : __f_(0) {}
     function(const function&);
     template<class _Fp>
       function(_Fp,
                typename enable_if<!is_integral<_Fp>::value>::type* = 0);
 
     template<class _Alloc>
-      _LIBCPP_INLINE_VISIBILITY
+      _LIBCUDACXX_INLINE_VISIBILITY
       function(allocator_arg_t, const _Alloc&) : __f_(0) {}
     template<class _Alloc>
-      _LIBCPP_INLINE_VISIBILITY
+      _LIBCUDACXX_INLINE_VISIBILITY
       function(allocator_arg_t, const _Alloc&, nullptr_t) : __f_(0) {}
     template<class _Alloc>
       function(allocator_arg_t, const _Alloc&, const function&);
@@ -2547,12 +2547,12 @@ class _LIBCPP_TEMPLATE_VIS function<_Rp(_A0, _A1, _A2)>
     // 20.7.16.2.2, function modifiers:
     void swap(function&);
     template<class _Fp, class _Alloc>
-      _LIBCPP_INLINE_VISIBILITY
+      _LIBCUDACXX_INLINE_VISIBILITY
       void assign(_Fp __f, const _Alloc& __a)
         {function(allocator_arg, __a, __f).swap(*this);}
 
     // 20.7.16.2.3, function capacity:
-    _LIBCPP_INLINE_VISIBILITY explicit operator bool() const {return __f_;}
+    _LIBCUDACXX_INLINE_VISIBILITY explicit operator bool() const {return __f_;}
 
     template<class _R2, class _B0, class _B1, class _B2>
       bool operator==(const function<_R2(_B0, _B1, _B2)>&) const = delete;
@@ -2562,12 +2562,12 @@ class _LIBCPP_TEMPLATE_VIS function<_Rp(_A0, _A1, _A2)>
     // 20.7.16.2.4, function invocation:
     _Rp operator()(_A0, _A1, _A2) const;
 
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCUDACXX_NO_RTTI
     // 20.7.16.2.5, function target access:
     const std::type_info& target_type() const;
     template <typename _Tp> _Tp* target();
     template <typename _Tp> const _Tp* target() const;
-#endif // _LIBCPP_NO_RTTI
+#endif // _LIBCUDACXX_NO_RTTI
 };
 
 template<class _Rp, class _A0, class _A1, class _A2>
@@ -2686,7 +2686,7 @@ typename enable_if
 >::type
 function<_Rp(_A0, _A1, _A2)>::operator=(_Fp __f)
 {
-    function(_VSTD::move(__f)).swap(*this);
+    function(_CUDA_VSTD::move(__f)).swap(*this);
     return *this;
 }
 
@@ -2703,7 +2703,7 @@ template<class _Rp, class _A0, class _A1, class _A2>
 void
 function<_Rp(_A0, _A1, _A2)>::swap(function& __f)
 {
-    if (_VSTD::addressof(__f) == this)
+    if (_CUDA_VSTD::addressof(__f) == this)
       return;
     if (__f_ == (__base*)&__buf_ && __f.__f_ == (__base*)&__f.__buf_)
     {
@@ -2735,7 +2735,7 @@ function<_Rp(_A0, _A1, _A2)>::swap(function& __f)
         __f_ = (__base*)&__buf_;
     }
     else
-        _VSTD::swap(__f_, __f.__f_);
+        _CUDA_VSTD::swap(__f_, __f.__f_);
 }
 
 template<class _Rp, class _A0, class _A1, class _A2>
@@ -2747,7 +2747,7 @@ function<_Rp(_A0, _A1, _A2)>::operator()(_A0 __a0, _A1 __a1, _A2 __a2) const
     return (*__f_)(__a0, __a1, __a2);
 }
 
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCUDACXX_NO_RTTI
 
 template<class _Rp, class _A0, class _A1, class _A2>
 const std::type_info&
@@ -2778,36 +2778,36 @@ function<_Rp(_A0, _A1, _A2)>::target() const
     return (const _Tp*)__f_->target(typeid(_Tp));
 }
 
-#endif // _LIBCPP_NO_RTTI
+#endif // _LIBCUDACXX_NO_RTTI
 
 template <class _Fp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator==(const function<_Fp>& __f, nullptr_t) {return !__f;}
 
 template <class _Fp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator==(nullptr_t, const function<_Fp>& __f) {return !__f;}
 
 template <class _Fp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator!=(const function<_Fp>& __f, nullptr_t) {return (bool)__f;}
 
 template <class _Fp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator!=(nullptr_t, const function<_Fp>& __f) {return (bool)__f;}
 
 template <class _Fp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 swap(function<_Fp>& __x, function<_Fp>& __y)
 {return __x.swap(__y);}
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___FUNCTIONAL_FUNCTION_H
+#endif // _LIBCUDACXX___FUNCTIONAL_FUNCTION_H

diff  --git a/libcxx/include/__functional/hash.h b/libcxx/include/__functional/hash.h
index 8a11931288cf..469ddc293113 100644
--- a/libcxx/include/__functional/hash.h
+++ b/libcxx/include/__functional/hash.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FUNCTIONAL_HASH_H
-#define _LIBCPP___FUNCTIONAL_HASH_H
+#ifndef _LIBCUDACXX___FUNCTIONAL_HASH_H
+#define _LIBCUDACXX___FUNCTIONAL_HASH_H
 
 #include <__config>
 #include <__functional/unary_function.h>
@@ -22,19 +22,19 @@
 #include <limits>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Size>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 _Size
 __loadword(const void* __p)
 {
     _Size __r;
-    _VSTD::memcpy(&__r, __p, sizeof(__r));
+    _CUDA_VSTD::memcpy(&__r, __p, sizeof(__r));
     return __r;
 }
 
@@ -48,7 +48,7 @@ template <class _Size>
 struct __murmur2_or_cityhash<_Size, 32>
 {
     inline _Size operator()(const void* __key, _Size __len)
-         _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK;
+         _LIBCUDACXX_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK;
 };
 
 // murmur2
@@ -73,10 +73,10 @@ __murmur2_or_cityhash<_Size, 32>::operator()(const void* __key, _Size __len)
     {
     case 3:
         __h ^= static_cast<_Size>(__data[2] << 16);
-        _LIBCPP_FALLTHROUGH();
+        _LIBCUDACXX_FALLTHROUGH();
     case 2:
         __h ^= static_cast<_Size>(__data[1] << 8);
-        _LIBCPP_FALLTHROUGH();
+        _LIBCUDACXX_FALLTHROUGH();
     case 1:
         __h ^= __data[0];
         __h *= __m;
@@ -90,7 +90,7 @@ __murmur2_or_cityhash<_Size, 32>::operator()(const void* __key, _Size __len)
 template <class _Size>
 struct __murmur2_or_cityhash<_Size, 64>
 {
-    inline _Size operator()(const void* __key, _Size __len)  _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK;
+    inline _Size operator()(const void* __key, _Size __len)  _LIBCUDACXX_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK;
 
  private:
   // Some primes between 2^63 and 2^64.
@@ -112,7 +112,7 @@ struct __murmur2_or_cityhash<_Size, 64>
   }
 
   static _Size __hash_len_16(_Size __u, _Size __v)
-     _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
+     _LIBCUDACXX_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
   {
     const _Size __mul = 0x9ddfea08eb382d69ULL;
     _Size __a = (__u ^ __v) * __mul;
@@ -124,7 +124,7 @@ struct __murmur2_or_cityhash<_Size, 64>
   }
 
   static _Size __hash_len_0_to_16(const char* __s, _Size __len)
-     _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
+     _LIBCUDACXX_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
   {
     if (__len > 8) {
       const _Size __a = __loadword<_Size>(__s);
@@ -149,7 +149,7 @@ struct __murmur2_or_cityhash<_Size, 64>
   }
 
   static _Size __hash_len_17_to_32(const char *__s, _Size __len)
-     _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
+     _LIBCUDACXX_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
   {
     const _Size __a = __loadword<_Size>(__s) * __k1;
     const _Size __b = __loadword<_Size>(__s + 8);
@@ -163,7 +163,7 @@ struct __murmur2_or_cityhash<_Size, 64>
   // Callers do best to use "random-looking" values for a and b.
   static pair<_Size, _Size> __weak_hash_len_32_with_seeds(
       _Size __w, _Size __x, _Size __y, _Size __z, _Size __a, _Size __b)
-        _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
+        _LIBCUDACXX_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
   {
     __a += __w;
     __b = __rotate(__b + __a + __z, 21);
@@ -177,7 +177,7 @@ struct __murmur2_or_cityhash<_Size, 64>
   // Return a 16-byte hash for s[0] ... s[31], a, and b.  Quick and dirty.
   static pair<_Size, _Size> __weak_hash_len_32_with_seeds(
       const char* __s, _Size __a, _Size __b)
-    _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
+    _LIBCUDACXX_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
   {
     return __weak_hash_len_32_with_seeds(__loadword<_Size>(__s),
                                          __loadword<_Size>(__s + 8),
@@ -189,7 +189,7 @@ struct __murmur2_or_cityhash<_Size, 64>
 
   // Return an 8-byte hash for 33 to 64 bytes.
   static _Size __hash_len_33_to_64(const char *__s, size_t __len)
-    _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
+    _LIBCUDACXX_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
   {
     _Size __z = __loadword<_Size>(__s + 24);
     _Size __a = __loadword<_Size>(__s) +
@@ -253,7 +253,7 @@ __murmur2_or_cityhash<_Size, 64>::operator()(const void* __key, _Size __len)
     __v = __weak_hash_len_32_with_seeds(__s, __v.second * __k1, __x + __w.first);
     __w = __weak_hash_len_32_with_seeds(__s + 32, __z + __w.second,
                                         __y + __loadword<_Size>(__s + 16));
-    _VSTD::swap(__z, __x);
+    _CUDA_VSTD::swap(__z, __x);
     __s += 64;
     __len -= 64;
   } while (__len != 0);
@@ -269,7 +269,7 @@ template <class _Tp>
 struct __scalar_hash<_Tp, 0>
     : public __unary_function<_Tp, size_t>
 {
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t operator()(_Tp __v) const _NOEXCEPT
     {
         union
@@ -287,7 +287,7 @@ template <class _Tp>
 struct __scalar_hash<_Tp, 1>
     : public __unary_function<_Tp, size_t>
 {
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t operator()(_Tp __v) const _NOEXCEPT
     {
         union
@@ -304,7 +304,7 @@ template <class _Tp>
 struct __scalar_hash<_Tp, 2>
     : public __unary_function<_Tp, size_t>
 {
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t operator()(_Tp __v) const _NOEXCEPT
     {
         union
@@ -325,7 +325,7 @@ template <class _Tp>
 struct __scalar_hash<_Tp, 3>
     : public __unary_function<_Tp, size_t>
 {
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t operator()(_Tp __v) const _NOEXCEPT
     {
         union
@@ -347,7 +347,7 @@ template <class _Tp>
 struct __scalar_hash<_Tp, 4>
     : public __unary_function<_Tp, size_t>
 {
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t operator()(_Tp __v) const _NOEXCEPT
     {
         union
@@ -371,7 +371,7 @@ struct _PairT {
   size_t second;
 };
 
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 inline size_t __hash_combine(size_t __lhs, size_t __rhs) _NOEXCEPT {
     typedef __scalar_hash<_PairT> _HashT;
     const _PairT __p = {__lhs, __rhs};
@@ -379,10 +379,10 @@ inline size_t __hash_combine(size_t __lhs, size_t __rhs) _NOEXCEPT {
 }
 
 template<class _Tp>
-struct _LIBCPP_TEMPLATE_VIS hash<_Tp*>
+struct _LIBCUDACXX_TEMPLATE_VIS hash<_Tp*>
     : public __unary_function<_Tp*, size_t>
 {
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t operator()(_Tp* __v) const _NOEXCEPT
     {
         union
@@ -396,143 +396,143 @@ struct _LIBCPP_TEMPLATE_VIS hash<_Tp*>
 };
 
 template <>
-struct _LIBCPP_TEMPLATE_VIS hash<bool>
+struct _LIBCUDACXX_TEMPLATE_VIS hash<bool>
     : public __unary_function<bool, size_t>
 {
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t operator()(bool __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
 };
 
 template <>
-struct _LIBCPP_TEMPLATE_VIS hash<char>
+struct _LIBCUDACXX_TEMPLATE_VIS hash<char>
     : public __unary_function<char, size_t>
 {
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t operator()(char __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
 };
 
 template <>
-struct _LIBCPP_TEMPLATE_VIS hash<signed char>
+struct _LIBCUDACXX_TEMPLATE_VIS hash<signed char>
     : public __unary_function<signed char, size_t>
 {
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t operator()(signed char __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
 };
 
 template <>
-struct _LIBCPP_TEMPLATE_VIS hash<unsigned char>
+struct _LIBCUDACXX_TEMPLATE_VIS hash<unsigned char>
     : public __unary_function<unsigned char, size_t>
 {
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t operator()(unsigned char __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
 };
 
-#ifndef _LIBCPP_HAS_NO_CHAR8_T
+#ifndef _LIBCUDACXX_HAS_NO_CHAR8_T
 template <>
-struct _LIBCPP_TEMPLATE_VIS hash<char8_t>
+struct _LIBCUDACXX_TEMPLATE_VIS hash<char8_t>
     : public __unary_function<char8_t, size_t>
 {
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t operator()(char8_t __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
 };
-#endif // !_LIBCPP_HAS_NO_CHAR8_T
+#endif // !_LIBCUDACXX_HAS_NO_CHAR8_T
 
 template <>
-struct _LIBCPP_TEMPLATE_VIS hash<char16_t>
+struct _LIBCUDACXX_TEMPLATE_VIS hash<char16_t>
     : public __unary_function<char16_t, size_t>
 {
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t operator()(char16_t __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
 };
 
 template <>
-struct _LIBCPP_TEMPLATE_VIS hash<char32_t>
+struct _LIBCUDACXX_TEMPLATE_VIS hash<char32_t>
     : public __unary_function<char32_t, size_t>
 {
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t operator()(char32_t __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
 };
 
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 template <>
-struct _LIBCPP_TEMPLATE_VIS hash<wchar_t>
+struct _LIBCUDACXX_TEMPLATE_VIS hash<wchar_t>
     : public __unary_function<wchar_t, size_t>
 {
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t operator()(wchar_t __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
 };
-#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#endif // _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 
 template <>
-struct _LIBCPP_TEMPLATE_VIS hash<short>
+struct _LIBCUDACXX_TEMPLATE_VIS hash<short>
     : public __unary_function<short, size_t>
 {
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t operator()(short __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
 };
 
 template <>
-struct _LIBCPP_TEMPLATE_VIS hash<unsigned short>
+struct _LIBCUDACXX_TEMPLATE_VIS hash<unsigned short>
     : public __unary_function<unsigned short, size_t>
 {
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t operator()(unsigned short __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
 };
 
 template <>
-struct _LIBCPP_TEMPLATE_VIS hash<int>
+struct _LIBCUDACXX_TEMPLATE_VIS hash<int>
     : public __unary_function<int, size_t>
 {
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t operator()(int __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
 };
 
 template <>
-struct _LIBCPP_TEMPLATE_VIS hash<unsigned int>
+struct _LIBCUDACXX_TEMPLATE_VIS hash<unsigned int>
     : public __unary_function<unsigned int, size_t>
 {
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t operator()(unsigned int __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
 };
 
 template <>
-struct _LIBCPP_TEMPLATE_VIS hash<long>
+struct _LIBCUDACXX_TEMPLATE_VIS hash<long>
     : public __unary_function<long, size_t>
 {
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t operator()(long __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
 };
 
 template <>
-struct _LIBCPP_TEMPLATE_VIS hash<unsigned long>
+struct _LIBCUDACXX_TEMPLATE_VIS hash<unsigned long>
     : public __unary_function<unsigned long, size_t>
 {
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t operator()(unsigned long __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
 };
 
 template <>
-struct _LIBCPP_TEMPLATE_VIS hash<long long>
+struct _LIBCUDACXX_TEMPLATE_VIS hash<long long>
     : public __scalar_hash<long long>
 {
 };
 
 template <>
-struct _LIBCPP_TEMPLATE_VIS hash<unsigned long long>
+struct _LIBCUDACXX_TEMPLATE_VIS hash<unsigned long long>
     : public __scalar_hash<unsigned long long>
 {
 };
 
-#ifndef _LIBCPP_HAS_NO_INT128
+#ifndef _LIBCUDACXX_HAS_NO_INT128
 
 template <>
-struct _LIBCPP_TEMPLATE_VIS hash<__int128_t>
+struct _LIBCUDACXX_TEMPLATE_VIS hash<__int128_t>
     : public __scalar_hash<__int128_t>
 {
 };
 
 template <>
-struct _LIBCPP_TEMPLATE_VIS hash<__uint128_t>
+struct _LIBCUDACXX_TEMPLATE_VIS hash<__uint128_t>
     : public __scalar_hash<__uint128_t>
 {
 };
@@ -540,10 +540,10 @@ struct _LIBCPP_TEMPLATE_VIS hash<__uint128_t>
 #endif
 
 template <>
-struct _LIBCPP_TEMPLATE_VIS hash<float>
+struct _LIBCUDACXX_TEMPLATE_VIS hash<float>
     : public __scalar_hash<float>
 {
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t operator()(float __v) const _NOEXCEPT
     {
         // -0.0 and 0.0 should return same hash
@@ -554,10 +554,10 @@ struct _LIBCPP_TEMPLATE_VIS hash<float>
 };
 
 template <>
-struct _LIBCPP_TEMPLATE_VIS hash<double>
+struct _LIBCUDACXX_TEMPLATE_VIS hash<double>
     : public __scalar_hash<double>
 {
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t operator()(double __v) const _NOEXCEPT
     {
         // -0.0 and 0.0 should return same hash
@@ -568,10 +568,10 @@ struct _LIBCPP_TEMPLATE_VIS hash<double>
 };
 
 template <>
-struct _LIBCPP_TEMPLATE_VIS hash<long double>
+struct _LIBCUDACXX_TEMPLATE_VIS hash<long double>
     : public __scalar_hash<long double>
 {
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t operator()(long double __v) const _NOEXCEPT
     {
         // -0.0 and 0.0 should return same hash
@@ -618,10 +618,10 @@ struct _LIBCPP_TEMPLATE_VIS hash<long double>
 };
 
 template <class _Tp, bool = is_enum<_Tp>::value>
-struct _LIBCPP_TEMPLATE_VIS __enum_hash
+struct _LIBCUDACXX_TEMPLATE_VIS __enum_hash
     : public __unary_function<_Tp, size_t>
 {
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t operator()(_Tp __v) const _NOEXCEPT
     {
         typedef typename underlying_type<_Tp>::type type;
@@ -629,59 +629,59 @@ struct _LIBCPP_TEMPLATE_VIS __enum_hash
     }
 };
 template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS __enum_hash<_Tp, false> {
+struct _LIBCUDACXX_TEMPLATE_VIS __enum_hash<_Tp, false> {
     __enum_hash() = delete;
     __enum_hash(__enum_hash const&) = delete;
     __enum_hash& operator=(__enum_hash const&) = delete;
 };
 
 template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS hash : public __enum_hash<_Tp>
+struct _LIBCUDACXX_TEMPLATE_VIS hash : public __enum_hash<_Tp>
 {
 };
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 
 template <>
-struct _LIBCPP_TEMPLATE_VIS hash<nullptr_t>
+struct _LIBCUDACXX_TEMPLATE_VIS hash<nullptr_t>
   : public __unary_function<nullptr_t, size_t>
 {
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t operator()(nullptr_t) const _NOEXCEPT {
         return 662607004ull;
     }
 };
 #endif
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 template <class _Key, class _Hash>
-using __check_hash_requirements _LIBCPP_NODEBUG = integral_constant<bool,
+using __check_hash_requirements _LIBCUDACXX_NODEBUG = integral_constant<bool,
     is_copy_constructible<_Hash>::value &&
     is_move_constructible<_Hash>::value &&
     __invokable_r<size_t, _Hash, _Key const&>::value
 >;
 
 template <class _Key, class _Hash = hash<_Key> >
-using __has_enabled_hash _LIBCPP_NODEBUG = integral_constant<bool,
+using __has_enabled_hash _LIBCUDACXX_NODEBUG = integral_constant<bool,
     __check_hash_requirements<_Key, _Hash>::value &&
     is_default_constructible<_Hash>::value
 >;
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Type, class>
-using __enable_hash_helper_imp _LIBCPP_NODEBUG = _Type;
+using __enable_hash_helper_imp _LIBCUDACXX_NODEBUG = _Type;
 
 template <class _Type, class ..._Keys>
-using __enable_hash_helper _LIBCPP_NODEBUG = __enable_hash_helper_imp<_Type,
+using __enable_hash_helper _LIBCUDACXX_NODEBUG = __enable_hash_helper_imp<_Type,
   typename enable_if<__all<__has_enabled_hash<_Keys>::value...>::value>::type
 >;
 #else
 template <class _Type, class ...>
-using __enable_hash_helper _LIBCPP_NODEBUG = _Type;
+using __enable_hash_helper _LIBCUDACXX_NODEBUG = _Type;
 #endif
 
-#endif // !_LIBCPP_CXX03_LANG
+#endif // !_LIBCUDACXX_CXX03_LANG
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___FUNCTIONAL_HASH_H
+#endif // _LIBCUDACXX___FUNCTIONAL_HASH_H

diff  --git a/libcxx/include/__functional/identity.h b/libcxx/include/__functional/identity.h
index 2fe3acca0899..415dbc10a009 100644
--- a/libcxx/include/__functional/identity.h
+++ b/libcxx/include/__functional/identity.h
@@ -7,40 +7,40 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FUNCTIONAL_IDENTITY_H
-#define _LIBCPP___FUNCTIONAL_IDENTITY_H
+#ifndef _LIBCUDACXX___FUNCTIONAL_IDENTITY_H
+#define _LIBCUDACXX___FUNCTIONAL_IDENTITY_H
 
 #include <__config>
 #include <__utility/forward.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 struct __identity {
   template <class _Tp>
-  _LIBCPP_NODISCARD _LIBCPP_CONSTEXPR _Tp&& operator()(_Tp&& __t) const _NOEXCEPT {
+  _LIBCUDACXX_NODISCARD _LIBCUDACXX_CONSTEXPR _Tp&& operator()(_Tp&& __t) const _NOEXCEPT {
     return std::forward<_Tp>(__t);
   }
 
   using is_transparent = void;
 };
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 struct identity {
     template<class _Tp>
-    _LIBCPP_NODISCARD_EXT constexpr _Tp&& operator()(_Tp&& __t) const noexcept
+    _LIBCUDACXX_NODISCARD_EXT constexpr _Tp&& operator()(_Tp&& __t) const noexcept
     {
-        return _VSTD::forward<_Tp>(__t);
+        return _CUDA_VSTD::forward<_Tp>(__t);
     }
 
     using is_transparent = void;
 };
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___FUNCTIONAL_IDENTITY_H
+#endif // _LIBCUDACXX___FUNCTIONAL_IDENTITY_H

diff  --git a/libcxx/include/__functional/invoke.h b/libcxx/include/__functional/invoke.h
index d56a0accdbce..e8d304950992 100644
--- a/libcxx/include/__functional/invoke.h
+++ b/libcxx/include/__functional/invoke.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FUNCTIONAL_INVOKE_H
-#define _LIBCPP___FUNCTIONAL_INVOKE_H
+#ifndef _LIBCUDACXX___FUNCTIONAL_INVOKE_H
+#define _LIBCUDACXX___FUNCTIONAL_INVOKE_H
 
 #include <__config>
 #include <__type_traits/add_lvalue_reference.h>
@@ -29,13 +29,13 @@
 #include <__utility/declval.h>
 #include <__utility/forward.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
 // TODO: Disentangle the type traits and std::invoke properly
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 struct __any
 {
@@ -336,24 +336,24 @@ __nat __invoke(__any, _Args&& ...__args);
 
 template <class _Fp, class _A0, class ..._Args,
           class = __enable_if_bullet1<_Fp, _A0> >
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR decltype((std::declval<_A0>().*std::declval<_Fp>())(std::declval<_Args>()...))
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR decltype((std::declval<_A0>().*std::declval<_Fp>())(std::declval<_Args>()...))
 __invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
     _NOEXCEPT_(noexcept((static_cast<_A0&&>(__a0).*__f)(static_cast<_Args&&>(__args)...)))
     { return           (static_cast<_A0&&>(__a0).*__f)(static_cast<_Args&&>(__args)...); }
 
 template <class _Fp, class _A0, class ..._Args,
           class = __enable_if_bullet2<_Fp, _A0> >
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR decltype((std::declval<_A0>().get().*std::declval<_Fp>())(std::declval<_Args>()...))
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR decltype((std::declval<_A0>().get().*std::declval<_Fp>())(std::declval<_Args>()...))
 __invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
     _NOEXCEPT_(noexcept((__a0.get().*__f)(static_cast<_Args&&>(__args)...)))
     { return          (__a0.get().*__f)(static_cast<_Args&&>(__args)...); }
 
 template <class _Fp, class _A0, class ..._Args,
           class = __enable_if_bullet3<_Fp, _A0> >
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR decltype(((*std::declval<_A0>()).*std::declval<_Fp>())(std::declval<_Args>()...))
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR decltype(((*std::declval<_A0>()).*std::declval<_Fp>())(std::declval<_Args>()...))
 __invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
     _NOEXCEPT_(noexcept(((*static_cast<_A0&&>(__a0)).*__f)(static_cast<_Args&&>(__args)...)))
     { return          ((*static_cast<_A0&&>(__a0)).*__f)(static_cast<_Args&&>(__args)...); }
@@ -362,24 +362,24 @@ __invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
 
 template <class _Fp, class _A0,
           class = __enable_if_bullet4<_Fp, _A0> >
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR decltype(std::declval<_A0>().*std::declval<_Fp>())
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR decltype(std::declval<_A0>().*std::declval<_Fp>())
 __invoke(_Fp&& __f, _A0&& __a0)
     _NOEXCEPT_(noexcept(static_cast<_A0&&>(__a0).*__f))
     { return          static_cast<_A0&&>(__a0).*__f; }
 
 template <class _Fp, class _A0,
           class = __enable_if_bullet5<_Fp, _A0> >
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR decltype(std::declval<_A0>().get().*std::declval<_Fp>())
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR decltype(std::declval<_A0>().get().*std::declval<_Fp>())
 __invoke(_Fp&& __f, _A0&& __a0)
     _NOEXCEPT_(noexcept(__a0.get().*__f))
     { return          __a0.get().*__f; }
 
 template <class _Fp, class _A0,
           class = __enable_if_bullet6<_Fp, _A0> >
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR decltype((*std::declval<_A0>()).*std::declval<_Fp>())
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR decltype((*std::declval<_A0>()).*std::declval<_Fp>())
 __invoke(_Fp&& __f, _A0&& __a0)
     _NOEXCEPT_(noexcept((*static_cast<_A0&&>(__a0)).*__f))
     { return          (*static_cast<_A0&&>(__a0)).*__f; }
@@ -387,8 +387,8 @@ __invoke(_Fp&& __f, _A0&& __a0)
 // bullet 7
 
 template <class _Fp, class ..._Args>
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR decltype(std::declval<_Fp>()(std::declval<_Args>()...))
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR decltype(std::declval<_Fp>()(std::declval<_Args>()...))
 __invoke(_Fp&& __f, _Args&& ...__args)
     _NOEXCEPT_(noexcept(static_cast<_Fp&&>(__f)(static_cast<_Args&&>(__args)...)))
     { return          static_cast<_Fp&&>(__f)(static_cast<_Args&&>(__args)...); }
@@ -429,14 +429,14 @@ struct __nothrow_invokable_r_imp<true, false, _Ret, _Fp, _Args...>
     static void __test_noexcept(_Tp) _NOEXCEPT;
 
     static const bool value = noexcept(_ThisT::__test_noexcept<_Ret>(
-        _VSTD::__invoke(declval<_Fp>(), declval<_Args>()...)));
+        _CUDA_VSTD::__invoke(declval<_Fp>(), declval<_Args>()...)));
 };
 
 template <class _Ret, class _Fp, class ..._Args>
 struct __nothrow_invokable_r_imp<true, true, _Ret, _Fp, _Args...>
 {
     static const bool value = noexcept(
-        _VSTD::__invoke(declval<_Fp>(), declval<_Args>()...));
+        _CUDA_VSTD::__invoke(declval<_Fp>(), declval<_Args>()...));
 };
 
 template <class _Ret, class _Fp, class ..._Args>
@@ -480,16 +480,16 @@ struct __invoke_void_return_wrapper<_Ret, true>
     }
 };
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 
 // is_invocable
 
 template <class _Fn, class ..._Args>
-struct _LIBCPP_TEMPLATE_VIS is_invocable
+struct _LIBCUDACXX_TEMPLATE_VIS is_invocable
     : integral_constant<bool, __invokable<_Fn, _Args...>::value> {};
 
 template <class _Ret, class _Fn, class ..._Args>
-struct _LIBCPP_TEMPLATE_VIS is_invocable_r
+struct _LIBCUDACXX_TEMPLATE_VIS is_invocable_r
     : integral_constant<bool, __invokable_r<_Ret, _Fn, _Args...>::value> {};
 
 template <class _Fn, class ..._Args>
@@ -501,11 +501,11 @@ inline constexpr bool is_invocable_r_v = is_invocable_r<_Ret, _Fn, _Args...>::va
 // is_nothrow_invocable
 
 template <class _Fn, class ..._Args>
-struct _LIBCPP_TEMPLATE_VIS is_nothrow_invocable
+struct _LIBCUDACXX_TEMPLATE_VIS is_nothrow_invocable
     : integral_constant<bool, __nothrow_invokable<_Fn, _Args...>::value> {};
 
 template <class _Ret, class _Fn, class ..._Args>
-struct _LIBCPP_TEMPLATE_VIS is_nothrow_invocable_r
+struct _LIBCUDACXX_TEMPLATE_VIS is_nothrow_invocable_r
     : integral_constant<bool, __nothrow_invokable_r<_Ret, _Fn, _Args...>::value> {};
 
 template <class _Fn, class ..._Args>
@@ -515,7 +515,7 @@ template <class _Ret, class _Fn, class ..._Args>
 inline constexpr bool is_nothrow_invocable_r_v = is_nothrow_invocable_r<_Ret, _Fn, _Args...>::value;
 
 template <class _Fn, class... _Args>
-struct _LIBCPP_TEMPLATE_VIS invoke_result
+struct _LIBCUDACXX_TEMPLATE_VIS invoke_result
     : __invoke_of<_Fn, _Args...>
 {
 };
@@ -524,15 +524,15 @@ template <class _Fn, class... _Args>
 using invoke_result_t = typename invoke_result<_Fn, _Args...>::type;
 
 template <class _Fn, class ..._Args>
-_LIBCPP_CONSTEXPR_AFTER_CXX17 invoke_result_t<_Fn, _Args...>
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17 invoke_result_t<_Fn, _Args...>
 invoke(_Fn&& __f, _Args&&... __args)
     noexcept(is_nothrow_invocable_v<_Fn, _Args...>)
 {
-    return _VSTD::__invoke(_VSTD::forward<_Fn>(__f), _VSTD::forward<_Args>(__args)...);
+    return _CUDA_VSTD::__invoke(_CUDA_VSTD::forward<_Fn>(__f), _CUDA_VSTD::forward<_Args>(__args)...);
 }
 
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCUDACXX_STD_VER > 14
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___FUNCTIONAL_INVOKE_H
+#endif // _LIBCUDACXX___FUNCTIONAL_INVOKE_H

diff  --git a/libcxx/include/__functional/is_transparent.h b/libcxx/include/__functional/is_transparent.h
index 74326c76c12f..9006673aa4a8 100644
--- a/libcxx/include/__functional/is_transparent.h
+++ b/libcxx/include/__functional/is_transparent.h
@@ -7,19 +7,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FUNCTIONAL_IS_TRANSPARENT
-#define _LIBCPP___FUNCTIONAL_IS_TRANSPARENT
+#ifndef _LIBCUDACXX___FUNCTIONAL_IS_TRANSPARENT
+#define _LIBCUDACXX___FUNCTIONAL_IS_TRANSPARENT
 
 #include <__config>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 
 template <class _Tp, class, class = void>
 struct __is_transparent : false_type {};
@@ -31,6 +31,6 @@ struct __is_transparent<_Tp, _Up,
 
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___FUNCTIONAL_IS_TRANSPARENT
+#endif // _LIBCUDACXX___FUNCTIONAL_IS_TRANSPARENT

diff  --git a/libcxx/include/__functional/mem_fn.h b/libcxx/include/__functional/mem_fn.h
index a5818b3f018c..661d0c1d7637 100644
--- a/libcxx/include/__functional/mem_fn.h
+++ b/libcxx/include/__functional/mem_fn.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FUNCTIONAL_MEM_FN_H
-#define _LIBCPP___FUNCTIONAL_MEM_FN_H
+#ifndef _LIBCUDACXX___FUNCTIONAL_MEM_FN_H
+#define _LIBCUDACXX___FUNCTIONAL_MEM_FN_H
 
 #include <__config>
 #include <__functional/binary_function.h>
@@ -17,11 +17,11 @@
 #include <__utility/forward.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Tp>
 class __mem_fn : public __weak_result_type<_Tp>
@@ -33,12 +33,12 @@ class __mem_fn : public __weak_result_type<_Tp>
     type __f_;
 
 public:
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     __mem_fn(type __f) _NOEXCEPT : __f_(__f) {}
 
     // invoke
     template <class... _ArgTypes>
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 
     typename __invoke_return<type, _ArgTypes...>::type
     operator() (_ArgTypes&&... __args) const {
@@ -47,13 +47,13 @@ class __mem_fn : public __weak_result_type<_Tp>
 };
 
 template<class _Rp, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 __mem_fn<_Rp _Tp::*>
 mem_fn(_Rp _Tp::* __pm) _NOEXCEPT
 {
     return __mem_fn<_Rp _Tp::*>(__pm);
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___FUNCTIONAL_MEM_FN_H
+#endif // _LIBCUDACXX___FUNCTIONAL_MEM_FN_H

diff  --git a/libcxx/include/__functional/mem_fun_ref.h b/libcxx/include/__functional/mem_fun_ref.h
index 65aab0696c16..faa3b4f78d71 100644
--- a/libcxx/include/__functional/mem_fun_ref.h
+++ b/libcxx/include/__functional/mem_fun_ref.h
@@ -7,167 +7,167 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FUNCTIONAL_MEM_FUN_REF_H
-#define _LIBCPP___FUNCTIONAL_MEM_FUN_REF_H
+#ifndef _LIBCUDACXX___FUNCTIONAL_MEM_FUN_REF_H
+#define _LIBCUDACXX___FUNCTIONAL_MEM_FUN_REF_H
 
 #include <__config>
 #include <__functional/binary_function.h>
 #include <__functional/unary_function.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
+#if _LIBCUDACXX_STD_VER <= 14 || defined(_LIBCUDACXX_ENABLE_CXX17_REMOVED_BINDERS)
 
 template<class _Sp, class _Tp>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 mem_fun_t
+class _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_DEPRECATED_IN_CXX11 mem_fun_t
     : public __unary_function<_Tp*, _Sp>
 {
     _Sp (_Tp::*__p_)();
 public:
-    _LIBCPP_INLINE_VISIBILITY explicit mem_fun_t(_Sp (_Tp::*__p)())
+    _LIBCUDACXX_INLINE_VISIBILITY explicit mem_fun_t(_Sp (_Tp::*__p)())
         : __p_(__p) {}
-    _LIBCPP_INLINE_VISIBILITY _Sp operator()(_Tp* __p) const
+    _LIBCUDACXX_INLINE_VISIBILITY _Sp operator()(_Tp* __p) const
         {return (__p->*__p_)();}
 };
 
 template<class _Sp, class _Tp, class _Ap>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 mem_fun1_t
+class _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_DEPRECATED_IN_CXX11 mem_fun1_t
     : public __binary_function<_Tp*, _Ap, _Sp>
 {
     _Sp (_Tp::*__p_)(_Ap);
 public:
-    _LIBCPP_INLINE_VISIBILITY explicit mem_fun1_t(_Sp (_Tp::*__p)(_Ap))
+    _LIBCUDACXX_INLINE_VISIBILITY explicit mem_fun1_t(_Sp (_Tp::*__p)(_Ap))
         : __p_(__p) {}
-    _LIBCPP_INLINE_VISIBILITY _Sp operator()(_Tp* __p, _Ap __x) const
+    _LIBCUDACXX_INLINE_VISIBILITY _Sp operator()(_Tp* __p, _Ap __x) const
         {return (__p->*__p_)(__x);}
 };
 
 template<class _Sp, class _Tp>
-_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_DEPRECATED_IN_CXX11 inline _LIBCUDACXX_INLINE_VISIBILITY
 mem_fun_t<_Sp,_Tp>
 mem_fun(_Sp (_Tp::*__f)())
     {return mem_fun_t<_Sp,_Tp>(__f);}
 
 template<class _Sp, class _Tp, class _Ap>
-_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_DEPRECATED_IN_CXX11 inline _LIBCUDACXX_INLINE_VISIBILITY
 mem_fun1_t<_Sp,_Tp,_Ap>
 mem_fun(_Sp (_Tp::*__f)(_Ap))
     {return mem_fun1_t<_Sp,_Tp,_Ap>(__f);}
 
 template<class _Sp, class _Tp>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 mem_fun_ref_t
+class _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_DEPRECATED_IN_CXX11 mem_fun_ref_t
     : public __unary_function<_Tp, _Sp>
 {
     _Sp (_Tp::*__p_)();
 public:
-    _LIBCPP_INLINE_VISIBILITY explicit mem_fun_ref_t(_Sp (_Tp::*__p)())
+    _LIBCUDACXX_INLINE_VISIBILITY explicit mem_fun_ref_t(_Sp (_Tp::*__p)())
         : __p_(__p) {}
-    _LIBCPP_INLINE_VISIBILITY _Sp operator()(_Tp& __p) const
+    _LIBCUDACXX_INLINE_VISIBILITY _Sp operator()(_Tp& __p) const
         {return (__p.*__p_)();}
 };
 
 template<class _Sp, class _Tp, class _Ap>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 mem_fun1_ref_t
+class _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_DEPRECATED_IN_CXX11 mem_fun1_ref_t
     : public __binary_function<_Tp, _Ap, _Sp>
 {
     _Sp (_Tp::*__p_)(_Ap);
 public:
-    _LIBCPP_INLINE_VISIBILITY explicit mem_fun1_ref_t(_Sp (_Tp::*__p)(_Ap))
+    _LIBCUDACXX_INLINE_VISIBILITY explicit mem_fun1_ref_t(_Sp (_Tp::*__p)(_Ap))
         : __p_(__p) {}
-    _LIBCPP_INLINE_VISIBILITY _Sp operator()(_Tp& __p, _Ap __x) const
+    _LIBCUDACXX_INLINE_VISIBILITY _Sp operator()(_Tp& __p, _Ap __x) const
         {return (__p.*__p_)(__x);}
 };
 
 template<class _Sp, class _Tp>
-_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_DEPRECATED_IN_CXX11 inline _LIBCUDACXX_INLINE_VISIBILITY
 mem_fun_ref_t<_Sp,_Tp>
 mem_fun_ref(_Sp (_Tp::*__f)())
     {return mem_fun_ref_t<_Sp,_Tp>(__f);}
 
 template<class _Sp, class _Tp, class _Ap>
-_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_DEPRECATED_IN_CXX11 inline _LIBCUDACXX_INLINE_VISIBILITY
 mem_fun1_ref_t<_Sp,_Tp,_Ap>
 mem_fun_ref(_Sp (_Tp::*__f)(_Ap))
     {return mem_fun1_ref_t<_Sp,_Tp,_Ap>(__f);}
 
 template <class _Sp, class _Tp>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 const_mem_fun_t
+class _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_DEPRECATED_IN_CXX11 const_mem_fun_t
     : public __unary_function<const _Tp*, _Sp>
 {
     _Sp (_Tp::*__p_)() const;
 public:
-    _LIBCPP_INLINE_VISIBILITY explicit const_mem_fun_t(_Sp (_Tp::*__p)() const)
+    _LIBCUDACXX_INLINE_VISIBILITY explicit const_mem_fun_t(_Sp (_Tp::*__p)() const)
         : __p_(__p) {}
-    _LIBCPP_INLINE_VISIBILITY _Sp operator()(const _Tp* __p) const
+    _LIBCUDACXX_INLINE_VISIBILITY _Sp operator()(const _Tp* __p) const
         {return (__p->*__p_)();}
 };
 
 template <class _Sp, class _Tp, class _Ap>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 const_mem_fun1_t
+class _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_DEPRECATED_IN_CXX11 const_mem_fun1_t
     : public __binary_function<const _Tp*, _Ap, _Sp>
 {
     _Sp (_Tp::*__p_)(_Ap) const;
 public:
-    _LIBCPP_INLINE_VISIBILITY explicit const_mem_fun1_t(_Sp (_Tp::*__p)(_Ap) const)
+    _LIBCUDACXX_INLINE_VISIBILITY explicit const_mem_fun1_t(_Sp (_Tp::*__p)(_Ap) const)
         : __p_(__p) {}
-    _LIBCPP_INLINE_VISIBILITY _Sp operator()(const _Tp* __p, _Ap __x) const
+    _LIBCUDACXX_INLINE_VISIBILITY _Sp operator()(const _Tp* __p, _Ap __x) const
         {return (__p->*__p_)(__x);}
 };
 
 template <class _Sp, class _Tp>
-_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_DEPRECATED_IN_CXX11 inline _LIBCUDACXX_INLINE_VISIBILITY
 const_mem_fun_t<_Sp,_Tp>
 mem_fun(_Sp (_Tp::*__f)() const)
     {return const_mem_fun_t<_Sp,_Tp>(__f);}
 
 template <class _Sp, class _Tp, class _Ap>
-_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_DEPRECATED_IN_CXX11 inline _LIBCUDACXX_INLINE_VISIBILITY
 const_mem_fun1_t<_Sp,_Tp,_Ap>
 mem_fun(_Sp (_Tp::*__f)(_Ap) const)
     {return const_mem_fun1_t<_Sp,_Tp,_Ap>(__f);}
 
 template <class _Sp, class _Tp>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 const_mem_fun_ref_t
+class _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_DEPRECATED_IN_CXX11 const_mem_fun_ref_t
     : public __unary_function<_Tp, _Sp>
 {
     _Sp (_Tp::*__p_)() const;
 public:
-    _LIBCPP_INLINE_VISIBILITY explicit const_mem_fun_ref_t(_Sp (_Tp::*__p)() const)
+    _LIBCUDACXX_INLINE_VISIBILITY explicit const_mem_fun_ref_t(_Sp (_Tp::*__p)() const)
         : __p_(__p) {}
-    _LIBCPP_INLINE_VISIBILITY _Sp operator()(const _Tp& __p) const
+    _LIBCUDACXX_INLINE_VISIBILITY _Sp operator()(const _Tp& __p) const
         {return (__p.*__p_)();}
 };
 
 template <class _Sp, class _Tp, class _Ap>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 const_mem_fun1_ref_t
+class _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_DEPRECATED_IN_CXX11 const_mem_fun1_ref_t
     : public __binary_function<_Tp, _Ap, _Sp>
 {
     _Sp (_Tp::*__p_)(_Ap) const;
 public:
-    _LIBCPP_INLINE_VISIBILITY explicit const_mem_fun1_ref_t(_Sp (_Tp::*__p)(_Ap) const)
+    _LIBCUDACXX_INLINE_VISIBILITY explicit const_mem_fun1_ref_t(_Sp (_Tp::*__p)(_Ap) const)
         : __p_(__p) {}
-    _LIBCPP_INLINE_VISIBILITY _Sp operator()(const _Tp& __p, _Ap __x) const
+    _LIBCUDACXX_INLINE_VISIBILITY _Sp operator()(const _Tp& __p, _Ap __x) const
         {return (__p.*__p_)(__x);}
 };
 
 template <class _Sp, class _Tp>
-_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_DEPRECATED_IN_CXX11 inline _LIBCUDACXX_INLINE_VISIBILITY
 const_mem_fun_ref_t<_Sp,_Tp>
 mem_fun_ref(_Sp (_Tp::*__f)() const)
     {return const_mem_fun_ref_t<_Sp,_Tp>(__f);}
 
 template <class _Sp, class _Tp, class _Ap>
-_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_DEPRECATED_IN_CXX11 inline _LIBCUDACXX_INLINE_VISIBILITY
 const_mem_fun1_ref_t<_Sp,_Tp,_Ap>
 mem_fun_ref(_Sp (_Tp::*__f)(_Ap) const)
     {return const_mem_fun1_ref_t<_Sp,_Tp,_Ap>(__f);}
 
-#endif // _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
+#endif // _LIBCUDACXX_STD_VER <= 14 || defined(_LIBCUDACXX_ENABLE_CXX17_REMOVED_BINDERS)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___FUNCTIONAL_MEM_FUN_REF_H
+#endif // _LIBCUDACXX___FUNCTIONAL_MEM_FUN_REF_H

diff  --git a/libcxx/include/__functional/not_fn.h b/libcxx/include/__functional/not_fn.h
index b5c415c25c44..2713962f7ad4 100644
--- a/libcxx/include/__functional/not_fn.h
+++ b/libcxx/include/__functional/not_fn.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FUNCTIONAL_NOT_FN_H
-#define _LIBCPP___FUNCTIONAL_NOT_FN_H
+#ifndef _LIBCUDACXX___FUNCTIONAL_NOT_FN_H
+#define _LIBCUDACXX___FUNCTIONAL_NOT_FN_H
 
 #include <__config>
 #include <__functional/invoke.h>
@@ -16,21 +16,21 @@
 #include <__utility/forward.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 
 struct __not_fn_op {
     template <class... _Args>
-    _LIBCPP_HIDE_FROM_ABI
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 auto operator()(_Args&&... __args) const
-        noexcept(noexcept(!_VSTD::invoke(_VSTD::forward<_Args>(__args)...)))
-        -> decltype(      !_VSTD::invoke(_VSTD::forward<_Args>(__args)...))
-        { return          !_VSTD::invoke(_VSTD::forward<_Args>(__args)...); }
+    _LIBCUDACXX_HIDE_FROM_ABI
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 auto operator()(_Args&&... __args) const
+        noexcept(noexcept(!_CUDA_VSTD::invoke(_CUDA_VSTD::forward<_Args>(__args)...)))
+        -> decltype(      !_CUDA_VSTD::invoke(_CUDA_VSTD::forward<_Args>(__args)...))
+        { return          !_CUDA_VSTD::invoke(_CUDA_VSTD::forward<_Args>(__args)...); }
 };
 
 template <class _Fn>
@@ -42,13 +42,13 @@ template <class _Fn, class = enable_if_t<
     is_constructible_v<decay_t<_Fn>, _Fn> &&
     is_move_constructible_v<decay_t<_Fn>>
 >>
-_LIBCPP_HIDE_FROM_ABI
-_LIBCPP_CONSTEXPR_AFTER_CXX17 auto not_fn(_Fn&& __f) {
-    return __not_fn_t<decay_t<_Fn>>(_VSTD::forward<_Fn>(__f));
+_LIBCUDACXX_HIDE_FROM_ABI
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17 auto not_fn(_Fn&& __f) {
+    return __not_fn_t<decay_t<_Fn>>(_CUDA_VSTD::forward<_Fn>(__f));
 }
 
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCUDACXX_STD_VER > 14
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___FUNCTIONAL_NOT_FN_H
+#endif // _LIBCUDACXX___FUNCTIONAL_NOT_FN_H

diff  --git a/libcxx/include/__functional/operations.h b/libcxx/include/__functional/operations.h
index 1c73c999db91..aff27b53f316 100644
--- a/libcxx/include/__functional/operations.h
+++ b/libcxx/include/__functional/operations.h
@@ -7,555 +7,555 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FUNCTIONAL_OPERATIONS_H
-#define _LIBCPP___FUNCTIONAL_OPERATIONS_H
+#ifndef _LIBCUDACXX___FUNCTIONAL_OPERATIONS_H
+#define _LIBCUDACXX___FUNCTIONAL_OPERATIONS_H
 
 #include <__config>
 #include <__functional/binary_function.h>
 #include <__functional/unary_function.h>
 #include <__utility/forward.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 // Arithmetic operations
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <class _Tp = void>
 #else
 template <class _Tp>
 #endif
-struct _LIBCPP_TEMPLATE_VIS plus
+struct _LIBCUDACXX_TEMPLATE_VIS plus
     : __binary_function<_Tp, _Tp, _Tp>
 {
     typedef _Tp __result_type;  // used by valarray
-    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
     _Tp operator()(const _Tp& __x, const _Tp& __y) const
         {return __x + __y;}
 };
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <>
-struct _LIBCPP_TEMPLATE_VIS plus<void>
+struct _LIBCUDACXX_TEMPLATE_VIS plus<void>
 {
     template <class _T1, class _T2>
-    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
     auto operator()(_T1&& __t, _T2&& __u) const
-        noexcept(noexcept(_VSTD::forward<_T1>(__t) + _VSTD::forward<_T2>(__u)))
-        -> decltype(      _VSTD::forward<_T1>(__t) + _VSTD::forward<_T2>(__u))
-        { return          _VSTD::forward<_T1>(__t) + _VSTD::forward<_T2>(__u); }
+        noexcept(noexcept(_CUDA_VSTD::forward<_T1>(__t) + _CUDA_VSTD::forward<_T2>(__u)))
+        -> decltype(      _CUDA_VSTD::forward<_T1>(__t) + _CUDA_VSTD::forward<_T2>(__u))
+        { return          _CUDA_VSTD::forward<_T1>(__t) + _CUDA_VSTD::forward<_T2>(__u); }
     typedef void is_transparent;
 };
 #endif
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <class _Tp = void>
 #else
 template <class _Tp>
 #endif
-struct _LIBCPP_TEMPLATE_VIS minus
+struct _LIBCUDACXX_TEMPLATE_VIS minus
     : __binary_function<_Tp, _Tp, _Tp>
 {
     typedef _Tp __result_type;  // used by valarray
-    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
     _Tp operator()(const _Tp& __x, const _Tp& __y) const
         {return __x - __y;}
 };
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <>
-struct _LIBCPP_TEMPLATE_VIS minus<void>
+struct _LIBCUDACXX_TEMPLATE_VIS minus<void>
 {
     template <class _T1, class _T2>
-    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
     auto operator()(_T1&& __t, _T2&& __u) const
-        noexcept(noexcept(_VSTD::forward<_T1>(__t) - _VSTD::forward<_T2>(__u)))
-        -> decltype(      _VSTD::forward<_T1>(__t) - _VSTD::forward<_T2>(__u))
-        { return          _VSTD::forward<_T1>(__t) - _VSTD::forward<_T2>(__u); }
+        noexcept(noexcept(_CUDA_VSTD::forward<_T1>(__t) - _CUDA_VSTD::forward<_T2>(__u)))
+        -> decltype(      _CUDA_VSTD::forward<_T1>(__t) - _CUDA_VSTD::forward<_T2>(__u))
+        { return          _CUDA_VSTD::forward<_T1>(__t) - _CUDA_VSTD::forward<_T2>(__u); }
     typedef void is_transparent;
 };
 #endif
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <class _Tp = void>
 #else
 template <class _Tp>
 #endif
-struct _LIBCPP_TEMPLATE_VIS multiplies
+struct _LIBCUDACXX_TEMPLATE_VIS multiplies
     : __binary_function<_Tp, _Tp, _Tp>
 {
     typedef _Tp __result_type;  // used by valarray
-    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
     _Tp operator()(const _Tp& __x, const _Tp& __y) const
         {return __x * __y;}
 };
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <>
-struct _LIBCPP_TEMPLATE_VIS multiplies<void>
+struct _LIBCUDACXX_TEMPLATE_VIS multiplies<void>
 {
     template <class _T1, class _T2>
-    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
     auto operator()(_T1&& __t, _T2&& __u) const
-        noexcept(noexcept(_VSTD::forward<_T1>(__t) * _VSTD::forward<_T2>(__u)))
-        -> decltype(      _VSTD::forward<_T1>(__t) * _VSTD::forward<_T2>(__u))
-        { return          _VSTD::forward<_T1>(__t) * _VSTD::forward<_T2>(__u); }
+        noexcept(noexcept(_CUDA_VSTD::forward<_T1>(__t) * _CUDA_VSTD::forward<_T2>(__u)))
+        -> decltype(      _CUDA_VSTD::forward<_T1>(__t) * _CUDA_VSTD::forward<_T2>(__u))
+        { return          _CUDA_VSTD::forward<_T1>(__t) * _CUDA_VSTD::forward<_T2>(__u); }
     typedef void is_transparent;
 };
 #endif
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <class _Tp = void>
 #else
 template <class _Tp>
 #endif
-struct _LIBCPP_TEMPLATE_VIS divides
+struct _LIBCUDACXX_TEMPLATE_VIS divides
     : __binary_function<_Tp, _Tp, _Tp>
 {
     typedef _Tp __result_type;  // used by valarray
-    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
     _Tp operator()(const _Tp& __x, const _Tp& __y) const
         {return __x / __y;}
 };
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <>
-struct _LIBCPP_TEMPLATE_VIS divides<void>
+struct _LIBCUDACXX_TEMPLATE_VIS divides<void>
 {
     template <class _T1, class _T2>
-    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
     auto operator()(_T1&& __t, _T2&& __u) const
-        noexcept(noexcept(_VSTD::forward<_T1>(__t) / _VSTD::forward<_T2>(__u)))
-        -> decltype(      _VSTD::forward<_T1>(__t) / _VSTD::forward<_T2>(__u))
-        { return          _VSTD::forward<_T1>(__t) / _VSTD::forward<_T2>(__u); }
+        noexcept(noexcept(_CUDA_VSTD::forward<_T1>(__t) / _CUDA_VSTD::forward<_T2>(__u)))
+        -> decltype(      _CUDA_VSTD::forward<_T1>(__t) / _CUDA_VSTD::forward<_T2>(__u))
+        { return          _CUDA_VSTD::forward<_T1>(__t) / _CUDA_VSTD::forward<_T2>(__u); }
     typedef void is_transparent;
 };
 #endif
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <class _Tp = void>
 #else
 template <class _Tp>
 #endif
-struct _LIBCPP_TEMPLATE_VIS modulus
+struct _LIBCUDACXX_TEMPLATE_VIS modulus
     : __binary_function<_Tp, _Tp, _Tp>
 {
     typedef _Tp __result_type;  // used by valarray
-    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
     _Tp operator()(const _Tp& __x, const _Tp& __y) const
         {return __x % __y;}
 };
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <>
-struct _LIBCPP_TEMPLATE_VIS modulus<void>
+struct _LIBCUDACXX_TEMPLATE_VIS modulus<void>
 {
     template <class _T1, class _T2>
-    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
     auto operator()(_T1&& __t, _T2&& __u) const
-        noexcept(noexcept(_VSTD::forward<_T1>(__t) % _VSTD::forward<_T2>(__u)))
-        -> decltype(      _VSTD::forward<_T1>(__t) % _VSTD::forward<_T2>(__u))
-        { return          _VSTD::forward<_T1>(__t) % _VSTD::forward<_T2>(__u); }
+        noexcept(noexcept(_CUDA_VSTD::forward<_T1>(__t) % _CUDA_VSTD::forward<_T2>(__u)))
+        -> decltype(      _CUDA_VSTD::forward<_T1>(__t) % _CUDA_VSTD::forward<_T2>(__u))
+        { return          _CUDA_VSTD::forward<_T1>(__t) % _CUDA_VSTD::forward<_T2>(__u); }
     typedef void is_transparent;
 };
 #endif
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <class _Tp = void>
 #else
 template <class _Tp>
 #endif
-struct _LIBCPP_TEMPLATE_VIS negate
+struct _LIBCUDACXX_TEMPLATE_VIS negate
     : __unary_function<_Tp, _Tp>
 {
     typedef _Tp __result_type;  // used by valarray
-    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
     _Tp operator()(const _Tp& __x) const
         {return -__x;}
 };
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <>
-struct _LIBCPP_TEMPLATE_VIS negate<void>
+struct _LIBCUDACXX_TEMPLATE_VIS negate<void>
 {
     template <class _Tp>
-    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
     auto operator()(_Tp&& __x) const
-        noexcept(noexcept(- _VSTD::forward<_Tp>(__x)))
-        -> decltype(      - _VSTD::forward<_Tp>(__x))
-        { return          - _VSTD::forward<_Tp>(__x); }
+        noexcept(noexcept(- _CUDA_VSTD::forward<_Tp>(__x)))
+        -> decltype(      - _CUDA_VSTD::forward<_Tp>(__x))
+        { return          - _CUDA_VSTD::forward<_Tp>(__x); }
     typedef void is_transparent;
 };
 #endif
 
 // Bitwise operations
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <class _Tp = void>
 #else
 template <class _Tp>
 #endif
-struct _LIBCPP_TEMPLATE_VIS bit_and
+struct _LIBCUDACXX_TEMPLATE_VIS bit_and
     : __binary_function<_Tp, _Tp, _Tp>
 {
     typedef _Tp __result_type;  // used by valarray
-    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
     _Tp operator()(const _Tp& __x, const _Tp& __y) const
         {return __x & __y;}
 };
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <>
-struct _LIBCPP_TEMPLATE_VIS bit_and<void>
+struct _LIBCUDACXX_TEMPLATE_VIS bit_and<void>
 {
     template <class _T1, class _T2>
-    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
     auto operator()(_T1&& __t, _T2&& __u) const
-        noexcept(noexcept(_VSTD::forward<_T1>(__t) & _VSTD::forward<_T2>(__u)))
-        -> decltype(      _VSTD::forward<_T1>(__t) & _VSTD::forward<_T2>(__u))
-        { return          _VSTD::forward<_T1>(__t) & _VSTD::forward<_T2>(__u); }
+        noexcept(noexcept(_CUDA_VSTD::forward<_T1>(__t) & _CUDA_VSTD::forward<_T2>(__u)))
+        -> decltype(      _CUDA_VSTD::forward<_T1>(__t) & _CUDA_VSTD::forward<_T2>(__u))
+        { return          _CUDA_VSTD::forward<_T1>(__t) & _CUDA_VSTD::forward<_T2>(__u); }
     typedef void is_transparent;
 };
 #endif
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <class _Tp = void>
-struct _LIBCPP_TEMPLATE_VIS bit_not
+struct _LIBCUDACXX_TEMPLATE_VIS bit_not
     : __unary_function<_Tp, _Tp>
 {
-    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
     _Tp operator()(const _Tp& __x) const
         {return ~__x;}
 };
 
 template <>
-struct _LIBCPP_TEMPLATE_VIS bit_not<void>
+struct _LIBCUDACXX_TEMPLATE_VIS bit_not<void>
 {
     template <class _Tp>
-    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
     auto operator()(_Tp&& __x) const
-        noexcept(noexcept(~_VSTD::forward<_Tp>(__x)))
-        -> decltype(      ~_VSTD::forward<_Tp>(__x))
-        { return          ~_VSTD::forward<_Tp>(__x); }
+        noexcept(noexcept(~_CUDA_VSTD::forward<_Tp>(__x)))
+        -> decltype(      ~_CUDA_VSTD::forward<_Tp>(__x))
+        { return          ~_CUDA_VSTD::forward<_Tp>(__x); }
     typedef void is_transparent;
 };
 #endif
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <class _Tp = void>
 #else
 template <class _Tp>
 #endif
-struct _LIBCPP_TEMPLATE_VIS bit_or
+struct _LIBCUDACXX_TEMPLATE_VIS bit_or
     : __binary_function<_Tp, _Tp, _Tp>
 {
     typedef _Tp __result_type;  // used by valarray
-    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
     _Tp operator()(const _Tp& __x, const _Tp& __y) const
         {return __x | __y;}
 };
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <>
-struct _LIBCPP_TEMPLATE_VIS bit_or<void>
+struct _LIBCUDACXX_TEMPLATE_VIS bit_or<void>
 {
     template <class _T1, class _T2>
-    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
     auto operator()(_T1&& __t, _T2&& __u) const
-        noexcept(noexcept(_VSTD::forward<_T1>(__t) | _VSTD::forward<_T2>(__u)))
-        -> decltype(      _VSTD::forward<_T1>(__t) | _VSTD::forward<_T2>(__u))
-        { return          _VSTD::forward<_T1>(__t) | _VSTD::forward<_T2>(__u); }
+        noexcept(noexcept(_CUDA_VSTD::forward<_T1>(__t) | _CUDA_VSTD::forward<_T2>(__u)))
+        -> decltype(      _CUDA_VSTD::forward<_T1>(__t) | _CUDA_VSTD::forward<_T2>(__u))
+        { return          _CUDA_VSTD::forward<_T1>(__t) | _CUDA_VSTD::forward<_T2>(__u); }
     typedef void is_transparent;
 };
 #endif
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <class _Tp = void>
 #else
 template <class _Tp>
 #endif
-struct _LIBCPP_TEMPLATE_VIS bit_xor
+struct _LIBCUDACXX_TEMPLATE_VIS bit_xor
     : __binary_function<_Tp, _Tp, _Tp>
 {
     typedef _Tp __result_type;  // used by valarray
-    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
     _Tp operator()(const _Tp& __x, const _Tp& __y) const
         {return __x ^ __y;}
 };
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <>
-struct _LIBCPP_TEMPLATE_VIS bit_xor<void>
+struct _LIBCUDACXX_TEMPLATE_VIS bit_xor<void>
 {
     template <class _T1, class _T2>
-    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
     auto operator()(_T1&& __t, _T2&& __u) const
-        noexcept(noexcept(_VSTD::forward<_T1>(__t) ^ _VSTD::forward<_T2>(__u)))
-        -> decltype(      _VSTD::forward<_T1>(__t) ^ _VSTD::forward<_T2>(__u))
-        { return          _VSTD::forward<_T1>(__t) ^ _VSTD::forward<_T2>(__u); }
+        noexcept(noexcept(_CUDA_VSTD::forward<_T1>(__t) ^ _CUDA_VSTD::forward<_T2>(__u)))
+        -> decltype(      _CUDA_VSTD::forward<_T1>(__t) ^ _CUDA_VSTD::forward<_T2>(__u))
+        { return          _CUDA_VSTD::forward<_T1>(__t) ^ _CUDA_VSTD::forward<_T2>(__u); }
     typedef void is_transparent;
 };
 #endif
 
 // Comparison operations
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <class _Tp = void>
 #else
 template <class _Tp>
 #endif
-struct _LIBCPP_TEMPLATE_VIS equal_to
+struct _LIBCUDACXX_TEMPLATE_VIS equal_to
     : __binary_function<_Tp, _Tp, bool>
 {
     typedef bool __result_type;  // used by valarray
-    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
     bool operator()(const _Tp& __x, const _Tp& __y) const
         {return __x == __y;}
 };
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <>
-struct _LIBCPP_TEMPLATE_VIS equal_to<void>
+struct _LIBCUDACXX_TEMPLATE_VIS equal_to<void>
 {
     template <class _T1, class _T2>
-    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
     auto operator()(_T1&& __t, _T2&& __u) const
-        noexcept(noexcept(_VSTD::forward<_T1>(__t) == _VSTD::forward<_T2>(__u)))
-        -> decltype(      _VSTD::forward<_T1>(__t) == _VSTD::forward<_T2>(__u))
-        { return          _VSTD::forward<_T1>(__t) == _VSTD::forward<_T2>(__u); }
+        noexcept(noexcept(_CUDA_VSTD::forward<_T1>(__t) == _CUDA_VSTD::forward<_T2>(__u)))
+        -> decltype(      _CUDA_VSTD::forward<_T1>(__t) == _CUDA_VSTD::forward<_T2>(__u))
+        { return          _CUDA_VSTD::forward<_T1>(__t) == _CUDA_VSTD::forward<_T2>(__u); }
     typedef void is_transparent;
 };
 #endif
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <class _Tp = void>
 #else
 template <class _Tp>
 #endif
-struct _LIBCPP_TEMPLATE_VIS not_equal_to
+struct _LIBCUDACXX_TEMPLATE_VIS not_equal_to
     : __binary_function<_Tp, _Tp, bool>
 {
     typedef bool __result_type;  // used by valarray
-    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
     bool operator()(const _Tp& __x, const _Tp& __y) const
         {return __x != __y;}
 };
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <>
-struct _LIBCPP_TEMPLATE_VIS not_equal_to<void>
+struct _LIBCUDACXX_TEMPLATE_VIS not_equal_to<void>
 {
     template <class _T1, class _T2>
-    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
     auto operator()(_T1&& __t, _T2&& __u) const
-        noexcept(noexcept(_VSTD::forward<_T1>(__t) != _VSTD::forward<_T2>(__u)))
-        -> decltype(      _VSTD::forward<_T1>(__t) != _VSTD::forward<_T2>(__u))
-        { return          _VSTD::forward<_T1>(__t) != _VSTD::forward<_T2>(__u); }
+        noexcept(noexcept(_CUDA_VSTD::forward<_T1>(__t) != _CUDA_VSTD::forward<_T2>(__u)))
+        -> decltype(      _CUDA_VSTD::forward<_T1>(__t) != _CUDA_VSTD::forward<_T2>(__u))
+        { return          _CUDA_VSTD::forward<_T1>(__t) != _CUDA_VSTD::forward<_T2>(__u); }
     typedef void is_transparent;
 };
 #endif
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <class _Tp = void>
 #else
 template <class _Tp>
 #endif
-struct _LIBCPP_TEMPLATE_VIS less
+struct _LIBCUDACXX_TEMPLATE_VIS less
     : __binary_function<_Tp, _Tp, bool>
 {
     typedef bool __result_type;  // used by valarray
-    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
     bool operator()(const _Tp& __x, const _Tp& __y) const
         {return __x < __y;}
 };
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <>
-struct _LIBCPP_TEMPLATE_VIS less<void>
+struct _LIBCUDACXX_TEMPLATE_VIS less<void>
 {
     template <class _T1, class _T2>
-    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
     auto operator()(_T1&& __t, _T2&& __u) const
-        noexcept(noexcept(_VSTD::forward<_T1>(__t) < _VSTD::forward<_T2>(__u)))
-        -> decltype(      _VSTD::forward<_T1>(__t) < _VSTD::forward<_T2>(__u))
-        { return          _VSTD::forward<_T1>(__t) < _VSTD::forward<_T2>(__u); }
+        noexcept(noexcept(_CUDA_VSTD::forward<_T1>(__t) < _CUDA_VSTD::forward<_T2>(__u)))
+        -> decltype(      _CUDA_VSTD::forward<_T1>(__t) < _CUDA_VSTD::forward<_T2>(__u))
+        { return          _CUDA_VSTD::forward<_T1>(__t) < _CUDA_VSTD::forward<_T2>(__u); }
     typedef void is_transparent;
 };
 #endif
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <class _Tp = void>
 #else
 template <class _Tp>
 #endif
-struct _LIBCPP_TEMPLATE_VIS less_equal
+struct _LIBCUDACXX_TEMPLATE_VIS less_equal
     : __binary_function<_Tp, _Tp, bool>
 {
     typedef bool __result_type;  // used by valarray
-    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
     bool operator()(const _Tp& __x, const _Tp& __y) const
         {return __x <= __y;}
 };
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <>
-struct _LIBCPP_TEMPLATE_VIS less_equal<void>
+struct _LIBCUDACXX_TEMPLATE_VIS less_equal<void>
 {
     template <class _T1, class _T2>
-    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
     auto operator()(_T1&& __t, _T2&& __u) const
-        noexcept(noexcept(_VSTD::forward<_T1>(__t) <= _VSTD::forward<_T2>(__u)))
-        -> decltype(      _VSTD::forward<_T1>(__t) <= _VSTD::forward<_T2>(__u))
-        { return          _VSTD::forward<_T1>(__t) <= _VSTD::forward<_T2>(__u); }
+        noexcept(noexcept(_CUDA_VSTD::forward<_T1>(__t) <= _CUDA_VSTD::forward<_T2>(__u)))
+        -> decltype(      _CUDA_VSTD::forward<_T1>(__t) <= _CUDA_VSTD::forward<_T2>(__u))
+        { return          _CUDA_VSTD::forward<_T1>(__t) <= _CUDA_VSTD::forward<_T2>(__u); }
     typedef void is_transparent;
 };
 #endif
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <class _Tp = void>
 #else
 template <class _Tp>
 #endif
-struct _LIBCPP_TEMPLATE_VIS greater_equal
+struct _LIBCUDACXX_TEMPLATE_VIS greater_equal
     : __binary_function<_Tp, _Tp, bool>
 {
     typedef bool __result_type;  // used by valarray
-    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
     bool operator()(const _Tp& __x, const _Tp& __y) const
         {return __x >= __y;}
 };
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <>
-struct _LIBCPP_TEMPLATE_VIS greater_equal<void>
+struct _LIBCUDACXX_TEMPLATE_VIS greater_equal<void>
 {
     template <class _T1, class _T2>
-    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
     auto operator()(_T1&& __t, _T2&& __u) const
-        noexcept(noexcept(_VSTD::forward<_T1>(__t) >= _VSTD::forward<_T2>(__u)))
-        -> decltype(      _VSTD::forward<_T1>(__t) >= _VSTD::forward<_T2>(__u))
-        { return          _VSTD::forward<_T1>(__t) >= _VSTD::forward<_T2>(__u); }
+        noexcept(noexcept(_CUDA_VSTD::forward<_T1>(__t) >= _CUDA_VSTD::forward<_T2>(__u)))
+        -> decltype(      _CUDA_VSTD::forward<_T1>(__t) >= _CUDA_VSTD::forward<_T2>(__u))
+        { return          _CUDA_VSTD::forward<_T1>(__t) >= _CUDA_VSTD::forward<_T2>(__u); }
     typedef void is_transparent;
 };
 #endif
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <class _Tp = void>
 #else
 template <class _Tp>
 #endif
-struct _LIBCPP_TEMPLATE_VIS greater
+struct _LIBCUDACXX_TEMPLATE_VIS greater
     : __binary_function<_Tp, _Tp, bool>
 {
     typedef bool __result_type;  // used by valarray
-    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
     bool operator()(const _Tp& __x, const _Tp& __y) const
         {return __x > __y;}
 };
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <>
-struct _LIBCPP_TEMPLATE_VIS greater<void>
+struct _LIBCUDACXX_TEMPLATE_VIS greater<void>
 {
     template <class _T1, class _T2>
-    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
     auto operator()(_T1&& __t, _T2&& __u) const
-        noexcept(noexcept(_VSTD::forward<_T1>(__t) > _VSTD::forward<_T2>(__u)))
-        -> decltype(      _VSTD::forward<_T1>(__t) > _VSTD::forward<_T2>(__u))
-        { return          _VSTD::forward<_T1>(__t) > _VSTD::forward<_T2>(__u); }
+        noexcept(noexcept(_CUDA_VSTD::forward<_T1>(__t) > _CUDA_VSTD::forward<_T2>(__u)))
+        -> decltype(      _CUDA_VSTD::forward<_T1>(__t) > _CUDA_VSTD::forward<_T2>(__u))
+        { return          _CUDA_VSTD::forward<_T1>(__t) > _CUDA_VSTD::forward<_T2>(__u); }
     typedef void is_transparent;
 };
 #endif
 
 // Logical operations
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <class _Tp = void>
 #else
 template <class _Tp>
 #endif
-struct _LIBCPP_TEMPLATE_VIS logical_and
+struct _LIBCUDACXX_TEMPLATE_VIS logical_and
     : __binary_function<_Tp, _Tp, bool>
 {
     typedef bool __result_type;  // used by valarray
-    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
     bool operator()(const _Tp& __x, const _Tp& __y) const
         {return __x && __y;}
 };
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <>
-struct _LIBCPP_TEMPLATE_VIS logical_and<void>
+struct _LIBCUDACXX_TEMPLATE_VIS logical_and<void>
 {
     template <class _T1, class _T2>
-    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
     auto operator()(_T1&& __t, _T2&& __u) const
-        noexcept(noexcept(_VSTD::forward<_T1>(__t) && _VSTD::forward<_T2>(__u)))
-        -> decltype(      _VSTD::forward<_T1>(__t) && _VSTD::forward<_T2>(__u))
-        { return          _VSTD::forward<_T1>(__t) && _VSTD::forward<_T2>(__u); }
+        noexcept(noexcept(_CUDA_VSTD::forward<_T1>(__t) && _CUDA_VSTD::forward<_T2>(__u)))
+        -> decltype(      _CUDA_VSTD::forward<_T1>(__t) && _CUDA_VSTD::forward<_T2>(__u))
+        { return          _CUDA_VSTD::forward<_T1>(__t) && _CUDA_VSTD::forward<_T2>(__u); }
     typedef void is_transparent;
 };
 #endif
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <class _Tp = void>
 #else
 template <class _Tp>
 #endif
-struct _LIBCPP_TEMPLATE_VIS logical_not
+struct _LIBCUDACXX_TEMPLATE_VIS logical_not
     : __unary_function<_Tp, bool>
 {
     typedef bool __result_type;  // used by valarray
-    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
     bool operator()(const _Tp& __x) const
         {return !__x;}
 };
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <>
-struct _LIBCPP_TEMPLATE_VIS logical_not<void>
+struct _LIBCUDACXX_TEMPLATE_VIS logical_not<void>
 {
     template <class _Tp>
-    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
     auto operator()(_Tp&& __x) const
-        noexcept(noexcept(!_VSTD::forward<_Tp>(__x)))
-        -> decltype(      !_VSTD::forward<_Tp>(__x))
-        { return          !_VSTD::forward<_Tp>(__x); }
+        noexcept(noexcept(!_CUDA_VSTD::forward<_Tp>(__x)))
+        -> decltype(      !_CUDA_VSTD::forward<_Tp>(__x))
+        { return          !_CUDA_VSTD::forward<_Tp>(__x); }
     typedef void is_transparent;
 };
 #endif
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <class _Tp = void>
 #else
 template <class _Tp>
 #endif
-struct _LIBCPP_TEMPLATE_VIS logical_or
+struct _LIBCUDACXX_TEMPLATE_VIS logical_or
     : __binary_function<_Tp, _Tp, bool>
 {
     typedef bool __result_type;  // used by valarray
-    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
     bool operator()(const _Tp& __x, const _Tp& __y) const
         {return __x || __y;}
 };
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <>
-struct _LIBCPP_TEMPLATE_VIS logical_or<void>
+struct _LIBCUDACXX_TEMPLATE_VIS logical_or<void>
 {
     template <class _T1, class _T2>
-    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
     auto operator()(_T1&& __t, _T2&& __u) const
-        noexcept(noexcept(_VSTD::forward<_T1>(__t) || _VSTD::forward<_T2>(__u)))
-        -> decltype(      _VSTD::forward<_T1>(__t) || _VSTD::forward<_T2>(__u))
-        { return          _VSTD::forward<_T1>(__t) || _VSTD::forward<_T2>(__u); }
+        noexcept(noexcept(_CUDA_VSTD::forward<_T1>(__t) || _CUDA_VSTD::forward<_T2>(__u)))
+        -> decltype(      _CUDA_VSTD::forward<_T1>(__t) || _CUDA_VSTD::forward<_T2>(__u))
+        { return          _CUDA_VSTD::forward<_T1>(__t) || _CUDA_VSTD::forward<_T2>(__u); }
     typedef void is_transparent;
 };
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___FUNCTIONAL_OPERATIONS_H
+#endif // _LIBCUDACXX___FUNCTIONAL_OPERATIONS_H

diff  --git a/libcxx/include/__functional/perfect_forward.h b/libcxx/include/__functional/perfect_forward.h
index 9ffea1a8c75d..ce4882c1ca5d 100644
--- a/libcxx/include/__functional/perfect_forward.h
+++ b/libcxx/include/__functional/perfect_forward.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FUNCTIONAL_PERFECT_FORWARD_H
-#define _LIBCPP___FUNCTIONAL_PERFECT_FORWARD_H
+#ifndef _LIBCUDACXX___FUNCTIONAL_PERFECT_FORWARD_H
+#define _LIBCUDACXX___FUNCTIONAL_PERFECT_FORWARD_H
 
 #include <__config>
 #include <__utility/declval.h>
@@ -17,13 +17,13 @@
 #include <tuple>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 
 template <class _Op, class _Indices, class... _BoundArgs>
 struct __perfect_forward_impl;
@@ -38,7 +38,7 @@ struct __perfect_forward_impl<_Op, index_sequence<_Idx...>, _BoundArgs...> {
     is_constructible_v<tuple<_BoundArgs...>, _Args&&...>
   >>
   explicit constexpr __perfect_forward_impl(_Args&&... __bound_args)
-    : __bound_args_(_VSTD::forward<_Args>(__bound_args)...) {}
+    : __bound_args_(_CUDA_VSTD::forward<_Args>(__bound_args)...) {}
 
   __perfect_forward_impl(__perfect_forward_impl const&) = default;
   __perfect_forward_impl(__perfect_forward_impl&&) = default;
@@ -47,37 +47,37 @@ struct __perfect_forward_impl<_Op, index_sequence<_Idx...>, _BoundArgs...> {
   __perfect_forward_impl& operator=(__perfect_forward_impl&&) = default;
 
   template <class... _Args, class = enable_if_t<is_invocable_v<_Op, _BoundArgs&..., _Args...>>>
-  _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Args&&... __args) &
-    noexcept(noexcept(_Op()(_VSTD::get<_Idx>(__bound_args_)..., _VSTD::forward<_Args>(__args)...)))
-    -> decltype(      _Op()(_VSTD::get<_Idx>(__bound_args_)..., _VSTD::forward<_Args>(__args)...))
-    { return          _Op()(_VSTD::get<_Idx>(__bound_args_)..., _VSTD::forward<_Args>(__args)...); }
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Args&&... __args) &
+    noexcept(noexcept(_Op()(_CUDA_VSTD::get<_Idx>(__bound_args_)..., _CUDA_VSTD::forward<_Args>(__args)...)))
+    -> decltype(      _Op()(_CUDA_VSTD::get<_Idx>(__bound_args_)..., _CUDA_VSTD::forward<_Args>(__args)...))
+    { return          _Op()(_CUDA_VSTD::get<_Idx>(__bound_args_)..., _CUDA_VSTD::forward<_Args>(__args)...); }
 
   template <class... _Args, class = enable_if_t<!is_invocable_v<_Op, _BoundArgs&..., _Args...>>>
   auto operator()(_Args&&...) & = delete;
 
   template <class... _Args, class = enable_if_t<is_invocable_v<_Op, _BoundArgs const&..., _Args...>>>
-  _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Args&&... __args) const&
-    noexcept(noexcept(_Op()(_VSTD::get<_Idx>(__bound_args_)..., _VSTD::forward<_Args>(__args)...)))
-    -> decltype(      _Op()(_VSTD::get<_Idx>(__bound_args_)..., _VSTD::forward<_Args>(__args)...))
-    { return          _Op()(_VSTD::get<_Idx>(__bound_args_)..., _VSTD::forward<_Args>(__args)...); }
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Args&&... __args) const&
+    noexcept(noexcept(_Op()(_CUDA_VSTD::get<_Idx>(__bound_args_)..., _CUDA_VSTD::forward<_Args>(__args)...)))
+    -> decltype(      _Op()(_CUDA_VSTD::get<_Idx>(__bound_args_)..., _CUDA_VSTD::forward<_Args>(__args)...))
+    { return          _Op()(_CUDA_VSTD::get<_Idx>(__bound_args_)..., _CUDA_VSTD::forward<_Args>(__args)...); }
 
   template <class... _Args, class = enable_if_t<!is_invocable_v<_Op, _BoundArgs const&..., _Args...>>>
   auto operator()(_Args&&...) const& = delete;
 
   template <class... _Args, class = enable_if_t<is_invocable_v<_Op, _BoundArgs..., _Args...>>>
-  _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Args&&... __args) &&
-    noexcept(noexcept(_Op()(_VSTD::get<_Idx>(_VSTD::move(__bound_args_))..., _VSTD::forward<_Args>(__args)...)))
-    -> decltype(      _Op()(_VSTD::get<_Idx>(_VSTD::move(__bound_args_))..., _VSTD::forward<_Args>(__args)...))
-    { return          _Op()(_VSTD::get<_Idx>(_VSTD::move(__bound_args_))..., _VSTD::forward<_Args>(__args)...); }
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Args&&... __args) &&
+    noexcept(noexcept(_Op()(_CUDA_VSTD::get<_Idx>(_CUDA_VSTD::move(__bound_args_))..., _CUDA_VSTD::forward<_Args>(__args)...)))
+    -> decltype(      _Op()(_CUDA_VSTD::get<_Idx>(_CUDA_VSTD::move(__bound_args_))..., _CUDA_VSTD::forward<_Args>(__args)...))
+    { return          _Op()(_CUDA_VSTD::get<_Idx>(_CUDA_VSTD::move(__bound_args_))..., _CUDA_VSTD::forward<_Args>(__args)...); }
 
   template <class... _Args, class = enable_if_t<!is_invocable_v<_Op, _BoundArgs..., _Args...>>>
   auto operator()(_Args&&...) && = delete;
 
   template <class... _Args, class = enable_if_t<is_invocable_v<_Op, _BoundArgs const..., _Args...>>>
-  _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Args&&... __args) const&&
-    noexcept(noexcept(_Op()(_VSTD::get<_Idx>(_VSTD::move(__bound_args_))..., _VSTD::forward<_Args>(__args)...)))
-    -> decltype(      _Op()(_VSTD::get<_Idx>(_VSTD::move(__bound_args_))..., _VSTD::forward<_Args>(__args)...))
-    { return          _Op()(_VSTD::get<_Idx>(_VSTD::move(__bound_args_))..., _VSTD::forward<_Args>(__args)...); }
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Args&&... __args) const&&
+    noexcept(noexcept(_Op()(_CUDA_VSTD::get<_Idx>(_CUDA_VSTD::move(__bound_args_))..., _CUDA_VSTD::forward<_Args>(__args)...)))
+    -> decltype(      _Op()(_CUDA_VSTD::get<_Idx>(_CUDA_VSTD::move(__bound_args_))..., _CUDA_VSTD::forward<_Args>(__args)...))
+    { return          _Op()(_CUDA_VSTD::get<_Idx>(_CUDA_VSTD::move(__bound_args_))..., _CUDA_VSTD::forward<_Args>(__args)...); }
 
   template <class... _Args, class = enable_if_t<!is_invocable_v<_Op, _BoundArgs const..., _Args...>>>
   auto operator()(_Args&&...) const&& = delete;
@@ -87,8 +87,8 @@ struct __perfect_forward_impl<_Op, index_sequence<_Idx...>, _BoundArgs...> {
 template <class _Op, class ..._Args>
 using __perfect_forward = __perfect_forward_impl<_Op, index_sequence_for<_Args...>, _Args...>;
 
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCUDACXX_STD_VER > 14
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___FUNCTIONAL_PERFECT_FORWARD_H
+#endif // _LIBCUDACXX___FUNCTIONAL_PERFECT_FORWARD_H

diff  --git a/libcxx/include/__functional/pointer_to_binary_function.h b/libcxx/include/__functional/pointer_to_binary_function.h
index b2676c58f885..cd48debca7e9 100644
--- a/libcxx/include/__functional/pointer_to_binary_function.h
+++ b/libcxx/include/__functional/pointer_to_binary_function.h
@@ -7,40 +7,40 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FUNCTIONAL_POINTER_TO_BINARY_FUNCTION_H
-#define _LIBCPP___FUNCTIONAL_POINTER_TO_BINARY_FUNCTION_H
+#ifndef _LIBCUDACXX___FUNCTIONAL_POINTER_TO_BINARY_FUNCTION_H
+#define _LIBCUDACXX___FUNCTIONAL_POINTER_TO_BINARY_FUNCTION_H
 
 #include <__config>
 #include <__functional/binary_function.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
+#if _LIBCUDACXX_STD_VER <= 14 || defined(_LIBCUDACXX_ENABLE_CXX17_REMOVED_BINDERS)
 
 template <class _Arg1, class _Arg2, class _Result>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 pointer_to_binary_function
+class _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_DEPRECATED_IN_CXX11 pointer_to_binary_function
     : public __binary_function<_Arg1, _Arg2, _Result>
 {
     _Result (*__f_)(_Arg1, _Arg2);
 public:
-    _LIBCPP_INLINE_VISIBILITY explicit pointer_to_binary_function(_Result (*__f)(_Arg1, _Arg2))
+    _LIBCUDACXX_INLINE_VISIBILITY explicit pointer_to_binary_function(_Result (*__f)(_Arg1, _Arg2))
         : __f_(__f) {}
-    _LIBCPP_INLINE_VISIBILITY _Result operator()(_Arg1 __x, _Arg2 __y) const
+    _LIBCUDACXX_INLINE_VISIBILITY _Result operator()(_Arg1 __x, _Arg2 __y) const
         {return __f_(__x, __y);}
 };
 
 template <class _Arg1, class _Arg2, class _Result>
-_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_DEPRECATED_IN_CXX11 inline _LIBCUDACXX_INLINE_VISIBILITY
 pointer_to_binary_function<_Arg1,_Arg2,_Result>
 ptr_fun(_Result (*__f)(_Arg1,_Arg2))
     {return pointer_to_binary_function<_Arg1,_Arg2,_Result>(__f);}
 
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___FUNCTIONAL_POINTER_TO_BINARY_FUNCTION_H
+#endif // _LIBCUDACXX___FUNCTIONAL_POINTER_TO_BINARY_FUNCTION_H

diff  --git a/libcxx/include/__functional/pointer_to_unary_function.h b/libcxx/include/__functional/pointer_to_unary_function.h
index 77d07adf20f0..dbd866b65954 100644
--- a/libcxx/include/__functional/pointer_to_unary_function.h
+++ b/libcxx/include/__functional/pointer_to_unary_function.h
@@ -7,40 +7,40 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FUNCTIONAL_POINTER_TO_UNARY_FUNCTION_H
-#define _LIBCPP___FUNCTIONAL_POINTER_TO_UNARY_FUNCTION_H
+#ifndef _LIBCUDACXX___FUNCTIONAL_POINTER_TO_UNARY_FUNCTION_H
+#define _LIBCUDACXX___FUNCTIONAL_POINTER_TO_UNARY_FUNCTION_H
 
 #include <__config>
 #include <__functional/unary_function.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
+#if _LIBCUDACXX_STD_VER <= 14 || defined(_LIBCUDACXX_ENABLE_CXX17_REMOVED_BINDERS)
 
 template <class _Arg, class _Result>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 pointer_to_unary_function
+class _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_DEPRECATED_IN_CXX11 pointer_to_unary_function
     : public __unary_function<_Arg, _Result>
 {
     _Result (*__f_)(_Arg);
 public:
-    _LIBCPP_INLINE_VISIBILITY explicit pointer_to_unary_function(_Result (*__f)(_Arg))
+    _LIBCUDACXX_INLINE_VISIBILITY explicit pointer_to_unary_function(_Result (*__f)(_Arg))
         : __f_(__f) {}
-    _LIBCPP_INLINE_VISIBILITY _Result operator()(_Arg __x) const
+    _LIBCUDACXX_INLINE_VISIBILITY _Result operator()(_Arg __x) const
         {return __f_(__x);}
 };
 
 template <class _Arg, class _Result>
-_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_DEPRECATED_IN_CXX11 inline _LIBCUDACXX_INLINE_VISIBILITY
 pointer_to_unary_function<_Arg,_Result>
 ptr_fun(_Result (*__f)(_Arg))
     {return pointer_to_unary_function<_Arg,_Result>(__f);}
 
-#endif // _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
+#endif // _LIBCUDACXX_STD_VER <= 14 || defined(_LIBCUDACXX_ENABLE_CXX17_REMOVED_BINDERS)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___FUNCTIONAL_POINTER_TO_UNARY_FUNCTION_H
+#endif // _LIBCUDACXX___FUNCTIONAL_POINTER_TO_UNARY_FUNCTION_H

diff  --git a/libcxx/include/__functional/ranges_operations.h b/libcxx/include/__functional/ranges_operations.h
index 3f63a86731e0..1b747d7f395c 100644
--- a/libcxx/include/__functional/ranges_operations.h
+++ b/libcxx/include/__functional/ranges_operations.h
@@ -7,20 +7,20 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FUNCTIONAL_RANGES_OPERATIONS_H
-#define _LIBCPP___FUNCTIONAL_RANGES_OPERATIONS_H
+#ifndef _LIBCUDACXX___FUNCTIONAL_RANGES_OPERATIONS_H
+#define _LIBCUDACXX___FUNCTIONAL_RANGES_OPERATIONS_H
 
 #include <__config>
 #include <__utility/forward.h>
 #include <concepts>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 namespace ranges {
 
@@ -28,8 +28,8 @@ struct equal_to {
   template <class _Tp, class _Up>
   requires equality_comparable_with<_Tp, _Up>
   [[nodiscard]] constexpr bool operator()(_Tp &&__t, _Up &&__u) const
-      noexcept(noexcept(bool(_VSTD::forward<_Tp>(__t) == _VSTD::forward<_Up>(__u)))) {
-    return _VSTD::forward<_Tp>(__t) == _VSTD::forward<_Up>(__u);
+      noexcept(noexcept(bool(_CUDA_VSTD::forward<_Tp>(__t) == _CUDA_VSTD::forward<_Up>(__u)))) {
+    return _CUDA_VSTD::forward<_Tp>(__t) == _CUDA_VSTD::forward<_Up>(__u);
   }
 
   using is_transparent = void;
@@ -39,8 +39,8 @@ struct not_equal_to {
   template <class _Tp, class _Up>
   requires equality_comparable_with<_Tp, _Up>
   [[nodiscard]] constexpr bool operator()(_Tp &&__t, _Up &&__u) const
-      noexcept(noexcept(bool(!(_VSTD::forward<_Tp>(__t) == _VSTD::forward<_Up>(__u))))) {
-    return !(_VSTD::forward<_Tp>(__t) == _VSTD::forward<_Up>(__u));
+      noexcept(noexcept(bool(!(_CUDA_VSTD::forward<_Tp>(__t) == _CUDA_VSTD::forward<_Up>(__u))))) {
+    return !(_CUDA_VSTD::forward<_Tp>(__t) == _CUDA_VSTD::forward<_Up>(__u));
   }
 
   using is_transparent = void;
@@ -50,8 +50,8 @@ struct less {
   template <class _Tp, class _Up>
   requires totally_ordered_with<_Tp, _Up>
   [[nodiscard]] constexpr bool operator()(_Tp &&__t, _Up &&__u) const
-      noexcept(noexcept(bool(_VSTD::forward<_Tp>(__t) < _VSTD::forward<_Up>(__u)))) {
-    return _VSTD::forward<_Tp>(__t) < _VSTD::forward<_Up>(__u);
+      noexcept(noexcept(bool(_CUDA_VSTD::forward<_Tp>(__t) < _CUDA_VSTD::forward<_Up>(__u)))) {
+    return _CUDA_VSTD::forward<_Tp>(__t) < _CUDA_VSTD::forward<_Up>(__u);
   }
 
   using is_transparent = void;
@@ -61,8 +61,8 @@ struct less_equal {
   template <class _Tp, class _Up>
   requires totally_ordered_with<_Tp, _Up>
   [[nodiscard]] constexpr bool operator()(_Tp &&__t, _Up &&__u) const
-      noexcept(noexcept(bool(!(_VSTD::forward<_Up>(__u) < _VSTD::forward<_Tp>(__t))))) {
-    return !(_VSTD::forward<_Up>(__u) < _VSTD::forward<_Tp>(__t));
+      noexcept(noexcept(bool(!(_CUDA_VSTD::forward<_Up>(__u) < _CUDA_VSTD::forward<_Tp>(__t))))) {
+    return !(_CUDA_VSTD::forward<_Up>(__u) < _CUDA_VSTD::forward<_Tp>(__t));
   }
 
   using is_transparent = void;
@@ -72,8 +72,8 @@ struct greater {
   template <class _Tp, class _Up>
   requires totally_ordered_with<_Tp, _Up>
   [[nodiscard]] constexpr bool operator()(_Tp &&__t, _Up &&__u) const
-      noexcept(noexcept(bool(_VSTD::forward<_Up>(__u) < _VSTD::forward<_Tp>(__t)))) {
-    return _VSTD::forward<_Up>(__u) < _VSTD::forward<_Tp>(__t);
+      noexcept(noexcept(bool(_CUDA_VSTD::forward<_Up>(__u) < _CUDA_VSTD::forward<_Tp>(__t)))) {
+    return _CUDA_VSTD::forward<_Up>(__u) < _CUDA_VSTD::forward<_Tp>(__t);
   }
 
   using is_transparent = void;
@@ -83,8 +83,8 @@ struct greater_equal {
   template <class _Tp, class _Up>
   requires totally_ordered_with<_Tp, _Up>
   [[nodiscard]] constexpr bool operator()(_Tp &&__t, _Up &&__u) const
-      noexcept(noexcept(bool(!(_VSTD::forward<_Tp>(__t) < _VSTD::forward<_Up>(__u))))) {
-    return !(_VSTD::forward<_Tp>(__t) < _VSTD::forward<_Up>(__u));
+      noexcept(noexcept(bool(!(_CUDA_VSTD::forward<_Tp>(__t) < _CUDA_VSTD::forward<_Up>(__u))))) {
+    return !(_CUDA_VSTD::forward<_Tp>(__t) < _CUDA_VSTD::forward<_Up>(__u));
   }
 
   using is_transparent = void;
@@ -92,8 +92,8 @@ struct greater_equal {
 
 } // namespace ranges
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___FUNCTIONAL_RANGES_OPERATIONS_H
+#endif // _LIBCUDACXX___FUNCTIONAL_RANGES_OPERATIONS_H

diff  --git a/libcxx/include/__functional/reference_wrapper.h b/libcxx/include/__functional/reference_wrapper.h
index 8245e3a04734..ef3d22774384 100644
--- a/libcxx/include/__functional/reference_wrapper.h
+++ b/libcxx/include/__functional/reference_wrapper.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FUNCTIONAL_REFERENCE_WRAPPER_H
-#define _LIBCPP___FUNCTIONAL_REFERENCE_WRAPPER_H
+#ifndef _LIBCUDACXX___FUNCTIONAL_REFERENCE_WRAPPER_H
+#define _LIBCUDACXX___FUNCTIONAL_REFERENCE_WRAPPER_H
 
 #include <__config>
 #include <__functional/weak_result_type.h>
@@ -16,14 +16,14 @@
 #include <__utility/forward.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Tp>
-class _LIBCPP_TEMPLATE_VIS reference_wrapper : public __weak_result_type<_Tp>
+class _LIBCUDACXX_TEMPLATE_VIS reference_wrapper : public __weak_result_type<_Tp>
 {
 public:
     // types
@@ -36,34 +36,34 @@ class _LIBCPP_TEMPLATE_VIS reference_wrapper : public __weak_result_type<_Tp>
 
 public:
     template <class _Up, class = __enable_if_t<!__is_same_uncvref<_Up, reference_wrapper>::value, decltype(__fun(declval<_Up>())) > >
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     reference_wrapper(_Up&& __u) _NOEXCEPT_(noexcept(__fun(declval<_Up>()))) {
         type& __f = static_cast<_Up&&>(__u);
-        __f_ = _VSTD::addressof(__f);
+        __f_ = _CUDA_VSTD::addressof(__f);
     }
 
     // access
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     operator type&() const _NOEXCEPT {return *__f_;}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     type& get() const _NOEXCEPT {return *__f_;}
 
     // invoke
     template <class... _ArgTypes>
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     typename __invoke_of<type&, _ArgTypes...>::type
     operator() (_ArgTypes&&... __args) const {
         return std::__invoke(get(), std::forward<_ArgTypes>(__args)...);
     }
 };
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 reference_wrapper(_Tp&) -> reference_wrapper<_Tp>;
 #endif
 
 template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 reference_wrapper<_Tp>
 ref(_Tp& __t) _NOEXCEPT
 {
@@ -71,7 +71,7 @@ ref(_Tp& __t) _NOEXCEPT
 }
 
 template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 reference_wrapper<_Tp>
 ref(reference_wrapper<_Tp> __t) _NOEXCEPT
 {
@@ -79,7 +79,7 @@ ref(reference_wrapper<_Tp> __t) _NOEXCEPT
 }
 
 template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 reference_wrapper<const _Tp>
 cref(const _Tp& __t) _NOEXCEPT
 {
@@ -87,7 +87,7 @@ cref(const _Tp& __t) _NOEXCEPT
 }
 
 template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 reference_wrapper<const _Tp>
 cref(reference_wrapper<_Tp> __t) _NOEXCEPT
 {
@@ -97,6 +97,6 @@ cref(reference_wrapper<_Tp> __t) _NOEXCEPT
 template <class _Tp> void ref(const _Tp&&) = delete;
 template <class _Tp> void cref(const _Tp&&) = delete;
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___FUNCTIONAL_REFERENCE_WRAPPER_H
+#endif // _LIBCUDACXX___FUNCTIONAL_REFERENCE_WRAPPER_H

diff  --git a/libcxx/include/__functional/unary_function.h b/libcxx/include/__functional/unary_function.h
index f07cac175a99..37987918c840 100644
--- a/libcxx/include/__functional/unary_function.h
+++ b/libcxx/include/__functional/unary_function.h
@@ -6,46 +6,46 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FUNCTIONAL_UNARY_FUNCTION_H
-#define _LIBCPP___FUNCTIONAL_UNARY_FUNCTION_H
+#ifndef _LIBCUDACXX___FUNCTIONAL_UNARY_FUNCTION_H
+#define _LIBCUDACXX___FUNCTIONAL_UNARY_FUNCTION_H
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION)
+#if _LIBCUDACXX_STD_VER <= 14 || defined(_LIBCUDACXX_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION)
 
 template <class _Arg, class _Result>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 unary_function
+struct _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_DEPRECATED_IN_CXX11 unary_function
 {
     typedef _Arg    argument_type;
     typedef _Result result_type;
 };
 
-#endif // _LIBCPP_STD_VER <= 14
+#endif // _LIBCUDACXX_STD_VER <= 14
 
 template <class _Arg, class _Result> struct __unary_function_keep_layout_base {
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
-  using argument_type _LIBCPP_DEPRECATED_IN_CXX17 = _Arg;
-  using result_type _LIBCPP_DEPRECATED_IN_CXX17 = _Result;
+#if _LIBCUDACXX_STD_VER <= 17 || defined(_LIBCUDACXX_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+  using argument_type _LIBCUDACXX_DEPRECATED_IN_CXX17 = _Arg;
+  using result_type _LIBCUDACXX_DEPRECATED_IN_CXX17 = _Result;
 #endif
 };
 
-#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION)
-_LIBCPP_DIAGNOSTIC_PUSH
-_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wdeprecated-declarations")
+#if _LIBCUDACXX_STD_VER <= 14 || defined(_LIBCUDACXX_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION)
+_LIBCUDACXX_DIAGNOSTIC_PUSH
+_LIBCUDACXX_CLANG_DIAGNOSTIC_IGNORED("-Wdeprecated-declarations")
 template <class _Arg, class _Result>
 using __unary_function = unary_function<_Arg, _Result>;
-_LIBCPP_DIAGNOSTIC_POP
+_LIBCUDACXX_DIAGNOSTIC_POP
 #else
 template <class _Arg, class _Result>
 using __unary_function = __unary_function_keep_layout_base<_Arg, _Result>;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___FUNCTIONAL_UNARY_FUNCTION_H
+#endif // _LIBCUDACXX___FUNCTIONAL_UNARY_FUNCTION_H

diff  --git a/libcxx/include/__functional/unary_negate.h b/libcxx/include/__functional/unary_negate.h
index 7f081903fe44..36b584d4338e 100644
--- a/libcxx/include/__functional/unary_negate.h
+++ b/libcxx/include/__functional/unary_negate.h
@@ -7,41 +7,41 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FUNCTIONAL_UNARY_NEGATE_H
-#define _LIBCPP___FUNCTIONAL_UNARY_NEGATE_H
+#ifndef _LIBCUDACXX___FUNCTIONAL_UNARY_NEGATE_H
+#define _LIBCUDACXX___FUNCTIONAL_UNARY_NEGATE_H
 
 #include <__config>
 #include <__functional/unary_function.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_NEGATORS)
+#if _LIBCUDACXX_STD_VER <= 17 || defined(_LIBCUDACXX_ENABLE_CXX20_REMOVED_NEGATORS)
 
 template <class _Predicate>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 unary_negate
+class _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_DEPRECATED_IN_CXX17 unary_negate
     : public __unary_function<typename _Predicate::argument_type, bool>
 {
     _Predicate __pred_;
 public:
-    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
     explicit unary_negate(const _Predicate& __pred)
         : __pred_(__pred) {}
-    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
     bool operator()(const typename _Predicate::argument_type& __x) const
         {return !__pred_(__x);}
 };
 
 template <class _Predicate>
-_LIBCPP_DEPRECATED_IN_CXX17 inline _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_DEPRECATED_IN_CXX17 inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
 unary_negate<_Predicate>
 not1(const _Predicate& __pred) {return unary_negate<_Predicate>(__pred);}
 
-#endif // _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_NEGATORS)
+#endif // _LIBCUDACXX_STD_VER <= 17 || defined(_LIBCUDACXX_ENABLE_CXX20_REMOVED_NEGATORS)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___FUNCTIONAL_UNARY_NEGATE_H
+#endif // _LIBCUDACXX___FUNCTIONAL_UNARY_NEGATE_H

diff  --git a/libcxx/include/__functional/unwrap_ref.h b/libcxx/include/__functional/unwrap_ref.h
index f7207934e1b4..2740e78dacfe 100644
--- a/libcxx/include/__functional/unwrap_ref.h
+++ b/libcxx/include/__functional/unwrap_ref.h
@@ -6,30 +6,30 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FUNCTIONAL_UNWRAP_REF_H
-#define _LIBCPP___FUNCTIONAL_UNWRAP_REF_H
+#ifndef _LIBCUDACXX___FUNCTIONAL_UNWRAP_REF_H
+#define _LIBCUDACXX___FUNCTIONAL_UNWRAP_REF_H
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Tp>
-struct __unwrap_reference { typedef _LIBCPP_NODEBUG _Tp type; };
+struct __unwrap_reference { typedef _LIBCUDACXX_NODEBUG _Tp type; };
 
 template <class _Tp>
 class reference_wrapper;
 
 template <class _Tp>
-struct __unwrap_reference<reference_wrapper<_Tp> > { typedef _LIBCPP_NODEBUG _Tp& type; };
+struct __unwrap_reference<reference_wrapper<_Tp> > { typedef _LIBCUDACXX_NODEBUG _Tp& type; };
 
 template <class _Tp>
 struct decay;
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 template <class _Tp>
 struct unwrap_reference : __unwrap_reference<_Tp> { };
 
@@ -45,13 +45,13 @@ using unwrap_ref_decay_t = typename unwrap_ref_decay<_Tp>::type;
 
 template <class _Tp>
 struct __unwrap_ref_decay
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
     : unwrap_ref_decay<_Tp>
 #else
     : __unwrap_reference<typename decay<_Tp>::type>
 #endif
 { };
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___FUNCTIONAL_UNWRAP_REF_H
+#endif // _LIBCUDACXX___FUNCTIONAL_UNWRAP_REF_H

diff  --git a/libcxx/include/__functional/weak_result_type.h b/libcxx/include/__functional/weak_result_type.h
index 96d8cf7146b1..879bad2cfbf1 100644
--- a/libcxx/include/__functional/weak_result_type.h
+++ b/libcxx/include/__functional/weak_result_type.h
@@ -7,19 +7,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FUNCTIONAL_WEAK_RESULT_TYPE_H
-#define _LIBCPP___FUNCTIONAL_WEAK_RESULT_TYPE_H
+#ifndef _LIBCUDACXX___FUNCTIONAL_WEAK_RESULT_TYPE_H
+#define _LIBCUDACXX___FUNCTIONAL_WEAK_RESULT_TYPE_H
 
 #include <__config>
 #include <__functional/binary_function.h>
 #include <__functional/unary_function.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Tp>
 struct __has_result_type
@@ -90,8 +90,8 @@ struct __weak_result_type_imp // bool is true
     : public __maybe_derive_from_unary_function<_Tp>,
       public __maybe_derive_from_binary_function<_Tp>
 {
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
-    using result_type _LIBCPP_NODEBUG _LIBCPP_DEPRECATED_IN_CXX17 = typename _Tp::result_type;
+#if _LIBCUDACXX_STD_VER <= 17 || defined(_LIBCUDACXX_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+    using result_type _LIBCUDACXX_NODEBUG _LIBCUDACXX_DEPRECATED_IN_CXX17 = typename _Tp::result_type;
 #endif
 };
 
@@ -113,24 +113,24 @@ struct __weak_result_type
 template <class _Rp>
 struct __weak_result_type<_Rp ()>
 {
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
-    using result_type _LIBCPP_NODEBUG _LIBCPP_DEPRECATED_IN_CXX17 = _Rp;
+#if _LIBCUDACXX_STD_VER <= 17 || defined(_LIBCUDACXX_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+    using result_type _LIBCUDACXX_NODEBUG _LIBCUDACXX_DEPRECATED_IN_CXX17 = _Rp;
 #endif
 };
 
 template <class _Rp>
 struct __weak_result_type<_Rp (&)()>
 {
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
-    using result_type _LIBCPP_NODEBUG _LIBCPP_DEPRECATED_IN_CXX17 = _Rp;
+#if _LIBCUDACXX_STD_VER <= 17 || defined(_LIBCUDACXX_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+    using result_type _LIBCUDACXX_NODEBUG _LIBCUDACXX_DEPRECATED_IN_CXX17 = _Rp;
 #endif
 };
 
 template <class _Rp>
 struct __weak_result_type<_Rp (*)()>
 {
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
-    using result_type _LIBCPP_NODEBUG _LIBCPP_DEPRECATED_IN_CXX17 = _Rp;
+#if _LIBCUDACXX_STD_VER <= 17 || defined(_LIBCUDACXX_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+    using result_type _LIBCUDACXX_NODEBUG _LIBCUDACXX_DEPRECATED_IN_CXX17 = _Rp;
 #endif
 };
 
@@ -227,65 +227,65 @@ struct __weak_result_type<_Rp (_Cp::*)(_A1) const volatile>
 template <class _Rp, class _A1, class _A2, class _A3, class ..._A4>
 struct __weak_result_type<_Rp (_A1, _A2, _A3, _A4...)>
 {
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
-    using result_type _LIBCPP_NODEBUG _LIBCPP_DEPRECATED_IN_CXX17 = _Rp;
+#if _LIBCUDACXX_STD_VER <= 17 || defined(_LIBCUDACXX_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+    using result_type _LIBCUDACXX_NODEBUG _LIBCUDACXX_DEPRECATED_IN_CXX17 = _Rp;
 #endif
 };
 
 template <class _Rp, class _A1, class _A2, class _A3, class ..._A4>
 struct __weak_result_type<_Rp (&)(_A1, _A2, _A3, _A4...)>
 {
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
-    using result_type _LIBCPP_NODEBUG _LIBCPP_DEPRECATED_IN_CXX17 = _Rp;
+#if _LIBCUDACXX_STD_VER <= 17 || defined(_LIBCUDACXX_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+    using result_type _LIBCUDACXX_NODEBUG _LIBCUDACXX_DEPRECATED_IN_CXX17 = _Rp;
 #endif
 };
 
 template <class _Rp, class _A1, class _A2, class _A3, class ..._A4>
 struct __weak_result_type<_Rp (*)(_A1, _A2, _A3, _A4...)>
 {
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
-    using result_type _LIBCPP_NODEBUG _LIBCPP_DEPRECATED_IN_CXX17 = _Rp;
+#if _LIBCUDACXX_STD_VER <= 17 || defined(_LIBCUDACXX_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+    using result_type _LIBCUDACXX_NODEBUG _LIBCUDACXX_DEPRECATED_IN_CXX17 = _Rp;
 #endif
 };
 
 template <class _Rp, class _Cp, class _A1, class _A2, class ..._A3>
 struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...)>
 {
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
-    using result_type _LIBCPP_NODEBUG _LIBCPP_DEPRECATED_IN_CXX17 = _Rp;
+#if _LIBCUDACXX_STD_VER <= 17 || defined(_LIBCUDACXX_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+    using result_type _LIBCUDACXX_NODEBUG _LIBCUDACXX_DEPRECATED_IN_CXX17 = _Rp;
 #endif
 };
 
 template <class _Rp, class _Cp, class _A1, class _A2, class ..._A3>
 struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...) const>
 {
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
-    using result_type _LIBCPP_NODEBUG _LIBCPP_DEPRECATED_IN_CXX17 = _Rp;
+#if _LIBCUDACXX_STD_VER <= 17 || defined(_LIBCUDACXX_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+    using result_type _LIBCUDACXX_NODEBUG _LIBCUDACXX_DEPRECATED_IN_CXX17 = _Rp;
 #endif
 };
 
 template <class _Rp, class _Cp, class _A1, class _A2, class ..._A3>
 struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...) volatile>
 {
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
-    using result_type _LIBCPP_NODEBUG _LIBCPP_DEPRECATED_IN_CXX17 = _Rp;
+#if _LIBCUDACXX_STD_VER <= 17 || defined(_LIBCUDACXX_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+    using result_type _LIBCUDACXX_NODEBUG _LIBCUDACXX_DEPRECATED_IN_CXX17 = _Rp;
 #endif
 };
 
 template <class _Rp, class _Cp, class _A1, class _A2, class ..._A3>
 struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...) const volatile>
 {
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
-    using result_type _LIBCPP_NODEBUG _LIBCPP_DEPRECATED_IN_CXX17 = _Rp;
+#if _LIBCUDACXX_STD_VER <= 17 || defined(_LIBCUDACXX_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+    using result_type _LIBCUDACXX_NODEBUG _LIBCUDACXX_DEPRECATED_IN_CXX17 = _Rp;
 #endif
 };
 
 template <class _Tp, class ..._Args>
 struct __invoke_return
 {
-    typedef decltype(_VSTD::__invoke(declval<_Tp>(), declval<_Args>()...)) type;
+    typedef decltype(_CUDA_VSTD::__invoke(declval<_Tp>(), declval<_Args>()...)) type;
 };
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___FUNCTIONAL_WEAK_RESULT_TYPE_H
+#endif // _LIBCUDACXX___FUNCTIONAL_WEAK_RESULT_TYPE_H

diff  --git a/libcxx/include/__fwd/span.h b/libcxx/include/__fwd/span.h
index f38b8cfa0526..7a901c9e4c37 100644
--- a/libcxx/include/__fwd/span.h
+++ b/libcxx/include/__fwd/span.h
@@ -7,31 +7,31 @@
 //
 //===---------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_FWD_SPAN_H
-#define _LIBCPP_FWD_SPAN_H
+#ifndef _LIBCUDACXX_FWD_SPAN_H
+#define _LIBCUDACXX_FWD_SPAN_H
 
 #include <__config>
 #include <cstddef>
 #include <limits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 inline constexpr size_t dynamic_extent = numeric_limits<size_t>::max();
 template <typename _Tp, size_t _Extent = dynamic_extent> class span;
 
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP_FWD_SPAN_H
+#endif // _LIBCUDACXX_FWD_SPAN_H

diff  --git a/libcxx/include/__fwd/string_view.h b/libcxx/include/__fwd/string_view.h
index e5e77b292a6e..a98ecf84295c 100644
--- a/libcxx/include/__fwd/string_view.h
+++ b/libcxx/include/__fwd/string_view.h
@@ -7,31 +7,31 @@
 //
 //===---------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_FWD_STRING_VIEW_H
-#define _LIBCPP_FWD_STRING_VIEW_H
+#ifndef _LIBCUDACXX_FWD_STRING_VIEW_H
+#define _LIBCUDACXX_FWD_STRING_VIEW_H
 
 #include <__config>
 #include <iosfwd> // char_traits
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template<class _CharT, class _Traits = char_traits<_CharT> >
-class _LIBCPP_TEMPLATE_VIS basic_string_view;
+class _LIBCUDACXX_TEMPLATE_VIS basic_string_view;
 
 typedef basic_string_view<char>     string_view;
-#ifndef _LIBCPP_HAS_NO_CHAR8_T
+#ifndef _LIBCUDACXX_HAS_NO_CHAR8_T
 typedef basic_string_view<char8_t>  u8string_view;
 #endif
 typedef basic_string_view<char16_t> u16string_view;
 typedef basic_string_view<char32_t> u32string_view;
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 typedef basic_string_view<wchar_t>  wstring_view;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_FWD_STRING_VIEW_H
+#endif // _LIBCUDACXX_FWD_STRING_VIEW_H

diff  --git a/libcxx/include/__hash_table b/libcxx/include/__hash_table
index 959ef7fe7d83..6ca9de3fc8fa 100644
--- a/libcxx/include/__hash_table
+++ b/libcxx/include/__hash_table
@@ -7,13 +7,13 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___HASH_TABLE
-#define _LIBCPP___HASH_TABLE
+#ifndef _LIBCUDACXX___HASH_TABLE
+#define _LIBCUDACXX___HASH_TABLE
 
 #include <__algorithm/max.h>
 #include <__algorithm/min.h>
 #include <__assert>
-#include <__bits> // __libcpp_clz
+#include <__bits> // __LIBCUDACXX_clz
 #include <__config>
 #include <__debug>
 #include <__functional/hash.h>
@@ -25,15 +25,15 @@
 #include <memory>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Key, class _Tp>
 struct __hash_value_type;
@@ -50,7 +50,7 @@ struct __is_hash_value_type : false_type {};
 template <class _One>
 struct __is_hash_value_type<_One> : __is_hash_value_type_imp<__uncvref_t<_One> > {};
 
-_LIBCPP_FUNC_VIS
+_LIBCUDACXX_FUNC_VIS
 size_t __next_prime(size_t __n);
 
 template <class _NodePtr>
@@ -61,7 +61,7 @@ struct __hash_node_base
     typedef typename __rebind_pointer<_NodePtr, __first_node>::type __node_base_pointer;
     typedef _NodePtr __node_pointer;
 
-#if defined(_LIBCPP_ABI_FIX_UNORDERED_NODE_POINTER_UB)
+#if defined(_LIBCUDACXX_ABI_FIX_UNORDERED_NODE_POINTER_UB)
   typedef __node_base_pointer __next_pointer;
 #else
   typedef typename conditional<
@@ -72,28 +72,28 @@ struct __hash_node_base
 
     __next_pointer    __next_;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __next_pointer __ptr() _NOEXCEPT {
         return static_cast<__next_pointer>(
             pointer_traits<__node_base_pointer>::pointer_to(*this));
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __node_pointer __upcast() _NOEXCEPT {
         return static_cast<__node_pointer>(
             pointer_traits<__node_base_pointer>::pointer_to(*this));
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t __hash() const _NOEXCEPT {
         return static_cast<__node_type const&>(*this).__hash_;
     }
 
-    _LIBCPP_INLINE_VISIBILITY __hash_node_base() _NOEXCEPT : __next_(nullptr) {}
+    _LIBCUDACXX_INLINE_VISIBILITY __hash_node_base() _NOEXCEPT : __next_(nullptr) {}
 };
 
 template <class _Tp, class _VoidPtr>
-struct _LIBCPP_STANDALONE_DEBUG __hash_node
+struct _LIBCUDACXX_STANDALONE_DEBUG __hash_node
     : public __hash_node_base
              <
                  typename __rebind_pointer<_VoidPtr, __hash_node<_Tp, _VoidPtr> >::type
@@ -105,14 +105,14 @@ struct _LIBCPP_STANDALONE_DEBUG __hash_node
     __node_value_type __value_;
 };
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 __is_hash_power2(size_t __bc)
 {
     return __bc > 2 && !(__bc & (__bc - 1));
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 size_t
 __constrain_hash(size_t __h, size_t __bc)
 {
@@ -120,22 +120,22 @@ __constrain_hash(size_t __h, size_t __bc)
         (__h < __bc ? __h : __h % __bc);
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 size_t
 __next_hash_pow2(size_t __n)
 {
-    return __n < 2 ? __n : (size_t(1) << (numeric_limits<size_t>::digits - __libcpp_clz(__n-1)));
+    return __n < 2 ? __n : (size_t(1) << (numeric_limits<size_t>::digits - __LIBCUDACXX_clz(__n-1)));
 }
 
 
 template <class _Tp, class _Hash, class _Equal, class _Alloc> class __hash_table;
 
-template <class _NodePtr>      class _LIBCPP_TEMPLATE_VIS __hash_iterator;
-template <class _ConstNodePtr> class _LIBCPP_TEMPLATE_VIS __hash_const_iterator;
-template <class _NodePtr>      class _LIBCPP_TEMPLATE_VIS __hash_local_iterator;
-template <class _ConstNodePtr> class _LIBCPP_TEMPLATE_VIS __hash_const_local_iterator;
-template <class _HashIterator> class _LIBCPP_TEMPLATE_VIS __hash_map_iterator;
-template <class _HashIterator> class _LIBCPP_TEMPLATE_VIS __hash_map_const_iterator;
+template <class _NodePtr>      class _LIBCUDACXX_TEMPLATE_VIS __hash_iterator;
+template <class _ConstNodePtr> class _LIBCUDACXX_TEMPLATE_VIS __hash_const_iterator;
+template <class _NodePtr>      class _LIBCUDACXX_TEMPLATE_VIS __hash_local_iterator;
+template <class _ConstNodePtr> class _LIBCUDACXX_TEMPLATE_VIS __hash_const_local_iterator;
+template <class _HashIterator> class _LIBCUDACXX_TEMPLATE_VIS __hash_map_iterator;
+template <class _HashIterator> class _LIBCUDACXX_TEMPLATE_VIS __hash_map_const_iterator;
 
 template <class _Tp>
 struct __hash_key_value_types {
@@ -145,21 +145,21 @@ struct __hash_key_value_types {
   typedef _Tp __container_value_type;
   static const bool __is_map = false;
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   static key_type const& __get_key(_Tp const& __v) {
     return __v;
   }
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   static __container_value_type const& __get_value(__node_value_type const& __v) {
     return __v;
   }
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   static __container_value_type* __get_ptr(__node_value_type& __n) {
-    return _VSTD::addressof(__n);
+    return _CUDA_VSTD::addressof(__n);
   }
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   static __container_value_type&& __move(__node_value_type& __v) {
-    return _VSTD::move(__v);
+    return _CUDA_VSTD::move(__v);
   }
 };
 
@@ -172,30 +172,30 @@ struct __hash_key_value_types<__hash_value_type<_Key, _Tp> > {
   typedef __container_value_type                       __map_value_type;
   static const bool __is_map = true;
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   static key_type const& __get_key(__container_value_type const& __v) {
     return __v.first;
   }
 
   template <class _Up>
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   static __enable_if_t<__is_same_uncvref<_Up, __node_value_type>::value, __container_value_type const&>
   __get_value(_Up& __t) {
     return __t.__get_value();
   }
 
   template <class _Up>
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   static __enable_if_t<__is_same_uncvref<_Up, __container_value_type>::value, __container_value_type const&>
   __get_value(_Up& __t) {
     return __t;
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   static __container_value_type* __get_ptr(__node_value_type& __n) {
-    return _VSTD::addressof(__n.__get_value());
+    return _CUDA_VSTD::addressof(__n.__get_value());
   }
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   static pair<key_type&&, mapped_type&&> __move(__node_value_type& __v) {
     return __v.__move();
   }
@@ -274,7 +274,7 @@ struct __make_hash_node_types {
 };
 
 template <class _NodePtr>
-class _LIBCPP_TEMPLATE_VIS __hash_iterator
+class _LIBCUDACXX_TEMPLATE_VIS __hash_iterator
 {
     typedef __hash_node_types<_NodePtr> _NodeTypes;
     typedef _NodePtr                            __node_pointer;
@@ -289,59 +289,59 @@ public:
     typedef value_type&                                    reference;
     typedef typename _NodeTypes::__node_value_type_pointer pointer;
 
-    _LIBCPP_INLINE_VISIBILITY __hash_iterator() _NOEXCEPT : __node_(nullptr) {
-        _VSTD::__debug_db_insert_i(this);
+    _LIBCUDACXX_INLINE_VISIBILITY __hash_iterator() _NOEXCEPT : __node_(nullptr) {
+        _CUDA_VSTD::__debug_db_insert_i(this);
     }
 
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
-    _LIBCPP_INLINE_VISIBILITY
+#ifdef _LIBCUDACXX_ENABLE_DEBUG_MODE
+    _LIBCUDACXX_INLINE_VISIBILITY
     __hash_iterator(const __hash_iterator& __i)
         : __node_(__i.__node_)
     {
-        __get_db()->__iterator_copy(this, _VSTD::addressof(__i));
+        __get_db()->__iterator_copy(this, _CUDA_VSTD::addressof(__i));
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     ~__hash_iterator()
     {
         __get_db()->__erase_i(this);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __hash_iterator& operator=(const __hash_iterator& __i)
     {
-        if (this != _VSTD::addressof(__i))
+        if (this != _CUDA_VSTD::addressof(__i))
         {
-            __get_db()->__iterator_copy(this, _VSTD::addressof(__i));
+            __get_db()->__iterator_copy(this, _CUDA_VSTD::addressof(__i));
             __node_ = __i.__node_;
         }
         return *this;
     }
-#endif // _LIBCPP_ENABLE_DEBUG_MODE
+#endif // _LIBCUDACXX_ENABLE_DEBUG_MODE
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     reference operator*() const {
-        _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
+        _LIBCUDACXX_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
                              "Attempted to dereference a non-dereferenceable unordered container iterator");
         return __node_->__upcast()->__value_;
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     pointer operator->() const {
-        _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
+        _LIBCUDACXX_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
                            "Attempted to dereference a non-dereferenceable unordered container iterator");
         return pointer_traits<pointer>::pointer_to(__node_->__upcast()->__value_);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __hash_iterator& operator++() {
-        _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
+        _LIBCUDACXX_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
                        "Attempted to increment a non-incrementable unordered container iterator");
         __node_ = __node_->__next_;
         return *this;
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __hash_iterator operator++(int)
     {
         __hash_iterator __t(*this);
@@ -349,34 +349,34 @@ public:
         return __t;
     }
 
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
     bool operator==(const __hash_iterator& __x, const __hash_iterator& __y)
     {
         return __x.__node_ == __y.__node_;
     }
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
     bool operator!=(const __hash_iterator& __x, const __hash_iterator& __y)
         {return !(__x == __y);}
 
 private:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __hash_iterator(__next_pointer __node, const void* __c) _NOEXCEPT
         : __node_(__node)
         {
             (void)__c;
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
+#ifdef _LIBCUDACXX_ENABLE_DEBUG_MODE
             __get_db()->__insert_ic(this, __c);
 #endif
         }
     template <class, class, class, class> friend class __hash_table;
-    template <class> friend class _LIBCPP_TEMPLATE_VIS __hash_const_iterator;
-    template <class> friend class _LIBCPP_TEMPLATE_VIS __hash_map_iterator;
-    template <class, class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS unordered_map;
-    template <class, class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS unordered_multimap;
+    template <class> friend class _LIBCUDACXX_TEMPLATE_VIS __hash_const_iterator;
+    template <class> friend class _LIBCUDACXX_TEMPLATE_VIS __hash_map_iterator;
+    template <class, class, class, class, class> friend class _LIBCUDACXX_TEMPLATE_VIS unordered_map;
+    template <class, class, class, class, class> friend class _LIBCUDACXX_TEMPLATE_VIS unordered_multimap;
 };
 
 template <class _NodePtr>
-class _LIBCPP_TEMPLATE_VIS __hash_const_iterator
+class _LIBCUDACXX_TEMPLATE_VIS __hash_const_iterator
 {
     static_assert(!is_const<typename pointer_traits<_NodePtr>::element_type>::value, "");
     typedef __hash_node_types<_NodePtr> _NodeTypes;
@@ -395,67 +395,67 @@ public:
     typedef typename _NodeTypes::__const_node_value_type_pointer pointer;
 
 
-    _LIBCPP_INLINE_VISIBILITY __hash_const_iterator() _NOEXCEPT : __node_(nullptr) {
-        _VSTD::__debug_db_insert_i(this);
+    _LIBCUDACXX_INLINE_VISIBILITY __hash_const_iterator() _NOEXCEPT : __node_(nullptr) {
+        _CUDA_VSTD::__debug_db_insert_i(this);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __hash_const_iterator(const __non_const_iterator& __x) _NOEXCEPT
         : __node_(__x.__node_)
     {
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
-        __get_db()->__iterator_copy(this, _VSTD::addressof(__x));
+#ifdef _LIBCUDACXX_ENABLE_DEBUG_MODE
+        __get_db()->__iterator_copy(this, _CUDA_VSTD::addressof(__x));
 #endif
     }
 
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
-    _LIBCPP_INLINE_VISIBILITY
+#ifdef _LIBCUDACXX_ENABLE_DEBUG_MODE
+    _LIBCUDACXX_INLINE_VISIBILITY
     __hash_const_iterator(const __hash_const_iterator& __i)
         : __node_(__i.__node_)
     {
-        __get_db()->__iterator_copy(this, _VSTD::addressof(__i));
+        __get_db()->__iterator_copy(this, _CUDA_VSTD::addressof(__i));
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     ~__hash_const_iterator()
     {
         __get_db()->__erase_i(this);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __hash_const_iterator& operator=(const __hash_const_iterator& __i)
     {
-        if (this != _VSTD::addressof(__i))
+        if (this != _CUDA_VSTD::addressof(__i))
         {
-            __get_db()->__iterator_copy(this, _VSTD::addressof(__i));
+            __get_db()->__iterator_copy(this, _CUDA_VSTD::addressof(__i));
             __node_ = __i.__node_;
         }
         return *this;
     }
-#endif // _LIBCPP_ENABLE_DEBUG_MODE
+#endif // _LIBCUDACXX_ENABLE_DEBUG_MODE
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     reference operator*() const {
-        _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
+        _LIBCUDACXX_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
                            "Attempted to dereference a non-dereferenceable unordered container const_iterator");
         return __node_->__upcast()->__value_;
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     pointer operator->() const {
-        _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
+        _LIBCUDACXX_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
                            "Attempted to dereference a non-dereferenceable unordered container const_iterator");
         return pointer_traits<pointer>::pointer_to(__node_->__upcast()->__value_);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __hash_const_iterator& operator++() {
-        _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
+        _LIBCUDACXX_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
                              "Attempted to increment a non-incrementable unordered container const_iterator");
         __node_ = __node_->__next_;
         return *this;
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __hash_const_iterator operator++(int)
     {
         __hash_const_iterator __t(*this);
@@ -463,33 +463,33 @@ public:
         return __t;
     }
 
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
     bool operator==(const __hash_const_iterator& __x, const __hash_const_iterator& __y)
     {
         return __x.__node_ == __y.__node_;
     }
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
     bool operator!=(const __hash_const_iterator& __x, const __hash_const_iterator& __y)
         {return !(__x == __y);}
 
 private:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __hash_const_iterator(__next_pointer __node, const void* __c) _NOEXCEPT
         : __node_(__node)
         {
             (void)__c;
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
+#ifdef _LIBCUDACXX_ENABLE_DEBUG_MODE
             __get_db()->__insert_ic(this, __c);
 #endif
         }
     template <class, class, class, class> friend class __hash_table;
-    template <class> friend class _LIBCPP_TEMPLATE_VIS __hash_map_const_iterator;
-    template <class, class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS unordered_map;
-    template <class, class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS unordered_multimap;
+    template <class> friend class _LIBCUDACXX_TEMPLATE_VIS __hash_map_const_iterator;
+    template <class, class, class, class, class> friend class _LIBCUDACXX_TEMPLATE_VIS unordered_map;
+    template <class, class, class, class, class> friend class _LIBCUDACXX_TEMPLATE_VIS unordered_multimap;
 };
 
 template <class _NodePtr>
-class _LIBCPP_TEMPLATE_VIS __hash_local_iterator
+class _LIBCUDACXX_TEMPLATE_VIS __hash_local_iterator
 {
     typedef __hash_node_types<_NodePtr> _NodeTypes;
     typedef _NodePtr                            __node_pointer;
@@ -506,57 +506,57 @@ public:
     typedef value_type&                                         reference;
     typedef typename _NodeTypes::__node_value_type_pointer      pointer;
 
-    _LIBCPP_INLINE_VISIBILITY __hash_local_iterator() _NOEXCEPT : __node_(nullptr) {
-        _VSTD::__debug_db_insert_i(this);
+    _LIBCUDACXX_INLINE_VISIBILITY __hash_local_iterator() _NOEXCEPT : __node_(nullptr) {
+        _CUDA_VSTD::__debug_db_insert_i(this);
     }
 
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
-    _LIBCPP_INLINE_VISIBILITY
+#ifdef _LIBCUDACXX_ENABLE_DEBUG_MODE
+    _LIBCUDACXX_INLINE_VISIBILITY
     __hash_local_iterator(const __hash_local_iterator& __i)
         : __node_(__i.__node_),
           __bucket_(__i.__bucket_),
           __bucket_count_(__i.__bucket_count_)
     {
-        __get_db()->__iterator_copy(this, _VSTD::addressof(__i));
+        __get_db()->__iterator_copy(this, _CUDA_VSTD::addressof(__i));
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     ~__hash_local_iterator()
     {
         __get_db()->__erase_i(this);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __hash_local_iterator& operator=(const __hash_local_iterator& __i)
     {
-        if (this != _VSTD::addressof(__i))
+        if (this != _CUDA_VSTD::addressof(__i))
         {
-            __get_db()->__iterator_copy(this, _VSTD::addressof(__i));
+            __get_db()->__iterator_copy(this, _CUDA_VSTD::addressof(__i));
             __node_ = __i.__node_;
             __bucket_ = __i.__bucket_;
             __bucket_count_ = __i.__bucket_count_;
         }
         return *this;
     }
-#endif // _LIBCPP_ENABLE_DEBUG_MODE
+#endif // _LIBCUDACXX_ENABLE_DEBUG_MODE
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     reference operator*() const {
-        _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
+        _LIBCUDACXX_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
                            "Attempted to dereference a non-dereferenceable unordered container local_iterator");
         return __node_->__upcast()->__value_;
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     pointer operator->() const {
-        _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
+        _LIBCUDACXX_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
                              "Attempted to dereference a non-dereferenceable unordered container local_iterator");
         return pointer_traits<pointer>::pointer_to(__node_->__upcast()->__value_);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __hash_local_iterator& operator++() {
-        _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
+        _LIBCUDACXX_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
                        "Attempted to increment a non-incrementable unordered container local_iterator");
         __node_ = __node_->__next_;
         if (__node_ != nullptr && __constrain_hash(__node_->__hash(), __bucket_count_) != __bucket_)
@@ -564,7 +564,7 @@ public:
         return *this;
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __hash_local_iterator operator++(int)
     {
         __hash_local_iterator __t(*this);
@@ -572,17 +572,17 @@ public:
         return __t;
     }
 
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
     bool operator==(const __hash_local_iterator& __x, const __hash_local_iterator& __y)
     {
         return __x.__node_ == __y.__node_;
     }
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
     bool operator!=(const __hash_local_iterator& __x, const __hash_local_iterator& __y)
         {return !(__x == __y);}
 
 private:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __hash_local_iterator(__next_pointer __node, size_t __bucket,
                                    size_t __bucket_count, const void* __c) _NOEXCEPT
         : __node_(__node),
@@ -590,19 +590,19 @@ private:
           __bucket_count_(__bucket_count)
         {
             (void)__c;
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
+#ifdef _LIBCUDACXX_ENABLE_DEBUG_MODE
             __get_db()->__insert_ic(this, __c);
 #endif
             if (__node_ != nullptr)
                 __node_ = __node_->__next_;
         }
     template <class, class, class, class> friend class __hash_table;
-    template <class> friend class _LIBCPP_TEMPLATE_VIS __hash_const_local_iterator;
-    template <class> friend class _LIBCPP_TEMPLATE_VIS __hash_map_iterator;
+    template <class> friend class _LIBCUDACXX_TEMPLATE_VIS __hash_const_local_iterator;
+    template <class> friend class _LIBCUDACXX_TEMPLATE_VIS __hash_map_iterator;
 };
 
 template <class _ConstNodePtr>
-class _LIBCPP_TEMPLATE_VIS __hash_const_local_iterator
+class _LIBCUDACXX_TEMPLATE_VIS __hash_const_local_iterator
 {
     typedef __hash_node_types<_ConstNodePtr> _NodeTypes;
     typedef _ConstNodePtr                       __node_pointer;
@@ -628,68 +628,68 @@ public:
     typedef typename _NodeTypes::__const_node_value_type_pointer pointer;
 
 
-    _LIBCPP_INLINE_VISIBILITY __hash_const_local_iterator() _NOEXCEPT : __node_(nullptr) {
-        _VSTD::__debug_db_insert_i(this);
+    _LIBCUDACXX_INLINE_VISIBILITY __hash_const_local_iterator() _NOEXCEPT : __node_(nullptr) {
+        _CUDA_VSTD::__debug_db_insert_i(this);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __hash_const_local_iterator(const __non_const_iterator& __x) _NOEXCEPT
         : __node_(__x.__node_),
           __bucket_(__x.__bucket_),
           __bucket_count_(__x.__bucket_count_)
     {
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
-        __get_db()->__iterator_copy(this, _VSTD::addressof(__x));
+#ifdef _LIBCUDACXX_ENABLE_DEBUG_MODE
+        __get_db()->__iterator_copy(this, _CUDA_VSTD::addressof(__x));
 #endif
     }
 
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
-    _LIBCPP_INLINE_VISIBILITY
+#ifdef _LIBCUDACXX_ENABLE_DEBUG_MODE
+    _LIBCUDACXX_INLINE_VISIBILITY
     __hash_const_local_iterator(const __hash_const_local_iterator& __i)
         : __node_(__i.__node_),
           __bucket_(__i.__bucket_),
           __bucket_count_(__i.__bucket_count_)
     {
-        __get_db()->__iterator_copy(this, _VSTD::addressof(__i));
+        __get_db()->__iterator_copy(this, _CUDA_VSTD::addressof(__i));
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     ~__hash_const_local_iterator()
     {
         __get_db()->__erase_i(this);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __hash_const_local_iterator& operator=(const __hash_const_local_iterator& __i)
     {
-        if (this != _VSTD::addressof(__i))
+        if (this != _CUDA_VSTD::addressof(__i))
         {
-            __get_db()->__iterator_copy(this, _VSTD::addressof(__i));
+            __get_db()->__iterator_copy(this, _CUDA_VSTD::addressof(__i));
             __node_ = __i.__node_;
             __bucket_ = __i.__bucket_;
             __bucket_count_ = __i.__bucket_count_;
         }
         return *this;
     }
-#endif // _LIBCPP_ENABLE_DEBUG_MODE
+#endif // _LIBCUDACXX_ENABLE_DEBUG_MODE
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     reference operator*() const {
-        _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
+        _LIBCUDACXX_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
                            "Attempted to dereference a non-dereferenceable unordered container const_local_iterator");
         return __node_->__upcast()->__value_;
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     pointer operator->() const {
-        _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
+        _LIBCUDACXX_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
                            "Attempted to dereference a non-dereferenceable unordered container const_local_iterator");
         return pointer_traits<pointer>::pointer_to(__node_->__upcast()->__value_);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __hash_const_local_iterator& operator++() {
-        _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
+        _LIBCUDACXX_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
                        "Attempted to increment a non-incrementable unordered container const_local_iterator");
         __node_ = __node_->__next_;
         if (__node_ != nullptr && __constrain_hash(__node_->__hash(), __bucket_count_) != __bucket_)
@@ -697,7 +697,7 @@ public:
         return *this;
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __hash_const_local_iterator operator++(int)
     {
         __hash_const_local_iterator __t(*this);
@@ -705,17 +705,17 @@ public:
         return __t;
     }
 
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
     bool operator==(const __hash_const_local_iterator& __x, const __hash_const_local_iterator& __y)
     {
         return __x.__node_ == __y.__node_;
     }
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
     bool operator!=(const __hash_const_local_iterator& __x, const __hash_const_local_iterator& __y)
         {return !(__x == __y);}
 
 private:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __hash_const_local_iterator(__next_pointer __node_ptr, size_t __bucket,
                                          size_t __bucket_count, const void* __c) _NOEXCEPT
         : __node_(__node_ptr),
@@ -723,14 +723,14 @@ private:
           __bucket_count_(__bucket_count)
         {
             (void)__c;
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
+#ifdef _LIBCUDACXX_ENABLE_DEBUG_MODE
             __get_db()->__insert_ic(this, __c);
 #endif
             if (__node_ != nullptr)
                 __node_ = __node_->__next_;
         }
     template <class, class, class, class> friend class __hash_table;
-    template <class> friend class _LIBCPP_TEMPLATE_VIS __hash_map_const_iterator;
+    template <class> friend class _LIBCUDACXX_TEMPLATE_VIS __hash_map_const_iterator;
 };
 
 template <class _Alloc>
@@ -744,35 +744,35 @@ class __bucket_list_deallocator
 public:
     typedef typename __alloc_traits::pointer pointer;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __bucket_list_deallocator()
         _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
         : __data_(0, __default_init_tag()) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __bucket_list_deallocator(const allocator_type& __a, size_type __size)
         _NOEXCEPT_(is_nothrow_copy_constructible<allocator_type>::value)
         : __data_(__size, __a) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __bucket_list_deallocator(__bucket_list_deallocator&& __x)
         _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)
-        : __data_(_VSTD::move(__x.__data_))
+        : __data_(_CUDA_VSTD::move(__x.__data_))
     {
         __x.size() = 0;
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type& size() _NOEXCEPT {return __data_.first();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type  size() const _NOEXCEPT {return __data_.first();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     allocator_type& __alloc() _NOEXCEPT {return __data_.second();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const allocator_type& __alloc() const _NOEXCEPT {return __data_.second();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void operator()(pointer __p) _NOEXCEPT
     {
         __alloc_traits::deallocate(__alloc(), __p, size());
@@ -801,14 +801,14 @@ public:
     __hash_node_destructor& operator=(const __hash_node_destructor&) = delete;
 
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __hash_node_destructor(allocator_type& __na,
                                     bool __constructed = false) _NOEXCEPT
         : __na_(__na),
           __value_constructed(__constructed)
         {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void operator()(pointer __p) _NOEXCEPT
     {
         if (__value_constructed)
@@ -820,7 +820,7 @@ public:
     template <class> friend class __hash_map_node_destructor;
 };
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _NodeType, class _Alloc>
 struct __generic_container_node_destructor;
 
@@ -834,7 +834,7 @@ struct __generic_container_node_destructor<__hash_node<_Tp, _VoidPtr>, _Alloc>
 
 template <class _Key, class _Hash, class _Equal>
 struct __enforce_unordered_container_requirements {
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
     static_assert(__check_hash_requirements<_Key, _Hash>::value,
     "the specified hash does not meet the Hash requirements");
     static_assert(is_copy_constructible<_Equal>::value,
@@ -844,10 +844,10 @@ struct __enforce_unordered_container_requirements {
 };
 
 template <class _Key, class _Hash, class _Equal>
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_DIAGNOSE_WARNING(!__invokable<_Equal const&, _Key const&, _Key const&>::value,
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_DIAGNOSE_WARNING(!__invokable<_Equal const&, _Key const&, _Key const&>::value,
     "the specified comparator type does not provide a viable const call operator")
-    _LIBCPP_DIAGNOSE_WARNING(!__invokable<_Hash const&, _Key const&>::value,
+    _LIBCUDACXX_DIAGNOSE_WARNING(!__invokable<_Hash const&, _Key const&>::value,
     "the specified hash functor does not provide a viable const call operator")
 #endif
 typename __enforce_unordered_container_requirements<_Key, _Hash, _Equal>::type
@@ -882,7 +882,7 @@ public:
     typedef const value_type&                        const_reference;
     typedef typename __alloc_traits::pointer         pointer;
     typedef typename __alloc_traits::const_pointer   const_pointer;
-#ifndef _LIBCPP_ABI_FIX_UNORDERED_CONTAINER_SIZE_TYPE
+#ifndef _LIBCUDACXX_ABI_FIX_UNORDERED_CONTAINER_SIZE_TYPE
     typedef typename __alloc_traits::size_type       size_type;
 #else
     typedef typename _NodeTypes::size_type           size_type;
@@ -928,30 +928,30 @@ private:
     __compressed_pair<float, key_equal>                   __p3_;
     // --- Member data end ---
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type& size() _NOEXCEPT {return __p2_.first();}
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type  size() const _NOEXCEPT {return __p2_.first();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     hasher& hash_function() _NOEXCEPT {return __p2_.second();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const hasher& hash_function() const _NOEXCEPT {return __p2_.second();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     float& max_load_factor() _NOEXCEPT {return __p3_.first();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     float  max_load_factor() const _NOEXCEPT {return __p3_.first();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     key_equal& key_eq() _NOEXCEPT {return __p3_.second();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const key_equal& key_eq() const _NOEXCEPT {return __p3_.second();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __node_allocator& __node_alloc() _NOEXCEPT {return __p1_.second();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const __node_allocator& __node_alloc() const _NOEXCEPT
         {return __p1_.second();}
 
@@ -961,7 +961,7 @@ public:
     typedef __hash_local_iterator<__node_pointer>             local_iterator;
     typedef __hash_const_local_iterator<__node_pointer>       const_local_iterator;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __hash_table()
         _NOEXCEPT_(
             is_nothrow_default_constructible<__bucket_list>::value &&
@@ -969,7 +969,7 @@ public:
             is_nothrow_default_constructible<__node_allocator>::value &&
             is_nothrow_default_constructible<hasher>::value &&
             is_nothrow_default_constructible<key_equal>::value);
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __hash_table(const hasher& __hf, const key_equal& __eql);
     __hash_table(const hasher& __hf, const key_equal& __eql,
                  const allocator_type& __a);
@@ -987,7 +987,7 @@ public:
     ~__hash_table();
 
     __hash_table& operator=(const __hash_table& __u);
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __hash_table& operator=(__hash_table&& __u)
         _NOEXCEPT_(
             __node_traits::propagate_on_container_move_assignment::value &&
@@ -999,185 +999,185 @@ public:
     template <class _InputIterator>
         void __assign_multi(_InputIterator __first, _InputIterator __last);
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type max_size() const _NOEXCEPT
     {
-        return _VSTD::min<size_type>(
+        return _CUDA_VSTD::min<size_type>(
             __node_traits::max_size(__node_alloc()),
             numeric_limits<
diff erence_type >::max()
         );
     }
 
 private:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __next_pointer __node_insert_multi_prepare(size_t __cp_hash,
                                                value_type& __cp_val);
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __node_insert_multi_perform(__node_pointer __cp,
                                      __next_pointer __pn) _NOEXCEPT;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __next_pointer __node_insert_unique_prepare(size_t __nd_hash,
                                                 value_type& __nd_val);
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __node_insert_unique_perform(__node_pointer __ptr) _NOEXCEPT;
 
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     pair<iterator, bool> __node_insert_unique(__node_pointer __nd);
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator             __node_insert_multi(__node_pointer __nd);
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator             __node_insert_multi(const_iterator __p,
                                              __node_pointer __nd);
 
     template <class _Key, class ..._Args>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     pair<iterator, bool> __emplace_unique_key_args(_Key const& __k, _Args&&... __args);
 
     template <class... _Args>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     pair<iterator, bool> __emplace_unique_impl(_Args&&... __args);
 
     template <class _Pp>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     pair<iterator, bool> __emplace_unique(_Pp&& __x) {
-      return __emplace_unique_extract_key(_VSTD::forward<_Pp>(__x),
+      return __emplace_unique_extract_key(_CUDA_VSTD::forward<_Pp>(__x),
                                           __can_extract_key<_Pp, key_type>());
     }
 
     template <class _First, class _Second>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __enable_if_t<__can_extract_map_key<_First, key_type, __container_value_type>::value, pair<iterator, bool> >
     __emplace_unique(_First&& __f, _Second&& __s) {
-        return __emplace_unique_key_args(__f, _VSTD::forward<_First>(__f),
-                                              _VSTD::forward<_Second>(__s));
+        return __emplace_unique_key_args(__f, _CUDA_VSTD::forward<_First>(__f),
+                                              _CUDA_VSTD::forward<_Second>(__s));
     }
 
     template <class... _Args>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     pair<iterator, bool> __emplace_unique(_Args&&... __args) {
-      return __emplace_unique_impl(_VSTD::forward<_Args>(__args)...);
+      return __emplace_unique_impl(_CUDA_VSTD::forward<_Args>(__args)...);
     }
 
     template <class _Pp>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     pair<iterator, bool>
     __emplace_unique_extract_key(_Pp&& __x, __extract_key_fail_tag) {
-      return __emplace_unique_impl(_VSTD::forward<_Pp>(__x));
+      return __emplace_unique_impl(_CUDA_VSTD::forward<_Pp>(__x));
     }
     template <class _Pp>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     pair<iterator, bool>
     __emplace_unique_extract_key(_Pp&& __x, __extract_key_self_tag) {
-      return __emplace_unique_key_args(__x, _VSTD::forward<_Pp>(__x));
+      return __emplace_unique_key_args(__x, _CUDA_VSTD::forward<_Pp>(__x));
     }
     template <class _Pp>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     pair<iterator, bool>
     __emplace_unique_extract_key(_Pp&& __x, __extract_key_first_tag) {
-      return __emplace_unique_key_args(__x.first, _VSTD::forward<_Pp>(__x));
+      return __emplace_unique_key_args(__x.first, _CUDA_VSTD::forward<_Pp>(__x));
     }
 
     template <class... _Args>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator __emplace_multi(_Args&&... __args);
     template <class... _Args>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator __emplace_hint_multi(const_iterator __p, _Args&&... __args);
 
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     pair<iterator, bool>
     __insert_unique(__container_value_type&& __x) {
-      return __emplace_unique_key_args(_NodeTypes::__get_key(__x), _VSTD::move(__x));
+      return __emplace_unique_key_args(_NodeTypes::__get_key(__x), _CUDA_VSTD::move(__x));
     }
 
     template <class _Pp, class = __enable_if_t<!__is_same_uncvref<_Pp, __container_value_type>::value> >
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     pair<iterator, bool> __insert_unique(_Pp&& __x) {
-      return __emplace_unique(_VSTD::forward<_Pp>(__x));
+      return __emplace_unique(_CUDA_VSTD::forward<_Pp>(__x));
     }
 
     template <class _Pp>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator __insert_multi(_Pp&& __x) {
-      return __emplace_multi(_VSTD::forward<_Pp>(__x));
+      return __emplace_multi(_CUDA_VSTD::forward<_Pp>(__x));
     }
 
     template <class _Pp>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator __insert_multi(const_iterator __p, _Pp&& __x) {
-        return __emplace_hint_multi(__p, _VSTD::forward<_Pp>(__x));
+        return __emplace_hint_multi(__p, _CUDA_VSTD::forward<_Pp>(__x));
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     pair<iterator, bool> __insert_unique(const __container_value_type& __x) {
         return __emplace_unique_key_args(_NodeTypes::__get_key(__x), __x);
     }
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
     template <class _NodeHandle, class _InsertReturnType>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _InsertReturnType __node_handle_insert_unique(_NodeHandle&& __nh);
     template <class _NodeHandle>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator __node_handle_insert_unique(const_iterator __hint,
                                          _NodeHandle&& __nh);
     template <class _Table>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __node_handle_merge_unique(_Table& __source);
 
     template <class _NodeHandle>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator __node_handle_insert_multi(_NodeHandle&& __nh);
     template <class _NodeHandle>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator __node_handle_insert_multi(const_iterator __hint, _NodeHandle&& __nh);
     template <class _Table>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __node_handle_merge_multi(_Table& __source);
 
     template <class _NodeHandle>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _NodeHandle __node_handle_extract(key_type const& __key);
     template <class _NodeHandle>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _NodeHandle __node_handle_extract(const_iterator __it);
 #endif
 
     void clear() _NOEXCEPT;
-    _LIBCPP_INLINE_VISIBILITY void __rehash_unique(size_type __n) { __rehash<true>(__n); }
-    _LIBCPP_INLINE_VISIBILITY void __rehash_multi(size_type __n) { __rehash<false>(__n); }
-    _LIBCPP_INLINE_VISIBILITY void __reserve_unique(size_type __n)
+    _LIBCUDACXX_INLINE_VISIBILITY void __rehash_unique(size_type __n) { __rehash<true>(__n); }
+    _LIBCUDACXX_INLINE_VISIBILITY void __rehash_multi(size_type __n) { __rehash<false>(__n); }
+    _LIBCUDACXX_INLINE_VISIBILITY void __reserve_unique(size_type __n)
     {
         __rehash_unique(static_cast<size_type>(ceil(__n / max_load_factor())));
     }
-    _LIBCPP_INLINE_VISIBILITY void __reserve_multi(size_type __n)
+    _LIBCUDACXX_INLINE_VISIBILITY void __reserve_multi(size_type __n)
     {
         __rehash_multi(static_cast<size_type>(ceil(__n / max_load_factor())));
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type bucket_count() const _NOEXCEPT
     {
         return __bucket_list_.get_deleter().size();
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator       begin() _NOEXCEPT;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator       end() _NOEXCEPT;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator begin() const _NOEXCEPT;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator end() const _NOEXCEPT;
 
     template <class _Key>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         size_type bucket(const _Key& __k) const
         {
-            _LIBCPP_ASSERT(bucket_count() > 0,
+            _LIBCUDACXX_ASSERT(bucket_count() > 0,
                 "unordered container::bucket(key) called when bucket_count() == 0");
             return __constrain_hash(hash_function()(__k), bucket_count());
         }
@@ -1199,7 +1199,7 @@ public:
     __node_holder remove(const_iterator __p) _NOEXCEPT;
 
     template <class _Key>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         size_type __count_unique(const _Key& __k) const;
     template <class _Key>
         size_type __count_multi(const _Key& __k) const;
@@ -1219,7 +1219,7 @@ public:
         __equal_range_multi(const _Key& __k) const;
 
     void swap(__hash_table& __u)
-#if _LIBCPP_STD_VER <= 11
+#if _LIBCUDACXX_STD_VER <= 11
         _NOEXCEPT_(
             __is_nothrow_swappable<hasher>::value && __is_nothrow_swappable<key_equal>::value
             && (!allocator_traits<__pointer_allocator>::propagate_on_container_swap::value
@@ -1231,66 +1231,66 @@ public:
      _NOEXCEPT_(__is_nothrow_swappable<hasher>::value && __is_nothrow_swappable<key_equal>::value);
 #endif
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type max_bucket_count() const _NOEXCEPT
         {return max_size(); }
     size_type bucket_size(size_type __n) const;
-    _LIBCPP_INLINE_VISIBILITY float load_factor() const _NOEXCEPT
+    _LIBCUDACXX_INLINE_VISIBILITY float load_factor() const _NOEXCEPT
     {
         size_type __bc = bucket_count();
         return __bc != 0 ? (float)size() / __bc : 0.f;
     }
-    _LIBCPP_INLINE_VISIBILITY void max_load_factor(float __mlf) _NOEXCEPT
+    _LIBCUDACXX_INLINE_VISIBILITY void max_load_factor(float __mlf) _NOEXCEPT
     {
-        _LIBCPP_ASSERT(__mlf > 0,
+        _LIBCUDACXX_ASSERT(__mlf > 0,
             "unordered container::max_load_factor(lf) called with lf <= 0");
-        max_load_factor() = _VSTD::max(__mlf, load_factor());
+        max_load_factor() = _CUDA_VSTD::max(__mlf, load_factor());
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     local_iterator
     begin(size_type __n)
     {
-        _LIBCPP_ASSERT(__n < bucket_count(),
+        _LIBCUDACXX_ASSERT(__n < bucket_count(),
             "unordered container::begin(n) called with n >= bucket_count()");
         return local_iterator(__bucket_list_[__n], __n, bucket_count(), this);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     local_iterator
     end(size_type __n)
     {
-        _LIBCPP_ASSERT(__n < bucket_count(),
+        _LIBCUDACXX_ASSERT(__n < bucket_count(),
             "unordered container::end(n) called with n >= bucket_count()");
         return local_iterator(nullptr, __n, bucket_count(), this);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_local_iterator
     cbegin(size_type __n) const
     {
-        _LIBCPP_ASSERT(__n < bucket_count(),
+        _LIBCUDACXX_ASSERT(__n < bucket_count(),
             "unordered container::cbegin(n) called with n >= bucket_count()");
         return const_local_iterator(__bucket_list_[__n], __n, bucket_count(), this);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_local_iterator
     cend(size_type __n) const
     {
-        _LIBCPP_ASSERT(__n < bucket_count(),
+        _LIBCUDACXX_ASSERT(__n < bucket_count(),
             "unordered container::cend(n) called with n >= bucket_count()");
         return const_local_iterator(nullptr, __n, bucket_count(), this);
     }
 
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
+#ifdef _LIBCUDACXX_ENABLE_DEBUG_MODE
 
     bool __dereferenceable(const const_iterator* __i) const;
     bool __decrementable(const const_iterator* __i) const;
     bool __addable(const const_iterator* __i, ptr
diff _t __n) const;
     bool __subscriptable(const const_iterator* __i, ptr
diff _t __n) const;
 
-#endif // _LIBCPP_ENABLE_DEBUG_MODE
+#endif // _LIBCUDACXX_ENABLE_DEBUG_MODE
 
 private:
     template <bool _UniqueKeys> void __rehash(size_type __n);
@@ -1303,12 +1303,12 @@ private:
     __node_holder __construct_node_hash(size_t __hash, _First&& __f, _Rest&&... __rest);
 
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __copy_assign_alloc(const __hash_table& __u)
         {__copy_assign_alloc(__u, integral_constant<bool,
              __node_traits::propagate_on_container_copy_assignment::value>());}
     void __copy_assign_alloc(const __hash_table& __u, true_type);
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
         void __copy_assign_alloc(const __hash_table&, false_type) {}
 
     void __move_assign(__hash_table& __u, false_type);
@@ -1317,7 +1317,7 @@ private:
             is_nothrow_move_assignable<__node_allocator>::value &&
             is_nothrow_move_assignable<hasher>::value &&
             is_nothrow_move_assignable<key_equal>::value);
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __move_assign_alloc(__hash_table& __u)
         _NOEXCEPT_(
             !__node_traits::propagate_on_container_move_assignment::value ||
@@ -1325,24 +1325,24 @@ private:
              is_nothrow_move_assignable<__node_allocator>::value))
         {__move_assign_alloc(__u, integral_constant<bool,
              __node_traits::propagate_on_container_move_assignment::value>());}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __move_assign_alloc(__hash_table& __u, true_type)
         _NOEXCEPT_(
             is_nothrow_move_assignable<__pointer_allocator>::value &&
             is_nothrow_move_assignable<__node_allocator>::value)
     {
         __bucket_list_.get_deleter().__alloc() =
-                _VSTD::move(__u.__bucket_list_.get_deleter().__alloc());
-        __node_alloc() = _VSTD::move(__u.__node_alloc());
+                _CUDA_VSTD::move(__u.__bucket_list_.get_deleter().__alloc());
+        __node_alloc() = _CUDA_VSTD::move(__u.__node_alloc());
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
         void __move_assign_alloc(__hash_table&, false_type) _NOEXCEPT {}
 
     void __deallocate_node(__next_pointer __np) _NOEXCEPT;
     __next_pointer __detach() _NOEXCEPT;
 
-    template <class, class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS unordered_map;
-    template <class, class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS unordered_multimap;
+    template <class, class, class, class, class> friend class _LIBCUDACXX_TEMPLATE_VIS unordered_map;
+    template <class, class, class, class, class> friend class _LIBCUDACXX_TEMPLATE_VIS unordered_multimap;
 };
 
 template <class _Tp, class _Hash, class _Equal, class _Alloc>
@@ -1421,10 +1421,10 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(__hash_table&& __u)
             is_nothrow_move_constructible<__node_allocator>::value &&
             is_nothrow_move_constructible<hasher>::value &&
             is_nothrow_move_constructible<key_equal>::value)
-    : __bucket_list_(_VSTD::move(__u.__bucket_list_)),
-      __p1_(_VSTD::move(__u.__p1_)),
-      __p2_(_VSTD::move(__u.__p2_)),
-      __p3_(_VSTD::move(__u.__p3_))
+    : __bucket_list_(_CUDA_VSTD::move(__u.__bucket_list_)),
+      __p1_(_CUDA_VSTD::move(__u.__p1_)),
+      __p2_(_CUDA_VSTD::move(__u.__p2_)),
+      __p3_(_CUDA_VSTD::move(__u.__p3_))
 {
     if (size() > 0)
     {
@@ -1440,8 +1440,8 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(__hash_table&& __u,
                                                        const allocator_type& __a)
     : __bucket_list_(nullptr, __bucket_list_deleter(__pointer_allocator(__a), 0)),
       __p1_(__default_init_tag(), __node_allocator(__a)),
-      __p2_(0, _VSTD::move(__u.hash_function())),
-      __p3_(_VSTD::move(__u.__p3_))
+      __p2_(0, _CUDA_VSTD::move(__u.hash_function())),
+      __p3_(_CUDA_VSTD::move(__u.__p3_))
 {
     if (__a == allocator_type(__u.__node_alloc()))
     {
@@ -1463,7 +1463,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(__hash_table&& __u,
 template <class _Tp, class _Hash, class _Equal, class _Alloc>
 __hash_table<_Tp, _Hash, _Equal, _Alloc>::~__hash_table()
 {
-#if defined(_LIBCPP_CXX03_LANG)
+#if defined(_LIBCUDACXX_CXX03_LANG)
     static_assert((is_copy_constructible<key_equal>::value),
                  "Predicate must be copy-constructible.");
     static_assert((is_copy_constructible<hasher>::value),
@@ -1493,7 +1493,7 @@ template <class _Tp, class _Hash, class _Equal, class _Alloc>
 __hash_table<_Tp, _Hash, _Equal, _Alloc>&
 __hash_table<_Tp, _Hash, _Equal, _Alloc>::operator=(const __hash_table& __u)
 {
-    if (this != _VSTD::addressof(__u))
+    if (this != _CUDA_VSTD::addressof(__u))
     {
         __copy_assign_alloc(__u);
         hash_function() = __u.hash_function();
@@ -1513,7 +1513,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__deallocate_node(__next_pointer __np)
     while (__np != nullptr)
     {
         __next_pointer __next = __np->__next_;
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
+#ifdef _LIBCUDACXX_ENABLE_DEBUG_MODE
         __c_node* __c = __get_db()->__find_c_and_lock(this);
         for (__i_node** __p = __c->end_; __p != __c->beg_; )
         {
@@ -1523,7 +1523,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__deallocate_node(__next_pointer __np)
             {
                 (*__p)->__c_ = nullptr;
                 if (--__c->end_ != __p)
-                    _VSTD::memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));
+                    _CUDA_VSTD::memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));
             }
         }
         __get_db()->unlock();
@@ -1563,9 +1563,9 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__move_assign(
     __u.__bucket_list_.get_deleter().size() = 0;
     __move_assign_alloc(__u);
     size() = __u.size();
-    hash_function() = _VSTD::move(__u.hash_function());
+    hash_function() = _CUDA_VSTD::move(__u.hash_function());
     max_load_factor() = __u.max_load_factor();
-    key_eq() = _VSTD::move(__u.key_eq());
+    key_eq() = _CUDA_VSTD::move(__u.key_eq());
     __p1_.first().__next_ = __u.__p1_.first().__next_;
     if (size() > 0)
     {
@@ -1586,33 +1586,33 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__move_assign(
         __move_assign(__u, true_type());
     else
     {
-        hash_function() = _VSTD::move(__u.hash_function());
-        key_eq() = _VSTD::move(__u.key_eq());
+        hash_function() = _CUDA_VSTD::move(__u.hash_function());
+        key_eq() = _CUDA_VSTD::move(__u.key_eq());
         max_load_factor() = __u.max_load_factor();
         if (bucket_count() != 0)
         {
             __next_pointer __cache = __detach();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
             try
             {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
                 const_iterator __i = __u.begin();
                 while (__cache != nullptr && __u.size() != 0)
                 {
                     __cache->__upcast()->__value_ =
-                        _VSTD::move(__u.remove(__i++)->__value_);
+                        _CUDA_VSTD::move(__u.remove(__i++)->__value_);
                     __next_pointer __next = __cache->__next_;
                     __node_insert_multi(__cache->__upcast());
                     __cache = __next;
                 }
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
             }
             catch (...)
             {
                 __deallocate_node(__cache);
                 throw;
             }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
             __deallocate_node(__cache);
         }
         const_iterator __i = __u.begin();
@@ -1654,10 +1654,10 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__assign_unique(_InputIterator __first
     if (bucket_count() != 0)
     {
         __next_pointer __cache = __detach();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         try
         {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
             for (; __cache != nullptr && __first != __last; ++__first)
             {
                 __cache->__upcast()->__value_ = *__first;
@@ -1665,14 +1665,14 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__assign_unique(_InputIterator __first
                 __node_insert_unique(__cache->__upcast());
                 __cache = __next;
             }
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         }
         catch (...)
         {
             __deallocate_node(__cache);
             throw;
         }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
         __deallocate_node(__cache);
     }
     for (; __first != __last; ++__first)
@@ -1694,10 +1694,10 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__assign_multi(_InputIterator __first,
     if (bucket_count() != 0)
     {
         __next_pointer __cache = __detach();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         try
         {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
             for (; __cache != nullptr && __first != __last; ++__first)
             {
                 __cache->__upcast()->__value_ = *__first;
@@ -1705,14 +1705,14 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__assign_multi(_InputIterator __first,
                 __node_insert_multi(__cache->__upcast());
                 __cache = __next;
             }
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         }
         catch (...)
         {
             __deallocate_node(__cache);
             throw;
         }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
         __deallocate_node(__cache);
     }
     for (; __first != __last; ++__first)
@@ -1775,7 +1775,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::clear() _NOEXCEPT
 // Note that this function does forward exceptions if key_eq() throws, and never
 // mutates __value or actually inserts into the map.
 template <class _Tp, class _Hash, class _Equal, class _Alloc>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::__next_pointer
 __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_unique_prepare(
     size_t __hash, value_type& __value)
@@ -1799,7 +1799,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_unique_prepare(
     }
     if (size()+1 > __bc * max_load_factor() || __bc == 0)
     {
-        __rehash_unique(_VSTD::max<size_type>(2 * __bc + !__is_hash_power2(__bc),
+        __rehash_unique(_CUDA_VSTD::max<size_type>(2 * __bc + !__is_hash_power2(__bc),
                                      size_type(ceil(float(size() + 1) / max_load_factor()))));
     }
     return nullptr;
@@ -1810,7 +1810,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_unique_prepare(
 // rehashing has already occurred and that no element with the same key exists
 // in the map.
 template <class _Tp, class _Hash, class _Equal, class _Alloc>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 void
 __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_unique_perform(
     __node_pointer __nd) _NOEXCEPT
@@ -1871,7 +1871,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_multi_prepare(
     size_type __bc = bucket_count();
     if (size()+1 > __bc * max_load_factor() || __bc == 0)
     {
-        __rehash_multi(_VSTD::max<size_type>(2 * __bc + !__is_hash_power2(__bc),
+        __rehash_multi(_CUDA_VSTD::max<size_type>(2 * __bc + !__is_hash_power2(__bc),
                        size_type(ceil(float(size() + 1) / max_load_factor()))));
         __bc = bucket_count();
     }
@@ -1955,7 +1955,7 @@ typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
 __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_multi(
         const_iterator __p, __node_pointer __cp)
 {
-    _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__p)) == this,
+    _LIBCUDACXX_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_CUDA_VSTD::addressof(__p)) == this,
                          "unordered container::emplace_hint(const_iterator, args...) called with an iterator not"
                          " referring to this unordered container");
     if (__p != end() && key_eq()(*__p, __cp->__value_))
@@ -1965,7 +1965,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_multi(
         size_type __bc = bucket_count();
         if (size()+1 > __bc * max_load_factor() || __bc == 0)
         {
-            __rehash_multi(_VSTD::max<size_type>(2 * __bc + !__is_hash_power2(__bc),
+            __rehash_multi(_CUDA_VSTD::max<size_type>(2 * __bc + !__is_hash_power2(__bc),
                            size_type(ceil(float(size() + 1) / max_load_factor()))));
             __bc = bucket_count();
         }
@@ -2010,10 +2010,10 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_unique_key_args(_Key const&
         }
     }
     {
-        __node_holder __h = __construct_node_hash(__hash, _VSTD::forward<_Args>(__args)...);
+        __node_holder __h = __construct_node_hash(__hash, _CUDA_VSTD::forward<_Args>(__args)...);
         if (size()+1 > __bc * max_load_factor() || __bc == 0)
         {
-            __rehash_unique(_VSTD::max<size_type>(2 * __bc + !__is_hash_power2(__bc),
+            __rehash_unique(_CUDA_VSTD::max<size_type>(2 * __bc + !__is_hash_power2(__bc),
                            size_type(ceil(float(size() + 1) / max_load_factor()))));
             __bc = bucket_count();
             __chash = __constrain_hash(__hash, __bc);
@@ -2050,7 +2050,7 @@ template <class... _Args>
 pair<typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator, bool>
 __hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_unique_impl(_Args&&... __args)
 {
-    __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
+    __node_holder __h = __construct_node(_CUDA_VSTD::forward<_Args>(__args)...);
     pair<iterator, bool> __r = __node_insert_unique(__h.get());
     if (__r.second)
         __h.release();
@@ -2062,7 +2062,7 @@ template <class... _Args>
 typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
 __hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_multi(_Args&&... __args)
 {
-    __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
+    __node_holder __h = __construct_node(_CUDA_VSTD::forward<_Args>(__args)...);
     iterator __r = __node_insert_multi(__h.get());
     __h.release();
     return __r;
@@ -2074,19 +2074,19 @@ typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
 __hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_hint_multi(
         const_iterator __p, _Args&&... __args)
 {
-    _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__p)) == this,
+    _LIBCUDACXX_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_CUDA_VSTD::addressof(__p)) == this,
                          "unordered container::emplace_hint(const_iterator, args...) called with an iterator not"
                          " referring to this unordered container");
-    __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
+    __node_holder __h = __construct_node(_CUDA_VSTD::forward<_Args>(__args)...);
     iterator __r = __node_insert_multi(__p, __h.get());
     __h.release();
     return __r;
 }
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp, class _Hash, class _Equal, class _Alloc>
 template <class _NodeHandle, class _InsertReturnType>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _InsertReturnType
 __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_handle_insert_unique(
     _NodeHandle&& __nh)
@@ -2096,12 +2096,12 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_handle_insert_unique(
     pair<iterator, bool> __result = __node_insert_unique(__nh.__ptr_);
     if (__result.second)
         __nh.__release_ptr();
-    return _InsertReturnType{__result.first, __result.second, _VSTD::move(__nh)};
+    return _InsertReturnType{__result.first, __result.second, _CUDA_VSTD::move(__nh)};
 }
 
 template <class _Tp, class _Hash, class _Equal, class _Alloc>
 template <class _NodeHandle>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
 __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_handle_insert_unique(
     const_iterator, _NodeHandle&& __nh)
@@ -2116,7 +2116,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_handle_insert_unique(
 
 template <class _Tp, class _Hash, class _Equal, class _Alloc>
 template <class _NodeHandle>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _NodeHandle
 __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_handle_extract(
     key_type const& __key)
@@ -2129,7 +2129,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_handle_extract(
 
 template <class _Tp, class _Hash, class _Equal, class _Alloc>
 template <class _NodeHandle>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _NodeHandle
 __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_handle_extract(
     const_iterator __p)
@@ -2140,7 +2140,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_handle_extract(
 
 template <class _Tp, class _Hash, class _Equal, class _Alloc>
 template <class _Table>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 void
 __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_handle_merge_unique(
     _Table& __source)
@@ -2166,7 +2166,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_handle_merge_unique(
 
 template <class _Tp, class _Hash, class _Equal, class _Alloc>
 template <class _NodeHandle>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
 __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_handle_insert_multi(
     _NodeHandle&& __nh)
@@ -2180,7 +2180,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_handle_insert_multi(
 
 template <class _Tp, class _Hash, class _Equal, class _Alloc>
 template <class _NodeHandle>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
 __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_handle_insert_multi(
     const_iterator __hint, _NodeHandle&& __nh)
@@ -2194,7 +2194,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_handle_insert_multi(
 
 template <class _Tp, class _Hash, class _Equal, class _Alloc>
 template <class _Table>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 void
 __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_handle_merge_multi(
     _Table& __source)
@@ -2213,13 +2213,13 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_handle_merge_multi(
         __node_insert_multi_perform(__src_ptr, __pn);
     }
 }
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCUDACXX_STD_VER > 14
 
 template <class _Tp, class _Hash, class _Equal, class _Alloc>
 template <bool _UniqueKeys>
 void
 __hash_table<_Tp, _Hash, _Equal, _Alloc>::__rehash(size_type __n)
-_LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
+_LIBCUDACXX_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
 {
     if (__n == 1)
         __n = 2;
@@ -2230,7 +2230,7 @@ _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
         __do_rehash<_UniqueKeys>(__n);
     else if (__n < __bc)
     {
-        __n = _VSTD::max<size_type>
+        __n = _CUDA_VSTD::max<size_type>
               (
                   __n,
                   __is_hash_power2(__bc) ? __next_hash_pow2(size_t(ceil(float(size()) / max_load_factor()))) :
@@ -2279,7 +2279,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__do_rehash(size_type __nbc)
                     else
                     {
                         __next_pointer __np = __cp;
-                        if _LIBCPP_CONSTEXPR_AFTER_CXX14 (!_UniqueKeys)
+                        if _LIBCUDACXX_CONSTEXPR_AFTER_CXX14 (!_UniqueKeys)
                         {
                             for (; __np->__next_ != nullptr &&
                                    key_eq()(__cp->__upcast()->__value_,
@@ -2362,7 +2362,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node(_Args&& ...__args)
                   "Construct cannot be called with a hash value type");
     __node_allocator& __na = __node_alloc();
     __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
-    __node_traits::construct(__na, _NodeTypes::__get_ptr(__h->__value_), _VSTD::forward<_Args>(__args)...);
+    __node_traits::construct(__na, _NodeTypes::__get_ptr(__h->__value_), _CUDA_VSTD::forward<_Args>(__args)...);
     __h.get_deleter().__value_constructed = true;
     __h->__hash_ = hash_function()(__h->__value_);
     __h->__next_ = nullptr;
@@ -2380,8 +2380,8 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node_hash(
     __node_allocator& __na = __node_alloc();
     __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
     __node_traits::construct(__na, _NodeTypes::__get_ptr(__h->__value_),
-                             _VSTD::forward<_First>(__f),
-                             _VSTD::forward<_Rest>(__rest)...);
+                             _CUDA_VSTD::forward<_First>(__f),
+                             _CUDA_VSTD::forward<_Rest>(__rest)...);
     __h.get_deleter().__value_constructed = true;
     __h->__hash_ = __hash;
     __h->__next_ = nullptr;
@@ -2393,10 +2393,10 @@ typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
 __hash_table<_Tp, _Hash, _Equal, _Alloc>::erase(const_iterator __p)
 {
     __next_pointer __np = __p.__node_;
-    _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__p)) == this,
+    _LIBCUDACXX_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_CUDA_VSTD::addressof(__p)) == this,
                          "unordered container erase(iterator) called with an iterator not"
                          " referring to this container");
-    _LIBCPP_ASSERT(__p != end(),
+    _LIBCUDACXX_ASSERT(__p != end(),
                    "unordered container erase(iterator) called with a non-dereferenceable iterator");
     iterator __r(__np, this);
     ++__r;
@@ -2409,10 +2409,10 @@ typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
 __hash_table<_Tp, _Hash, _Equal, _Alloc>::erase(const_iterator __first,
                                                 const_iterator __last)
 {
-    _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__first)) == this,
+    _LIBCUDACXX_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_CUDA_VSTD::addressof(__first)) == this,
                          "unordered container::erase(iterator, iterator) called with an iterator not"
                          " referring to this container");
-    _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__last)) == this,
+    _LIBCUDACXX_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_CUDA_VSTD::addressof(__last)) == this,
                          "unordered container::erase(iterator, iterator) called with an iterator not"
                          " referring to this container");
     for (const_iterator __p = __first; __first != __last; __p = __first)
@@ -2488,7 +2488,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::remove(const_iterator __p) _NOEXCEPT
     __pn->__next_ = __cn->__next_;
     __cn->__next_ = nullptr;
     --size();
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
+#ifdef _LIBCUDACXX_ENABLE_DEBUG_MODE
     __c_node* __c = __get_db()->__find_c_and_lock(this);
     for (__i_node** __dp = __c->end_; __dp != __c->beg_; )
     {
@@ -2498,7 +2498,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::remove(const_iterator __p) _NOEXCEPT
         {
             (*__dp)->__c_ = nullptr;
             if (--__c->end_ != __dp)
-                _VSTD::memmove(__dp, __dp+1, (__c->end_ - __dp)*sizeof(__i_node*));
+                _CUDA_VSTD::memmove(__dp, __dp+1, (__c->end_ - __dp)*sizeof(__i_node*));
         }
     }
     __get_db()->unlock();
@@ -2605,7 +2605,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__equal_range_multi(
 template <class _Tp, class _Hash, class _Equal, class _Alloc>
 void
 __hash_table<_Tp, _Hash, _Equal, _Alloc>::swap(__hash_table& __u)
-#if _LIBCPP_STD_VER <= 11
+#if _LIBCUDACXX_STD_VER <= 11
     _NOEXCEPT_(
         __is_nothrow_swappable<hasher>::value && __is_nothrow_swappable<key_equal>::value
         && (!allocator_traits<__pointer_allocator>::propagate_on_container_swap::value
@@ -2617,7 +2617,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::swap(__hash_table& __u)
   _NOEXCEPT_(__is_nothrow_swappable<hasher>::value && __is_nothrow_swappable<key_equal>::value)
 #endif
 {
-    _LIBCPP_ASSERT(__node_traits::propagate_on_container_swap::value ||
+    _LIBCUDACXX_ASSERT(__node_traits::propagate_on_container_swap::value ||
                    this->__node_alloc() == __u.__node_alloc(),
                    "list::swap: Either propagate_on_container_swap must be true"
                    " or the allocators must compare equal");
@@ -2626,11 +2626,11 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::swap(__hash_table& __u)
     __bucket_list_.reset(__u.__bucket_list_.release());
     __u.__bucket_list_.reset(__npp);
     }
-    _VSTD::swap(__bucket_list_.get_deleter().size(), __u.__bucket_list_.get_deleter().size());
-    _VSTD::__swap_allocator(__bucket_list_.get_deleter().__alloc(),
+    _CUDA_VSTD::swap(__bucket_list_.get_deleter().size(), __u.__bucket_list_.get_deleter().size());
+    _CUDA_VSTD::__swap_allocator(__bucket_list_.get_deleter().__alloc(),
              __u.__bucket_list_.get_deleter().__alloc());
-    _VSTD::__swap_allocator(__node_alloc(), __u.__node_alloc());
-    _VSTD::swap(__p1_.first().__next_, __u.__p1_.first().__next_);
+    _CUDA_VSTD::__swap_allocator(__node_alloc(), __u.__node_alloc());
+    _CUDA_VSTD::swap(__p1_.first().__next_, __u.__p1_.first().__next_);
     __p2_.swap(__u.__p2_);
     __p3_.swap(__u.__p3_);
     if (size() > 0)
@@ -2646,7 +2646,7 @@ template <class _Tp, class _Hash, class _Equal, class _Alloc>
 typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::size_type
 __hash_table<_Tp, _Hash, _Equal, _Alloc>::bucket_size(size_type __n) const
 {
-    _LIBCPP_ASSERT(__n < bucket_count(),
+    _LIBCUDACXX_ASSERT(__n < bucket_count(),
         "unordered container::bucket_size(n) called with n >= bucket_count()");
     __next_pointer __np = __bucket_list_[__n];
     size_type __bc = bucket_count();
@@ -2662,7 +2662,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::bucket_size(size_type __n) const
 }
 
 template <class _Tp, class _Hash, class _Equal, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 swap(__hash_table<_Tp, _Hash, _Equal, _Alloc>& __x,
      __hash_table<_Tp, _Hash, _Equal, _Alloc>& __y)
@@ -2671,7 +2671,7 @@ swap(__hash_table<_Tp, _Hash, _Equal, _Alloc>& __x,
     __x.swap(__y);
 }
 
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
+#ifdef _LIBCUDACXX_ENABLE_DEBUG_MODE
 
 template <class _Tp, class _Hash, class _Equal, class _Alloc>
 bool
@@ -2701,10 +2701,10 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__subscriptable(const const_iterator*,
     return false;
 }
 
-#endif // _LIBCPP_ENABLE_DEBUG_MODE
+#endif // _LIBCUDACXX_ENABLE_DEBUG_MODE
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___HASH_TABLE
+#endif // _LIBCUDACXX___HASH_TABLE

diff  --git a/libcxx/include/__ios/fpos.h b/libcxx/include/__ios/fpos.h
index 87f0135fc3ea..f65c591b6b58 100644
--- a/libcxx/include/__ios/fpos.h
+++ b/libcxx/include/__ios/fpos.h
@@ -7,49 +7,49 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___IOS_FPOS_H
-#define _LIBCPP___IOS_FPOS_H
+#ifndef _LIBCUDACXX___IOS_FPOS_H
+#define _LIBCUDACXX___IOS_FPOS_H
 
 #include <__config>
 #include <iosfwd>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _StateT>
-class _LIBCPP_TEMPLATE_VIS fpos {
+class _LIBCUDACXX_TEMPLATE_VIS fpos {
 private:
   _StateT __st_;
   streamoff __off_;
 
 public:
-  _LIBCPP_HIDE_FROM_ABI fpos(streamoff __off = streamoff()) : __st_(), __off_(__off) {}
+  _LIBCUDACXX_HIDE_FROM_ABI fpos(streamoff __off = streamoff()) : __st_(), __off_(__off) {}
 
-  _LIBCPP_HIDE_FROM_ABI operator streamoff() const { return __off_; }
+  _LIBCUDACXX_HIDE_FROM_ABI operator streamoff() const { return __off_; }
 
-  _LIBCPP_HIDE_FROM_ABI _StateT state() const { return __st_; }
-  _LIBCPP_HIDE_FROM_ABI void state(_StateT __st) { __st_ = __st; }
+  _LIBCUDACXX_HIDE_FROM_ABI _StateT state() const { return __st_; }
+  _LIBCUDACXX_HIDE_FROM_ABI void state(_StateT __st) { __st_ = __st; }
 
-  _LIBCPP_HIDE_FROM_ABI fpos& operator+=(streamoff __off) {
+  _LIBCUDACXX_HIDE_FROM_ABI fpos& operator+=(streamoff __off) {
     __off_ += __off;
     return *this;
   }
 
-  _LIBCPP_HIDE_FROM_ABI fpos operator+(streamoff __off) const {
+  _LIBCUDACXX_HIDE_FROM_ABI fpos operator+(streamoff __off) const {
     fpos __t(*this);
     __t += __off;
     return __t;
   }
 
-  _LIBCPP_HIDE_FROM_ABI fpos& operator-=(streamoff __off) {
+  _LIBCUDACXX_HIDE_FROM_ABI fpos& operator-=(streamoff __off) {
     __off_ -= __off;
     return *this;
   }
 
-  _LIBCPP_HIDE_FROM_ABI fpos operator-(streamoff __off) const {
+  _LIBCUDACXX_HIDE_FROM_ABI fpos operator-(streamoff __off) const {
     fpos __t(*this);
     __t -= __off;
     return __t;
@@ -57,23 +57,23 @@ class _LIBCPP_TEMPLATE_VIS fpos {
 };
 
 template <class _StateT>
-inline _LIBCPP_HIDE_FROM_ABI
+inline _LIBCUDACXX_HIDE_FROM_ABI
 streamoff operator-(const fpos<_StateT>& __x, const fpos<_StateT>& __y) {
   return streamoff(__x) - streamoff(__y);
 }
 
 template <class _StateT>
-inline _LIBCPP_HIDE_FROM_ABI
+inline _LIBCUDACXX_HIDE_FROM_ABI
 bool operator==(const fpos<_StateT>& __x, const fpos<_StateT>& __y) {
   return streamoff(__x) == streamoff(__y);
 }
 
 template <class _StateT>
-inline _LIBCPP_HIDE_FROM_ABI
+inline _LIBCUDACXX_HIDE_FROM_ABI
 bool operator!=(const fpos<_StateT>& __x, const fpos<_StateT>& __y) {
   return streamoff(__x) != streamoff(__y);
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___IOS_FPOS_H
+#endif // _LIBCUDACXX___IOS_FPOS_H

diff  --git a/libcxx/include/__iterator/access.h b/libcxx/include/__iterator/access.h
index 7abd4c5573d6..155ac48de428 100644
--- a/libcxx/include/__iterator/access.h
+++ b/libcxx/include/__iterator/access.h
@@ -7,20 +7,20 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ITERATOR_ACCESS_H
-#define _LIBCPP___ITERATOR_ACCESS_H
+#ifndef _LIBCUDACXX___ITERATOR_ACCESS_H
+#define _LIBCUDACXX___ITERATOR_ACCESS_H
 
 #include <__config>
 #include <cstddef>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Tp, size_t _Np>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 _Tp*
 begin(_Tp (&__array)[_Np])
 {
@@ -28,17 +28,17 @@ begin(_Tp (&__array)[_Np])
 }
 
 template <class _Tp, size_t _Np>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 _Tp*
 end(_Tp (&__array)[_Np])
 {
     return __array + _Np;
 }
 
-#if !defined(_LIBCPP_CXX03_LANG)
+#if !defined(_LIBCUDACXX_CXX03_LANG)
 
 template <class _Cp>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 auto
 begin(_Cp& __c) -> decltype(__c.begin())
 {
@@ -46,7 +46,7 @@ begin(_Cp& __c) -> decltype(__c.begin())
 }
 
 template <class _Cp>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 auto
 begin(const _Cp& __c) -> decltype(__c.begin())
 {
@@ -54,7 +54,7 @@ begin(const _Cp& __c) -> decltype(__c.begin())
 }
 
 template <class _Cp>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 auto
 end(_Cp& __c) -> decltype(__c.end())
 {
@@ -62,36 +62,36 @@ end(_Cp& __c) -> decltype(__c.end())
 }
 
 template <class _Cp>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 auto
 end(const _Cp& __c) -> decltype(__c.end())
 {
     return __c.end();
 }
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 
 template <class _Cp>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-auto cbegin(const _Cp& __c) -> decltype(_VSTD::begin(__c))
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
+auto cbegin(const _Cp& __c) -> decltype(_CUDA_VSTD::begin(__c))
 {
-    return _VSTD::begin(__c);
+    return _CUDA_VSTD::begin(__c);
 }
 
 template <class _Cp>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-auto cend(const _Cp& __c) -> decltype(_VSTD::end(__c))
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
+auto cend(const _Cp& __c) -> decltype(_CUDA_VSTD::end(__c))
 {
-    return _VSTD::end(__c);
+    return _CUDA_VSTD::end(__c);
 }
 
 #endif
 
 
-#else  // defined(_LIBCPP_CXX03_LANG)
+#else  // defined(_LIBCUDACXX_CXX03_LANG)
 
 template <class _Cp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 typename _Cp::iterator
 begin(_Cp& __c)
 {
@@ -99,7 +99,7 @@ begin(_Cp& __c)
 }
 
 template <class _Cp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 typename _Cp::const_iterator
 begin(const _Cp& __c)
 {
@@ -107,7 +107,7 @@ begin(const _Cp& __c)
 }
 
 template <class _Cp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 typename _Cp::iterator
 end(_Cp& __c)
 {
@@ -115,15 +115,15 @@ end(_Cp& __c)
 }
 
 template <class _Cp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 typename _Cp::const_iterator
 end(const _Cp& __c)
 {
     return __c.end();
 }
 
-#endif // !defined(_LIBCPP_CXX03_LANG)
+#endif // !defined(_LIBCUDACXX_CXX03_LANG)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ITERATOR_ACCESS_H
+#endif // _LIBCUDACXX___ITERATOR_ACCESS_H

diff  --git a/libcxx/include/__iterator/advance.h b/libcxx/include/__iterator/advance.h
index 4b8b0dc970a1..499b390f2722 100644
--- a/libcxx/include/__iterator/advance.h
+++ b/libcxx/include/__iterator/advance.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ITERATOR_ADVANCE_H
-#define _LIBCPP___ITERATOR_ADVANCE_H
+#ifndef _LIBCUDACXX___ITERATOR_ADVANCE_H
+#define _LIBCUDACXX___ITERATOR_ADVANCE_H
 
 #include <__assert>
 #include <__config>
@@ -22,21 +22,21 @@
 #include <limits>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _InputIter>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 void __advance(_InputIter& __i, typename iterator_traits<_InputIter>::
diff erence_type __n, input_iterator_tag) {
   for (; __n > 0; --__n)
     ++__i;
 }
 
 template <class _BiDirIter>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 void __advance(_BiDirIter& __i, typename iterator_traits<_BiDirIter>::
diff erence_type __n, bidirectional_iterator_tag) {
   if (__n >= 0)
     for (; __n > 0; --__n)
@@ -47,25 +47,25 @@ void __advance(_BiDirIter& __i, typename iterator_traits<_BiDirIter>::
diff erence
 }
 
 template <class _RandIter>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 void __advance(_RandIter& __i, typename iterator_traits<_RandIter>::
diff erence_type __n, random_access_iterator_tag) {
   __i += __n;
 }
 
 template <
     class _InputIter, class _Distance,
-    class _IntegralDistance = decltype(_VSTD::__convert_to_integral(declval<_Distance>())),
+    class _IntegralDistance = decltype(_CUDA_VSTD::__convert_to_integral(declval<_Distance>())),
     class = __enable_if_t<is_integral<_IntegralDistance>::value> >
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 void advance(_InputIter& __i, _Distance __orig_n) {
   typedef typename iterator_traits<_InputIter>::
diff erence_type _Difference;
-  _Difference __n = static_cast<_Difference>(_VSTD::__convert_to_integral(__orig_n));
-  _LIBCPP_ASSERT(__n >= 0 || __is_cpp17_bidirectional_iterator<_InputIter>::value,
+  _Difference __n = static_cast<_Difference>(_CUDA_VSTD::__convert_to_integral(__orig_n));
+  _LIBCUDACXX_ASSERT(__n >= 0 || __is_cpp17_bidirectional_iterator<_InputIter>::value,
                  "Attempt to advance(it, n) with negative n on a non-bidirectional iterator");
-  _VSTD::__advance(__i, __n, typename iterator_traits<_InputIter>::iterator_category());
+  _CUDA_VSTD::__advance(__i, __n, typename iterator_traits<_InputIter>::iterator_category());
 }
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
 // [range.iter.op.advance]
 
@@ -75,7 +75,7 @@ namespace __advance {
 struct __fn {
 private:
   template <class _Ip>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   static constexpr void __advance_forward(_Ip& __i, iter_
diff erence_t<_Ip> __n) {
     while (__n > 0) {
       --__n;
@@ -84,7 +84,7 @@ struct __fn {
   }
 
   template <class _Ip>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   static constexpr void __advance_backward(_Ip& __i, iter_
diff erence_t<_Ip> __n) {
     while (__n < 0) {
       ++__n;
@@ -95,9 +95,9 @@ struct __fn {
 public:
   // Preconditions: If `I` does not model `bidirectional_iterator`, `n` is not negative.
   template <input_or_output_iterator _Ip>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr void operator()(_Ip& __i, iter_
diff erence_t<_Ip> __n) const {
-    _LIBCPP_ASSERT(__n >= 0 || bidirectional_iterator<_Ip>,
+    _LIBCUDACXX_ASSERT(__n >= 0 || bidirectional_iterator<_Ip>,
                    "If `n < 0`, then `bidirectional_iterator<I>` must be true.");
 
     // If `I` models `random_access_iterator`, equivalent to `i += n`.
@@ -119,10 +119,10 @@ struct __fn {
 
   // Preconditions: Either `assignable_from<I&, S> || sized_sentinel_for<S, I>` is modeled, or [i, bound_sentinel) denotes a range.
   template <input_or_output_iterator _Ip, sentinel_for<_Ip> _Sp>
-  _LIBCPP_HIDE_FROM_ABI constexpr void operator()(_Ip& __i, _Sp __bound_sentinel) const {
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr void operator()(_Ip& __i, _Sp __bound_sentinel) const {
     // If `I` and `S` model `assignable_from<I&, S>`, equivalent to `i = std::move(bound_sentinel)`.
     if constexpr (assignable_from<_Ip&, _Sp>) {
-      __i = _VSTD::move(__bound_sentinel);
+      __i = _CUDA_VSTD::move(__bound_sentinel);
     }
     // Otherwise, if `S` and `I` model `sized_sentinel_for<S, I>`, equivalent to `ranges::advance(i, bound_sentinel - i)`.
     else if constexpr (sized_sentinel_for<_Sp, _Ip>) {
@@ -142,9 +142,9 @@ struct __fn {
   //   * If `n < 0`, [bound_sentinel, i) denotes a range, `I` models `bidirectional_iterator`, and `I` and `S` model `same_as<I, S>`.
   // Returns: `n - M`, where `M` is the 
diff erence between the ending and starting position.
   template <input_or_output_iterator _Ip, sentinel_for<_Ip> _Sp>
-  _LIBCPP_HIDE_FROM_ABI constexpr iter_
diff erence_t<_Ip> operator()(_Ip& __i, iter_
diff erence_t<_Ip> __n,
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr iter_
diff erence_t<_Ip> operator()(_Ip& __i, iter_
diff erence_t<_Ip> __n,
                                                                     _Sp __bound_sentinel) const {
-    _LIBCPP_ASSERT((__n >= 0) || (bidirectional_iterator<_Ip> && same_as<_Ip, _Sp>),
+    _LIBCUDACXX_ASSERT((__n >= 0) || (bidirectional_iterator<_Ip> && same_as<_Ip, _Sp>),
                    "If `n < 0`, then `bidirectional_iterator<I> && same_as<I, S>` must be true.");
     // If `S` and `I` model `sized_sentinel_for<S, I>`:
     if constexpr (sized_sentinel_for<_Sp, _Ip>) {
@@ -181,7 +181,7 @@ struct __fn {
       return __n;
     }
 
-    __libcpp_unreachable();
+    __LIBCUDACXX_unreachable();
   }
 };
 
@@ -192,8 +192,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ITERATOR_ADVANCE_H
+#endif // _LIBCUDACXX___ITERATOR_ADVANCE_H

diff  --git a/libcxx/include/__iterator/back_insert_iterator.h b/libcxx/include/__iterator/back_insert_iterator.h
index e9f9f2abec2a..449b91944b43 100644
--- a/libcxx/include/__iterator/back_insert_iterator.h
+++ b/libcxx/include/__iterator/back_insert_iterator.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ITERATOR_BACK_INSERT_ITERATOR_H
-#define _LIBCPP___ITERATOR_BACK_INSERT_ITERATOR_H
+#ifndef _LIBCUDACXX___ITERATOR_BACK_INSERT_ITERATOR_H
+#define _LIBCUDACXX___ITERATOR_BACK_INSERT_ITERATOR_H
 
 #include <__config>
 #include <__iterator/iterator.h>
@@ -17,26 +17,26 @@
 #include <__utility/move.h>
 #include <cstddef>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+_LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
 template <class _Container>
-class _LIBCPP_TEMPLATE_VIS back_insert_iterator
-#if _LIBCPP_STD_VER <= 14 || !defined(_LIBCPP_ABI_NO_ITERATOR_BASES)
+class _LIBCUDACXX_TEMPLATE_VIS back_insert_iterator
+#if _LIBCUDACXX_STD_VER <= 14 || !defined(_LIBCUDACXX_ABI_NO_ITERATOR_BASES)
     : public iterator<output_iterator_tag, void, void, void, void>
 #endif
 {
-_LIBCPP_SUPPRESS_DEPRECATED_POP
+_LIBCUDACXX_SUPPRESS_DEPRECATED_POP
 protected:
     _Container* container;
 public:
     typedef output_iterator_tag iterator_category;
     typedef void value_type;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
     typedef ptr
diff _t 
diff erence_type;
 #else
     typedef void 
diff erence_type;
@@ -45,28 +45,28 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
     typedef void reference;
     typedef _Container container_type;
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 explicit back_insert_iterator(_Container& __x) : container(_VSTD::addressof(__x)) {}
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 back_insert_iterator& operator=(const typename _Container::value_type& __value)
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 explicit back_insert_iterator(_Container& __x) : container(_CUDA_VSTD::addressof(__x)) {}
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 back_insert_iterator& operator=(const typename _Container::value_type& __value)
         {container->push_back(__value); return *this;}
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 back_insert_iterator& operator=(typename _Container::value_type&& __value)
-        {container->push_back(_VSTD::move(__value)); return *this;}
-#endif // _LIBCPP_CXX03_LANG
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 back_insert_iterator& operator*()     {return *this;}
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 back_insert_iterator& operator++()    {return *this;}
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 back_insert_iterator  operator++(int) {return *this;}
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 back_insert_iterator& operator=(typename _Container::value_type&& __value)
+        {container->push_back(_CUDA_VSTD::move(__value)); return *this;}
+#endif // _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 back_insert_iterator& operator*()     {return *this;}
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 back_insert_iterator& operator++()    {return *this;}
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 back_insert_iterator  operator++(int) {return *this;}
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _Container* __get_container() const { return container; }
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _Container* __get_container() const { return container; }
 };
 
 template <class _Container>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 back_insert_iterator<_Container>
 back_inserter(_Container& __x)
 {
     return back_insert_iterator<_Container>(__x);
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ITERATOR_BACK_INSERT_ITERATOR_H
+#endif // _LIBCUDACXX___ITERATOR_BACK_INSERT_ITERATOR_H

diff  --git a/libcxx/include/__iterator/bounded_iter.h b/libcxx/include/__iterator/bounded_iter.h
index a395e2b638eb..b48b1002d7e8 100644
--- a/libcxx/include/__iterator/bounded_iter.h
+++ b/libcxx/include/__iterator/bounded_iter.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ITERATOR_BOUNDED_ITER_H
-#define _LIBCPP___ITERATOR_BOUNDED_ITER_H
+#ifndef _LIBCUDACXX___ITERATOR_BOUNDED_ITER_H
+#define _LIBCUDACXX___ITERATOR_BOUNDED_ITER_H
 
 #include <__assert>
 #include <__config>
@@ -17,11 +17,11 @@
 #include <__utility/move.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 // Iterator wrapper that carries the valid range it is allowed to access.
 //
@@ -40,7 +40,7 @@ struct __bounded_iter {
   using pointer           = typename iterator_traits<_Iterator>::pointer;
   using reference         = typename iterator_traits<_Iterator>::reference;
   using iterator_category = typename iterator_traits<_Iterator>::iterator_category;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
   using iterator_concept = contiguous_iterator_tag;
 #endif
 
@@ -48,20 +48,20 @@ struct __bounded_iter {
   //
   // Such an iterator does not point to any object and is conceptually out of bounds, so it is
   // not dereferenceable. Observing operations like comparison and assignment are valid.
-  _LIBCPP_HIDE_FROM_ABI __bounded_iter() = default;
+  _LIBCUDACXX_HIDE_FROM_ABI __bounded_iter() = default;
 
-  _LIBCPP_HIDE_FROM_ABI __bounded_iter(__bounded_iter const&) = default;
-  _LIBCPP_HIDE_FROM_ABI __bounded_iter(__bounded_iter&&)      = default;
+  _LIBCUDACXX_HIDE_FROM_ABI __bounded_iter(__bounded_iter const&) = default;
+  _LIBCUDACXX_HIDE_FROM_ABI __bounded_iter(__bounded_iter&&)      = default;
 
   template <class _OtherIterator, class = __enable_if_t< is_convertible<_OtherIterator, _Iterator>::value > >
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR __bounded_iter(__bounded_iter<_OtherIterator> const& __other) _NOEXCEPT
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR __bounded_iter(__bounded_iter<_OtherIterator> const& __other) _NOEXCEPT
       : __current_(__other.__current_),
         __begin_(__other.__begin_),
         __end_(__other.__end_) {}
 
   // Assign a bounded iterator to another one, rebinding the bounds of the iterator as well.
-  _LIBCPP_HIDE_FROM_ABI __bounded_iter& operator=(__bounded_iter const&) = default;
-  _LIBCPP_HIDE_FROM_ABI __bounded_iter& operator=(__bounded_iter&&)      = default;
+  _LIBCUDACXX_HIDE_FROM_ABI __bounded_iter& operator=(__bounded_iter const&) = default;
+  _LIBCUDACXX_HIDE_FROM_ABI __bounded_iter& operator=(__bounded_iter&&)      = default;
 
 private:
   // Create an iterator wrapping the given iterator, and whose bounds are described
@@ -73,33 +73,33 @@ struct __bounded_iter {
   //
   // Since it is non-standard for iterators to have this constructor, __bounded_iter must
   // be created via `std::__make_bounded_iter`.
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 explicit __bounded_iter(
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 explicit __bounded_iter(
       _Iterator __current, _Iterator __begin, _Iterator __end)
       : __current_(__current), __begin_(__begin), __end_(__end) {
-    _LIBCPP_ASSERT(__begin <= __end, "__bounded_iter(current, begin, end): [begin, end) is not a valid range");
+    _LIBCUDACXX_ASSERT(__begin <= __end, "__bounded_iter(current, begin, end): [begin, end) is not a valid range");
   }
 
   template <class _It>
-  friend _LIBCPP_CONSTEXPR __bounded_iter<_It> __make_bounded_iter(_It, _It, _It);
+  friend _LIBCUDACXX_CONSTEXPR __bounded_iter<_It> __make_bounded_iter(_It, _It, _It);
 
 public:
   // Dereference and indexing operations.
   //
   // These operations check that the iterator is dereferenceable, that is within [begin, end).
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 reference operator*() const _NOEXCEPT {
-    _LIBCPP_ASSERT(
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 reference operator*() const _NOEXCEPT {
+    _LIBCUDACXX_ASSERT(
         __in_bounds(__current_), "__bounded_iter::operator*: Attempt to dereference an out-of-range iterator");
     return *__current_;
   }
 
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 pointer operator->() const _NOEXCEPT {
-    _LIBCPP_ASSERT(
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 pointer operator->() const _NOEXCEPT {
+    _LIBCUDACXX_ASSERT(
         __in_bounds(__current_), "__bounded_iter::operator->: Attempt to dereference an out-of-range iterator");
     return std::__to_address(__current_);
   }
 
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 reference operator[](
diff erence_type __n) const _NOEXCEPT {
-    _LIBCPP_ASSERT(
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 reference operator[](
diff erence_type __n) const _NOEXCEPT {
+    _LIBCUDACXX_ASSERT(
         __in_bounds(__current_ + __n), "__bounded_iter::operator[]: Attempt to index an iterator out-of-range");
     return __current_[__n];
   }
@@ -108,54 +108,54 @@ struct __bounded_iter {
   //
   // These operations do not check that the resulting iterator is within the bounds, since that
   // would make it impossible to create a past-the-end iterator.
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 __bounded_iter& operator++() _NOEXCEPT {
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 __bounded_iter& operator++() _NOEXCEPT {
     ++__current_;
     return *this;
   }
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 __bounded_iter operator++(int) _NOEXCEPT {
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 __bounded_iter operator++(int) _NOEXCEPT {
     __bounded_iter __tmp(*this);
     ++*this;
     return __tmp;
   }
 
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 __bounded_iter& operator--() _NOEXCEPT {
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 __bounded_iter& operator--() _NOEXCEPT {
     --__current_;
     return *this;
   }
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 __bounded_iter operator--(int) _NOEXCEPT {
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 __bounded_iter operator--(int) _NOEXCEPT {
     __bounded_iter __tmp(*this);
     --*this;
     return __tmp;
   }
 
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 __bounded_iter& operator+=(
diff erence_type __n) _NOEXCEPT {
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 __bounded_iter& operator+=(
diff erence_type __n) _NOEXCEPT {
     __current_ += __n;
     return *this;
   }
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 friend __bounded_iter
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 friend __bounded_iter
   operator+(__bounded_iter const& __self, 
diff erence_type __n) _NOEXCEPT {
     __bounded_iter __tmp(__self);
     __tmp += __n;
     return __tmp;
   }
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 friend __bounded_iter
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 friend __bounded_iter
   operator+(
diff erence_type __n, __bounded_iter const& __self) _NOEXCEPT {
     __bounded_iter __tmp(__self);
     __tmp += __n;
     return __tmp;
   }
 
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 __bounded_iter& operator-=(
diff erence_type __n) _NOEXCEPT {
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 __bounded_iter& operator-=(
diff erence_type __n) _NOEXCEPT {
     __current_ -= __n;
     return *this;
   }
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 friend __bounded_iter
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 friend __bounded_iter
   operator-(__bounded_iter const& __self, 
diff erence_type __n) _NOEXCEPT {
     __bounded_iter __tmp(__self);
     __tmp -= __n;
     return __tmp;
   }
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 friend 
diff erence_type
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 friend 
diff erence_type
   operator-(__bounded_iter const& __x, __bounded_iter const& __y) _NOEXCEPT {
     return __x.__current_ - __y.__current_;
   }
@@ -166,34 +166,34 @@ struct __bounded_iter {
   // The valid range for each iterator is also not considered as part of the comparison,
   // i.e. two iterators pointing to the same location will be considered equal even
   // if they have 
diff erent validity ranges.
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR friend bool
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR friend bool
   operator==(__bounded_iter const& __x, __bounded_iter const& __y) _NOEXCEPT {
     return __x.__current_ == __y.__current_;
   }
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR friend bool
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR friend bool
   operator!=(__bounded_iter const& __x, __bounded_iter const& __y) _NOEXCEPT {
     return __x.__current_ != __y.__current_;
   }
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR friend bool
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR friend bool
   operator<(__bounded_iter const& __x, __bounded_iter const& __y) _NOEXCEPT {
     return __x.__current_ < __y.__current_;
   }
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR friend bool
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR friend bool
   operator>(__bounded_iter const& __x, __bounded_iter const& __y) _NOEXCEPT {
     return __x.__current_ > __y.__current_;
   }
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR friend bool
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR friend bool
   operator<=(__bounded_iter const& __x, __bounded_iter const& __y) _NOEXCEPT {
     return __x.__current_ <= __y.__current_;
   }
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR friend bool
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR friend bool
   operator>=(__bounded_iter const& __x, __bounded_iter const& __y) _NOEXCEPT {
     return __x.__current_ >= __y.__current_;
   }
 
 private:
   // Return whether the given iterator is in the bounds of this __bounded_iter.
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool __in_bounds(_Iterator const& __iter) const {
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR bool __in_bounds(_Iterator const& __iter) const {
     return __iter >= __begin_ && __iter < __end_;
   }
 
@@ -204,11 +204,11 @@ struct __bounded_iter {
 };
 
 template <class _It>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR __bounded_iter<_It> __make_bounded_iter(_It __it, _It __begin, _It __end) {
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR __bounded_iter<_It> __make_bounded_iter(_It __it, _It __begin, _It __end) {
   return __bounded_iter<_It>(std::move(__it), std::move(__begin), std::move(__end));
 }
 
-#if _LIBCPP_STD_VER <= 17
+#if _LIBCUDACXX_STD_VER <= 17
 template <class _Iterator>
 struct __is_cpp17_contiguous_iterator<__bounded_iter<_Iterator> > : true_type {};
 #endif
@@ -219,11 +219,11 @@ struct pointer_traits<__bounded_iter<_Iterator> > {
   using element_type    = typename pointer_traits<_Iterator>::element_type;
   using 
diff erence_type = typename pointer_traits<_Iterator>::
diff erence_type;
 
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR static element_type* to_address(pointer __it) _NOEXCEPT {
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR static element_type* to_address(pointer __it) _NOEXCEPT {
     return std::__to_address(__it.__current_);
   }
 };
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ITERATOR_BOUNDED_ITER_H
+#endif // _LIBCUDACXX___ITERATOR_BOUNDED_ITER_H

diff  --git a/libcxx/include/__iterator/common_iterator.h b/libcxx/include/__iterator/common_iterator.h
index abcc0b675e63..07d842a8104c 100644
--- a/libcxx/include/__iterator/common_iterator.h
+++ b/libcxx/include/__iterator/common_iterator.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ITERATOR_COMMON_ITERATOR_H
-#define _LIBCPP___ITERATOR_COMMON_ITERATOR_H
+#ifndef _LIBCUDACXX___ITERATOR_COMMON_ITERATOR_H
+#define _LIBCUDACXX___ITERATOR_COMMON_ITERATOR_H
 
 #include <__assert>
 #include <__config>
@@ -21,13 +21,13 @@
 #include <concepts>
 #include <variant>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 template<class _Iter>
 concept __can_use_postfix_proxy =
@@ -39,7 +39,7 @@ template<input_or_output_iterator _Iter, sentinel_for<_Iter> _Sent>
 class common_iterator {
   struct __proxy {
     constexpr const iter_value_t<_Iter>* operator->() const noexcept {
-      return _VSTD::addressof(__value_);
+      return _CUDA_VSTD::addressof(__value_);
     }
     iter_value_t<_Iter> __value_;
   };
@@ -56,54 +56,54 @@ class common_iterator {
 
   common_iterator() requires default_initializable<_Iter> = default;
 
-  constexpr common_iterator(_Iter __i) : __hold_(in_place_type<_Iter>, _VSTD::move(__i)) {}
-  constexpr common_iterator(_Sent __s) : __hold_(in_place_type<_Sent>, _VSTD::move(__s)) {}
+  constexpr common_iterator(_Iter __i) : __hold_(in_place_type<_Iter>, _CUDA_VSTD::move(__i)) {}
+  constexpr common_iterator(_Sent __s) : __hold_(in_place_type<_Sent>, _CUDA_VSTD::move(__s)) {}
 
   template<class _I2, class _S2>
     requires convertible_to<const _I2&, _Iter> && convertible_to<const _S2&, _Sent>
   constexpr common_iterator(const common_iterator<_I2, _S2>& __other)
     : __hold_([&]() -> variant<_Iter, _Sent> {
-      _LIBCPP_ASSERT(!__other.__hold_.valueless_by_exception(), "Attempted to construct from a valueless common_iterator");
+      _LIBCUDACXX_ASSERT(!__other.__hold_.valueless_by_exception(), "Attempted to construct from a valueless common_iterator");
       if (__other.__hold_.index() == 0)
-        return variant<_Iter, _Sent>{in_place_index<0>, _VSTD::__unchecked_get<0>(__other.__hold_)};
-      return variant<_Iter, _Sent>{in_place_index<1>, _VSTD::__unchecked_get<1>(__other.__hold_)};
+        return variant<_Iter, _Sent>{in_place_index<0>, _CUDA_VSTD::__unchecked_get<0>(__other.__hold_)};
+      return variant<_Iter, _Sent>{in_place_index<1>, _CUDA_VSTD::__unchecked_get<1>(__other.__hold_)};
     }()) {}
 
   template<class _I2, class _S2>
     requires convertible_to<const _I2&, _Iter> && convertible_to<const _S2&, _Sent> &&
              assignable_from<_Iter&, const _I2&> && assignable_from<_Sent&, const _S2&>
   common_iterator& operator=(const common_iterator<_I2, _S2>& __other) {
-    _LIBCPP_ASSERT(!__other.__hold_.valueless_by_exception(), "Attempted to assign from a valueless common_iterator");
+    _LIBCUDACXX_ASSERT(!__other.__hold_.valueless_by_exception(), "Attempted to assign from a valueless common_iterator");
 
     auto __idx = __hold_.index();
     auto __other_idx = __other.__hold_.index();
 
     // If they're the same index, just assign.
     if (__idx == 0 && __other_idx == 0)
-      _VSTD::__unchecked_get<0>(__hold_) = _VSTD::__unchecked_get<0>(__other.__hold_);
+      _CUDA_VSTD::__unchecked_get<0>(__hold_) = _CUDA_VSTD::__unchecked_get<0>(__other.__hold_);
     else if (__idx == 1 && __other_idx == 1)
-      _VSTD::__unchecked_get<1>(__hold_) = _VSTD::__unchecked_get<1>(__other.__hold_);
+      _CUDA_VSTD::__unchecked_get<1>(__hold_) = _CUDA_VSTD::__unchecked_get<1>(__other.__hold_);
 
     // Otherwise replace with the oposite element.
     else if (__other_idx == 1)
-      __hold_.template emplace<1>(_VSTD::__unchecked_get<1>(__other.__hold_));
+      __hold_.template emplace<1>(_CUDA_VSTD::__unchecked_get<1>(__other.__hold_));
     else if (__other_idx == 0)
-      __hold_.template emplace<0>(_VSTD::__unchecked_get<0>(__other.__hold_));
+      __hold_.template emplace<0>(_CUDA_VSTD::__unchecked_get<0>(__other.__hold_));
 
     return *this;
   }
 
   constexpr decltype(auto) operator*()
   {
-    _LIBCPP_ASSERT(holds_alternative<_Iter>(__hold_), "Attempted to dereference a non-dereferenceable common_iterator");
-    return *_VSTD::__unchecked_get<_Iter>(__hold_);
+    _LIBCUDACXX_ASSERT(holds_alternative<_Iter>(__hold_), "Attempted to dereference a non-dereferenceable common_iterator");
+    return *_CUDA_VSTD::__unchecked_get<_Iter>(__hold_);
   }
 
   constexpr decltype(auto) operator*() const
     requires __dereferenceable<const _Iter>
   {
-    _LIBCPP_ASSERT(holds_alternative<_Iter>(__hold_), "Attempted to dereference a non-dereferenceable common_iterator");
-    return *_VSTD::__unchecked_get<_Iter>(__hold_);
+    _LIBCUDACXX_ASSERT(holds_alternative<_Iter>(__hold_), "Attempted to dereference a non-dereferenceable common_iterator");
+    return *_CUDA_VSTD::__unchecked_get<_Iter>(__hold_);
   }
 
   template<class _I2 = _Iter>
@@ -113,31 +113,31 @@ class common_iterator {
      is_reference_v<iter_reference_t<_I2>> ||
      constructible_from<iter_value_t<_I2>, iter_reference_t<_I2>>)
   {
-    _LIBCPP_ASSERT(holds_alternative<_Iter>(__hold_), "Attempted to dereference a non-dereferenceable common_iterator");
+    _LIBCUDACXX_ASSERT(holds_alternative<_Iter>(__hold_), "Attempted to dereference a non-dereferenceable common_iterator");
     if constexpr (is_pointer_v<_Iter> || requires(const _Iter& __i) { __i.operator->(); })    {
-      return _VSTD::__unchecked_get<_Iter>(__hold_);
+      return _CUDA_VSTD::__unchecked_get<_Iter>(__hold_);
     } else if constexpr (is_reference_v<iter_reference_t<_Iter>>) {
-      auto&& __tmp = *_VSTD::__unchecked_get<_Iter>(__hold_);
-      return _VSTD::addressof(__tmp);
+      auto&& __tmp = *_CUDA_VSTD::__unchecked_get<_Iter>(__hold_);
+      return _CUDA_VSTD::addressof(__tmp);
     } else {
-      return __proxy{*_VSTD::__unchecked_get<_Iter>(__hold_)};
+      return __proxy{*_CUDA_VSTD::__unchecked_get<_Iter>(__hold_)};
     }
   }
 
   common_iterator& operator++() {
-    _LIBCPP_ASSERT(holds_alternative<_Iter>(__hold_), "Attempted to increment a non-dereferenceable common_iterator");
-    ++_VSTD::__unchecked_get<_Iter>(__hold_); return *this;
+    _LIBCUDACXX_ASSERT(holds_alternative<_Iter>(__hold_), "Attempted to increment a non-dereferenceable common_iterator");
+    ++_CUDA_VSTD::__unchecked_get<_Iter>(__hold_); return *this;
   }
 
   decltype(auto) operator++(int) {
-    _LIBCPP_ASSERT(holds_alternative<_Iter>(__hold_), "Attempted to increment a non-dereferenceable common_iterator");
+    _LIBCUDACXX_ASSERT(holds_alternative<_Iter>(__hold_), "Attempted to increment a non-dereferenceable common_iterator");
     if constexpr (forward_iterator<_Iter>) {
       auto __tmp = *this;
       ++*this;
       return __tmp;
     } else if constexpr (requires (_Iter& __i) { { *__i++ } -> __can_reference; } ||
                          !__can_use_postfix_proxy<_Iter>) {
-      return _VSTD::__unchecked_get<_Iter>(__hold_)++;
+      return _CUDA_VSTD::__unchecked_get<_Iter>(__hold_)++;
     } else {
       auto __p = __postfix_proxy{**this};
       ++*this;
@@ -148,8 +148,8 @@ class common_iterator {
   template<class _I2, sentinel_for<_Iter> _S2>
     requires sentinel_for<_Sent, _I2>
   friend constexpr bool operator==(const common_iterator& __x, const common_iterator<_I2, _S2>& __y) {
-    _LIBCPP_ASSERT(!__x.__hold_.valueless_by_exception(), "Attempted to compare a valueless common_iterator");
-    _LIBCPP_ASSERT(!__y.__hold_.valueless_by_exception(), "Attempted to compare a valueless common_iterator");
+    _LIBCUDACXX_ASSERT(!__x.__hold_.valueless_by_exception(), "Attempted to compare a valueless common_iterator");
+    _LIBCUDACXX_ASSERT(!__y.__hold_.valueless_by_exception(), "Attempted to compare a valueless common_iterator");
 
     auto __x_index = __x.__hold_.index();
     auto __y_index = __y.__hold_.index();
@@ -158,16 +158,16 @@ class common_iterator {
       return true;
 
     if (__x_index == 0)
-      return _VSTD::__unchecked_get<_Iter>(__x.__hold_) == _VSTD::__unchecked_get<_S2>(__y.__hold_);
+      return _CUDA_VSTD::__unchecked_get<_Iter>(__x.__hold_) == _CUDA_VSTD::__unchecked_get<_S2>(__y.__hold_);
 
-    return _VSTD::__unchecked_get<_Sent>(__x.__hold_) == _VSTD::__unchecked_get<_I2>(__y.__hold_);
+    return _CUDA_VSTD::__unchecked_get<_Sent>(__x.__hold_) == _CUDA_VSTD::__unchecked_get<_I2>(__y.__hold_);
   }
 
   template<class _I2, sentinel_for<_Iter> _S2>
     requires sentinel_for<_Sent, _I2> && equality_comparable_with<_Iter, _I2>
   friend constexpr bool operator==(const common_iterator& __x, const common_iterator<_I2, _S2>& __y) {
-    _LIBCPP_ASSERT(!__x.__hold_.valueless_by_exception(), "Attempted to compare a valueless common_iterator");
-    _LIBCPP_ASSERT(!__y.__hold_.valueless_by_exception(), "Attempted to compare a valueless common_iterator");
+    _LIBCUDACXX_ASSERT(!__x.__hold_.valueless_by_exception(), "Attempted to compare a valueless common_iterator");
+    _LIBCUDACXX_ASSERT(!__y.__hold_.valueless_by_exception(), "Attempted to compare a valueless common_iterator");
 
     auto __x_index = __x.__hold_.index();
     auto __y_index = __y.__hold_.index();
@@ -176,19 +176,19 @@ class common_iterator {
       return true;
 
     if (__x_index == 0 && __y_index == 0)
-      return  _VSTD::__unchecked_get<_Iter>(__x.__hold_) ==  _VSTD::__unchecked_get<_I2>(__y.__hold_);
+      return  _CUDA_VSTD::__unchecked_get<_Iter>(__x.__hold_) ==  _CUDA_VSTD::__unchecked_get<_I2>(__y.__hold_);
 
     if (__x_index == 0)
-      return  _VSTD::__unchecked_get<_Iter>(__x.__hold_) == _VSTD::__unchecked_get<_S2>(__y.__hold_);
+      return  _CUDA_VSTD::__unchecked_get<_Iter>(__x.__hold_) == _CUDA_VSTD::__unchecked_get<_S2>(__y.__hold_);
 
-    return _VSTD::__unchecked_get<_Sent>(__x.__hold_) ==  _VSTD::__unchecked_get<_I2>(__y.__hold_);
+    return _CUDA_VSTD::__unchecked_get<_Sent>(__x.__hold_) ==  _CUDA_VSTD::__unchecked_get<_I2>(__y.__hold_);
   }
 
   template<sized_sentinel_for<_Iter> _I2, sized_sentinel_for<_Iter> _S2>
     requires sized_sentinel_for<_Sent, _I2>
   friend constexpr iter_
diff erence_t<_I2> operator-(const common_iterator& __x, const common_iterator<_I2, _S2>& __y) {
-    _LIBCPP_ASSERT(!__x.__hold_.valueless_by_exception(), "Attempted to subtract from a valueless common_iterator");
-    _LIBCPP_ASSERT(!__y.__hold_.valueless_by_exception(), "Attempted to subtract a valueless common_iterator");
+    _LIBCUDACXX_ASSERT(!__x.__hold_.valueless_by_exception(), "Attempted to subtract from a valueless common_iterator");
+    _LIBCUDACXX_ASSERT(!__y.__hold_.valueless_by_exception(), "Attempted to subtract a valueless common_iterator");
 
     auto __x_index = __x.__hold_.index();
     auto __y_index = __y.__hold_.index();
@@ -197,29 +197,29 @@ class common_iterator {
       return 0;
 
     if (__x_index == 0 && __y_index == 0)
-      return  _VSTD::__unchecked_get<_Iter>(__x.__hold_) - _VSTD::__unchecked_get<_I2>(__y.__hold_);
+      return  _CUDA_VSTD::__unchecked_get<_Iter>(__x.__hold_) - _CUDA_VSTD::__unchecked_get<_I2>(__y.__hold_);
 
     if (__x_index == 0)
-      return  _VSTD::__unchecked_get<_Iter>(__x.__hold_) - _VSTD::__unchecked_get<_S2>(__y.__hold_);
+      return  _CUDA_VSTD::__unchecked_get<_Iter>(__x.__hold_) - _CUDA_VSTD::__unchecked_get<_S2>(__y.__hold_);
 
-    return _VSTD::__unchecked_get<_Sent>(__x.__hold_) - _VSTD::__unchecked_get<_I2>(__y.__hold_);
+    return _CUDA_VSTD::__unchecked_get<_Sent>(__x.__hold_) - _CUDA_VSTD::__unchecked_get<_I2>(__y.__hold_);
   }
 
   friend constexpr iter_rvalue_reference_t<_Iter> iter_move(const common_iterator& __i)
     noexcept(noexcept(ranges::iter_move(declval<const _Iter&>())))
       requires input_iterator<_Iter>
   {
-    _LIBCPP_ASSERT(holds_alternative<_Iter>(__i.__hold_), "Attempted to iter_move a non-dereferenceable common_iterator");
-    return ranges::iter_move( _VSTD::__unchecked_get<_Iter>(__i.__hold_));
+    _LIBCUDACXX_ASSERT(holds_alternative<_Iter>(__i.__hold_), "Attempted to iter_move a non-dereferenceable common_iterator");
+    return ranges::iter_move( _CUDA_VSTD::__unchecked_get<_Iter>(__i.__hold_));
   }
 
   template<indirectly_swappable<_Iter> _I2, class _S2>
   friend constexpr void iter_swap(const common_iterator& __x, const common_iterator<_I2, _S2>& __y)
       noexcept(noexcept(ranges::iter_swap(declval<const _Iter&>(), declval<const _I2&>())))
   {
-    _LIBCPP_ASSERT(holds_alternative<_Iter>(__x.__hold_), "Attempted to iter_swap a non-dereferenceable common_iterator");
-    _LIBCPP_ASSERT(holds_alternative<_I2>(__y.__hold_), "Attempted to iter_swap a non-dereferenceable common_iterator");
-    return ranges::iter_swap(_VSTD::__unchecked_get<_Iter>(__x.__hold_), _VSTD::__unchecked_get<_I2>(__y.__hold_));
+    _LIBCUDACXX_ASSERT(holds_alternative<_Iter>(__x.__hold_), "Attempted to iter_swap a non-dereferenceable common_iterator");
+    _LIBCUDACXX_ASSERT(holds_alternative<_I2>(__y.__hold_), "Attempted to iter_swap a non-dereferenceable common_iterator");
+    return ranges::iter_swap(_CUDA_VSTD::__unchecked_get<_Iter>(__x.__hold_), _CUDA_VSTD::__unchecked_get<_I2>(__y.__hold_));
   }
 };
 
@@ -263,8 +263,8 @@ struct iterator_traits<common_iterator<_Iter, _Sent>> {
   using reference = iter_reference_t<_Iter>;
 };
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ITERATOR_COMMON_ITERATOR_H
+#endif // _LIBCUDACXX___ITERATOR_COMMON_ITERATOR_H

diff  --git a/libcxx/include/__iterator/concepts.h b/libcxx/include/__iterator/concepts.h
index bd68889333ce..3b860888849f 100644
--- a/libcxx/include/__iterator/concepts.h
+++ b/libcxx/include/__iterator/concepts.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ITERATOR_CONCEPTS_H
-#define _LIBCPP___ITERATOR_CONCEPTS_H
+#ifndef _LIBCUDACXX___ITERATOR_CONCEPTS_H
+#define _LIBCUDACXX___ITERATOR_CONCEPTS_H
 
 #include <__config>
 #include <__iterator/incrementable_traits.h>
@@ -20,13 +20,13 @@
 #include <concepts>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 // [iterator.concept.readable]
 template<class _In>
@@ -52,10 +52,10 @@ using iter_common_reference_t = common_reference_t<iter_reference_t<_Tp>, iter_v
 template<class _Out, class _Tp>
 concept indirectly_writable =
   requires(_Out&& __o, _Tp&& __t) {
-    *__o = _VSTD::forward<_Tp>(__t);                        // not required to be equality-preserving
-    *_VSTD::forward<_Out>(__o) = _VSTD::forward<_Tp>(__t);  // not required to be equality-preserving
-    const_cast<const iter_reference_t<_Out>&&>(*__o) = _VSTD::forward<_Tp>(__t);                       // not required to be equality-preserving
-    const_cast<const iter_reference_t<_Out>&&>(*_VSTD::forward<_Out>(__o)) = _VSTD::forward<_Tp>(__t); // not required to be equality-preserving
+    *__o = _CUDA_VSTD::forward<_Tp>(__t);                        // not required to be equality-preserving
+    *_CUDA_VSTD::forward<_Out>(__o) = _CUDA_VSTD::forward<_Tp>(__t);  // not required to be equality-preserving
+    const_cast<const iter_reference_t<_Out>&&>(*__o) = _CUDA_VSTD::forward<_Tp>(__t);                       // not required to be equality-preserving
+    const_cast<const iter_reference_t<_Out>&&>(*_CUDA_VSTD::forward<_Out>(__o)) = _CUDA_VSTD::forward<_Tp>(__t); // not required to be equality-preserving
   };
 
 // [iterator.concept.winc]
@@ -127,7 +127,7 @@ concept output_iterator =
   input_or_output_iterator<_Ip> &&
   indirectly_writable<_Ip, _Tp> &&
   requires (_Ip __it, _Tp&& __t) {
-    *__it++ = _VSTD::forward<_Tp>(__t); // not required to be equality-preserving
+    *__it++ = _CUDA_VSTD::forward<_Tp>(__t); // not required to be equality-preserving
   };
 
 // [iterator.concept.forward]
@@ -170,7 +170,7 @@ concept contiguous_iterator =
   is_lvalue_reference_v<iter_reference_t<_Ip>> &&
   same_as<iter_value_t<_Ip>, remove_cvref_t<iter_reference_t<_Ip>>> &&
   requires(const _Ip& __i) {
-    { _VSTD::to_address(__i) } -> same_as<add_pointer_t<iter_reference_t<_Ip>>>;
+    { _CUDA_VSTD::to_address(__i) } -> same_as<add_pointer_t<iter_reference_t<_Ip>>>;
   };
 
 template<class _Ip>
@@ -273,8 +273,8 @@ concept indirectly_copyable_storable =
 // Note: indirectly_swappable is located in iter_swap.h to prevent a dependency cycle
 // (both iter_swap and indirectly_swappable require indirectly_readable).
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ITERATOR_CONCEPTS_H
+#endif // _LIBCUDACXX___ITERATOR_CONCEPTS_H

diff  --git a/libcxx/include/__iterator/counted_iterator.h b/libcxx/include/__iterator/counted_iterator.h
index b0f5c66ecf21..98ce32a96181 100644
--- a/libcxx/include/__iterator/counted_iterator.h
+++ b/libcxx/include/__iterator/counted_iterator.h
@@ -6,8 +6,8 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-#ifndef _LIBCPP___ITERATOR_COUNTED_ITERATOR_H
-#define _LIBCPP___ITERATOR_COUNTED_ITERATOR_H
+#ifndef _LIBCUDACXX___ITERATOR_COUNTED_ITERATOR_H
+#define _LIBCUDACXX___ITERATOR_COUNTED_ITERATOR_H
 
 #include <__assert>
 #include <__config>
@@ -24,13 +24,13 @@
 #include <concepts>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 template<class>
 struct __counted_iterator_concept {};
@@ -65,97 +65,97 @@ class counted_iterator
   , public __counted_iterator_value_type<_Iter>
 {
 public:
-  _LIBCPP_NO_UNIQUE_ADDRESS _Iter __current_ = _Iter();
+  _LIBCUDACXX_NO_UNIQUE_ADDRESS _Iter __current_ = _Iter();
   iter_
diff erence_t<_Iter> __count_ = 0;
 
   using iterator_type = _Iter;
   using 
diff erence_type = iter_
diff erence_t<_Iter>;
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr counted_iterator() requires default_initializable<_Iter> = default;
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr counted_iterator(_Iter __iter, iter_
diff erence_t<_Iter> __n)
-   : __current_(_VSTD::move(__iter)), __count_(__n) {
-    _LIBCPP_ASSERT(__n >= 0, "__n must not be negative.");
+   : __current_(_CUDA_VSTD::move(__iter)), __count_(__n) {
+    _LIBCUDACXX_ASSERT(__n >= 0, "__n must not be negative.");
   }
 
   template<class _I2>
     requires convertible_to<const _I2&, _Iter>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr counted_iterator(const counted_iterator<_I2>& __other)
    : __current_(__other.__current_), __count_(__other.__count_) {}
 
   template<class _I2>
     requires assignable_from<_Iter&, const _I2&>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr counted_iterator& operator=(const counted_iterator<_I2>& __other) {
     __current_ = __other.__current_;
     __count_ = __other.__count_;
     return *this;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr const _Iter& base() const& noexcept { return __current_; }
 
-  _LIBCPP_HIDE_FROM_ABI
-  constexpr _Iter base() && { return _VSTD::move(__current_); }
+  _LIBCUDACXX_HIDE_FROM_ABI
+  constexpr _Iter base() && { return _CUDA_VSTD::move(__current_); }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr iter_
diff erence_t<_Iter> count() const noexcept { return __count_; }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr decltype(auto) operator*() {
-    _LIBCPP_ASSERT(__count_ > 0, "Iterator is equal to or past end.");
+    _LIBCUDACXX_ASSERT(__count_ > 0, "Iterator is equal to or past end.");
     return *__current_;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr decltype(auto) operator*() const
     requires __dereferenceable<const _Iter>
   {
-    _LIBCPP_ASSERT(__count_ > 0, "Iterator is equal to or past end.");
+    _LIBCUDACXX_ASSERT(__count_ > 0, "Iterator is equal to or past end.");
     return *__current_;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto operator->() const noexcept
     requires contiguous_iterator<_Iter>
   {
-    return _VSTD::to_address(__current_);
+    return _CUDA_VSTD::to_address(__current_);
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr counted_iterator& operator++() {
-    _LIBCPP_ASSERT(__count_ > 0, "Iterator already at or past end.");
+    _LIBCUDACXX_ASSERT(__count_ > 0, "Iterator already at or past end.");
     ++__current_;
     --__count_;
     return *this;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   decltype(auto) operator++(int) {
-    _LIBCPP_ASSERT(__count_ > 0, "Iterator already at or past end.");
+    _LIBCUDACXX_ASSERT(__count_ > 0, "Iterator already at or past end.");
     --__count_;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     try { return __current_++; }
     catch(...) { ++__count_; throw; }
 #else
     return __current_++;
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr counted_iterator operator++(int)
     requires forward_iterator<_Iter>
   {
-    _LIBCPP_ASSERT(__count_ > 0, "Iterator already at or past end.");
+    _LIBCUDACXX_ASSERT(__count_ > 0, "Iterator already at or past end.");
     counted_iterator __tmp = *this;
     ++*this;
     return __tmp;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr counted_iterator& operator--()
     requires bidirectional_iterator<_Iter>
   {
@@ -164,7 +164,7 @@ class counted_iterator
     return *this;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr counted_iterator operator--(int)
     requires bidirectional_iterator<_Iter>
   {
@@ -173,14 +173,14 @@ class counted_iterator
     return __tmp;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr counted_iterator operator+(iter_
diff erence_t<_Iter> __n) const
     requires random_access_iterator<_Iter>
   {
     return counted_iterator(__current_ + __n, __count_ - __n);
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr counted_iterator operator+(
     iter_
diff erence_t<_Iter> __n, const counted_iterator& __x)
     requires random_access_iterator<_Iter>
@@ -188,17 +188,17 @@ class counted_iterator
     return __x + __n;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr counted_iterator& operator+=(iter_
diff erence_t<_Iter> __n)
     requires random_access_iterator<_Iter>
   {
-    _LIBCPP_ASSERT(__n <= __count_, "Cannot advance iterator past end.");
+    _LIBCUDACXX_ASSERT(__n <= __count_, "Cannot advance iterator past end.");
     __current_ += __n;
     __count_ -= __n;
     return *this;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr counted_iterator operator-(iter_
diff erence_t<_Iter> __n) const
     requires random_access_iterator<_Iter>
   {
@@ -206,32 +206,32 @@ class counted_iterator
   }
 
   template<common_with<_Iter> _I2>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr iter_
diff erence_t<_I2> operator-(
     const counted_iterator& __lhs, const counted_iterator<_I2>& __rhs)
   {
     return __rhs.__count_ - __lhs.__count_;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr iter_
diff erence_t<_Iter> operator-(
     const counted_iterator& __lhs, default_sentinel_t)
   {
     return -__lhs.__count_;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr iter_
diff erence_t<_Iter> operator-(
     default_sentinel_t, const counted_iterator& __rhs)
   {
     return __rhs.__count_;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr counted_iterator& operator-=(iter_
diff erence_t<_Iter> __n)
     requires random_access_iterator<_Iter>
   {
-    _LIBCPP_ASSERT(-__n <= __count_, "Attempt to subtract too large of a size: "
+    _LIBCUDACXX_ASSERT(-__n <= __count_, "Attempt to subtract too large of a size: "
                                      "counted_iterator would be decremented before the "
                                      "first element of its range.");
     __current_ -= __n;
@@ -239,23 +239,23 @@ class counted_iterator
     return *this;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr decltype(auto) operator[](iter_
diff erence_t<_Iter> __n) const
     requires random_access_iterator<_Iter>
   {
-    _LIBCPP_ASSERT(__n < __count_, "Subscript argument must be less than size.");
+    _LIBCUDACXX_ASSERT(__n < __count_, "Subscript argument must be less than size.");
     return __current_[__n];
   }
 
   template<common_with<_Iter> _I2>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr bool operator==(
     const counted_iterator& __lhs, const counted_iterator<_I2>& __rhs)
   {
     return __lhs.__count_ == __rhs.__count_;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr bool operator==(
     const counted_iterator& __lhs, default_sentinel_t)
   {
@@ -269,21 +269,21 @@ class counted_iterator
     return __rhs.__count_ <=> __lhs.__count_;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr iter_rvalue_reference_t<_Iter> iter_move(const counted_iterator& __i)
     noexcept(noexcept(ranges::iter_move(__i.__current_)))
       requires input_iterator<_Iter>
   {
-    _LIBCPP_ASSERT(__i.__count_ > 0, "Iterator must not be past end of range.");
+    _LIBCUDACXX_ASSERT(__i.__count_ > 0, "Iterator must not be past end of range.");
     return ranges::iter_move(__i.__current_);
   }
 
   template<indirectly_swappable<_Iter> _I2>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr void iter_swap(const counted_iterator& __x, const counted_iterator<_I2>& __y)
     noexcept(noexcept(ranges::iter_swap(__x.__current_, __y.__current_)))
   {
-    _LIBCPP_ASSERT(__x.__count_ > 0 && __y.__count_ > 0,
+    _LIBCUDACXX_ASSERT(__x.__count_ > 0 && __y.__count_ > 0,
                    "Iterators must not be past end of range.");
     return ranges::iter_swap(__x.__current_, __y.__current_);
   }
@@ -296,8 +296,8 @@ struct iterator_traits<counted_iterator<_Iter>> : iterator_traits<_Iter> {
                                 add_pointer_t<iter_reference_t<_Iter>>, void>;
 };
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ITERATOR_COUNTED_ITERATOR_H
+#endif // _LIBCUDACXX___ITERATOR_COUNTED_ITERATOR_H

diff  --git a/libcxx/include/__iterator/data.h b/libcxx/include/__iterator/data.h
index 88eb752b642e..62a57ffbe087 100644
--- a/libcxx/include/__iterator/data.h
+++ b/libcxx/include/__iterator/data.h
@@ -7,45 +7,45 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ITERATOR_DATA_H
-#define _LIBCPP___ITERATOR_DATA_H
+#ifndef _LIBCUDACXX___ITERATOR_DATA_H
+#define _LIBCUDACXX___ITERATOR_DATA_H
 
 #include <__config>
 #include <cstddef>
 #include <initializer_list>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 
 template <class _Cont> constexpr
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 auto data(_Cont& __c)
 _NOEXCEPT_(noexcept(__c.data()))
 -> decltype        (__c.data())
 { return            __c.data(); }
 
 template <class _Cont> constexpr
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 auto data(const _Cont& __c)
 _NOEXCEPT_(noexcept(__c.data()))
 -> decltype        (__c.data())
 { return            __c.data(); }
 
 template <class _Tp, size_t _Sz>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 constexpr _Tp* data(_Tp (&__array)[_Sz]) noexcept { return __array; }
 
 template <class _Ep>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 constexpr const _Ep* data(initializer_list<_Ep> __il) noexcept { return __il.begin(); }
 
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ITERATOR_DATA_H
+#endif // _LIBCUDACXX___ITERATOR_DATA_H

diff  --git a/libcxx/include/__iterator/default_sentinel.h b/libcxx/include/__iterator/default_sentinel.h
index 669032aa9729..951847ec693c 100644
--- a/libcxx/include/__iterator/default_sentinel.h
+++ b/libcxx/include/__iterator/default_sentinel.h
@@ -7,24 +7,24 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ITERATOR_DEFAULT_SENTINEL_H
-#define _LIBCPP___ITERATOR_DEFAULT_SENTINEL_H
+#ifndef _LIBCUDACXX___ITERATOR_DEFAULT_SENTINEL_H
+#define _LIBCUDACXX___ITERATOR_DEFAULT_SENTINEL_H
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 struct default_sentinel_t { };
 inline constexpr default_sentinel_t default_sentinel{};
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ITERATOR_DEFAULT_SENTINEL_H
+#endif // _LIBCUDACXX___ITERATOR_DEFAULT_SENTINEL_H

diff  --git a/libcxx/include/__iterator/distance.h b/libcxx/include/__iterator/distance.h
index 8819078958d3..7337bc758414 100644
--- a/libcxx/include/__iterator/distance.h
+++ b/libcxx/include/__iterator/distance.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ITERATOR_DISTANCE_H
-#define _LIBCPP___ITERATOR_DISTANCE_H
+#ifndef _LIBCUDACXX___ITERATOR_DISTANCE_H
+#define _LIBCUDACXX___ITERATOR_DISTANCE_H
 
 #include <__config>
 #include <__iterator/concepts.h>
@@ -19,14 +19,14 @@
 #include <__ranges/size.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _InputIter>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 typename iterator_traits<_InputIter>::
diff erence_type
 __distance(_InputIter __first, _InputIter __last, input_iterator_tag)
 {
@@ -37,7 +37,7 @@ __distance(_InputIter __first, _InputIter __last, input_iterator_tag)
 }
 
 template <class _RandIter>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 typename iterator_traits<_RandIter>::
diff erence_type
 __distance(_RandIter __first, _RandIter __last, random_access_iterator_tag)
 {
@@ -45,14 +45,14 @@ __distance(_RandIter __first, _RandIter __last, random_access_iterator_tag)
 }
 
 template <class _InputIter>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 typename iterator_traits<_InputIter>::
diff erence_type
 distance(_InputIter __first, _InputIter __last)
 {
-    return _VSTD::__distance(__first, __last, typename iterator_traits<_InputIter>::iterator_category());
+    return _CUDA_VSTD::__distance(__first, __last, typename iterator_traits<_InputIter>::iterator_category());
 }
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
 // [range.iter.op.distance]
 
@@ -62,7 +62,7 @@ namespace __distance {
 struct __fn {
   template<class _Ip, sentinel_for<_Ip> _Sp>
     requires (!sized_sentinel_for<_Sp, _Ip>)
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr iter_
diff erence_t<_Ip> operator()(_Ip __first, _Sp __last) const {
     iter_
diff erence_t<_Ip> __n = 0;
     while (__first != __last) {
@@ -73,7 +73,7 @@ struct __fn {
   }
 
   template<class _Ip, sized_sentinel_for<decay_t<_Ip>> _Sp>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr iter_
diff erence_t<_Ip> operator()(_Ip&& __first, _Sp __last) const {
     if constexpr (sized_sentinel_for<_Sp, __uncvref_t<_Ip>>) {
       return __last - __first;
@@ -83,7 +83,7 @@ struct __fn {
   }
 
   template<range _Rp>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr range_
diff erence_t<_Rp> operator()(_Rp&& __r) const {
     if constexpr (sized_range<_Rp>) {
       return static_cast<range_
diff erence_t<_Rp>>(ranges::size(__r));
@@ -100,8 +100,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ITERATOR_DISTANCE_H
+#endif // _LIBCUDACXX___ITERATOR_DISTANCE_H

diff  --git a/libcxx/include/__iterator/empty.h b/libcxx/include/__iterator/empty.h
index 748ca9ecbd59..86ce9ba8562a 100644
--- a/libcxx/include/__iterator/empty.h
+++ b/libcxx/include/__iterator/empty.h
@@ -7,38 +7,38 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ITERATOR_EMPTY_H
-#define _LIBCPP___ITERATOR_EMPTY_H
+#ifndef _LIBCUDACXX___ITERATOR_EMPTY_H
+#define _LIBCUDACXX___ITERATOR_EMPTY_H
 
 #include <__config>
 #include <cstddef>
 #include <initializer_list>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 
 template <class _Cont>
-_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_NODISCARD_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY
 constexpr auto empty(const _Cont& __c)
 _NOEXCEPT_(noexcept(__c.empty()))
 -> decltype        (__c.empty())
 { return            __c.empty(); }
 
 template <class _Tp, size_t _Sz>
-_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_NODISCARD_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY
 constexpr bool empty(const _Tp (&)[_Sz]) noexcept { return false; }
 
 template <class _Ep>
-_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_NODISCARD_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY
 constexpr bool empty(initializer_list<_Ep> __il) noexcept { return __il.size() == 0; }
 
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCUDACXX_STD_VER > 14
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ITERATOR_EMPTY_H
+#endif // _LIBCUDACXX___ITERATOR_EMPTY_H

diff  --git a/libcxx/include/__iterator/erase_if_container.h b/libcxx/include/__iterator/erase_if_container.h
index d7c71a947a2b..e414f52051d3 100644
--- a/libcxx/include/__iterator/erase_if_container.h
+++ b/libcxx/include/__iterator/erase_if_container.h
@@ -7,21 +7,21 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ITERATOR_ERASE_IF_CONTAINER_H
-#define _LIBCPP___ITERATOR_ERASE_IF_CONTAINER_H
+#ifndef _LIBCUDACXX___ITERATOR_ERASE_IF_CONTAINER_H
+#define _LIBCUDACXX___ITERATOR_ERASE_IF_CONTAINER_H
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Container, class _Predicate>
-_LIBCPP_HIDE_FROM_ABI
+_LIBCUDACXX_HIDE_FROM_ABI
 typename _Container::size_type
-__libcpp_erase_if_container(_Container& __c, _Predicate& __pred) {
+__LIBCUDACXX_erase_if_container(_Container& __c, _Predicate& __pred) {
   typename _Container::size_type __old_size = __c.size();
 
   const typename _Container::iterator __last = __c.end();
@@ -35,6 +35,6 @@ __libcpp_erase_if_container(_Container& __c, _Predicate& __pred) {
   return __old_size - __c.size();
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ITERATOR_ERASE_IF_CONTAINER_H
+#endif // _LIBCUDACXX___ITERATOR_ERASE_IF_CONTAINER_H

diff  --git a/libcxx/include/__iterator/front_insert_iterator.h b/libcxx/include/__iterator/front_insert_iterator.h
index 9c8ec0028298..a3519d4380bc 100644
--- a/libcxx/include/__iterator/front_insert_iterator.h
+++ b/libcxx/include/__iterator/front_insert_iterator.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ITERATOR_FRONT_INSERT_ITERATOR_H
-#define _LIBCPP___ITERATOR_FRONT_INSERT_ITERATOR_H
+#ifndef _LIBCUDACXX___ITERATOR_FRONT_INSERT_ITERATOR_H
+#define _LIBCUDACXX___ITERATOR_FRONT_INSERT_ITERATOR_H
 
 #include <__config>
 #include <__iterator/iterator.h>
@@ -17,26 +17,26 @@
 #include <__utility/move.h>
 #include <cstddef>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+_LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
 template <class _Container>
-class _LIBCPP_TEMPLATE_VIS front_insert_iterator
-#if _LIBCPP_STD_VER <= 14 || !defined(_LIBCPP_ABI_NO_ITERATOR_BASES)
+class _LIBCUDACXX_TEMPLATE_VIS front_insert_iterator
+#if _LIBCUDACXX_STD_VER <= 14 || !defined(_LIBCUDACXX_ABI_NO_ITERATOR_BASES)
     : public iterator<output_iterator_tag, void, void, void, void>
 #endif
 {
-_LIBCPP_SUPPRESS_DEPRECATED_POP
+_LIBCUDACXX_SUPPRESS_DEPRECATED_POP
 protected:
     _Container* container;
 public:
     typedef output_iterator_tag iterator_category;
     typedef void value_type;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
     typedef ptr
diff _t 
diff erence_type;
 #else
     typedef void 
diff erence_type;
@@ -45,26 +45,26 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
     typedef void reference;
     typedef _Container container_type;
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 explicit front_insert_iterator(_Container& __x) : container(_VSTD::addressof(__x)) {}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 front_insert_iterator& operator=(const typename _Container::value_type& __value)
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 explicit front_insert_iterator(_Container& __x) : container(_CUDA_VSTD::addressof(__x)) {}
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 front_insert_iterator& operator=(const typename _Container::value_type& __value)
         {container->push_front(__value); return *this;}
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 front_insert_iterator& operator=(typename _Container::value_type&& __value)
-        {container->push_front(_VSTD::move(__value)); return *this;}
-#endif // _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 front_insert_iterator& operator*()     {return *this;}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 front_insert_iterator& operator++()    {return *this;}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 front_insert_iterator  operator++(int) {return *this;}
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 front_insert_iterator& operator=(typename _Container::value_type&& __value)
+        {container->push_front(_CUDA_VSTD::move(__value)); return *this;}
+#endif // _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 front_insert_iterator& operator*()     {return *this;}
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 front_insert_iterator& operator++()    {return *this;}
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 front_insert_iterator  operator++(int) {return *this;}
 };
 
 template <class _Container>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 front_insert_iterator<_Container>
 front_inserter(_Container& __x)
 {
     return front_insert_iterator<_Container>(__x);
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ITERATOR_FRONT_INSERT_ITERATOR_H
+#endif // _LIBCUDACXX___ITERATOR_FRONT_INSERT_ITERATOR_H

diff  --git a/libcxx/include/__iterator/incrementable_traits.h b/libcxx/include/__iterator/incrementable_traits.h
index e6a5ed720f9f..f8a16c339c0a 100644
--- a/libcxx/include/__iterator/incrementable_traits.h
+++ b/libcxx/include/__iterator/incrementable_traits.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ITERATOR_INCREMENTABLE_TRAITS_H
-#define _LIBCPP___ITERATOR_INCREMENTABLE_TRAITS_H
+#ifndef _LIBCUDACXX___ITERATOR_INCREMENTABLE_TRAITS_H
+#define _LIBCUDACXX___ITERATOR_INCREMENTABLE_TRAITS_H
 
 #include <__config>
 #include <__type_traits/is_primary_template.h>
@@ -16,13 +16,13 @@
 #include <cstddef>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 // [incrementable.traits]
 template<class> struct incrementable_traits {};
@@ -67,8 +67,8 @@ using iter_
diff erence_t = typename conditional_t<__is_primary_template<iterator_
                                                  incrementable_traits<remove_cvref_t<_Ip> >,
                                                  iterator_traits<remove_cvref_t<_Ip> > >::
diff erence_type;
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ITERATOR_INCREMENTABLE_TRAITS_H
+#endif // _LIBCUDACXX___ITERATOR_INCREMENTABLE_TRAITS_H

diff  --git a/libcxx/include/__iterator/indirectly_comparable.h b/libcxx/include/__iterator/indirectly_comparable.h
index 868190fc48da..2315e108dce6 100644
--- a/libcxx/include/__iterator/indirectly_comparable.h
+++ b/libcxx/include/__iterator/indirectly_comparable.h
@@ -7,28 +7,28 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ITERATOR_INDIRECTLY_COMPARABLE_H
-#define _LIBCPP___ITERATOR_INDIRECTLY_COMPARABLE_H
+#ifndef _LIBCUDACXX___ITERATOR_INDIRECTLY_COMPARABLE_H
+#define _LIBCUDACXX___ITERATOR_INDIRECTLY_COMPARABLE_H
 
 #include <__config>
 #include <__functional/identity.h>
 #include <__iterator/concepts.h>
 #include <__iterator/projected.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 template <class _I1, class _I2, class _Rp, class _P1 = identity, class _P2 = identity>
 concept indirectly_comparable =
   indirect_binary_predicate<_Rp, projected<_I1, _P1>, projected<_I2, _P2>>;
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ITERATOR_INDIRECTLY_COMPARABLE_H
+#endif // _LIBCUDACXX___ITERATOR_INDIRECTLY_COMPARABLE_H

diff  --git a/libcxx/include/__iterator/insert_iterator.h b/libcxx/include/__iterator/insert_iterator.h
index b35d8bf16af9..0af5c8e4ccb0 100644
--- a/libcxx/include/__iterator/insert_iterator.h
+++ b/libcxx/include/__iterator/insert_iterator.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ITERATOR_INSERT_ITERATOR_H
-#define _LIBCPP___ITERATOR_INSERT_ITERATOR_H
+#ifndef _LIBCUDACXX___ITERATOR_INSERT_ITERATOR_H
+#define _LIBCUDACXX___ITERATOR_INSERT_ITERATOR_H
 
 #include <__config>
 #include <__iterator/iterator.h>
@@ -18,13 +18,13 @@
 #include <__utility/move.h>
 #include <cstddef>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 template <class _Container>
 using __insert_iterator_iter_t = ranges::iterator_t<_Container>;
 #else
@@ -32,21 +32,21 @@ template <class _Container>
 using __insert_iterator_iter_t = typename _Container::iterator;
 #endif
 
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+_LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
 template <class _Container>
-class _LIBCPP_TEMPLATE_VIS insert_iterator
-#if _LIBCPP_STD_VER <= 14 || !defined(_LIBCPP_ABI_NO_ITERATOR_BASES)
+class _LIBCUDACXX_TEMPLATE_VIS insert_iterator
+#if _LIBCUDACXX_STD_VER <= 14 || !defined(_LIBCUDACXX_ABI_NO_ITERATOR_BASES)
     : public iterator<output_iterator_tag, void, void, void, void>
 #endif
 {
-_LIBCPP_SUPPRESS_DEPRECATED_POP
+_LIBCUDACXX_SUPPRESS_DEPRECATED_POP
 protected:
     _Container* container;
     __insert_iterator_iter_t<_Container> iter;
 public:
     typedef output_iterator_tag iterator_category;
     typedef void value_type;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
     typedef ptr
diff _t 
diff erence_type;
 #else
     typedef void 
diff erence_type;
@@ -55,27 +55,27 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
     typedef void reference;
     typedef _Container container_type;
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 insert_iterator(_Container& __x, __insert_iterator_iter_t<_Container> __i)
-        : container(_VSTD::addressof(__x)), iter(__i) {}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 insert_iterator& operator=(const typename _Container::value_type& __value)
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 insert_iterator(_Container& __x, __insert_iterator_iter_t<_Container> __i)
+        : container(_CUDA_VSTD::addressof(__x)), iter(__i) {}
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 insert_iterator& operator=(const typename _Container::value_type& __value)
         {iter = container->insert(iter, __value); ++iter; return *this;}
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 insert_iterator& operator=(typename _Container::value_type&& __value)
-        {iter = container->insert(iter, _VSTD::move(__value)); ++iter; return *this;}
-#endif // _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 insert_iterator& operator*()        {return *this;}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 insert_iterator& operator++()       {return *this;}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 insert_iterator& operator++(int)    {return *this;}
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 insert_iterator& operator=(typename _Container::value_type&& __value)
+        {iter = container->insert(iter, _CUDA_VSTD::move(__value)); ++iter; return *this;}
+#endif // _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 insert_iterator& operator*()        {return *this;}
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 insert_iterator& operator++()       {return *this;}
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 insert_iterator& operator++(int)    {return *this;}
 };
 
 template <class _Container>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 insert_iterator<_Container>
 inserter(_Container& __x, __insert_iterator_iter_t<_Container> __i)
 {
     return insert_iterator<_Container>(__x, __i);
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ITERATOR_INSERT_ITERATOR_H
+#endif // _LIBCUDACXX___ITERATOR_INSERT_ITERATOR_H

diff  --git a/libcxx/include/__iterator/istream_iterator.h b/libcxx/include/__iterator/istream_iterator.h
index a056961c10a8..5dd94a3b00ba 100644
--- a/libcxx/include/__iterator/istream_iterator.h
+++ b/libcxx/include/__iterator/istream_iterator.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ITERATOR_ISTREAM_ITERATOR_H
-#define _LIBCPP___ITERATOR_ISTREAM_ITERATOR_H
+#ifndef _LIBCUDACXX___ITERATOR_ISTREAM_ITERATOR_H
+#define _LIBCUDACXX___ITERATOR_ISTREAM_ITERATOR_H
 
 #include <__config>
 #include <__iterator/default_sentinel.h>
@@ -18,21 +18,21 @@
 #include <cstddef>
 #include <iosfwd> // for forward declarations of char_traits and basic_istream
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+_LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
 template <class _Tp, class _CharT = char,
           class _Traits = char_traits<_CharT>, class _Distance = ptr
diff _t>
-class _LIBCPP_TEMPLATE_VIS istream_iterator
-#if _LIBCPP_STD_VER <= 14 || !defined(_LIBCPP_ABI_NO_ITERATOR_BASES)
+class _LIBCUDACXX_TEMPLATE_VIS istream_iterator
+#if _LIBCUDACXX_STD_VER <= 14 || !defined(_LIBCUDACXX_ABI_NO_ITERATOR_BASES)
     : public iterator<input_iterator_tag, _Tp, _Distance, const _Tp*, const _Tp&>
 #endif
 {
-_LIBCPP_SUPPRESS_DEPRECATED_POP
+_LIBCUDACXX_SUPPRESS_DEPRECATED_POP
 public:
     typedef input_iterator_tag iterator_category;
     typedef _Tp value_type;
@@ -46,42 +46,42 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
     istream_type* __in_stream_;
     _Tp __value_;
 public:
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR istream_iterator() : __in_stream_(nullptr), __value_() {}
-#if _LIBCPP_STD_VER > 17
-    _LIBCPP_HIDE_FROM_ABI constexpr istream_iterator(default_sentinel_t) : istream_iterator() {}
-#endif // _LIBCPP_STD_VER > 17
-    _LIBCPP_INLINE_VISIBILITY istream_iterator(istream_type& __s) : __in_stream_(_VSTD::addressof(__s))
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR istream_iterator() : __in_stream_(nullptr), __value_() {}
+#if _LIBCUDACXX_STD_VER > 17
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr istream_iterator(default_sentinel_t) : istream_iterator() {}
+#endif // _LIBCUDACXX_STD_VER > 17
+    _LIBCUDACXX_INLINE_VISIBILITY istream_iterator(istream_type& __s) : __in_stream_(_CUDA_VSTD::addressof(__s))
         {
             if (!(*__in_stream_ >> __value_))
                 __in_stream_ = nullptr;
         }
 
-    _LIBCPP_INLINE_VISIBILITY const _Tp& operator*() const {return __value_;}
-    _LIBCPP_INLINE_VISIBILITY const _Tp* operator->() const {return _VSTD::addressof((operator*()));}
-    _LIBCPP_INLINE_VISIBILITY istream_iterator& operator++()
+    _LIBCUDACXX_INLINE_VISIBILITY const _Tp& operator*() const {return __value_;}
+    _LIBCUDACXX_INLINE_VISIBILITY const _Tp* operator->() const {return _CUDA_VSTD::addressof((operator*()));}
+    _LIBCUDACXX_INLINE_VISIBILITY istream_iterator& operator++()
         {
             if (!(*__in_stream_ >> __value_))
                 __in_stream_ = nullptr;
             return *this;
         }
-    _LIBCPP_INLINE_VISIBILITY istream_iterator  operator++(int)
+    _LIBCUDACXX_INLINE_VISIBILITY istream_iterator  operator++(int)
         {istream_iterator __t(*this); ++(*this); return __t;}
 
     template <class _Up, class _CharU, class _TraitsU, class _DistanceU>
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
     bool
     operator==(const istream_iterator<_Up, _CharU, _TraitsU, _DistanceU>& __x,
                const istream_iterator<_Up, _CharU, _TraitsU, _DistanceU>& __y);
 
-#if _LIBCPP_STD_VER > 17
-    friend _LIBCPP_HIDE_FROM_ABI bool operator==(const istream_iterator& __i, default_sentinel_t) {
+#if _LIBCUDACXX_STD_VER > 17
+    friend _LIBCUDACXX_HIDE_FROM_ABI bool operator==(const istream_iterator& __i, default_sentinel_t) {
       return __i.__in_stream_ == nullptr;
     }
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 };
 
 template <class _Tp, class _CharT, class _Traits, class _Distance>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator==(const istream_iterator<_Tp, _CharT, _Traits, _Distance>& __x,
            const istream_iterator<_Tp, _CharT, _Traits, _Distance>& __y)
@@ -89,17 +89,17 @@ operator==(const istream_iterator<_Tp, _CharT, _Traits, _Distance>& __x,
     return __x.__in_stream_ == __y.__in_stream_;
 }
 
-#if _LIBCPP_STD_VER <= 17
+#if _LIBCUDACXX_STD_VER <= 17
 template <class _Tp, class _CharT, class _Traits, class _Distance>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator!=(const istream_iterator<_Tp, _CharT, _Traits, _Distance>& __x,
            const istream_iterator<_Tp, _CharT, _Traits, _Distance>& __y)
 {
     return !(__x == __y);
 }
-#endif // _LIBCPP_STD_VER <= 17
+#endif // _LIBCUDACXX_STD_VER <= 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ITERATOR_ISTREAM_ITERATOR_H
+#endif // _LIBCUDACXX___ITERATOR_ISTREAM_ITERATOR_H

diff  --git a/libcxx/include/__iterator/istreambuf_iterator.h b/libcxx/include/__iterator/istreambuf_iterator.h
index bc53a6a1c80e..d26eb1d2c972 100644
--- a/libcxx/include/__iterator/istreambuf_iterator.h
+++ b/libcxx/include/__iterator/istreambuf_iterator.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ITERATOR_ISTREAMBUF_ITERATOR_H
-#define _LIBCPP___ITERATOR_ISTREAMBUF_ITERATOR_H
+#ifndef _LIBCUDACXX___ITERATOR_ISTREAMBUF_ITERATOR_H
+#define _LIBCUDACXX___ITERATOR_ISTREAMBUF_ITERATOR_H
 
 #include <__config>
 #include <__iterator/default_sentinel.h>
@@ -16,22 +16,22 @@
 #include <__iterator/iterator_traits.h>
 #include <iosfwd> // for forward declaration of basic_streambuf
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+_LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
 template<class _CharT, class _Traits>
-class _LIBCPP_TEMPLATE_VIS istreambuf_iterator
-#if _LIBCPP_STD_VER <= 14 || !defined(_LIBCPP_ABI_NO_ITERATOR_BASES)
+class _LIBCUDACXX_TEMPLATE_VIS istreambuf_iterator
+#if _LIBCUDACXX_STD_VER <= 14 || !defined(_LIBCUDACXX_ABI_NO_ITERATOR_BASES)
     : public iterator<input_iterator_tag, _CharT,
                       typename _Traits::off_type, _CharT*,
                       _CharT>
 #endif
 {
-_LIBCPP_SUPPRESS_DEPRECATED_POP
+_LIBCUDACXX_SUPPRESS_DEPRECATED_POP
 public:
     typedef input_iterator_tag              iterator_category;
     typedef _CharT                          value_type;
@@ -50,15 +50,15 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
     {
         char_type __keep_;
         streambuf_type* __sbuf_;
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         explicit __proxy(char_type __c, streambuf_type* __s)
             : __keep_(__c), __sbuf_(__s) {}
         friend class istreambuf_iterator;
     public:
-        _LIBCPP_INLINE_VISIBILITY char_type operator*() const {return __keep_;}
+        _LIBCUDACXX_INLINE_VISIBILITY char_type operator*() const {return __keep_;}
     };
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool __test_for_eof() const
     {
         if (__sbuf_ && traits_type::eq_int_type(__sbuf_->sgetc(), traits_type::eof()))
@@ -66,54 +66,54 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
         return __sbuf_ == nullptr;
     }
 public:
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR istreambuf_iterator() _NOEXCEPT : __sbuf_(nullptr) {}
-#if _LIBCPP_STD_VER > 17
-    _LIBCPP_INLINE_VISIBILITY constexpr istreambuf_iterator(default_sentinel_t) noexcept
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR istreambuf_iterator() _NOEXCEPT : __sbuf_(nullptr) {}
+#if _LIBCUDACXX_STD_VER > 17
+    _LIBCUDACXX_INLINE_VISIBILITY constexpr istreambuf_iterator(default_sentinel_t) noexcept
         : istreambuf_iterator() {}
-#endif // _LIBCPP_STD_VER > 17
-    _LIBCPP_INLINE_VISIBILITY istreambuf_iterator(istream_type& __s) _NOEXCEPT
+#endif // _LIBCUDACXX_STD_VER > 17
+    _LIBCUDACXX_INLINE_VISIBILITY istreambuf_iterator(istream_type& __s) _NOEXCEPT
         : __sbuf_(__s.rdbuf()) {}
-    _LIBCPP_INLINE_VISIBILITY istreambuf_iterator(streambuf_type* __s) _NOEXCEPT
+    _LIBCUDACXX_INLINE_VISIBILITY istreambuf_iterator(streambuf_type* __s) _NOEXCEPT
         : __sbuf_(__s) {}
-    _LIBCPP_INLINE_VISIBILITY istreambuf_iterator(const __proxy& __p) _NOEXCEPT
+    _LIBCUDACXX_INLINE_VISIBILITY istreambuf_iterator(const __proxy& __p) _NOEXCEPT
         : __sbuf_(__p.__sbuf_) {}
 
-    _LIBCPP_INLINE_VISIBILITY char_type  operator*() const
+    _LIBCUDACXX_INLINE_VISIBILITY char_type  operator*() const
         {return static_cast<char_type>(__sbuf_->sgetc());}
-    _LIBCPP_INLINE_VISIBILITY istreambuf_iterator& operator++()
+    _LIBCUDACXX_INLINE_VISIBILITY istreambuf_iterator& operator++()
         {
             __sbuf_->sbumpc();
             return *this;
         }
-    _LIBCPP_INLINE_VISIBILITY __proxy              operator++(int)
+    _LIBCUDACXX_INLINE_VISIBILITY __proxy              operator++(int)
         {
             return __proxy(__sbuf_->sbumpc(), __sbuf_);
         }
 
-    _LIBCPP_INLINE_VISIBILITY bool equal(const istreambuf_iterator& __b) const
+    _LIBCUDACXX_INLINE_VISIBILITY bool equal(const istreambuf_iterator& __b) const
         {return __test_for_eof() == __b.__test_for_eof();}
 
-#if _LIBCPP_STD_VER > 17
-    friend _LIBCPP_HIDE_FROM_ABI bool operator==(const istreambuf_iterator& __i, default_sentinel_t) {
+#if _LIBCUDACXX_STD_VER > 17
+    friend _LIBCUDACXX_HIDE_FROM_ABI bool operator==(const istreambuf_iterator& __i, default_sentinel_t) {
       return __i.__test_for_eof();
     }
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 };
 
 template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool operator==(const istreambuf_iterator<_CharT,_Traits>& __a,
                 const istreambuf_iterator<_CharT,_Traits>& __b)
                 {return __a.equal(__b);}
 
-#if _LIBCPP_STD_VER <= 17
+#if _LIBCUDACXX_STD_VER <= 17
 template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool operator!=(const istreambuf_iterator<_CharT,_Traits>& __a,
                 const istreambuf_iterator<_CharT,_Traits>& __b)
                 {return !__a.equal(__b);}
-#endif // _LIBCPP_STD_VER <= 17
+#endif // _LIBCUDACXX_STD_VER <= 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ITERATOR_ISTREAMBUF_ITERATOR_H
+#endif // _LIBCUDACXX___ITERATOR_ISTREAMBUF_ITERATOR_H

diff  --git a/libcxx/include/__iterator/iter_move.h b/libcxx/include/__iterator/iter_move.h
index d8240ab9c2f1..9854307b91fd 100644
--- a/libcxx/include/__iterator/iter_move.h
+++ b/libcxx/include/__iterator/iter_move.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ITERATOR_ITER_MOVE_H
-#define _LIBCPP___ITERATOR_ITER_MOVE_H
+#ifndef _LIBCUDACXX___ITERATOR_ITER_MOVE_H
+#define _LIBCUDACXX___ITERATOR_ITER_MOVE_H
 
 #include <__concepts/class_or_enum.h>
 #include <__config>
@@ -17,13 +17,13 @@
 #include <__utility/move.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 // [iterator.cust.move]
 
@@ -61,7 +61,7 @@ concept __just_deref =
 struct __fn {
   template<class _Ip>
     requires __unqualified_iter_move<_Ip>
-  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator()(_Ip&& __i) const
+  [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI constexpr decltype(auto) operator()(_Ip&& __i) const
     noexcept(noexcept(iter_move(std::forward<_Ip>(__i))))
   {
     return iter_move(std::forward<_Ip>(__i));
@@ -69,14 +69,14 @@ struct __fn {
 
   template<class _Ip>
     requires __move_deref<_Ip>
-  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Ip&& __i) const
+  [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Ip&& __i) const
     noexcept(noexcept(std::move(*std::forward<_Ip>(__i))))
     -> decltype(      std::move(*std::forward<_Ip>(__i)))
     { return          std::move(*std::forward<_Ip>(__i)); }
 
   template<class _Ip>
     requires __just_deref<_Ip>
-  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Ip&& __i) const
+  [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Ip&& __i) const
     noexcept(noexcept(*std::forward<_Ip>(__i)))
     -> decltype(      *std::forward<_Ip>(__i))
     { return          *std::forward<_Ip>(__i); }
@@ -92,8 +92,8 @@ template<__dereferenceable _Tp>
   requires requires(_Tp& __t) { { ranges::iter_move(__t) } -> __can_reference; }
 using iter_rvalue_reference_t = decltype(ranges::iter_move(declval<_Tp&>()));
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ITERATOR_ITER_MOVE_H
+#endif // _LIBCUDACXX___ITERATOR_ITER_MOVE_H

diff  --git a/libcxx/include/__iterator/iter_swap.h b/libcxx/include/__iterator/iter_swap.h
index 9e06464c3690..987c4aa059e0 100644
--- a/libcxx/include/__iterator/iter_swap.h
+++ b/libcxx/include/__iterator/iter_swap.h
@@ -6,8 +6,8 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-#ifndef _LIBCPP___ITERATOR_ITER_SWAP_H
-#define _LIBCPP___ITERATOR_ITER_SWAP_H
+#ifndef _LIBCUDACXX___ITERATOR_ITER_SWAP_H
+#define _LIBCUDACXX___ITERATOR_ITER_SWAP_H
 
 #include <__config>
 #include <__iterator/concepts.h>
@@ -19,13 +19,13 @@
 #include <concepts>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 // [iter.cust.swap]
 
@@ -38,7 +38,7 @@ namespace __iter_swap {
   concept __unqualified_iter_swap =
     (__class_or_enum<remove_cvref_t<_T1>> || __class_or_enum<remove_cvref_t<_T2>>) &&
     requires (_T1&& __x, _T2&& __y) {
-      iter_swap(_VSTD::forward<_T1>(__x), _VSTD::forward<_T2>(__y));
+      iter_swap(_CUDA_VSTD::forward<_T1>(__x), _CUDA_VSTD::forward<_T2>(__y));
     };
 
   template<class _T1, class _T2>
@@ -49,21 +49,21 @@ namespace __iter_swap {
   struct __fn {
     template <class _T1, class _T2>
       requires __unqualified_iter_swap<_T1, _T2>
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr void operator()(_T1&& __x, _T2&& __y) const
-      noexcept(noexcept(iter_swap(_VSTD::forward<_T1>(__x), _VSTD::forward<_T2>(__y))))
+      noexcept(noexcept(iter_swap(_CUDA_VSTD::forward<_T1>(__x), _CUDA_VSTD::forward<_T2>(__y))))
     {
-      (void)iter_swap(_VSTD::forward<_T1>(__x), _VSTD::forward<_T2>(__y));
+      (void)iter_swap(_CUDA_VSTD::forward<_T1>(__x), _CUDA_VSTD::forward<_T2>(__y));
     }
 
     template <class _T1, class _T2>
       requires (!__unqualified_iter_swap<_T1, _T2>) &&
                __readable_swappable<_T1, _T2>
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr void operator()(_T1&& __x, _T2&& __y) const
-      noexcept(noexcept(ranges::swap(*_VSTD::forward<_T1>(__x), *_VSTD::forward<_T2>(__y))))
+      noexcept(noexcept(ranges::swap(*_CUDA_VSTD::forward<_T1>(__x), *_CUDA_VSTD::forward<_T2>(__y))))
     {
-      ranges::swap(*_VSTD::forward<_T1>(__x), *_VSTD::forward<_T2>(__y));
+      ranges::swap(*_CUDA_VSTD::forward<_T1>(__x), *_CUDA_VSTD::forward<_T2>(__y));
     }
 
     template <class _T1, class _T2>
@@ -71,15 +71,15 @@ namespace __iter_swap {
                 !__readable_swappable<_T1, _T2>) &&
                indirectly_movable_storable<_T1, _T2> &&
                indirectly_movable_storable<_T2, _T1>
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr void operator()(_T1&& __x, _T2&& __y) const
       noexcept(noexcept(iter_value_t<_T2>(ranges::iter_move(__y))) &&
                noexcept(*__y = ranges::iter_move(__x)) &&
-               noexcept(*_VSTD::forward<_T1>(__x) = declval<iter_value_t<_T2>>()))
+               noexcept(*_CUDA_VSTD::forward<_T1>(__x) = declval<iter_value_t<_T2>>()))
     {
       iter_value_t<_T2> __old(ranges::iter_move(__y));
       *__y = ranges::iter_move(__x);
-      *_VSTD::forward<_T1>(__x) = _VSTD::move(__old);
+      *_CUDA_VSTD::forward<_T1>(__x) = _CUDA_VSTD::move(__old);
     }
   };
 } // namespace __iter_swap
@@ -99,8 +99,8 @@ concept indirectly_swappable =
     ranges::iter_swap(__i2, __i1);
   };
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ITERATOR_ITER_SWAP_H
+#endif // _LIBCUDACXX___ITERATOR_ITER_SWAP_H

diff  --git a/libcxx/include/__iterator/iterator.h b/libcxx/include/__iterator/iterator.h
index b417eeab79bf..cbb38b7cfdc6 100644
--- a/libcxx/include/__iterator/iterator.h
+++ b/libcxx/include/__iterator/iterator.h
@@ -7,21 +7,21 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ITERATOR_ITERATOR_H
-#define _LIBCPP___ITERATOR_ITERATOR_H
+#ifndef _LIBCUDACXX___ITERATOR_ITERATOR_H
+#define _LIBCUDACXX___ITERATOR_ITERATOR_H
 
 #include <__config>
 #include <cstddef>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template<class _Category, class _Tp, class _Distance = ptr
diff _t,
          class _Pointer = _Tp*, class _Reference = _Tp&>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 iterator
+struct _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_DEPRECATED_IN_CXX17 iterator
 {
     typedef _Tp        value_type;
     typedef _Distance  
diff erence_type;
@@ -30,6 +30,6 @@ struct _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 iterator
     typedef _Category  iterator_category;
 };
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ITERATOR_ITERATOR_H
+#endif // _LIBCUDACXX___ITERATOR_ITERATOR_H

diff  --git a/libcxx/include/__iterator/iterator_traits.h b/libcxx/include/__iterator/iterator_traits.h
index 0cc64adc0de9..04eb0e7a0b7f 100644
--- a/libcxx/include/__iterator/iterator_traits.h
+++ b/libcxx/include/__iterator/iterator_traits.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ITERATOR_ITERATOR_TRAITS_H
-#define _LIBCPP___ITERATOR_ITERATOR_TRAITS_H
+#ifndef _LIBCUDACXX___ITERATOR_ITERATOR_TRAITS_H
+#define _LIBCUDACXX___ITERATOR_ITERATOR_TRAITS_H
 
 #include <__config>
 #include <__iterator/incrementable_traits.h>
@@ -17,13 +17,13 @@
 #include <cstddef>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 template <class _Tp>
 using __with_reference = _Tp&;
@@ -42,18 +42,18 @@ concept __dereferenceable = requires(_Tp& __t) {
 template<__dereferenceable _Tp>
 using iter_reference_t = decltype(*declval<_Tp&>());
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
 template <class _Iter>
-struct _LIBCPP_TEMPLATE_VIS iterator_traits;
-
-struct _LIBCPP_TEMPLATE_VIS input_iterator_tag {};
-struct _LIBCPP_TEMPLATE_VIS output_iterator_tag {};
-struct _LIBCPP_TEMPLATE_VIS forward_iterator_tag       : public input_iterator_tag {};
-struct _LIBCPP_TEMPLATE_VIS bidirectional_iterator_tag : public forward_iterator_tag {};
-struct _LIBCPP_TEMPLATE_VIS random_access_iterator_tag : public bidirectional_iterator_tag {};
-#if _LIBCPP_STD_VER > 17
-struct _LIBCPP_TEMPLATE_VIS contiguous_iterator_tag    : public random_access_iterator_tag {};
+struct _LIBCUDACXX_TEMPLATE_VIS iterator_traits;
+
+struct _LIBCUDACXX_TEMPLATE_VIS input_iterator_tag {};
+struct _LIBCUDACXX_TEMPLATE_VIS output_iterator_tag {};
+struct _LIBCUDACXX_TEMPLATE_VIS forward_iterator_tag       : public input_iterator_tag {};
+struct _LIBCUDACXX_TEMPLATE_VIS bidirectional_iterator_tag : public forward_iterator_tag {};
+struct _LIBCUDACXX_TEMPLATE_VIS random_access_iterator_tag : public bidirectional_iterator_tag {};
+#if _LIBCUDACXX_STD_VER > 17
+struct _LIBCUDACXX_TEMPLATE_VIS contiguous_iterator_tag    : public random_access_iterator_tag {};
 #endif
 
 template <class _Iter>
@@ -137,7 +137,7 @@ struct __has_iterator_concept
     static const bool value = decltype(__test<_Tp>(nullptr))::value;
 };
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 // The `cpp17-*-iterator` exposition-only concepts have very similar names to the `Cpp17*Iterator` named requirements
 // from `[iterator.cpp17]`. To avoid confusion between the two, the exposition-only concepts have been banished to
@@ -361,7 +361,7 @@ struct iterator_traits : __iterator_traits<_Ip> {
   using __primary_template = iterator_traits;
 };
 
-#else // _LIBCPP_STD_VER > 17
+#else // _LIBCUDACXX_STD_VER > 17
 
 template <class _Iter, bool> struct __iterator_traits {};
 
@@ -393,25 +393,25 @@ struct __iterator_traits<_Iter, true>
 //    the client expects instead of failing at compile time.
 
 template <class _Iter>
-struct _LIBCPP_TEMPLATE_VIS iterator_traits
+struct _LIBCUDACXX_TEMPLATE_VIS iterator_traits
     : __iterator_traits<_Iter, __has_iterator_typedefs<_Iter>::value> {
 
   using __primary_template = iterator_traits;
 };
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
 template<class _Tp>
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 requires is_object_v<_Tp>
 #endif
-struct _LIBCPP_TEMPLATE_VIS iterator_traits<_Tp*>
+struct _LIBCUDACXX_TEMPLATE_VIS iterator_traits<_Tp*>
 {
     typedef ptr
diff _t 
diff erence_type;
     typedef typename remove_cv<_Tp>::type value_type;
     typedef _Tp* pointer;
     typedef _Tp& reference;
     typedef random_access_iterator_tag iterator_category;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
     typedef contiguous_iterator_tag    iterator_concept;
 #endif
 };
@@ -451,7 +451,7 @@ struct __is_cpp17_random_access_iterator : public __has_iterator_category_conver
 // Such iterators receive special "contiguous" optimizations in
 // std::copy and std::sort.
 //
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 template <class _Tp>
 struct __is_cpp17_contiguous_iterator : _Or<
     __has_iterator_category_convertible_to<_Tp, contiguous_iterator_tag>,
@@ -514,6 +514,6 @@ using __iter_
diff _t = typename iterator_traits<_Iter>::
diff erence_type;
 template<class _InputIterator>
 using __iter_value_type = typename iterator_traits<_InputIterator>::value_type;
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ITERATOR_ITERATOR_TRAITS_H
+#endif // _LIBCUDACXX___ITERATOR_ITERATOR_TRAITS_H

diff  --git a/libcxx/include/__iterator/mergeable.h b/libcxx/include/__iterator/mergeable.h
index b9f2d081dc7e..70b39ca96422 100644
--- a/libcxx/include/__iterator/mergeable.h
+++ b/libcxx/include/__iterator/mergeable.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ITERATOR_MERGEABLE_H
-#define _LIBCPP___ITERATOR_MERGEABLE_H
+#ifndef _LIBCUDACXX___ITERATOR_MERGEABLE_H
+#define _LIBCUDACXX___ITERATOR_MERGEABLE_H
 
 #include <__config>
 #include <__functional/identity.h>
@@ -16,13 +16,13 @@
 #include <__iterator/concepts.h>
 #include <__iterator/projected.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 template <class _Input1, class _Input2, class _Output,
           class _Comp = ranges::less, class _Proj1 = identity, class _Proj2 = identity>
@@ -34,8 +34,8 @@ concept mergeable =
     indirectly_copyable<_Input2, _Output> &&
     indirect_strict_weak_order<_Comp, projected<_Input1, _Proj1>, projected<_Input2, _Proj2>>;
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ITERATOR_MERGEABLE_H
+#endif // _LIBCUDACXX___ITERATOR_MERGEABLE_H

diff  --git a/libcxx/include/__iterator/move_iterator.h b/libcxx/include/__iterator/move_iterator.h
index 6be9f216dbb4..24e5b122ac53 100644
--- a/libcxx/include/__iterator/move_iterator.h
+++ b/libcxx/include/__iterator/move_iterator.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ITERATOR_MOVE_ITERATOR_H
-#define _LIBCPP___ITERATOR_MOVE_ITERATOR_H
+#ifndef _LIBCUDACXX___ITERATOR_MOVE_ITERATOR_H
+#define _LIBCUDACXX___ITERATOR_MOVE_ITERATOR_H
 
 #include <__compare/compare_three_way_result.h>
 #include <__compare/three_way_comparable.h>
@@ -27,13 +27,13 @@
 #include <__utility/move.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 template<class _Iter, class = void>
 struct __move_iter_category_base {};
 
@@ -51,16 +51,16 @@ template<class _Iter, class _Sent>
 concept __move_iter_comparable = requires {
     { declval<const _Iter&>() == declval<_Sent>() } -> convertible_to<bool>;
 };
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
 template <class _Iter>
-class _LIBCPP_TEMPLATE_VIS move_iterator
-#if _LIBCPP_STD_VER > 17
+class _LIBCUDACXX_TEMPLATE_VIS move_iterator
+#if _LIBCUDACXX_STD_VER > 17
     : public __move_iter_category_base<_Iter>
 #endif
 {
 public:
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
     using iterator_type = _Iter;
     using iterator_concept = input_iterator_tag;
     // iterator_category is inherited and not always present
@@ -85,61 +85,61 @@ class _LIBCPP_TEMPLATE_VIS move_iterator
             typename remove_reference<__reference>::type&&,
             __reference
         >::type reference;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     explicit move_iterator(_Iter __i) : __current_(std::move(__i)) {}
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     move_iterator& operator++() { ++__current_; return *this; }
 
-    _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_DEPRECATED_IN_CXX20 _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     pointer operator->() const { return __current_; }
 
-#if _LIBCPP_STD_VER > 17
-    _LIBCPP_HIDE_FROM_ABI constexpr
+#if _LIBCUDACXX_STD_VER > 17
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr
     move_iterator() requires is_constructible_v<_Iter> : __current_() {}
 
     template <class _Up>
         requires (!_IsSame<_Up, _Iter>::value) && convertible_to<const _Up&, _Iter>
-    _LIBCPP_HIDE_FROM_ABI constexpr
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr
     move_iterator(const move_iterator<_Up>& __u) : __current_(__u.base()) {}
 
     template <class _Up>
         requires (!_IsSame<_Up, _Iter>::value) &&
                  convertible_to<const _Up&, _Iter> &&
                  assignable_from<_Iter&, const _Up&>
-    _LIBCPP_HIDE_FROM_ABI constexpr
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr
     move_iterator& operator=(const move_iterator<_Up>& __u) {
         __current_ = __u.base();
         return *this;
     }
 
-    _LIBCPP_HIDE_FROM_ABI constexpr const _Iter& base() const & noexcept { return __current_; }
-    _LIBCPP_HIDE_FROM_ABI constexpr _Iter base() && { return std::move(__current_); }
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr const _Iter& base() const & noexcept { return __current_; }
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr _Iter base() && { return std::move(__current_); }
 
-    _LIBCPP_HIDE_FROM_ABI constexpr
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr
     reference operator*() const { return ranges::iter_move(__current_); }
-    _LIBCPP_HIDE_FROM_ABI constexpr
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr
     reference operator[](
diff erence_type __n) const { return ranges::iter_move(__current_ + __n); }
 
-    _LIBCPP_HIDE_FROM_ABI constexpr
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr
     auto operator++(int)
         requires forward_iterator<_Iter>
     {
         move_iterator __tmp(*this); ++__current_; return __tmp;
     }
 
-    _LIBCPP_HIDE_FROM_ABI constexpr
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr
     void operator++(int) { ++__current_; }
 #else
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     move_iterator() : __current_() {}
 
     template <class _Up, class = __enable_if_t<
         !is_same<_Up, _Iter>::value && is_convertible<const _Up&, _Iter>::value
     > >
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     move_iterator(const move_iterator<_Up>& __u) : __current_(__u.base()) {}
 
     template <class _Up, class = __enable_if_t<
@@ -147,40 +147,40 @@ class _LIBCPP_TEMPLATE_VIS move_iterator
         is_convertible<const _Up&, _Iter>::value &&
         is_assignable<_Iter&, const _Up&>::value
     > >
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     move_iterator& operator=(const move_iterator<_Up>& __u) {
         __current_ = __u.base();
         return *this;
     }
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     _Iter base() const { return __current_; }
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     reference operator*() const { return static_cast<reference>(*__current_); }
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     reference operator[](
diff erence_type __n) const { return static_cast<reference>(__current_[__n]); }
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     move_iterator operator++(int) { move_iterator __tmp(*this); ++__current_; return __tmp; }
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     move_iterator& operator--() { --__current_; return *this; }
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     move_iterator operator--(int) { move_iterator __tmp(*this); --__current_; return __tmp; }
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     move_iterator operator+(
diff erence_type __n) const { return move_iterator(__current_ + __n); }
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     move_iterator& operator+=(
diff erence_type __n) { __current_ += __n; return *this; }
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     move_iterator operator-(
diff erence_type __n) const { return move_iterator(__current_ - __n); }
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     move_iterator& operator-=(
diff erence_type __n) { __current_ -= __n; return *this; }
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
     template<sentinel_for<_Iter> _Sent>
-    friend _LIBCPP_HIDE_FROM_ABI constexpr
+    friend _LIBCUDACXX_HIDE_FROM_ABI constexpr
     bool operator==(const move_iterator& __x, const move_sentinel<_Sent>& __y)
         requires __move_iter_comparable<_Iter, _Sent>
     {
@@ -188,20 +188,20 @@ class _LIBCPP_TEMPLATE_VIS move_iterator
     }
 
     template<sized_sentinel_for<_Iter> _Sent>
-    friend _LIBCPP_HIDE_FROM_ABI constexpr
+    friend _LIBCUDACXX_HIDE_FROM_ABI constexpr
     iter_
diff erence_t<_Iter> operator-(const move_sentinel<_Sent>& __x, const move_iterator& __y)
     {
         return __x.base() - __y.base();
     }
 
     template<sized_sentinel_for<_Iter> _Sent>
-    friend _LIBCPP_HIDE_FROM_ABI constexpr
+    friend _LIBCUDACXX_HIDE_FROM_ABI constexpr
     iter_
diff erence_t<_Iter> operator-(const move_iterator& __x, const move_sentinel<_Sent>& __y)
     {
         return __x.base() - __y.base();
     }
 
-    friend _LIBCPP_HIDE_FROM_ABI constexpr
+    friend _LIBCUDACXX_HIDE_FROM_ABI constexpr
     iter_rvalue_reference_t<_Iter> iter_move(const move_iterator& __i)
         noexcept(noexcept(ranges::iter_move(__i.__current_)))
     {
@@ -209,13 +209,13 @@ class _LIBCPP_TEMPLATE_VIS move_iterator
     }
 
     template<indirectly_swappable<_Iter> _It2>
-    friend _LIBCPP_HIDE_FROM_ABI constexpr
+    friend _LIBCUDACXX_HIDE_FROM_ABI constexpr
     void iter_swap(const move_iterator& __x, const move_iterator<_It2>& __y)
         noexcept(noexcept(ranges::iter_swap(__x.__current_, __y.__current_)))
     {
         return ranges::iter_swap(__x.__current_, __y.__current_);
     }
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
 private:
     template<class _It2> friend class move_iterator;
@@ -224,62 +224,62 @@ class _LIBCPP_TEMPLATE_VIS move_iterator
 };
 
 template <class _Iter1, class _Iter2>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 bool operator==(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
 {
     return __x.base() == __y.base();
 }
 
-#if _LIBCPP_STD_VER <= 17
+#if _LIBCUDACXX_STD_VER <= 17
 template <class _Iter1, class _Iter2>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 bool operator!=(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
 {
     return __x.base() != __y.base();
 }
-#endif // _LIBCPP_STD_VER <= 17
+#endif // _LIBCUDACXX_STD_VER <= 17
 
 template <class _Iter1, class _Iter2>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 bool operator<(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
 {
     return __x.base() < __y.base();
 }
 
 template <class _Iter1, class _Iter2>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 bool operator>(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
 {
     return __x.base() > __y.base();
 }
 
 template <class _Iter1, class _Iter2>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 bool operator<=(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
 {
     return __x.base() <= __y.base();
 }
 
 template <class _Iter1, class _Iter2>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 bool operator>=(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
 {
     return __x.base() >= __y.base();
 }
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 template <class _Iter1, three_way_comparable_with<_Iter1> _Iter2>
-inline _LIBCPP_HIDE_FROM_ABI constexpr
+inline _LIBCUDACXX_HIDE_FROM_ABI constexpr
 auto operator<=>(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
     -> compare_three_way_result_t<_Iter1, _Iter2>
 {
     return __x.base() <=> __y.base();
 }
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 template <class _Iter1, class _Iter2>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 auto operator-(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
     -> decltype(__x.base() - __y.base())
 {
@@ -287,17 +287,17 @@ auto operator-(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __
 }
 #else
 template <class _Iter1, class _Iter2>
-inline _LIBCPP_HIDE_FROM_ABI
+inline _LIBCUDACXX_HIDE_FROM_ABI
 typename move_iterator<_Iter1>::
diff erence_type
 operator-(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
 {
     return __x.base() - __y.base();
 }
-#endif // !_LIBCPP_CXX03_LANG
+#endif // !_LIBCUDACXX_CXX03_LANG
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 template <class _Iter>
-inline _LIBCPP_HIDE_FROM_ABI constexpr
+inline _LIBCUDACXX_HIDE_FROM_ABI constexpr
 move_iterator<_Iter> operator+(iter_
diff erence_t<_Iter> __n, const move_iterator<_Iter>& __x)
     requires requires { { __x.base() + __n } -> same_as<_Iter>; }
 {
@@ -305,22 +305,22 @@ move_iterator<_Iter> operator+(iter_
diff erence_t<_Iter> __n, const move_iterator
 }
 #else
 template <class _Iter>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 move_iterator<_Iter>
 operator+(typename move_iterator<_Iter>::
diff erence_type __n, const move_iterator<_Iter>& __x)
 {
     return move_iterator<_Iter>(__x.base() + __n);
 }
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
 template <class _Iter>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 move_iterator<_Iter>
 make_move_iterator(_Iter __i)
 {
     return move_iterator<_Iter>(std::move(__i));
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ITERATOR_MOVE_ITERATOR_H
+#endif // _LIBCUDACXX___ITERATOR_MOVE_ITERATOR_H

diff  --git a/libcxx/include/__iterator/move_sentinel.h b/libcxx/include/__iterator/move_sentinel.h
index 5adf877b3490..55c82856fe5d 100644
--- a/libcxx/include/__iterator/move_sentinel.h
+++ b/libcxx/include/__iterator/move_sentinel.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ITERATOR_MOVE_SENTINEL_H
-#define _LIBCPP___ITERATOR_MOVE_SENTINEL_H
+#ifndef _LIBCUDACXX___ITERATOR_MOVE_SENTINEL_H
+#define _LIBCUDACXX___ITERATOR_MOVE_SENTINEL_H
 
 #include <__concepts/assignable.h>
 #include <__concepts/convertible_to.h>
@@ -15,32 +15,32 @@
 #include <__config>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 template <semiregular _Sent>
-class _LIBCPP_TEMPLATE_VIS move_sentinel
+class _LIBCUDACXX_TEMPLATE_VIS move_sentinel
 {
 public:
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   move_sentinel() = default;
 
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   explicit move_sentinel(_Sent __s) : __last_(std::move(__s)) {}
 
   template <class _S2>
     requires convertible_to<const _S2&, _Sent>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   move_sentinel(const move_sentinel<_S2>& __s) : __last_(__s.base()) {}
 
   template <class _S2>
     requires assignable_from<_Sent&, const _S2&>
-  _LIBCPP_HIDE_FROM_ABI constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr
   move_sentinel& operator=(const move_sentinel<_S2>& __s)
     { __last_ = __s.base(); return *this; }
 
@@ -50,8 +50,8 @@ class _LIBCPP_TEMPLATE_VIS move_sentinel
     _Sent __last_ = _Sent();
 };
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ITERATOR_MOVE_SENTINEL_H
+#endif // _LIBCUDACXX___ITERATOR_MOVE_SENTINEL_H

diff  --git a/libcxx/include/__iterator/next.h b/libcxx/include/__iterator/next.h
index 5363d6d58ecf..8dbb749905f3 100644
--- a/libcxx/include/__iterator/next.h
+++ b/libcxx/include/__iterator/next.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ITERATOR_NEXT_H
-#define _LIBCPP___ITERATOR_NEXT_H
+#ifndef _LIBCUDACXX___ITERATOR_NEXT_H
+#define _LIBCUDACXX___ITERATOR_NEXT_H
 
 #include <__assert>
 #include <__config>
@@ -18,24 +18,24 @@
 #include <__iterator/iterator_traits.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _InputIter>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     typename enable_if<__is_cpp17_input_iterator<_InputIter>::value, _InputIter>::type
     next(_InputIter __x, typename iterator_traits<_InputIter>::
diff erence_type __n = 1) {
-  _LIBCPP_ASSERT(__n >= 0 || __is_cpp17_bidirectional_iterator<_InputIter>::value,
+  _LIBCUDACXX_ASSERT(__n >= 0 || __is_cpp17_bidirectional_iterator<_InputIter>::value,
                  "Attempt to next(it, n) with negative n on a non-bidirectional iterator");
 
-  _VSTD::advance(__x, __n);
+  _CUDA_VSTD::advance(__x, __n);
   return __x;
 }
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
 // [range.iter.op.next]
 
@@ -44,27 +44,27 @@ namespace __next {
 
 struct __fn {
   template <input_or_output_iterator _Ip>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr _Ip operator()(_Ip __x) const {
     ++__x;
     return __x;
   }
 
   template <input_or_output_iterator _Ip>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr _Ip operator()(_Ip __x, iter_
diff erence_t<_Ip> __n) const {
     ranges::advance(__x, __n);
     return __x;
   }
 
   template <input_or_output_iterator _Ip, sentinel_for<_Ip> _Sp>
-  _LIBCPP_HIDE_FROM_ABI constexpr _Ip operator()(_Ip __x, _Sp __bound_sentinel) const {
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr _Ip operator()(_Ip __x, _Sp __bound_sentinel) const {
     ranges::advance(__x, __bound_sentinel);
     return __x;
   }
 
   template <input_or_output_iterator _Ip, sentinel_for<_Ip> _Sp>
-  _LIBCPP_HIDE_FROM_ABI constexpr _Ip operator()(_Ip __x, iter_
diff erence_t<_Ip> __n, _Sp __bound_sentinel) const {
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr _Ip operator()(_Ip __x, iter_
diff erence_t<_Ip> __n, _Sp __bound_sentinel) const {
     ranges::advance(__x, __n, __bound_sentinel);
     return __x;
   }
@@ -77,8 +77,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ITERATOR_NEXT_H
+#endif // _LIBCUDACXX___ITERATOR_NEXT_H

diff  --git a/libcxx/include/__iterator/ostream_iterator.h b/libcxx/include/__iterator/ostream_iterator.h
index d16f5a26ebaa..a17cfb340bf3 100644
--- a/libcxx/include/__iterator/ostream_iterator.h
+++ b/libcxx/include/__iterator/ostream_iterator.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ITERATOR_OSTREAM_ITERATOR_H
-#define _LIBCPP___ITERATOR_OSTREAM_ITERATOR_H
+#ifndef _LIBCUDACXX___ITERATOR_OSTREAM_ITERATOR_H
+#define _LIBCUDACXX___ITERATOR_OSTREAM_ITERATOR_H
 
 #include <__config>
 #include <__iterator/iterator.h>
@@ -17,24 +17,24 @@
 #include <cstddef>
 #include <iosfwd> // for forward declarations of char_traits and basic_ostream
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+_LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
 template <class _Tp, class _CharT = char, class _Traits = char_traits<_CharT> >
-class _LIBCPP_TEMPLATE_VIS ostream_iterator
-#if _LIBCPP_STD_VER <= 14 || !defined(_LIBCPP_ABI_NO_ITERATOR_BASES)
+class _LIBCUDACXX_TEMPLATE_VIS ostream_iterator
+#if _LIBCUDACXX_STD_VER <= 14 || !defined(_LIBCUDACXX_ABI_NO_ITERATOR_BASES)
     : public iterator<output_iterator_tag, void, void, void, void>
 #endif
 {
-_LIBCPP_SUPPRESS_DEPRECATED_POP
+_LIBCUDACXX_SUPPRESS_DEPRECATED_POP
 public:
     typedef output_iterator_tag             iterator_category;
     typedef void                            value_type;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
     typedef ptr
diff _t                       
diff erence_type;
 #else
     typedef void                            
diff erence_type;
@@ -49,11 +49,11 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
     ostream_type* __out_stream_;
     const char_type* __delim_;
 public:
-    _LIBCPP_INLINE_VISIBILITY ostream_iterator(ostream_type& __s) _NOEXCEPT
-        : __out_stream_(_VSTD::addressof(__s)), __delim_(nullptr) {}
-    _LIBCPP_INLINE_VISIBILITY ostream_iterator(ostream_type& __s, const _CharT* __delimiter) _NOEXCEPT
-        : __out_stream_(_VSTD::addressof(__s)), __delim_(__delimiter) {}
-    _LIBCPP_INLINE_VISIBILITY ostream_iterator& operator=(const _Tp& __value)
+    _LIBCUDACXX_INLINE_VISIBILITY ostream_iterator(ostream_type& __s) _NOEXCEPT
+        : __out_stream_(_CUDA_VSTD::addressof(__s)), __delim_(nullptr) {}
+    _LIBCUDACXX_INLINE_VISIBILITY ostream_iterator(ostream_type& __s, const _CharT* __delimiter) _NOEXCEPT
+        : __out_stream_(_CUDA_VSTD::addressof(__s)), __delim_(__delimiter) {}
+    _LIBCUDACXX_INLINE_VISIBILITY ostream_iterator& operator=(const _Tp& __value)
         {
             *__out_stream_ << __value;
             if (__delim_)
@@ -61,11 +61,11 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
             return *this;
         }
 
-    _LIBCPP_INLINE_VISIBILITY ostream_iterator& operator*()     {return *this;}
-    _LIBCPP_INLINE_VISIBILITY ostream_iterator& operator++()    {return *this;}
-    _LIBCPP_INLINE_VISIBILITY ostream_iterator& operator++(int) {return *this;}
+    _LIBCUDACXX_INLINE_VISIBILITY ostream_iterator& operator*()     {return *this;}
+    _LIBCUDACXX_INLINE_VISIBILITY ostream_iterator& operator++()    {return *this;}
+    _LIBCUDACXX_INLINE_VISIBILITY ostream_iterator& operator++(int) {return *this;}
 };
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ITERATOR_OSTREAM_ITERATOR_H
+#endif // _LIBCUDACXX___ITERATOR_OSTREAM_ITERATOR_H

diff  --git a/libcxx/include/__iterator/ostreambuf_iterator.h b/libcxx/include/__iterator/ostreambuf_iterator.h
index 6da7598ed272..8ca46e92bd38 100644
--- a/libcxx/include/__iterator/ostreambuf_iterator.h
+++ b/libcxx/include/__iterator/ostreambuf_iterator.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ITERATOR_OSTREAMBUF_ITERATOR_H
-#define _LIBCPP___ITERATOR_OSTREAMBUF_ITERATOR_H
+#ifndef _LIBCUDACXX___ITERATOR_OSTREAMBUF_ITERATOR_H
+#define _LIBCUDACXX___ITERATOR_OSTREAMBUF_ITERATOR_H
 
 #include <__config>
 #include <__iterator/iterator.h>
@@ -16,24 +16,24 @@
 #include <cstddef>
 #include <iosfwd> // for forward declaration of basic_streambuf
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+_LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
 template <class _CharT, class _Traits>
-class _LIBCPP_TEMPLATE_VIS ostreambuf_iterator
-#if _LIBCPP_STD_VER <= 14 || !defined(_LIBCPP_ABI_NO_ITERATOR_BASES)
+class _LIBCUDACXX_TEMPLATE_VIS ostreambuf_iterator
+#if _LIBCUDACXX_STD_VER <= 14 || !defined(_LIBCUDACXX_ABI_NO_ITERATOR_BASES)
     : public iterator<output_iterator_tag, void, void, void, void>
 #endif
 {
-_LIBCPP_SUPPRESS_DEPRECATED_POP
+_LIBCUDACXX_SUPPRESS_DEPRECATED_POP
 public:
     typedef output_iterator_tag                 iterator_category;
     typedef void                                value_type;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
     typedef ptr
diff _t                           
diff erence_type;
 #else
     typedef void                                
diff erence_type;
@@ -48,30 +48,30 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
 private:
     streambuf_type* __sbuf_;
 public:
-    _LIBCPP_INLINE_VISIBILITY ostreambuf_iterator(ostream_type& __s) _NOEXCEPT
+    _LIBCUDACXX_INLINE_VISIBILITY ostreambuf_iterator(ostream_type& __s) _NOEXCEPT
         : __sbuf_(__s.rdbuf()) {}
-    _LIBCPP_INLINE_VISIBILITY ostreambuf_iterator(streambuf_type* __s) _NOEXCEPT
+    _LIBCUDACXX_INLINE_VISIBILITY ostreambuf_iterator(streambuf_type* __s) _NOEXCEPT
         : __sbuf_(__s) {}
-    _LIBCPP_INLINE_VISIBILITY ostreambuf_iterator& operator=(_CharT __c)
+    _LIBCUDACXX_INLINE_VISIBILITY ostreambuf_iterator& operator=(_CharT __c)
         {
             if (__sbuf_ && traits_type::eq_int_type(__sbuf_->sputc(__c), traits_type::eof()))
                 __sbuf_ = nullptr;
             return *this;
         }
-    _LIBCPP_INLINE_VISIBILITY ostreambuf_iterator& operator*()     {return *this;}
-    _LIBCPP_INLINE_VISIBILITY ostreambuf_iterator& operator++()    {return *this;}
-    _LIBCPP_INLINE_VISIBILITY ostreambuf_iterator& operator++(int) {return *this;}
-    _LIBCPP_INLINE_VISIBILITY bool failed() const _NOEXCEPT {return __sbuf_ == nullptr;}
+    _LIBCUDACXX_INLINE_VISIBILITY ostreambuf_iterator& operator*()     {return *this;}
+    _LIBCUDACXX_INLINE_VISIBILITY ostreambuf_iterator& operator++()    {return *this;}
+    _LIBCUDACXX_INLINE_VISIBILITY ostreambuf_iterator& operator++(int) {return *this;}
+    _LIBCUDACXX_INLINE_VISIBILITY bool failed() const _NOEXCEPT {return __sbuf_ == nullptr;}
 
     template <class _Ch, class _Tr>
     friend
-    _LIBCPP_HIDDEN
+    _LIBCUDACXX_HIDDEN
     ostreambuf_iterator<_Ch, _Tr>
     __pad_and_output(ostreambuf_iterator<_Ch, _Tr> __s,
                      const _Ch* __ob, const _Ch* __op, const _Ch* __oe,
                      ios_base& __iob, _Ch __fl);
 };
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ITERATOR_OSTREAMBUF_ITERATOR_H
+#endif // _LIBCUDACXX___ITERATOR_OSTREAMBUF_ITERATOR_H

diff  --git a/libcxx/include/__iterator/permutable.h b/libcxx/include/__iterator/permutable.h
index 28d193eaae2c..a17f32886579 100644
--- a/libcxx/include/__iterator/permutable.h
+++ b/libcxx/include/__iterator/permutable.h
@@ -7,20 +7,20 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ITERATOR_PERMUTABLE_H
-#define _LIBCPP___ITERATOR_PERMUTABLE_H
+#ifndef _LIBCUDACXX___ITERATOR_PERMUTABLE_H
+#define _LIBCUDACXX___ITERATOR_PERMUTABLE_H
 
 #include <__config>
 #include <__iterator/concepts.h>
 #include <__iterator/iter_swap.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 template <class _Iterator>
 concept permutable =
@@ -28,8 +28,8 @@ concept permutable =
     indirectly_movable_storable<_Iterator, _Iterator> &&
     indirectly_swappable<_Iterator, _Iterator>;
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ITERATOR_PERMUTABLE_H
+#endif // _LIBCUDACXX___ITERATOR_PERMUTABLE_H

diff  --git a/libcxx/include/__iterator/prev.h b/libcxx/include/__iterator/prev.h
index eb997b91ba20..8ad8d3fa7f9a 100644
--- a/libcxx/include/__iterator/prev.h
+++ b/libcxx/include/__iterator/prev.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ITERATOR_PREV_H
-#define _LIBCPP___ITERATOR_PREV_H
+#ifndef _LIBCUDACXX___ITERATOR_PREV_H
+#define _LIBCUDACXX___ITERATOR_PREV_H
 
 #include <__assert>
 #include <__config>
@@ -18,23 +18,23 @@
 #include <__iterator/iterator_traits.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _InputIter>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     typename enable_if<__is_cpp17_input_iterator<_InputIter>::value, _InputIter>::type
     prev(_InputIter __x, typename iterator_traits<_InputIter>::
diff erence_type __n = 1) {
-  _LIBCPP_ASSERT(__n <= 0 || __is_cpp17_bidirectional_iterator<_InputIter>::value,
+  _LIBCUDACXX_ASSERT(__n <= 0 || __is_cpp17_bidirectional_iterator<_InputIter>::value,
                  "Attempt to prev(it, n) with a positive n on a non-bidirectional iterator");
-  _VSTD::advance(__x, -__n);
+  _CUDA_VSTD::advance(__x, -__n);
   return __x;
 }
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
 // [range.iter.op.prev]
 
@@ -43,21 +43,21 @@ namespace __prev {
 
 struct __fn {
   template <bidirectional_iterator _Ip>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr _Ip operator()(_Ip __x) const {
     --__x;
     return __x;
   }
 
   template <bidirectional_iterator _Ip>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr _Ip operator()(_Ip __x, iter_
diff erence_t<_Ip> __n) const {
     ranges::advance(__x, -__n);
     return __x;
   }
 
   template <bidirectional_iterator _Ip>
-  _LIBCPP_HIDE_FROM_ABI constexpr _Ip operator()(_Ip __x, iter_
diff erence_t<_Ip> __n, _Ip __bound_iter) const {
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr _Ip operator()(_Ip __x, iter_
diff erence_t<_Ip> __n, _Ip __bound_iter) const {
     ranges::advance(__x, -__n, __bound_iter);
     return __x;
   }
@@ -70,8 +70,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ITERATOR_PREV_H
+#endif // _LIBCUDACXX___ITERATOR_PREV_H

diff  --git a/libcxx/include/__iterator/projected.h b/libcxx/include/__iterator/projected.h
index 53526bd8e712..f6476a4d3644 100644
--- a/libcxx/include/__iterator/projected.h
+++ b/libcxx/include/__iterator/projected.h
@@ -6,21 +6,21 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-#ifndef _LIBCPP___ITERATOR_PROJECTED_H
-#define _LIBCPP___ITERATOR_PROJECTED_H
+#ifndef _LIBCUDACXX___ITERATOR_PROJECTED_H
+#define _LIBCUDACXX___ITERATOR_PROJECTED_H
 
 #include <__config>
 #include <__iterator/concepts.h>
 #include <__iterator/incrementable_traits.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 template<indirectly_readable _It, indirectly_regular_unary_invocable<_It> _Proj>
 struct projected {
@@ -33,8 +33,8 @@ struct incrementable_traits<projected<_It, _Proj>> {
   using 
diff erence_type = iter_
diff erence_t<_It>;
 };
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ITERATOR_PROJECTED_H
+#endif // _LIBCUDACXX___ITERATOR_PROJECTED_H

diff  --git a/libcxx/include/__iterator/readable_traits.h b/libcxx/include/__iterator/readable_traits.h
index 500b46ac145f..4653b618673d 100644
--- a/libcxx/include/__iterator/readable_traits.h
+++ b/libcxx/include/__iterator/readable_traits.h
@@ -7,20 +7,20 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ITERATOR_READABLE_TRAITS_H
-#define _LIBCPP___ITERATOR_READABLE_TRAITS_H
+#ifndef _LIBCUDACXX___ITERATOR_READABLE_TRAITS_H
+#define _LIBCUDACXX___ITERATOR_READABLE_TRAITS_H
 
 #include <__config>
 #include <concepts>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 // [readable.traits]
 template<class> struct __cond_value_type {};
@@ -79,8 +79,8 @@ using iter_value_t = typename conditional_t<__is_primary_template<iterator_trait
                                             indirectly_readable_traits<remove_cvref_t<_Ip> >,
                                             iterator_traits<remove_cvref_t<_Ip> > >::value_type;
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ITERATOR_READABLE_TRAITS_H
+#endif // _LIBCUDACXX___ITERATOR_READABLE_TRAITS_H

diff  --git a/libcxx/include/__iterator/reverse_access.h b/libcxx/include/__iterator/reverse_access.h
index 40c266378d36..50a5a0dcfc00 100644
--- a/libcxx/include/__iterator/reverse_access.h
+++ b/libcxx/include/__iterator/reverse_access.h
@@ -7,94 +7,94 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ITERATOR_REVERSE_ACCESS_H
-#define _LIBCPP___ITERATOR_REVERSE_ACCESS_H
+#ifndef _LIBCUDACXX___ITERATOR_REVERSE_ACCESS_H
+#define _LIBCUDACXX___ITERATOR_REVERSE_ACCESS_H
 
 #include <__config>
 #include <__iterator/reverse_iterator.h>
 #include <cstddef>
 #include <initializer_list>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 
 template <class _Tp, size_t _Np>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 reverse_iterator<_Tp*> rbegin(_Tp (&__array)[_Np])
 {
     return reverse_iterator<_Tp*>(__array + _Np);
 }
 
 template <class _Tp, size_t _Np>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 reverse_iterator<_Tp*> rend(_Tp (&__array)[_Np])
 {
     return reverse_iterator<_Tp*>(__array);
 }
 
 template <class _Ep>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 reverse_iterator<const _Ep*> rbegin(initializer_list<_Ep> __il)
 {
     return reverse_iterator<const _Ep*>(__il.end());
 }
 
 template <class _Ep>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 reverse_iterator<const _Ep*> rend(initializer_list<_Ep> __il)
 {
     return reverse_iterator<const _Ep*>(__il.begin());
 }
 
 template <class _Cp>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 auto rbegin(_Cp& __c) -> decltype(__c.rbegin())
 {
     return __c.rbegin();
 }
 
 template <class _Cp>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 auto rbegin(const _Cp& __c) -> decltype(__c.rbegin())
 {
     return __c.rbegin();
 }
 
 template <class _Cp>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 auto rend(_Cp& __c) -> decltype(__c.rend())
 {
     return __c.rend();
 }
 
 template <class _Cp>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 auto rend(const _Cp& __c) -> decltype(__c.rend())
 {
     return __c.rend();
 }
 
 template <class _Cp>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
-auto crbegin(const _Cp& __c) -> decltype(_VSTD::rbegin(__c))
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
+auto crbegin(const _Cp& __c) -> decltype(_CUDA_VSTD::rbegin(__c))
 {
-    return _VSTD::rbegin(__c);
+    return _CUDA_VSTD::rbegin(__c);
 }
 
 template <class _Cp>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
-auto crend(const _Cp& __c) -> decltype(_VSTD::rend(__c))
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
+auto crend(const _Cp& __c) -> decltype(_CUDA_VSTD::rend(__c))
 {
-    return _VSTD::rend(__c);
+    return _CUDA_VSTD::rend(__c);
 }
 
-#endif // _LIBCPP_STD_VER > 11
+#endif // _LIBCUDACXX_STD_VER > 11
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ITERATOR_REVERSE_ACCESS_H
+#endif // _LIBCUDACXX___ITERATOR_REVERSE_ACCESS_H

diff  --git a/libcxx/include/__iterator/reverse_iterator.h b/libcxx/include/__iterator/reverse_iterator.h
index 7b002205f333..376bb414550e 100644
--- a/libcxx/include/__iterator/reverse_iterator.h
+++ b/libcxx/include/__iterator/reverse_iterator.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ITERATOR_REVERSE_ITERATOR_H
-#define _LIBCPP___ITERATOR_REVERSE_ITERATOR_H
+#ifndef _LIBCUDACXX___ITERATOR_REVERSE_ITERATOR_H
+#define _LIBCUDACXX___ITERATOR_REVERSE_ITERATOR_H
 
 #include <__algorithm/unwrap_iter.h>
 #include <__compare/compare_three_way_result.h>
@@ -32,16 +32,16 @@
 #include <__utility/move.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+_LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
 template <class _Iter>
-class _LIBCPP_TEMPLATE_VIS reverse_iterator
-#if _LIBCPP_STD_VER <= 14 || !defined(_LIBCPP_ABI_NO_ITERATOR_BASES)
+class _LIBCUDACXX_TEMPLATE_VIS reverse_iterator
+#if _LIBCUDACXX_STD_VER <= 14 || !defined(_LIBCUDACXX_ABI_NO_ITERATOR_BASES)
     : public iterator<typename iterator_traits<_Iter>::iterator_category,
                       typename iterator_traits<_Iter>::value_type,
                       typename iterator_traits<_Iter>::
diff erence_type,
@@ -49,16 +49,16 @@ class _LIBCPP_TEMPLATE_VIS reverse_iterator
                       typename iterator_traits<_Iter>::reference>
 #endif
 {
-_LIBCPP_SUPPRESS_DEPRECATED_POP
+_LIBCUDACXX_SUPPRESS_DEPRECATED_POP
 private:
-#ifndef _LIBCPP_ABI_NO_ITERATOR_BASES
+#ifndef _LIBCUDACXX_ABI_NO_ITERATOR_BASES
     _Iter __t; // no longer used as of LWG #2360, not removed due to ABI break
 #endif
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
     static_assert(__is_cpp17_bidirectional_iterator<_Iter>::value || bidirectional_iterator<_Iter>,
         "reverse_iterator<It> requires It to be a bidirectional iterator.");
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
 protected:
     _Iter current;
@@ -69,7 +69,7 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
                                   random_access_iterator_tag,
                                   typename iterator_traits<_Iter>::iterator_category>;
     using pointer = typename iterator_traits<_Iter>::pointer;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
     using iterator_concept = _If<random_access_iterator<_Iter>, random_access_iterator_tag, bidirectional_iterator_tag>;
     using value_type = iter_value_t<_Iter>;
     using 
diff erence_type = iter_
diff erence_t<_Iter>;
@@ -80,17 +80,17 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
     using reference = typename iterator_traits<_Iter>::reference;
 #endif
 
-#ifndef _LIBCPP_ABI_NO_ITERATOR_BASES
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+#ifndef _LIBCUDACXX_ABI_NO_ITERATOR_BASES
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     reverse_iterator() : __t(), current() {}
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     explicit reverse_iterator(_Iter __x) : __t(__x), current(__x) {}
 
     template <class _Up, class = __enable_if_t<
         !is_same<_Up, _Iter>::value && is_convertible<_Up const&, _Iter>::value
     > >
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     reverse_iterator(const reverse_iterator<_Up>& __u)
         : __t(__u.base()), current(__u.base())
     { }
@@ -100,22 +100,22 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
         is_convertible<_Up const&, _Iter>::value &&
         is_assignable<_Iter&, _Up const&>::value
     > >
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     reverse_iterator& operator=(const reverse_iterator<_Up>& __u) {
         __t = current = __u.base();
         return *this;
     }
 #else
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     reverse_iterator() : current() {}
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     explicit reverse_iterator(_Iter __x) : current(__x) {}
 
     template <class _Up, class = __enable_if_t<
         !is_same<_Up, _Iter>::value && is_convertible<_Up const&, _Iter>::value
     > >
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     reverse_iterator(const reverse_iterator<_Up>& __u)
         : current(__u.base())
     { }
@@ -125,19 +125,19 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
         is_convertible<_Up const&, _Iter>::value &&
         is_assignable<_Iter&, _Up const&>::value
     > >
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     reverse_iterator& operator=(const reverse_iterator<_Up>& __u) {
         current = __u.base();
         return *this;
     }
 #endif
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     _Iter base() const {return current;}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     reference operator*() const {_Iter __tmp = current; return *--__tmp;}
 
-#if _LIBCPP_STD_VER > 17
-    _LIBCPP_INLINE_VISIBILITY
+#if _LIBCUDACXX_STD_VER > 17
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr pointer operator->() const
       requires is_pointer_v<_Iter> || requires(const _Iter __i) { __i.operator->(); }
     {
@@ -148,33 +148,33 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
       }
     }
 #else
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     pointer operator->() const {
       return std::addressof(operator*());
     }
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     reverse_iterator& operator++() {--current; return *this;}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     reverse_iterator operator++(int) {reverse_iterator __tmp(*this); --current; return __tmp;}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     reverse_iterator& operator--() {++current; return *this;}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     reverse_iterator operator--(int) {reverse_iterator __tmp(*this); ++current; return __tmp;}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     reverse_iterator operator+(
diff erence_type __n) const {return reverse_iterator(current - __n);}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     reverse_iterator& operator+=(
diff erence_type __n) {current -= __n; return *this;}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     reverse_iterator operator-(
diff erence_type __n) const {return reverse_iterator(current + __n);}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     reverse_iterator& operator-=(
diff erence_type __n) {current += __n; return *this;}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     reference operator[](
diff erence_type __n) const {return *(*this + __n);}
 
-#if _LIBCPP_STD_VER > 17
-    _LIBCPP_HIDE_FROM_ABI friend constexpr
+#if _LIBCUDACXX_STD_VER > 17
+    _LIBCUDACXX_HIDE_FROM_ABI friend constexpr
     iter_rvalue_reference_t<_Iter> iter_move(const reverse_iterator& __i)
       noexcept(is_nothrow_copy_constructible_v<_Iter> &&
           noexcept(ranges::iter_move(--declval<_Iter&>()))) {
@@ -183,7 +183,7 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
     }
 
     template <indirectly_swappable<_Iter> _Iter2>
-    _LIBCPP_HIDE_FROM_ABI friend constexpr
+    _LIBCUDACXX_HIDE_FROM_ABI friend constexpr
     void iter_swap(const reverse_iterator& __x, const reverse_iterator<_Iter2>& __y)
       noexcept(is_nothrow_copy_constructible_v<_Iter> &&
           is_nothrow_copy_constructible_v<_Iter2> &&
@@ -192,7 +192,7 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
       auto __ytmp = __y.base();
       ranges::iter_swap(--__xtmp, --__ytmp);
     }
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 };
 
 template <class _Iter>
@@ -202,96 +202,96 @@ template <class _Iter>
 struct __is_reverse_iterator<reverse_iterator<_Iter> > : true_type {};
 
 template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 bool
 operator==(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
     requires requires {
       { __x.base() == __y.base() } -> convertible_to<bool>;
     }
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 {
     return __x.base() == __y.base();
 }
 
 template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 bool
 operator<(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
     requires requires {
         { __x.base() > __y.base() } -> convertible_to<bool>;
       }
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 {
     return __x.base() > __y.base();
 }
 
 template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 bool
 operator!=(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
     requires requires {
       { __x.base() != __y.base() } -> convertible_to<bool>;
     }
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 {
     return __x.base() != __y.base();
 }
 
 template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 bool
 operator>(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
     requires requires {
         { __x.base() < __y.base() } -> convertible_to<bool>;
       }
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 {
     return __x.base() < __y.base();
 }
 
 template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 bool
 operator>=(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
     requires requires {
         { __x.base() <= __y.base() } -> convertible_to<bool>;
       }
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 {
     return __x.base() <= __y.base();
 }
 
 template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 bool
 operator<=(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
     requires requires {
         { __x.base() >= __y.base() } -> convertible_to<bool>;
       }
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 {
     return __x.base() >= __y.base();
 }
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 template <class _Iter1, three_way_comparable_with<_Iter1> _Iter2>
-_LIBCPP_HIDE_FROM_ABI constexpr
+_LIBCUDACXX_HIDE_FROM_ABI constexpr
 compare_three_way_result_t<_Iter1, _Iter2>
 operator<=>(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
 {
     return __y.base() <=> __x.base();
 }
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 auto
 operator-(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
 -> decltype(__y.base() - __x.base())
@@ -300,7 +300,7 @@ operator-(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& _
 }
 #else
 template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename reverse_iterator<_Iter1>::
diff erence_type
 operator-(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
 {
@@ -309,29 +309,29 @@ operator-(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& _
 #endif
 
 template <class _Iter>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 reverse_iterator<_Iter>
 operator+(typename reverse_iterator<_Iter>::
diff erence_type __n, const reverse_iterator<_Iter>& __x)
 {
     return reverse_iterator<_Iter>(__x.base() - __n);
 }
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 template <class _Iter1, class _Iter2>
   requires (!sized_sentinel_for<_Iter1, _Iter2>)
 inline constexpr bool disable_sized_sentinel_for<reverse_iterator<_Iter1>, reverse_iterator<_Iter2>> = true;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <class _Iter>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 reverse_iterator<_Iter> make_reverse_iterator(_Iter __i)
 {
     return reverse_iterator<_Iter>(__i);
 }
 #endif
 
-#if _LIBCPP_STD_VER <= 17
+#if _LIBCUDACXX_STD_VER <= 17
 template <class _Iter>
 using __unconstrained_reverse_iterator = reverse_iterator<_Iter>;
 #else
@@ -373,17 +373,17 @@ class __unconstrained_reverse_iterator {
   using 
diff erence_type = iter_
diff erence_t<_Iter>;
   using reference = iter_reference_t<_Iter>;
 
-  _LIBCPP_HIDE_FROM_ABI constexpr __unconstrained_reverse_iterator() = default;
-  _LIBCPP_HIDE_FROM_ABI constexpr __unconstrained_reverse_iterator(const __unconstrained_reverse_iterator&) = default;
-  _LIBCPP_HIDE_FROM_ABI constexpr explicit __unconstrained_reverse_iterator(_Iter __iter) : __iter_(__iter) {}
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr __unconstrained_reverse_iterator() = default;
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr __unconstrained_reverse_iterator(const __unconstrained_reverse_iterator&) = default;
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit __unconstrained_reverse_iterator(_Iter __iter) : __iter_(__iter) {}
 
-  _LIBCPP_HIDE_FROM_ABI constexpr _Iter base() const { return __iter_; }
-  _LIBCPP_HIDE_FROM_ABI constexpr reference operator*() const {
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr _Iter base() const { return __iter_; }
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr reference operator*() const {
     auto __tmp = __iter_;
     return *--__tmp;
   }
 
-  _LIBCPP_HIDE_FROM_ABI constexpr pointer operator->() const {
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr pointer operator->() const {
     if constexpr (is_pointer_v<_Iter>) {
       return std::prev(__iter_);
     } else {
@@ -391,7 +391,7 @@ class __unconstrained_reverse_iterator {
     }
   }
 
-  _LIBCPP_HIDE_FROM_ABI friend constexpr
+  _LIBCUDACXX_HIDE_FROM_ABI friend constexpr
   iter_rvalue_reference_t<_Iter> iter_move(const __unconstrained_reverse_iterator& __i)
     noexcept(is_nothrow_copy_constructible_v<_Iter> &&
         noexcept(ranges::iter_move(--declval<_Iter&>()))) {
@@ -399,80 +399,80 @@ class __unconstrained_reverse_iterator {
     return ranges::iter_move(--__tmp);
   }
 
-  _LIBCPP_HIDE_FROM_ABI constexpr __unconstrained_reverse_iterator& operator++() {
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr __unconstrained_reverse_iterator& operator++() {
     --__iter_;
     return *this;
   }
 
-  _LIBCPP_HIDE_FROM_ABI constexpr __unconstrained_reverse_iterator operator++(int) {
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr __unconstrained_reverse_iterator operator++(int) {
     auto __tmp = *this;
     --__iter_;
     return __tmp;
   }
 
-  _LIBCPP_HIDE_FROM_ABI constexpr __unconstrained_reverse_iterator& operator--() {
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr __unconstrained_reverse_iterator& operator--() {
     ++__iter_;
     return *this;
   }
 
-  _LIBCPP_HIDE_FROM_ABI constexpr __unconstrained_reverse_iterator operator--(int) {
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr __unconstrained_reverse_iterator operator--(int) {
     auto __tmp = *this;
     ++__iter_;
     return __tmp;
   }
 
-  _LIBCPP_HIDE_FROM_ABI constexpr __unconstrained_reverse_iterator& operator+=(
diff erence_type __n) {
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr __unconstrained_reverse_iterator& operator+=(
diff erence_type __n) {
     __iter_ -= __n;
     return *this;
   }
 
-  _LIBCPP_HIDE_FROM_ABI constexpr __unconstrained_reverse_iterator& operator-=(
diff erence_type __n) {
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr __unconstrained_reverse_iterator& operator-=(
diff erence_type __n) {
     __iter_ += __n;
     return *this;
   }
 
-  _LIBCPP_HIDE_FROM_ABI constexpr __unconstrained_reverse_iterator operator+(
diff erence_type __n) const {
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr __unconstrained_reverse_iterator operator+(
diff erence_type __n) const {
     return __unconstrained_reverse_iterator(__iter_ - __n);
   }
 
-  _LIBCPP_HIDE_FROM_ABI constexpr __unconstrained_reverse_iterator operator-(
diff erence_type __n) const {
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr __unconstrained_reverse_iterator operator-(
diff erence_type __n) const {
     return __unconstrained_reverse_iterator(__iter_ + __n);
   }
 
-  _LIBCPP_HIDE_FROM_ABI constexpr 
diff erence_type operator-(const __unconstrained_reverse_iterator& __other) const {
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr 
diff erence_type operator-(const __unconstrained_reverse_iterator& __other) const {
     return __other.__iter_ - __iter_;
   }
 
-  _LIBCPP_HIDE_FROM_ABI constexpr auto operator[](
diff erence_type __n) const { return *(*this + __n); }
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator[](
diff erence_type __n) const { return *(*this + __n); }
 
   // Deliberately unconstrained unlike the comparison functions in `reverse_iterator` -- see the class comment for the
   // rationale.
-  _LIBCPP_HIDE_FROM_ABI friend constexpr bool
+  _LIBCUDACXX_HIDE_FROM_ABI friend constexpr bool
   operator==(const __unconstrained_reverse_iterator& __lhs, const __unconstrained_reverse_iterator& __rhs) {
     return __lhs.base() == __rhs.base();
   }
 
-  _LIBCPP_HIDE_FROM_ABI friend constexpr bool
+  _LIBCUDACXX_HIDE_FROM_ABI friend constexpr bool
   operator!=(const __unconstrained_reverse_iterator& __lhs, const __unconstrained_reverse_iterator& __rhs) {
     return __lhs.base() != __rhs.base();
   }
 
-  _LIBCPP_HIDE_FROM_ABI friend constexpr bool
+  _LIBCUDACXX_HIDE_FROM_ABI friend constexpr bool
   operator<(const __unconstrained_reverse_iterator& __lhs, const __unconstrained_reverse_iterator& __rhs) {
     return __lhs.base() > __rhs.base();
   }
 
-  _LIBCPP_HIDE_FROM_ABI friend constexpr bool
+  _LIBCUDACXX_HIDE_FROM_ABI friend constexpr bool
   operator>(const __unconstrained_reverse_iterator& __lhs, const __unconstrained_reverse_iterator& __rhs) {
     return __lhs.base() < __rhs.base();
   }
 
-  _LIBCPP_HIDE_FROM_ABI friend constexpr bool
+  _LIBCUDACXX_HIDE_FROM_ABI friend constexpr bool
   operator<=(const __unconstrained_reverse_iterator& __lhs, const __unconstrained_reverse_iterator& __rhs) {
     return __lhs.base() >= __rhs.base();
   }
 
-  _LIBCPP_HIDE_FROM_ABI friend constexpr bool
+  _LIBCUDACXX_HIDE_FROM_ABI friend constexpr bool
   operator>=(const __unconstrained_reverse_iterator& __lhs, const __unconstrained_reverse_iterator& __rhs) {
     return __lhs.base() <= __rhs.base();
   }
@@ -481,27 +481,27 @@ class __unconstrained_reverse_iterator {
 template <class _Iter>
 struct __is_reverse_iterator<__unconstrained_reverse_iterator<_Iter>> : true_type {};
 
-#endif // _LIBCPP_STD_VER <= 17
+#endif // _LIBCUDACXX_STD_VER <= 17
 
 template <template <class> class _RevIter1, template <class> class _RevIter2, class _Iter>
 struct __unwrap_reverse_iter_impl {
   using _UnwrappedIter = decltype(__unwrap_iter_impl<_Iter>::__unwrap(std::declval<_Iter>()));
   using _ReverseWrapper = _RevIter1<_RevIter2<_Iter> >;
 
-  static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _ReverseWrapper
+  static _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR _ReverseWrapper
   __rewrap(_ReverseWrapper __orig_iter, _UnwrappedIter __unwrapped_iter) {
     return _ReverseWrapper(
         _RevIter2<_Iter>(__unwrap_iter_impl<_Iter>::__rewrap(__orig_iter.base().base(), __unwrapped_iter)));
   }
 
-  static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _UnwrappedIter __unwrap(_ReverseWrapper __i) _NOEXCEPT {
+  static _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR _UnwrappedIter __unwrap(_ReverseWrapper __i) _NOEXCEPT {
     return __unwrap_iter_impl<_Iter>::__unwrap(__i.base().base());
   }
 };
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 template <ranges::bidirectional_range _Range>
-_LIBCPP_HIDE_FROM_ABI constexpr ranges::
+_LIBCUDACXX_HIDE_FROM_ABI constexpr ranges::
     subrange<reverse_iterator<ranges::iterator_t<_Range>>, reverse_iterator<ranges::iterator_t<_Range>>>
     __reverse_range(_Range&& __range) {
   auto __first = ranges::begin(__range);
@@ -513,7 +513,7 @@ template <class _Iter, bool __b>
 struct __unwrap_iter_impl<reverse_iterator<reverse_iterator<_Iter> >, __b>
     : __unwrap_reverse_iter_impl<reverse_iterator, reverse_iterator, _Iter> {};
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 template <class _Iter, bool __b>
 struct __unwrap_iter_impl<reverse_iterator<__unconstrained_reverse_iterator<_Iter>>, __b>
@@ -527,8 +527,8 @@ template <class _Iter, bool __b>
 struct __unwrap_iter_impl<__unconstrained_reverse_iterator<__unconstrained_reverse_iterator<_Iter>>, __b>
     : __unwrap_reverse_iter_impl<__unconstrained_reverse_iterator, __unconstrained_reverse_iterator, _Iter> {};
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ITERATOR_REVERSE_ITERATOR_H
+#endif // _LIBCUDACXX___ITERATOR_REVERSE_ITERATOR_H

diff  --git a/libcxx/include/__iterator/size.h b/libcxx/include/__iterator/size.h
index e06013496668..f320785b68eb 100644
--- a/libcxx/include/__iterator/size.h
+++ b/libcxx/include/__iterator/size.h
@@ -7,35 +7,35 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ITERATOR_SIZE_H
-#define _LIBCPP___ITERATOR_SIZE_H
+#ifndef _LIBCUDACXX___ITERATOR_SIZE_H
+#define _LIBCUDACXX___ITERATOR_SIZE_H
 
 #include <__config>
 #include <cstddef>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 
 template <class _Cont>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 constexpr auto size(const _Cont& __c)
 _NOEXCEPT_(noexcept(__c.size()))
 -> decltype        (__c.size())
 { return            __c.size(); }
 
 template <class _Tp, size_t _Sz>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 constexpr size_t size(const _Tp (&)[_Sz]) noexcept { return _Sz; }
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 template <class _Cont>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 constexpr auto ssize(const _Cont& __c)
 _NOEXCEPT_(noexcept(static_cast<common_type_t<ptr
diff _t, make_signed_t<decltype(__c.size())>>>(__c.size())))
 ->                              common_type_t<ptr
diff _t, make_signed_t<decltype(__c.size())>>
@@ -43,16 +43,16 @@ _NOEXCEPT_(noexcept(static_cast<common_type_t<ptr
diff _t, make_signed_t<decltype(
 
 // GCC complains about the implicit conversion from ptr
diff _t to size_t in
 // the array bound.
-_LIBCPP_DIAGNOSTIC_PUSH
-_LIBCPP_GCC_DIAGNOSTIC_IGNORED("-Wsign-conversion")
+_LIBCUDACXX_DIAGNOSTIC_PUSH
+_LIBCUDACXX_GCC_DIAGNOSTIC_IGNORED("-Wsign-conversion")
 template <class _Tp, ptr
diff _t _Sz>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 constexpr ptr
diff _t ssize(const _Tp (&)[_Sz]) noexcept { return _Sz; }
-_LIBCPP_DIAGNOSTIC_POP
+_LIBCUDACXX_DIAGNOSTIC_POP
 #endif
 
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCUDACXX_STD_VER > 14
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ITERATOR_SIZE_H
+#endif // _LIBCUDACXX___ITERATOR_SIZE_H

diff  --git a/libcxx/include/__iterator/sortable.h b/libcxx/include/__iterator/sortable.h
index bcf934f87be0..404cf0d35788 100644
--- a/libcxx/include/__iterator/sortable.h
+++ b/libcxx/include/__iterator/sortable.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ITERATOR_SORTABLE_H
-#define _LIBCPP___ITERATOR_SORTABLE_H
+#ifndef _LIBCUDACXX___ITERATOR_SORTABLE_H
+#define _LIBCUDACXX___ITERATOR_SORTABLE_H
 
 #include <__config>
 #include <__functional/identity.h>
@@ -17,21 +17,21 @@
 #include <__iterator/permutable.h>
 #include <__iterator/projected.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 template <class _Iter, class _Comp = ranges::less, class _Proj = identity>
 concept sortable =
   permutable<_Iter> &&
   indirect_strict_weak_order<_Comp, projected<_Iter, _Proj>>;
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ITERATOR_SORTABLE_H
+#endif // _LIBCUDACXX___ITERATOR_SORTABLE_H

diff  --git a/libcxx/include/__iterator/unreachable_sentinel.h b/libcxx/include/__iterator/unreachable_sentinel.h
index d77cc99f02f7..b989dfc9b22a 100644
--- a/libcxx/include/__iterator/unreachable_sentinel.h
+++ b/libcxx/include/__iterator/unreachable_sentinel.h
@@ -7,23 +7,23 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ITERATOR_UNREACHABLE_SENTINEL_H
-#define _LIBCPP___ITERATOR_UNREACHABLE_SENTINEL_H
+#ifndef _LIBCUDACXX___ITERATOR_UNREACHABLE_SENTINEL_H
+#define _LIBCUDACXX___ITERATOR_UNREACHABLE_SENTINEL_H
 
 #include <__config>
 #include <__iterator/concepts.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 struct unreachable_sentinel_t {
   template<weakly_incrementable _Iter>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr bool operator==(unreachable_sentinel_t, const _Iter&) noexcept {
     return false;
   }
@@ -31,8 +31,8 @@ struct unreachable_sentinel_t {
 
 inline constexpr unreachable_sentinel_t unreachable_sentinel{};
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ITERATOR_UNREACHABLE_SENTINEL_H
+#endif // _LIBCUDACXX___ITERATOR_UNREACHABLE_SENTINEL_H

diff  --git a/libcxx/include/__iterator/wrap_iter.h b/libcxx/include/__iterator/wrap_iter.h
index f780048754c9..2fe525b4ae26 100644
--- a/libcxx/include/__iterator/wrap_iter.h
+++ b/libcxx/include/__iterator/wrap_iter.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___ITERATOR_WRAP_ITER_H
-#define _LIBCPP___ITERATOR_WRAP_ITER_H
+#ifndef _LIBCUDACXX___ITERATOR_WRAP_ITER_H
+#define _LIBCUDACXX___ITERATOR_WRAP_ITER_H
 
 #include <__config>
 #include <__debug>
@@ -17,11 +17,11 @@
 #include <__memory/pointer_traits.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Iter>
 class __wrap_iter
@@ -33,215 +33,215 @@ class __wrap_iter
     typedef typename iterator_traits<iterator_type>::pointer           pointer;
     typedef typename iterator_traits<iterator_type>::reference         reference;
     typedef typename iterator_traits<iterator_type>::iterator_category iterator_category;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
     typedef contiguous_iterator_tag                                    iterator_concept;
 #endif
 
 private:
     iterator_type __i;
 public:
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 __wrap_iter() _NOEXCEPT
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 __wrap_iter() _NOEXCEPT
                 : __i()
     {
-        _VSTD::__debug_db_insert_i(this);
+        _CUDA_VSTD::__debug_db_insert_i(this);
     }
-    template <class _Up> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
+    template <class _Up> _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
         __wrap_iter(const __wrap_iter<_Up>& __u,
             typename enable_if<is_convertible<_Up, iterator_type>::value>::type* = nullptr) _NOEXCEPT
             : __i(__u.base())
     {
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
-      if (!__libcpp_is_constant_evaluated())
-        __get_db()->__iterator_copy(this, _VSTD::addressof(__u));
+#ifdef _LIBCUDACXX_ENABLE_DEBUG_MODE
+      if (!__LIBCUDACXX_is_constant_evaluated())
+        __get_db()->__iterator_copy(this, _CUDA_VSTD::addressof(__u));
 #endif
     }
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
+#ifdef _LIBCUDACXX_ENABLE_DEBUG_MODE
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
     __wrap_iter(const __wrap_iter& __x)
         : __i(__x.base())
     {
-      if (!__libcpp_is_constant_evaluated())
-        __get_db()->__iterator_copy(this, _VSTD::addressof(__x));
+      if (!__LIBCUDACXX_is_constant_evaluated())
+        __get_db()->__iterator_copy(this, _CUDA_VSTD::addressof(__x));
     }
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
     __wrap_iter& operator=(const __wrap_iter& __x)
     {
-        if (this != _VSTD::addressof(__x))
+        if (this != _CUDA_VSTD::addressof(__x))
         {
-            if (!__libcpp_is_constant_evaluated())
-                __get_db()->__iterator_copy(this, _VSTD::addressof(__x));
+            if (!__LIBCUDACXX_is_constant_evaluated())
+                __get_db()->__iterator_copy(this, _CUDA_VSTD::addressof(__x));
             __i = __x.__i;
         }
         return *this;
     }
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     ~__wrap_iter()
     {
-      if (!__libcpp_is_constant_evaluated())
+      if (!__LIBCUDACXX_is_constant_evaluated())
         __get_db()->__erase_i(this);
     }
 #endif
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 reference operator*() const _NOEXCEPT
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 reference operator*() const _NOEXCEPT
     {
-        _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
+        _LIBCUDACXX_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
                              "Attempted to dereference a non-dereferenceable iterator");
         return *__i;
     }
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 pointer operator->() const _NOEXCEPT
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 pointer operator->() const _NOEXCEPT
     {
-        _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
+        _LIBCUDACXX_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
                              "Attempted to dereference a non-dereferenceable iterator");
-        return _VSTD::__to_address(__i);
+        return _CUDA_VSTD::__to_address(__i);
     }
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 __wrap_iter& operator++() _NOEXCEPT
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 __wrap_iter& operator++() _NOEXCEPT
     {
-        _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
+        _LIBCUDACXX_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
                              "Attempted to increment a non-incrementable iterator");
         ++__i;
         return *this;
     }
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 __wrap_iter  operator++(int) _NOEXCEPT
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 __wrap_iter  operator++(int) _NOEXCEPT
         {__wrap_iter __tmp(*this); ++(*this); return __tmp;}
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 __wrap_iter& operator--() _NOEXCEPT
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 __wrap_iter& operator--() _NOEXCEPT
     {
-        _LIBCPP_DEBUG_ASSERT(__get_const_db()->__decrementable(this),
+        _LIBCUDACXX_DEBUG_ASSERT(__get_const_db()->__decrementable(this),
                              "Attempted to decrement a non-decrementable iterator");
         --__i;
         return *this;
     }
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 __wrap_iter  operator--(int) _NOEXCEPT
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 __wrap_iter  operator--(int) _NOEXCEPT
         {__wrap_iter __tmp(*this); --(*this); return __tmp;}
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 __wrap_iter  operator+ (
diff erence_type __n) const _NOEXCEPT
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 __wrap_iter  operator+ (
diff erence_type __n) const _NOEXCEPT
         {__wrap_iter __w(*this); __w += __n; return __w;}
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 __wrap_iter& operator+=(
diff erence_type __n) _NOEXCEPT
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 __wrap_iter& operator+=(
diff erence_type __n) _NOEXCEPT
     {
-        _LIBCPP_DEBUG_ASSERT(__get_const_db()->__addable(this, __n),
+        _LIBCUDACXX_DEBUG_ASSERT(__get_const_db()->__addable(this, __n),
                              "Attempted to add/subtract an iterator outside its valid range");
         __i += __n;
         return *this;
     }
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 __wrap_iter  operator- (
diff erence_type __n) const _NOEXCEPT
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 __wrap_iter  operator- (
diff erence_type __n) const _NOEXCEPT
         {return *this + (-__n);}
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 __wrap_iter& operator-=(
diff erence_type __n) _NOEXCEPT
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 __wrap_iter& operator-=(
diff erence_type __n) _NOEXCEPT
         {*this += -__n; return *this;}
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 reference    operator[](
diff erence_type __n) const _NOEXCEPT
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 reference    operator[](
diff erence_type __n) const _NOEXCEPT
     {
-        _LIBCPP_DEBUG_ASSERT(__get_const_db()->__subscriptable(this, __n),
+        _LIBCUDACXX_DEBUG_ASSERT(__get_const_db()->__subscriptable(this, __n),
                              "Attempted to subscript an iterator outside its valid range");
         return __i[__n];
     }
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 iterator_type base() const _NOEXCEPT {return __i;}
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 iterator_type base() const _NOEXCEPT {return __i;}
 
 private:
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
     explicit __wrap_iter(const void* __p, iterator_type __x) _NOEXCEPT : __i(__x)
     {
         (void)__p;
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
-      if (!__libcpp_is_constant_evaluated())
+#ifdef _LIBCUDACXX_ENABLE_DEBUG_MODE
+      if (!__LIBCUDACXX_is_constant_evaluated())
         __get_db()->__insert_ic(this, __p);
 #endif
     }
 
     template <class _Up> friend class __wrap_iter;
     template <class _CharT, class _Traits, class _Alloc> friend class basic_string;
-    template <class _Tp, class _Alloc> friend class _LIBCPP_TEMPLATE_VIS vector;
-    template <class _Tp, size_t> friend class _LIBCPP_TEMPLATE_VIS span;
+    template <class _Tp, class _Alloc> friend class _LIBCUDACXX_TEMPLATE_VIS vector;
+    template <class _Tp, size_t> friend class _LIBCUDACXX_TEMPLATE_VIS span;
 };
 
 template <class _Iter1>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR
 bool operator==(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT
 {
     return __x.base() == __y.base();
 }
 
 template <class _Iter1, class _Iter2>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR
 bool operator==(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
 {
     return __x.base() == __y.base();
 }
 
 template <class _Iter1>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 bool operator<(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT
 {
-    _LIBCPP_DEBUG_ASSERT(__get_const_db()->__less_than_comparable(_VSTD::addressof(__x), _VSTD::addressof(__y)),
+    _LIBCUDACXX_DEBUG_ASSERT(__get_const_db()->__less_than_comparable(_CUDA_VSTD::addressof(__x), _CUDA_VSTD::addressof(__y)),
                          "Attempted to compare incomparable iterators");
     return __x.base() < __y.base();
 }
 
 template <class _Iter1, class _Iter2>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 bool operator<(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
 {
-    _LIBCPP_DEBUG_ASSERT(__get_const_db()->__less_than_comparable(&__x, &__y),
+    _LIBCUDACXX_DEBUG_ASSERT(__get_const_db()->__less_than_comparable(&__x, &__y),
                          "Attempted to compare incomparable iterators");
     return __x.base() < __y.base();
 }
 
 template <class _Iter1>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR
 bool operator!=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT
 {
     return !(__x == __y);
 }
 
 template <class _Iter1, class _Iter2>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR
 bool operator!=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
 {
     return !(__x == __y);
 }
 
 template <class _Iter1>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR
 bool operator>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT
 {
     return __y < __x;
 }
 
 template <class _Iter1, class _Iter2>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR
 bool operator>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
 {
     return __y < __x;
 }
 
 template <class _Iter1>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR
 bool operator>=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT
 {
     return !(__x < __y);
 }
 
 template <class _Iter1, class _Iter2>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR
 bool operator>=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
 {
     return !(__x < __y);
 }
 
 template <class _Iter1>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR
 bool operator<=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT
 {
     return !(__y < __x);
 }
 
 template <class _Iter1, class _Iter2>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR
 bool operator<=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
 {
     return !(__y < __x);
 }
 
 template <class _Iter1, class _Iter2>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
-#ifndef _LIBCPP_CXX03_LANG
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
+#ifndef _LIBCUDACXX_CXX03_LANG
 auto operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
     -> decltype(__x.base() - __y.base())
 #else
@@ -249,37 +249,37 @@ typename __wrap_iter<_Iter1>::
diff erence_type
 operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
 #endif // C++03
 {
-    _LIBCPP_DEBUG_ASSERT(__get_const_db()->__less_than_comparable(_VSTD::addressof(__x), _VSTD::addressof(__y)),
+    _LIBCUDACXX_DEBUG_ASSERT(__get_const_db()->__less_than_comparable(_CUDA_VSTD::addressof(__x), _CUDA_VSTD::addressof(__y)),
                          "Attempted to subtract incompatible iterators");
     return __x.base() - __y.base();
 }
 
 template <class _Iter1>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 __wrap_iter<_Iter1> operator+(typename __wrap_iter<_Iter1>::
diff erence_type __n, __wrap_iter<_Iter1> __x) _NOEXCEPT
 {
     __x += __n;
     return __x;
 }
 
-#if _LIBCPP_STD_VER <= 17
+#if _LIBCUDACXX_STD_VER <= 17
 template <class _It>
 struct __is_cpp17_contiguous_iterator<__wrap_iter<_It> > : true_type {};
 #endif
 
 template <class _It>
-struct _LIBCPP_TEMPLATE_VIS pointer_traits<__wrap_iter<_It> >
+struct _LIBCUDACXX_TEMPLATE_VIS pointer_traits<__wrap_iter<_It> >
 {
     typedef __wrap_iter<_It> pointer;
     typedef typename pointer_traits<_It>::element_type element_type;
     typedef typename pointer_traits<_It>::
diff erence_type 
diff erence_type;
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR
     static element_type *to_address(pointer __w) _NOEXCEPT {
-        return _VSTD::__to_address(__w.base());
+        return _CUDA_VSTD::__to_address(__w.base());
     }
 };
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___ITERATOR_WRAP_ITER_H
+#endif // _LIBCUDACXX___ITERATOR_WRAP_ITER_H

diff  --git a/libcxx/include/__locale b/libcxx/include/__locale
index 40f9a3ff57c2..e73c30ab1173 100644
--- a/libcxx/include/__locale
+++ b/libcxx/include/__locale
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___LOCALE
-#define _LIBCPP___LOCALE
+#ifndef _LIBCUDACXX___LOCALE
+#define _LIBCUDACXX___LOCALE
 
 #include <__availability>
 #include <__config>
@@ -19,7 +19,7 @@
 #include <mutex>
 #include <string>
 
-#if defined(_LIBCPP_MSVCRT_LIKE)
+#if defined(_LIBCUDACXX_MSVCRT_LIKE)
 # include <__support/win32/locale_win32.h>
 # include <cstring>
 #elif defined(_AIX) || defined(__MVS__)
@@ -40,35 +40,35 @@
 #elif defined(__wasi__)
 // WASI libc uses musl's locales support.
 # include <__support/musl/xlocale.h>
-#elif defined(_LIBCPP_HAS_MUSL_LIBC)
+#elif defined(_LIBCUDACXX_HAS_MUSL_LIBC)
 # include <__support/musl/xlocale.h>
 #endif
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if !defined(_LIBCPP_LOCALE__L_EXTENSIONS)
-struct __libcpp_locale_guard {
-  _LIBCPP_INLINE_VISIBILITY
-  __libcpp_locale_guard(locale_t& __loc) : __old_loc_(uselocale(__loc)) {}
+#if !defined(_LIBCUDACXX_LOCALE__L_EXTENSIONS)
+struct __LIBCUDACXX_locale_guard {
+  _LIBCUDACXX_INLINE_VISIBILITY
+  __LIBCUDACXX_locale_guard(locale_t& __loc) : __old_loc_(uselocale(__loc)) {}
 
-  _LIBCPP_INLINE_VISIBILITY
-  ~__libcpp_locale_guard() {
+  _LIBCUDACXX_INLINE_VISIBILITY
+  ~__LIBCUDACXX_locale_guard() {
     if (__old_loc_)
       uselocale(__old_loc_);
   }
 
   locale_t __old_loc_;
 private:
-  __libcpp_locale_guard(__libcpp_locale_guard const&);
-  __libcpp_locale_guard& operator=(__libcpp_locale_guard const&);
+  __LIBCUDACXX_locale_guard(__LIBCUDACXX_locale_guard const&);
+  __LIBCUDACXX_locale_guard& operator=(__LIBCUDACXX_locale_guard const&);
 };
-#elif defined(_LIBCPP_MSVCRT_LIKE)
-struct __libcpp_locale_guard {
-    __libcpp_locale_guard(locale_t __l) :
+#elif defined(_LIBCUDACXX_MSVCRT_LIKE)
+struct __LIBCUDACXX_locale_guard {
+    __LIBCUDACXX_locale_guard(locale_t __l) :
         __status(_configthreadlocale(_ENABLE_PER_THREAD_LOCALE)) {
       // Setting the locale can be expensive even when the locale given is
       // already the current locale, so do an explicit check to see if the
@@ -78,14 +78,14 @@ struct __libcpp_locale_guard {
       // locale name, otherwise it will be a semicolon-separated string listing
       // each category.  In the second case, we know at least one category won't
       // be what we want, so we only have to check the first case.
-      if (_VSTD::strcmp(__l.__get_locale(), __lc) != 0) {
+      if (_CUDA_VSTD::strcmp(__l.__get_locale(), __lc) != 0) {
         __locale_all = _strdup(__lc);
         if (__locale_all == nullptr)
           __throw_bad_alloc();
         __setlocale(__l.__get_locale());
       }
     }
-    ~__libcpp_locale_guard() {
+    ~__LIBCUDACXX_locale_guard() {
       // The CRT documentation doesn't explicitly say, but setlocale() does the
       // right thing when given a semicolon-separated list of locale settings
       // for the 
diff erent categories in the same format as returned by
@@ -107,27 +107,27 @@ struct __libcpp_locale_guard {
 };
 #endif
 
-class _LIBCPP_TYPE_VIS locale;
+class _LIBCUDACXX_TYPE_VIS locale;
 
 template <class _Facet>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 bool
 has_facet(const locale&) _NOEXCEPT;
 
 template <class _Facet>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 const _Facet&
 use_facet(const locale&);
 
-class _LIBCPP_TYPE_VIS locale
+class _LIBCUDACXX_TYPE_VIS locale
 {
 public:
     // types:
-    class _LIBCPP_TYPE_VIS facet;
-    class _LIBCPP_TYPE_VIS id;
+    class _LIBCUDACXX_TYPE_VIS facet;
+    class _LIBCUDACXX_TYPE_VIS id;
 
     typedef int category;
-    _LIBCPP_AVAILABILITY_LOCALE_CATEGORY
+    _LIBCUDACXX_AVAILABILITY_LOCALE_CATEGORY
     static const category // values assigned here are for exposition only
         none     = 0,
         collate  = LC_COLLATE_MASK,
@@ -146,7 +146,7 @@ public:
     locale(const locale&, const char*, category);
     locale(const locale&, const string&, category);
     template <class _Facet>
-        _LIBCPP_INLINE_VISIBILITY locale(const locale&, _Facet*);
+        _LIBCUDACXX_INLINE_VISIBILITY locale(const locale&, _Facet*);
     locale(const locale&, const locale&, category);
 
     ~locale();
@@ -154,7 +154,7 @@ public:
     const locale& operator=(const locale&)  _NOEXCEPT;
 
     template <class _Facet>
-      _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
+      _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
       locale combine(const locale&) const;
 
     // locale operations:
@@ -162,7 +162,7 @@ public:
     bool operator==(const locale&) const;
     bool operator!=(const locale& __y) const {return !(*this == __y);}
     template <class _CharT, class _Traits, class _Allocator>
-      _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
+      _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
       bool operator()(const basic_string<_CharT, _Traits, _Allocator>&,
                       const basic_string<_CharT, _Traits, _Allocator>&) const;
 
@@ -183,11 +183,11 @@ private:
     template <class _Facet> friend const _Facet& use_facet(const locale&);
 };
 
-class _LIBCPP_TYPE_VIS locale::facet
+class _LIBCUDACXX_TYPE_VIS locale::facet
     : public __shared_count
 {
 protected:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit facet(size_t __refs = 0)
         : __shared_count(static_cast<long>(__refs)-1) {}
 
@@ -199,14 +199,14 @@ private:
     virtual void __on_zero_shared() _NOEXCEPT;
 };
 
-class _LIBCPP_TYPE_VIS locale::id
+class _LIBCUDACXX_TYPE_VIS locale::id
 {
     once_flag      __flag_;
     int32_t        __id_;
 
     static int32_t __next_id;
 public:
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR id() :__id_(0) {}
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR id() :__id_(0) {}
     void operator=(const id&) = delete;
     id(const id&) = delete;
 
@@ -220,7 +220,7 @@ public:  // only needed for tests
 };
 
 template <class _Facet>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 locale::locale(const locale& __other, _Facet* __f)
 {
     __install_ctor(__other, __f, __f ? __f->id.__get() : 0);
@@ -230,14 +230,14 @@ template <class _Facet>
 locale
 locale::combine(const locale& __other) const
 {
-    if (!_VSTD::has_facet<_Facet>(__other))
+    if (!_CUDA_VSTD::has_facet<_Facet>(__other))
         __throw_runtime_error("locale::combine: locale missing facet");
 
-    return locale(*this, &const_cast<_Facet&>(_VSTD::use_facet<_Facet>(__other)));
+    return locale(*this, &const_cast<_Facet&>(_CUDA_VSTD::use_facet<_Facet>(__other)));
 }
 
 template <class _Facet>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 has_facet(const locale& __l)  _NOEXCEPT
 {
@@ -245,7 +245,7 @@ has_facet(const locale& __l)  _NOEXCEPT
 }
 
 template <class _Facet>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 const _Facet&
 use_facet(const locale& __l)
 {
@@ -255,34 +255,34 @@ use_facet(const locale& __l)
 // template <class _CharT> class collate;
 
 template <class _CharT>
-class _LIBCPP_TEMPLATE_VIS collate
+class _LIBCUDACXX_TEMPLATE_VIS collate
     : public locale::facet
 {
 public:
     typedef _CharT char_type;
     typedef basic_string<char_type> string_type;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit collate(size_t __refs = 0)
         : locale::facet(__refs) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     int compare(const char_type* __lo1, const char_type* __hi1,
                 const char_type* __lo2, const char_type* __hi2) const
     {
         return do_compare(__lo1, __hi1, __lo2, __hi2);
     }
 
-    // FIXME(EricWF): The _LIBCPP_ALWAYS_INLINE is needed on Windows to work
+    // FIXME(EricWF): The _LIBCUDACXX_ALWAYS_INLINE is needed on Windows to work
     // around a dllimport bug that expects an external instantiation.
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_ALWAYS_INLINE
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_ALWAYS_INLINE
     string_type transform(const char_type* __lo, const char_type* __hi) const
     {
         return do_transform(__lo, __hi);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     long hash(const char_type* __lo, const char_type* __hi) const
     {
         return do_hash(__lo, __hi);
@@ -337,17 +337,17 @@ collate<_CharT>::do_hash(const char_type* __lo, const char_type* __hi) const
     return static_cast<long>(__h);
 }
 
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS collate<char>;
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS collate<wchar_t>;
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS collate<char>;
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS collate<wchar_t>;
 #endif
 
 // template <class CharT> class collate_byname;
 
-template <class _CharT> class _LIBCPP_TEMPLATE_VIS collate_byname;
+template <class _CharT> class _LIBCUDACXX_TEMPLATE_VIS collate_byname;
 
 template <>
-class _LIBCPP_TYPE_VIS collate_byname<char>
+class _LIBCUDACXX_TYPE_VIS collate_byname<char>
     : public collate<char>
 {
     locale_t __l;
@@ -365,9 +365,9 @@ protected:
     virtual string_type do_transform(const char_type* __lo, const char_type* __hi) const;
 };
 
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 template <>
-class _LIBCPP_TYPE_VIS collate_byname<wchar_t>
+class _LIBCUDACXX_TYPE_VIS collate_byname<wchar_t>
     : public collate<wchar_t>
 {
     locale_t __l;
@@ -392,17 +392,17 @@ bool
 locale::operator()(const basic_string<_CharT, _Traits, _Allocator>& __x,
                    const basic_string<_CharT, _Traits, _Allocator>& __y) const
 {
-    return _VSTD::use_facet<_VSTD::collate<_CharT> >(*this).compare(
+    return _CUDA_VSTD::use_facet<_CUDA_VSTD::collate<_CharT> >(*this).compare(
                                        __x.data(), __x.data() + __x.size(),
                                        __y.data(), __y.data() + __y.size()) < 0;
 }
 
 // template <class charT> class ctype
 
-class _LIBCPP_TYPE_VIS ctype_base
+class _LIBCUDACXX_TYPE_VIS ctype_base
 {
 public:
-#if defined(_LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE)
+#if defined(_LIBCUDACXX_PROVIDES_DEFAULT_RUNE_TABLE)
     typedef unsigned long mask;
     static const mask space  = 1<<0;
     static const mask print  = 1<<1;
@@ -438,7 +438,7 @@ public:
 #else
     static const mask __regex_word = 0x80;
 #endif
-#elif defined(_LIBCPP_MSVCRT_LIKE)
+#elif defined(_LIBCUDACXX_MSVCRT_LIKE)
     typedef unsigned short mask;
     static const mask space  = _SPACE;
     static const mask print  = _BLANK|_PUNCT|_ALPHA|_DIGIT;
@@ -451,8 +451,8 @@ public:
     static const mask xdigit = _HEX;
     static const mask blank  = _BLANK;
     static const mask __regex_word = 0x4000; // 0x8000 and 0x0100 and 0x00ff are used
-# define _LIBCPP_CTYPE_MASK_IS_COMPOSITE_PRINT
-# define _LIBCPP_CTYPE_MASK_IS_COMPOSITE_ALPHA
+# define _LIBCUDACXX_CTYPE_MASK_IS_COMPOSITE_PRINT
+# define _LIBCUDACXX_CTYPE_MASK_IS_COMPOSITE_ALPHA
 #elif defined(__APPLE__) || defined(__FreeBSD__) || defined(__EMSCRIPTEN__) || defined(__NetBSD__)
 # ifdef __APPLE__
     typedef __uint32_t mask;
@@ -511,9 +511,9 @@ public:
     static const mask xdigit = _X | _N;
     static const mask blank  = _B;
     static const mask __regex_word = 0x80;
-# define _LIBCPP_CTYPE_MASK_IS_COMPOSITE_PRINT
-# define _LIBCPP_CTYPE_MASK_IS_COMPOSITE_ALPHA
-# define _LIBCPP_CTYPE_MASK_IS_COMPOSITE_XDIGIT
+# define _LIBCUDACXX_CTYPE_MASK_IS_COMPOSITE_PRINT
+# define _LIBCUDACXX_CTYPE_MASK_IS_COMPOSITE_ALPHA
+# define _LIBCUDACXX_CTYPE_MASK_IS_COMPOSITE_XDIGIT
 #elif defined(__MVS__)
 # if defined(__NATIVE_ASCII_F)
     typedef unsigned int mask;
@@ -542,99 +542,99 @@ public:
 # endif
     static const mask __regex_word = 0x8000;
 #else
-# error unknown rune table for this platform -- do you mean to define _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE?
+# error unknown rune table for this platform -- do you mean to define _LIBCUDACXX_PROVIDES_DEFAULT_RUNE_TABLE?
 #endif
     static const mask alnum  = alpha | digit;
     static const mask graph  = alnum | punct;
 
-    _LIBCPP_INLINE_VISIBILITY ctype_base() {}
+    _LIBCUDACXX_INLINE_VISIBILITY ctype_base() {}
 
     static_assert((__regex_word & ~(space | print | cntrl | upper | lower | alpha | digit | punct | xdigit | blank)) == __regex_word,
                   "__regex_word can't overlap other bits");
 };
 
-template <class _CharT> class _LIBCPP_TEMPLATE_VIS ctype;
+template <class _CharT> class _LIBCUDACXX_TEMPLATE_VIS ctype;
 
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 template <>
-class _LIBCPP_TYPE_VIS ctype<wchar_t>
+class _LIBCUDACXX_TYPE_VIS ctype<wchar_t>
     : public locale::facet,
       public ctype_base
 {
 public:
     typedef wchar_t char_type;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit ctype(size_t __refs = 0)
         : locale::facet(__refs) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool is(mask __m, char_type __c) const
     {
         return do_is(__m, __c);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const char_type* is(const char_type* __low, const char_type* __high, mask* __vec) const
     {
         return do_is(__low, __high, __vec);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const char_type* scan_is(mask __m, const char_type* __low, const char_type* __high) const
     {
         return do_scan_is(__m, __low, __high);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const char_type* scan_not(mask __m, const char_type* __low, const char_type* __high) const
     {
         return do_scan_not(__m, __low, __high);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     char_type toupper(char_type __c) const
     {
         return do_toupper(__c);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const char_type* toupper(char_type* __low, const char_type* __high) const
     {
         return do_toupper(__low, __high);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     char_type tolower(char_type __c) const
     {
         return do_tolower(__c);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const char_type* tolower(char_type* __low, const char_type* __high) const
     {
         return do_tolower(__low, __high);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     char_type widen(char __c) const
     {
         return do_widen(__c);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const char* widen(const char* __low, const char* __high, char_type* __to) const
     {
         return do_widen(__low, __high, __to);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     char narrow(char_type __c, char __dfault) const
     {
         return do_narrow(__c, __dfault);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const char_type* narrow(const char_type* __low, const char_type* __high, char __dfault, char* __to) const
     {
         return do_narrow(__low, __high, __dfault, __to);
@@ -657,10 +657,10 @@ protected:
     virtual char do_narrow(char_type, char __dfault) const;
     virtual const char_type* do_narrow(const char_type* __low, const char_type* __high, char __dfault, char* __dest) const;
 };
-#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#endif // _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 
 template <>
-class _LIBCPP_TYPE_VIS ctype<char>
+class _LIBCUDACXX_TYPE_VIS ctype<char>
     : public locale::facet, public ctype_base
 {
     const mask* __tab_;
@@ -670,13 +670,13 @@ public:
 
     explicit ctype(const mask* __tab = nullptr, bool __del = false, size_t __refs = 0);
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool is(mask __m, char_type __c) const
     {
         return isascii(__c) ? (__tab_[static_cast<int>(__c)] & __m) !=0 : false;
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const char_type* is(const char_type* __low, const char_type* __high, mask* __vec) const
     {
         for (; __low != __high; ++__low, ++__vec)
@@ -684,7 +684,7 @@ public:
         return __low;
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const char_type* scan_is (mask __m, const char_type* __low, const char_type* __high) const
     {
         for (; __low != __high; ++__low)
@@ -693,7 +693,7 @@ public:
         return __low;
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const char_type* scan_not(mask __m, const char_type* __low, const char_type* __high) const
     {
         for (; __low != __high; ++__low)
@@ -702,49 +702,49 @@ public:
         return __low;
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     char_type toupper(char_type __c) const
     {
         return do_toupper(__c);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const char_type* toupper(char_type* __low, const char_type* __high) const
     {
         return do_toupper(__low, __high);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     char_type tolower(char_type __c) const
     {
         return do_tolower(__c);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const char_type* tolower(char_type* __low, const char_type* __high) const
     {
         return do_tolower(__low, __high);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     char_type widen(char __c) const
     {
         return do_widen(__c);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const char* widen(const char* __low, const char* __high, char_type* __to) const
     {
         return do_widen(__low, __high, __to);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     char narrow(char_type __c, char __dfault) const
     {
         return do_narrow(__c, __dfault);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const char* narrow(const char_type* __low, const char_type* __high, char __dfault, char* __to) const
     {
         return do_narrow(__low, __high, __dfault, __to);
@@ -757,7 +757,7 @@ public:
 #else
     static const size_t table_size = 256;  // FIXME: Don't hardcode this.
 #endif
-    _LIBCPP_INLINE_VISIBILITY const mask* table() const  _NOEXCEPT {return __tab_;}
+    _LIBCUDACXX_INLINE_VISIBILITY const mask* table() const  _NOEXCEPT {return __tab_;}
     static const mask* classic_table()  _NOEXCEPT;
 #if defined(__GLIBC__) || defined(__EMSCRIPTEN__)
     static const int* __classic_upper_table() _NOEXCEPT;
@@ -786,10 +786,10 @@ protected:
 
 // template <class CharT> class ctype_byname;
 
-template <class _CharT> class _LIBCPP_TEMPLATE_VIS ctype_byname;
+template <class _CharT> class _LIBCUDACXX_TEMPLATE_VIS ctype_byname;
 
 template <>
-class _LIBCPP_TYPE_VIS ctype_byname<char>
+class _LIBCUDACXX_TYPE_VIS ctype_byname<char>
     : public ctype<char>
 {
     locale_t __l;
@@ -806,9 +806,9 @@ protected:
     virtual const char_type* do_tolower(char_type* __low, const char_type* __high) const;
 };
 
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 template <>
-class _LIBCPP_TYPE_VIS ctype_byname<wchar_t>
+class _LIBCUDACXX_TYPE_VIS ctype_byname<wchar_t>
     : public ctype<wchar_t>
 {
     locale_t __l;
@@ -832,10 +832,10 @@ protected:
     virtual char do_narrow(char_type, char __dfault) const;
     virtual const char_type* do_narrow(const char_type* __low, const char_type* __high, char __dfault, char* __dest) const;
 };
-#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#endif // _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 
 template <class _CharT>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 isspace(_CharT __c, const locale& __loc)
 {
@@ -843,7 +843,7 @@ isspace(_CharT __c, const locale& __loc)
 }
 
 template <class _CharT>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 isprint(_CharT __c, const locale& __loc)
 {
@@ -851,7 +851,7 @@ isprint(_CharT __c, const locale& __loc)
 }
 
 template <class _CharT>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 iscntrl(_CharT __c, const locale& __loc)
 {
@@ -859,7 +859,7 @@ iscntrl(_CharT __c, const locale& __loc)
 }
 
 template <class _CharT>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 isupper(_CharT __c, const locale& __loc)
 {
@@ -867,7 +867,7 @@ isupper(_CharT __c, const locale& __loc)
 }
 
 template <class _CharT>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 islower(_CharT __c, const locale& __loc)
 {
@@ -875,7 +875,7 @@ islower(_CharT __c, const locale& __loc)
 }
 
 template <class _CharT>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 isalpha(_CharT __c, const locale& __loc)
 {
@@ -883,7 +883,7 @@ isalpha(_CharT __c, const locale& __loc)
 }
 
 template <class _CharT>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 isdigit(_CharT __c, const locale& __loc)
 {
@@ -891,7 +891,7 @@ isdigit(_CharT __c, const locale& __loc)
 }
 
 template <class _CharT>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 ispunct(_CharT __c, const locale& __loc)
 {
@@ -899,7 +899,7 @@ ispunct(_CharT __c, const locale& __loc)
 }
 
 template <class _CharT>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 isxdigit(_CharT __c, const locale& __loc)
 {
@@ -907,7 +907,7 @@ isxdigit(_CharT __c, const locale& __loc)
 }
 
 template <class _CharT>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 isalnum(_CharT __c, const locale& __loc)
 {
@@ -915,7 +915,7 @@ isalnum(_CharT __c, const locale& __loc)
 }
 
 template <class _CharT>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 isgraph(_CharT __c, const locale& __loc)
 {
@@ -923,7 +923,7 @@ isgraph(_CharT __c, const locale& __loc)
 }
 
 template <class _CharT>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 _CharT
 toupper(_CharT __c, const locale& __loc)
 {
@@ -931,7 +931,7 @@ toupper(_CharT __c, const locale& __loc)
 }
 
 template <class _CharT>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 _CharT
 tolower(_CharT __c, const locale& __loc)
 {
@@ -940,21 +940,21 @@ tolower(_CharT __c, const locale& __loc)
 
 // codecvt_base
 
-class _LIBCPP_TYPE_VIS codecvt_base
+class _LIBCUDACXX_TYPE_VIS codecvt_base
 {
 public:
-    _LIBCPP_INLINE_VISIBILITY codecvt_base() {}
+    _LIBCUDACXX_INLINE_VISIBILITY codecvt_base() {}
     enum result {ok, partial, error, noconv};
 };
 
 // template <class internT, class externT, class stateT> class codecvt;
 
-template <class _InternT, class _ExternT, class _StateT> class _LIBCPP_TEMPLATE_VIS codecvt;
+template <class _InternT, class _ExternT, class _StateT> class _LIBCUDACXX_TEMPLATE_VIS codecvt;
 
 // template <> class codecvt<char, char, mbstate_t>
 
 template <>
-class _LIBCPP_TYPE_VIS codecvt<char, char, mbstate_t>
+class _LIBCUDACXX_TYPE_VIS codecvt<char, char, mbstate_t>
     : public locale::facet,
       public codecvt_base
 {
@@ -963,11 +963,11 @@ public:
     typedef char      extern_type;
     typedef mbstate_t state_type;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit codecvt(size_t __refs = 0)
         : locale::facet(__refs) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result out(state_type& __st,
                const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
                extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const
@@ -975,14 +975,14 @@ public:
         return do_out(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result unshift(state_type& __st,
                    extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const
     {
         return do_unshift(__st, __to, __to_end, __to_nxt);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result in(state_type& __st,
               const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt,
               intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const
@@ -990,25 +990,25 @@ public:
         return do_in(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     int encoding() const  _NOEXCEPT
     {
         return do_encoding();
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool always_noconv() const  _NOEXCEPT
     {
         return do_always_noconv();
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     int length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const
     {
         return do_length(__st, __frm, __end, __mx);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     int max_length() const  _NOEXCEPT
     {
         return do_max_length();
@@ -1017,7 +1017,7 @@ public:
     static locale::id id;
 
 protected:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit codecvt(const char*, size_t __refs = 0)
         : locale::facet(__refs) {}
 
@@ -1039,9 +1039,9 @@ protected:
 
 // template <> class codecvt<wchar_t, char, mbstate_t>
 
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 template <>
-class _LIBCPP_TYPE_VIS codecvt<wchar_t, char, mbstate_t>
+class _LIBCUDACXX_TYPE_VIS codecvt<wchar_t, char, mbstate_t>
     : public locale::facet,
       public codecvt_base
 {
@@ -1053,7 +1053,7 @@ public:
 
     explicit codecvt(size_t __refs = 0);
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result out(state_type& __st,
                const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
                extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const
@@ -1061,14 +1061,14 @@ public:
         return do_out(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result unshift(state_type& __st,
                    extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const
     {
         return do_unshift(__st, __to, __to_end, __to_nxt);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result in(state_type& __st,
               const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt,
               intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const
@@ -1076,25 +1076,25 @@ public:
         return do_in(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     int encoding() const  _NOEXCEPT
     {
         return do_encoding();
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool always_noconv() const  _NOEXCEPT
     {
         return do_always_noconv();
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     int length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const
     {
         return do_length(__st, __frm, __end, __mx);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     int max_length() const  _NOEXCEPT
     {
         return do_max_length();
@@ -1120,12 +1120,12 @@ protected:
     virtual int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const;
     virtual int do_max_length() const  _NOEXCEPT;
 };
-#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#endif // _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 
 // template <> class codecvt<char16_t, char, mbstate_t> // deprecated in C++20
 
 template <>
-class _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_TYPE_VIS codecvt<char16_t, char, mbstate_t>
+class _LIBCUDACXX_DEPRECATED_IN_CXX20 _LIBCUDACXX_TYPE_VIS codecvt<char16_t, char, mbstate_t>
     : public locale::facet,
       public codecvt_base
 {
@@ -1134,11 +1134,11 @@ public:
     typedef char      extern_type;
     typedef mbstate_t state_type;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit codecvt(size_t __refs = 0)
         : locale::facet(__refs) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result out(state_type& __st,
                const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
                extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const
@@ -1146,14 +1146,14 @@ public:
         return do_out(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result unshift(state_type& __st,
                    extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const
     {
         return do_unshift(__st, __to, __to_end, __to_nxt);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result in(state_type& __st,
               const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt,
               intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const
@@ -1161,25 +1161,25 @@ public:
         return do_in(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     int encoding() const  _NOEXCEPT
     {
         return do_encoding();
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool always_noconv() const  _NOEXCEPT
     {
         return do_always_noconv();
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     int length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const
     {
         return do_length(__st, __frm, __end, __mx);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     int max_length() const  _NOEXCEPT
     {
         return do_max_length();
@@ -1188,7 +1188,7 @@ public:
     static locale::id id;
 
 protected:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit codecvt(const char*, size_t __refs = 0)
         : locale::facet(__refs) {}
 
@@ -1208,12 +1208,12 @@ protected:
     virtual int do_max_length() const  _NOEXCEPT;
 };
 
-#ifndef _LIBCPP_HAS_NO_CHAR8_T
+#ifndef _LIBCUDACXX_HAS_NO_CHAR8_T
 
 // template <> class codecvt<char16_t, char8_t, mbstate_t> // C++20
 
 template <>
-class _LIBCPP_TYPE_VIS codecvt<char16_t, char8_t, mbstate_t>
+class _LIBCUDACXX_TYPE_VIS codecvt<char16_t, char8_t, mbstate_t>
     : public locale::facet,
       public codecvt_base
 {
@@ -1222,11 +1222,11 @@ public:
     typedef char8_t   extern_type;
     typedef mbstate_t state_type;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit codecvt(size_t __refs = 0)
         : locale::facet(__refs) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result out(state_type& __st,
                const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
                extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const
@@ -1234,14 +1234,14 @@ public:
         return do_out(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result unshift(state_type& __st,
                    extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const
     {
         return do_unshift(__st, __to, __to_end, __to_nxt);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result in(state_type& __st,
               const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt,
               intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const
@@ -1249,25 +1249,25 @@ public:
         return do_in(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     int encoding() const  _NOEXCEPT
     {
         return do_encoding();
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool always_noconv() const  _NOEXCEPT
     {
         return do_always_noconv();
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     int length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const
     {
         return do_length(__st, __frm, __end, __mx);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     int max_length() const  _NOEXCEPT
     {
         return do_max_length();
@@ -1276,7 +1276,7 @@ public:
     static locale::id id;
 
 protected:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit codecvt(const char*, size_t __refs = 0)
         : locale::facet(__refs) {}
 
@@ -1301,7 +1301,7 @@ protected:
 // template <> class codecvt<char32_t, char, mbstate_t> // deprecated in C++20
 
 template <>
-class _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_TYPE_VIS codecvt<char32_t, char, mbstate_t>
+class _LIBCUDACXX_DEPRECATED_IN_CXX20 _LIBCUDACXX_TYPE_VIS codecvt<char32_t, char, mbstate_t>
     : public locale::facet,
       public codecvt_base
 {
@@ -1310,11 +1310,11 @@ public:
     typedef char      extern_type;
     typedef mbstate_t state_type;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit codecvt(size_t __refs = 0)
         : locale::facet(__refs) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result out(state_type& __st,
                const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
                extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const
@@ -1322,14 +1322,14 @@ public:
         return do_out(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result unshift(state_type& __st,
                    extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const
     {
         return do_unshift(__st, __to, __to_end, __to_nxt);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result in(state_type& __st,
               const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt,
               intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const
@@ -1337,25 +1337,25 @@ public:
         return do_in(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     int encoding() const  _NOEXCEPT
     {
         return do_encoding();
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool always_noconv() const  _NOEXCEPT
     {
         return do_always_noconv();
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     int length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const
     {
         return do_length(__st, __frm, __end, __mx);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     int max_length() const  _NOEXCEPT
     {
         return do_max_length();
@@ -1364,7 +1364,7 @@ public:
     static locale::id id;
 
 protected:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit codecvt(const char*, size_t __refs = 0)
         : locale::facet(__refs) {}
 
@@ -1384,12 +1384,12 @@ protected:
     virtual int do_max_length() const  _NOEXCEPT;
 };
 
-#ifndef _LIBCPP_HAS_NO_CHAR8_T
+#ifndef _LIBCUDACXX_HAS_NO_CHAR8_T
 
 // template <> class codecvt<char32_t, char8_t, mbstate_t> // C++20
 
 template <>
-class _LIBCPP_TYPE_VIS codecvt<char32_t, char8_t, mbstate_t>
+class _LIBCUDACXX_TYPE_VIS codecvt<char32_t, char8_t, mbstate_t>
     : public locale::facet,
       public codecvt_base
 {
@@ -1398,11 +1398,11 @@ public:
     typedef char8_t   extern_type;
     typedef mbstate_t state_type;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit codecvt(size_t __refs = 0)
         : locale::facet(__refs) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result out(state_type& __st,
                const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
                extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const
@@ -1410,14 +1410,14 @@ public:
         return do_out(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result unshift(state_type& __st,
                    extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const
     {
         return do_unshift(__st, __to, __to_end, __to_nxt);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result in(state_type& __st,
               const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt,
               intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const
@@ -1425,25 +1425,25 @@ public:
         return do_in(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     int encoding() const  _NOEXCEPT
     {
         return do_encoding();
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool always_noconv() const  _NOEXCEPT
     {
         return do_always_noconv();
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     int length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const
     {
         return do_length(__st, __frm, __end, __mx);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     int max_length() const  _NOEXCEPT
     {
         return do_max_length();
@@ -1452,7 +1452,7 @@ public:
     static locale::id id;
 
 protected:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit codecvt(const char*, size_t __refs = 0)
         : locale::facet(__refs) {}
 
@@ -1477,36 +1477,36 @@ protected:
 // template <class _InternT, class _ExternT, class _StateT> class codecvt_byname
 
 template <class _InternT, class _ExternT, class _StateT>
-class _LIBCPP_TEMPLATE_VIS codecvt_byname
+class _LIBCUDACXX_TEMPLATE_VIS codecvt_byname
     : public codecvt<_InternT, _ExternT, _StateT>
 {
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit codecvt_byname(const char* __nm, size_t __refs = 0)
         : codecvt<_InternT, _ExternT, _StateT>(__nm, __refs) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit codecvt_byname(const string& __nm, size_t __refs = 0)
         : codecvt<_InternT, _ExternT, _StateT>(__nm.c_str(), __refs) {}
 protected:
     ~codecvt_byname();
 };
 
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+_LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
 template <class _InternT, class _ExternT, class _StateT>
 codecvt_byname<_InternT, _ExternT, _StateT>::~codecvt_byname()
 {
 }
-_LIBCPP_SUPPRESS_DEPRECATED_POP
+_LIBCUDACXX_SUPPRESS_DEPRECATED_POP
 
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char, char, mbstate_t>;
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<wchar_t, char, mbstate_t>;
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char, char, mbstate_t>;
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<wchar_t, char, mbstate_t>;
 #endif
-extern template class _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char16_t, char, mbstate_t>; // deprecated in C++20
-extern template class _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char32_t, char, mbstate_t>; // deprecated in C++20
-#ifndef _LIBCPP_HAS_NO_CHAR8_T
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char16_t, char8_t, mbstate_t>; // C++20
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char32_t, char8_t, mbstate_t>; // C++20
+extern template class _LIBCUDACXX_DEPRECATED_IN_CXX20 _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char16_t, char, mbstate_t>; // deprecated in C++20
+extern template class _LIBCUDACXX_DEPRECATED_IN_CXX20 _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char32_t, char, mbstate_t>; // deprecated in C++20
+#ifndef _LIBCUDACXX_HAS_NO_CHAR8_T
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char16_t, char8_t, mbstate_t>; // C++20
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char32_t, char8_t, mbstate_t>; // C++20
 #endif
 
 template <size_t _Np>
@@ -1521,7 +1521,7 @@ template <>
 struct __narrow_to_utf8<8>
 {
     template <class _OutputIterator, class _CharT>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _OutputIterator
     operator()(_OutputIterator __s, const _CharT* __wb, const _CharT* __we) const
     {
@@ -1531,19 +1531,19 @@ struct __narrow_to_utf8<8>
     }
 };
 
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+_LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
 template <>
-struct _LIBCPP_TYPE_VIS __narrow_to_utf8<16>
+struct _LIBCUDACXX_TYPE_VIS __narrow_to_utf8<16>
     : public codecvt<char16_t, char, mbstate_t>
 {
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __narrow_to_utf8() : codecvt<char16_t, char, mbstate_t>(1) {}
-_LIBCPP_SUPPRESS_DEPRECATED_POP
+_LIBCUDACXX_SUPPRESS_DEPRECATED_POP
 
     ~__narrow_to_utf8();
 
     template <class _OutputIterator, class _CharT>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _OutputIterator
     operator()(_OutputIterator __s, const _CharT* __wb, const _CharT* __we) const
     {
@@ -1567,19 +1567,19 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
     }
 };
 
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+_LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
 template <>
-struct _LIBCPP_TYPE_VIS __narrow_to_utf8<32>
+struct _LIBCUDACXX_TYPE_VIS __narrow_to_utf8<32>
     : public codecvt<char32_t, char, mbstate_t>
 {
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __narrow_to_utf8() : codecvt<char32_t, char, mbstate_t>(1) {}
-_LIBCPP_SUPPRESS_DEPRECATED_POP
+_LIBCUDACXX_SUPPRESS_DEPRECATED_POP
 
     ~__narrow_to_utf8();
 
     template <class _OutputIterator, class _CharT>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _OutputIterator
     operator()(_OutputIterator __s, const _CharT* __wb, const _CharT* __we) const
     {
@@ -1615,7 +1615,7 @@ template <>
 struct __widen_from_utf8<8>
 {
     template <class _OutputIterator>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _OutputIterator
     operator()(_OutputIterator __s, const char* __nb, const char* __ne) const
     {
@@ -1625,19 +1625,19 @@ struct __widen_from_utf8<8>
     }
 };
 
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+_LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
 template <>
-struct _LIBCPP_TYPE_VIS __widen_from_utf8<16>
+struct _LIBCUDACXX_TYPE_VIS __widen_from_utf8<16>
     : public codecvt<char16_t, char, mbstate_t>
 {
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __widen_from_utf8() : codecvt<char16_t, char, mbstate_t>(1) {}
-_LIBCPP_SUPPRESS_DEPRECATED_POP
+_LIBCUDACXX_SUPPRESS_DEPRECATED_POP
 
     ~__widen_from_utf8();
 
     template <class _OutputIterator>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _OutputIterator
     operator()(_OutputIterator __s, const char* __nb, const char* __ne) const
     {
@@ -1661,19 +1661,19 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
     }
 };
 
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+_LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
 template <>
-struct _LIBCPP_TYPE_VIS __widen_from_utf8<32>
+struct _LIBCUDACXX_TYPE_VIS __widen_from_utf8<32>
     : public codecvt<char32_t, char, mbstate_t>
 {
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __widen_from_utf8() : codecvt<char32_t, char, mbstate_t>(1) {}
-_LIBCPP_SUPPRESS_DEPRECATED_POP
+_LIBCUDACXX_SUPPRESS_DEPRECATED_POP
 
     ~__widen_from_utf8();
 
     template <class _OutputIterator>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _OutputIterator
     operator()(_OutputIterator __s, const char* __nb, const char* __ne) const
     {
@@ -1699,10 +1699,10 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
 
 // template <class charT> class numpunct
 
-template <class _CharT> class _LIBCPP_TEMPLATE_VIS numpunct;
+template <class _CharT> class _LIBCUDACXX_TEMPLATE_VIS numpunct;
 
 template <>
-class _LIBCPP_TYPE_VIS numpunct<char>
+class _LIBCUDACXX_TYPE_VIS numpunct<char>
     : public locale::facet
 {
 public:
@@ -1711,11 +1711,11 @@ public:
 
     explicit numpunct(size_t __refs = 0);
 
-    _LIBCPP_INLINE_VISIBILITY char_type decimal_point() const {return do_decimal_point();}
-    _LIBCPP_INLINE_VISIBILITY char_type thousands_sep() const {return do_thousands_sep();}
-    _LIBCPP_INLINE_VISIBILITY string grouping() const         {return do_grouping();}
-    _LIBCPP_INLINE_VISIBILITY string_type truename() const    {return do_truename();}
-    _LIBCPP_INLINE_VISIBILITY string_type falsename() const   {return do_falsename();}
+    _LIBCUDACXX_INLINE_VISIBILITY char_type decimal_point() const {return do_decimal_point();}
+    _LIBCUDACXX_INLINE_VISIBILITY char_type thousands_sep() const {return do_thousands_sep();}
+    _LIBCUDACXX_INLINE_VISIBILITY string grouping() const         {return do_grouping();}
+    _LIBCUDACXX_INLINE_VISIBILITY string_type truename() const    {return do_truename();}
+    _LIBCUDACXX_INLINE_VISIBILITY string_type falsename() const   {return do_falsename();}
 
     static locale::id id;
 
@@ -1732,9 +1732,9 @@ protected:
     string __grouping_;
 };
 
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 template <>
-class _LIBCPP_TYPE_VIS numpunct<wchar_t>
+class _LIBCUDACXX_TYPE_VIS numpunct<wchar_t>
     : public locale::facet
 {
 public:
@@ -1743,11 +1743,11 @@ public:
 
     explicit numpunct(size_t __refs = 0);
 
-    _LIBCPP_INLINE_VISIBILITY char_type decimal_point() const {return do_decimal_point();}
-    _LIBCPP_INLINE_VISIBILITY char_type thousands_sep() const {return do_thousands_sep();}
-    _LIBCPP_INLINE_VISIBILITY string grouping() const         {return do_grouping();}
-    _LIBCPP_INLINE_VISIBILITY string_type truename() const    {return do_truename();}
-    _LIBCPP_INLINE_VISIBILITY string_type falsename() const   {return do_falsename();}
+    _LIBCUDACXX_INLINE_VISIBILITY char_type decimal_point() const {return do_decimal_point();}
+    _LIBCUDACXX_INLINE_VISIBILITY char_type thousands_sep() const {return do_thousands_sep();}
+    _LIBCUDACXX_INLINE_VISIBILITY string grouping() const         {return do_grouping();}
+    _LIBCUDACXX_INLINE_VISIBILITY string_type truename() const    {return do_truename();}
+    _LIBCUDACXX_INLINE_VISIBILITY string_type falsename() const   {return do_falsename();}
 
     static locale::id id;
 
@@ -1763,14 +1763,14 @@ protected:
     char_type __thousands_sep_;
     string __grouping_;
 };
-#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#endif // _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 
 // template <class charT> class numpunct_byname
 
-template <class _CharT> class _LIBCPP_TEMPLATE_VIS numpunct_byname;
+template <class _CharT> class _LIBCUDACXX_TEMPLATE_VIS numpunct_byname;
 
 template <>
-class _LIBCPP_TYPE_VIS numpunct_byname<char>
+class _LIBCUDACXX_TYPE_VIS numpunct_byname<char>
 : public numpunct<char>
 {
 public:
@@ -1787,9 +1787,9 @@ private:
     void __init(const char*);
 };
 
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 template <>
-class _LIBCPP_TYPE_VIS numpunct_byname<wchar_t>
+class _LIBCUDACXX_TYPE_VIS numpunct_byname<wchar_t>
 : public numpunct<wchar_t>
 {
 public:
@@ -1805,8 +1805,8 @@ protected:
 private:
     void __init(const char*);
 };
-#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#endif // _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___LOCALE
+#endif // _LIBCUDACXX___LOCALE

diff  --git a/libcxx/include/__mbstate_t.h b/libcxx/include/__mbstate_t.h
index 487a6d092c71..30e4930e647b 100644
--- a/libcxx/include/__mbstate_t.h
+++ b/libcxx/include/__mbstate_t.h
@@ -7,12 +7,12 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___MBSTATE_T_H
-#define _LIBCPP___MBSTATE_T_H
+#ifndef _LIBCUDACXX___MBSTATE_T_H
+#define _LIBCUDACXX___MBSTATE_T_H
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
@@ -25,7 +25,7 @@
 // This is a gruesome hack, but I don't know how to make it cleaner for
 // the time being.
 
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 #   include <wchar.h> // for mbstate_t
 #elif __has_include(<bits/types/mbstate_t.h>)
 #   include <bits/types/mbstate_t.h> // works on most Unixes
@@ -35,10 +35,10 @@
 #   error "The library was configured without support for wide-characters, but we don't know how to get the definition of mbstate_t without <wchar.h> on your platform."
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-using ::mbstate_t _LIBCPP_USING_IF_EXISTS;
+using ::mbstate_t _LIBCUDACXX_USING_IF_EXISTS;
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___MBSTATE_T_H
+#endif // _LIBCUDACXX___MBSTATE_T_H

diff  --git a/libcxx/include/__memory/addressof.h b/libcxx/include/__memory/addressof.h
index 75e3dd0647b2..3e8c7a131e09 100644
--- a/libcxx/include/__memory/addressof.h
+++ b/libcxx/include/__memory/addressof.h
@@ -7,42 +7,42 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___MEMORY_ADDRESSOF_H
-#define _LIBCPP___MEMORY_ADDRESSOF_H
+#ifndef _LIBCUDACXX___MEMORY_ADDRESSOF_H
+#define _LIBCUDACXX___MEMORY_ADDRESSOF_H
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Tp>
-inline _LIBCPP_CONSTEXPR_AFTER_CXX14
-_LIBCPP_NO_CFI _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
+_LIBCUDACXX_NO_CFI _LIBCUDACXX_INLINE_VISIBILITY
 _Tp*
 addressof(_Tp& __x) _NOEXCEPT
 {
     return __builtin_addressof(__x);
 }
 
-#if defined(_LIBCPP_HAS_OBJC_ARC) && !defined(_LIBCPP_PREDEFINED_OBJC_ARC_ADDRESSOF)
+#if defined(_LIBCUDACXX_HAS_OBJC_ARC) && !defined(_LIBCUDACXX_PREDEFINED_OBJC_ARC_ADDRESSOF)
 // Objective-C++ Automatic Reference Counting uses qualified pointers
 // that require special addressof() signatures. When
-// _LIBCPP_PREDEFINED_OBJC_ARC_ADDRESSOF is defined, the compiler
+// _LIBCUDACXX_PREDEFINED_OBJC_ARC_ADDRESSOF is defined, the compiler
 // itself is providing these definitions. Otherwise, we provide them.
 template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 __strong _Tp*
 addressof(__strong _Tp& __x) _NOEXCEPT
 {
   return &__x;
 }
 
-#ifdef _LIBCPP_HAS_OBJC_ARC_WEAK
+#ifdef _LIBCUDACXX_HAS_OBJC_ARC_WEAK
 template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 __weak _Tp*
 addressof(__weak _Tp& __x) _NOEXCEPT
 {
@@ -51,7 +51,7 @@ addressof(__weak _Tp& __x) _NOEXCEPT
 #endif
 
 template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 __autoreleasing _Tp*
 addressof(__autoreleasing _Tp& __x) _NOEXCEPT
 {
@@ -59,7 +59,7 @@ addressof(__autoreleasing _Tp& __x) _NOEXCEPT
 }
 
 template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 __unsafe_unretained _Tp*
 addressof(__unsafe_unretained _Tp& __x) _NOEXCEPT
 {
@@ -67,10 +67,10 @@ addressof(__unsafe_unretained _Tp& __x) _NOEXCEPT
 }
 #endif
 
-#if !defined(_LIBCPP_CXX03_LANG)
+#if !defined(_LIBCUDACXX_CXX03_LANG)
 template <class _Tp> _Tp* addressof(const _Tp&&) noexcept = delete;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___MEMORY_ADDRESSOF_H
+#endif // _LIBCUDACXX___MEMORY_ADDRESSOF_H

diff  --git a/libcxx/include/__memory/allocate_at_least.h b/libcxx/include/__memory/allocate_at_least.h
index 7ce588a25d1b..f290132a51b4 100644
--- a/libcxx/include/__memory/allocate_at_least.h
+++ b/libcxx/include/__memory/allocate_at_least.h
@@ -6,20 +6,20 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___MEMORY_ALLOCATE_AT_LEAST_H
-#define _LIBCPP___MEMORY_ALLOCATE_AT_LEAST_H
+#ifndef _LIBCUDACXX___MEMORY_ALLOCATE_AT_LEAST_H
+#define _LIBCUDACXX___MEMORY_ALLOCATE_AT_LEAST_H
 
 #include <__config>
 #include <__memory/allocator_traits.h>
 #include <cstddef>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 20
+#if _LIBCUDACXX_STD_VER > 20
 template <class _Pointer>
 struct allocation_result {
   _Pointer ptr;
@@ -27,7 +27,7 @@ struct allocation_result {
 };
 
 template <class _Alloc>
-[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr
+[[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI constexpr
 allocation_result<typename allocator_traits<_Alloc>::pointer> allocate_at_least(_Alloc& __alloc, size_t __n) {
   if constexpr (requires { __alloc.allocate_at_least(__n); }) {
     return __alloc.allocate_at_least(__n);
@@ -37,7 +37,7 @@ allocation_result<typename allocator_traits<_Alloc>::pointer> allocate_at_least(
 }
 
 template <class _Alloc>
-[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr
+[[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI constexpr
 auto __allocate_at_least(_Alloc& __alloc, size_t __n) {
   return std::allocate_at_least(__alloc, __n);
 }
@@ -49,13 +49,13 @@ struct __allocation_result {
 };
 
 template <class _Alloc>
-_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
+_LIBCUDACXX_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR
 __allocation_result<typename allocator_traits<_Alloc>::pointer> __allocate_at_least(_Alloc& __alloc, size_t __n) {
   return {__alloc.allocate(__n), __n};
 }
 
-#endif // _LIBCPP_STD_VER > 20
+#endif // _LIBCUDACXX_STD_VER > 20
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___MEMORY_ALLOCATE_AT_LEAST_H
+#endif // _LIBCUDACXX___MEMORY_ALLOCATE_AT_LEAST_H

diff  --git a/libcxx/include/__memory/allocation_guard.h b/libcxx/include/__memory/allocation_guard.h
index 424598cc8158..8cbaa0c9aed8 100644
--- a/libcxx/include/__memory/allocation_guard.h
+++ b/libcxx/include/__memory/allocation_guard.h
@@ -7,19 +7,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___MEMORY_ALLOCATION_GUARD_H
-#define _LIBCPP___MEMORY_ALLOCATION_GUARD_H
+#ifndef _LIBCUDACXX___MEMORY_ALLOCATION_GUARD_H
+#define _LIBCUDACXX___MEMORY_ALLOCATION_GUARD_H
 
 #include <__config>
 #include <__memory/allocator_traits.h>
 #include <__utility/move.h>
 #include <cstddef>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 // Helper class to allocate memory using an Allocator in an exception safe
 // manner.
@@ -46,28 +46,28 @@ struct __allocation_guard {
     using _Size = typename allocator_traits<_Alloc>::size_type;
 
     template<class _AllocT> // we perform the allocator conversion inside the constructor
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     explicit __allocation_guard(_AllocT __alloc, _Size __n)
-        : __alloc_(_VSTD::move(__alloc))
+        : __alloc_(_CUDA_VSTD::move(__alloc))
         , __n_(__n)
         , __ptr_(allocator_traits<_Alloc>::allocate(__alloc_, __n_)) // initialization order is important
     { }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     ~__allocation_guard() _NOEXCEPT {
         if (__ptr_ != nullptr) {
             allocator_traits<_Alloc>::deallocate(__alloc_, __ptr_, __n_);
         }
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     _Pointer __release_ptr() _NOEXCEPT { // not called __release() because it's a keyword in objective-c++
         _Pointer __tmp = __ptr_;
         __ptr_ = nullptr;
         return __tmp;
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     _Pointer __get() const _NOEXCEPT {
         return __ptr_;
     }
@@ -78,6 +78,6 @@ struct __allocation_guard {
     _Pointer __ptr_;
 };
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___MEMORY_ALLOCATION_GUARD_H
+#endif // _LIBCUDACXX___MEMORY_ALLOCATION_GUARD_H

diff  --git a/libcxx/include/__memory/allocator.h b/libcxx/include/__memory/allocator.h
index 57ce23483df3..0228177d7c1a 100644
--- a/libcxx/include/__memory/allocator.h
+++ b/libcxx/include/__memory/allocator.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___MEMORY_ALLOCATOR_H
-#define _LIBCPP___MEMORY_ALLOCATOR_H
+#ifndef _LIBCUDACXX___MEMORY_ALLOCATOR_H
+#define _LIBCUDACXX___MEMORY_ALLOCATOR_H
 
 #include <__config>
 #include <__memory/allocate_at_least.h>
@@ -19,40 +19,40 @@
 #include <stdexcept>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Tp> class allocator;
 
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_VOID_SPECIALIZATION)
-// These specializations shouldn't be marked _LIBCPP_DEPRECATED_IN_CXX17.
+#if _LIBCUDACXX_STD_VER <= 17 || defined(_LIBCUDACXX_ENABLE_CXX20_REMOVED_ALLOCATOR_VOID_SPECIALIZATION)
+// These specializations shouldn't be marked _LIBCUDACXX_DEPRECATED_IN_CXX17.
 // Specializing allocator<void> is deprecated, but not using it.
 template <>
-class _LIBCPP_TEMPLATE_VIS allocator<void>
+class _LIBCUDACXX_TEMPLATE_VIS allocator<void>
 {
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS)
+#if _LIBCUDACXX_STD_VER <= 17 || defined(_LIBCUDACXX_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS)
 public:
-    _LIBCPP_DEPRECATED_IN_CXX17 typedef void*             pointer;
-    _LIBCPP_DEPRECATED_IN_CXX17 typedef const void*       const_pointer;
-    _LIBCPP_DEPRECATED_IN_CXX17 typedef void              value_type;
+    _LIBCUDACXX_DEPRECATED_IN_CXX17 typedef void*             pointer;
+    _LIBCUDACXX_DEPRECATED_IN_CXX17 typedef const void*       const_pointer;
+    _LIBCUDACXX_DEPRECATED_IN_CXX17 typedef void              value_type;
 
-    template <class _Up> struct _LIBCPP_DEPRECATED_IN_CXX17 rebind {typedef allocator<_Up> other;};
+    template <class _Up> struct _LIBCUDACXX_DEPRECATED_IN_CXX17 rebind {typedef allocator<_Up> other;};
 #endif
 };
 
 template <>
-class _LIBCPP_TEMPLATE_VIS allocator<const void>
+class _LIBCUDACXX_TEMPLATE_VIS allocator<const void>
 {
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS)
+#if _LIBCUDACXX_STD_VER <= 17 || defined(_LIBCUDACXX_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS)
 public:
-    _LIBCPP_DEPRECATED_IN_CXX17 typedef const void*       pointer;
-    _LIBCPP_DEPRECATED_IN_CXX17 typedef const void*       const_pointer;
-    _LIBCPP_DEPRECATED_IN_CXX17 typedef const void        value_type;
+    _LIBCUDACXX_DEPRECATED_IN_CXX17 typedef const void*       pointer;
+    _LIBCUDACXX_DEPRECATED_IN_CXX17 typedef const void*       const_pointer;
+    _LIBCUDACXX_DEPRECATED_IN_CXX17 typedef const void        value_type;
 
-    template <class _Up> struct _LIBCPP_DEPRECATED_IN_CXX17 rebind {typedef allocator<_Up> other;};
+    template <class _Up> struct _LIBCUDACXX_DEPRECATED_IN_CXX17 rebind {typedef allocator<_Up> other;};
 #endif
 };
 #endif
@@ -74,8 +74,8 @@ struct __non_trivial_if { };
 
 template <class _Unique>
 struct __non_trivial_if<true, _Unique> {
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR __non_trivial_if() _NOEXCEPT { }
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR __non_trivial_if() _NOEXCEPT { }
 };
 
 // allocator
@@ -84,7 +84,7 @@ struct __non_trivial_if<true, _Unique> {
 //       allocator<void> trivial in C++20.
 
 template <class _Tp>
-class _LIBCPP_TEMPLATE_VIS allocator
+class _LIBCUDACXX_TEMPLATE_VIS allocator
     : private __non_trivial_if<!is_void<_Tp>::value, allocator<_Tp> >
 {
     static_assert(!is_volatile<_Tp>::value, "std::allocator does not support volatile types");
@@ -95,77 +95,77 @@ class _LIBCPP_TEMPLATE_VIS allocator
     typedef true_type   propagate_on_container_move_assignment;
     typedef true_type   is_always_equal;
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     allocator() _NOEXCEPT = default;
 
     template <class _Up>
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     allocator(const allocator<_Up>&) _NOEXCEPT { }
 
-    _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_NODISCARD_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     _Tp* allocate(size_t __n) {
         if (__n > allocator_traits<allocator>::max_size(*this))
             __throw_bad_array_new_length();
-        if (__libcpp_is_constant_evaluated()) {
+        if (__LIBCUDACXX_is_constant_evaluated()) {
             return static_cast<_Tp*>(::operator new(__n * sizeof(_Tp)));
         } else {
-            return static_cast<_Tp*>(_VSTD::__libcpp_allocate(__n * sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp)));
+            return static_cast<_Tp*>(_CUDA_VSTD::__LIBCUDACXX_allocate(__n * sizeof(_Tp), _LIBCUDACXX_ALIGNOF(_Tp)));
         }
     }
 
-#if _LIBCPP_STD_VER > 20
-    [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr
+#if _LIBCUDACXX_STD_VER > 20
+    [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI constexpr
     allocation_result<_Tp*> allocate_at_least(size_t __n) {
         return {allocate(__n), __n};
     }
 #endif
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     void deallocate(_Tp* __p, size_t __n) _NOEXCEPT {
-        if (__libcpp_is_constant_evaluated()) {
+        if (__LIBCUDACXX_is_constant_evaluated()) {
             ::operator delete(__p);
         } else {
-            _VSTD::__libcpp_deallocate((void*)__p, __n * sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp));
+            _CUDA_VSTD::__LIBCUDACXX_deallocate((void*)__p, __n * sizeof(_Tp), _LIBCUDACXX_ALIGNOF(_Tp));
         }
     }
 
     // C++20 Removed members
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS)
-    _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp*       pointer;
-    _LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp* const_pointer;
-    _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp&       reference;
-    _LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp& const_reference;
+#if _LIBCUDACXX_STD_VER <= 17 || defined(_LIBCUDACXX_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS)
+    _LIBCUDACXX_DEPRECATED_IN_CXX17 typedef _Tp*       pointer;
+    _LIBCUDACXX_DEPRECATED_IN_CXX17 typedef const _Tp* const_pointer;
+    _LIBCUDACXX_DEPRECATED_IN_CXX17 typedef _Tp&       reference;
+    _LIBCUDACXX_DEPRECATED_IN_CXX17 typedef const _Tp& const_reference;
 
     template <class _Up>
-    struct _LIBCPP_DEPRECATED_IN_CXX17 rebind {
+    struct _LIBCUDACXX_DEPRECATED_IN_CXX17 rebind {
         typedef allocator<_Up> other;
     };
 
-    _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_DEPRECATED_IN_CXX17 _LIBCUDACXX_INLINE_VISIBILITY
     pointer address(reference __x) const _NOEXCEPT {
-        return _VSTD::addressof(__x);
+        return _CUDA_VSTD::addressof(__x);
     }
-    _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_DEPRECATED_IN_CXX17 _LIBCUDACXX_INLINE_VISIBILITY
     const_pointer address(const_reference __x) const _NOEXCEPT {
-        return _VSTD::addressof(__x);
+        return _CUDA_VSTD::addressof(__x);
     }
 
-    _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY _LIBCPP_DEPRECATED_IN_CXX17
+    _LIBCUDACXX_NODISCARD_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_DEPRECATED_IN_CXX17
     _Tp* allocate(size_t __n, const void*) {
         return allocate(__n);
     }
 
-    _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY size_type max_size() const _NOEXCEPT {
+    _LIBCUDACXX_DEPRECATED_IN_CXX17 _LIBCUDACXX_INLINE_VISIBILITY size_type max_size() const _NOEXCEPT {
         return size_type(~0) / sizeof(_Tp);
     }
 
     template <class _Up, class... _Args>
-    _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_DEPRECATED_IN_CXX17 _LIBCUDACXX_INLINE_VISIBILITY
     void construct(_Up* __p, _Args&&... __args) {
-        ::new ((void*)__p) _Up(_VSTD::forward<_Args>(__args)...);
+        ::new ((void*)__p) _Up(_CUDA_VSTD::forward<_Args>(__args)...);
     }
 
-    _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_DEPRECATED_IN_CXX17 _LIBCUDACXX_INLINE_VISIBILITY
     void destroy(pointer __p) {
         __p->~_Tp();
     }
@@ -173,7 +173,7 @@ class _LIBCPP_TEMPLATE_VIS allocator
 };
 
 template <class _Tp>
-class _LIBCPP_TEMPLATE_VIS allocator<const _Tp>
+class _LIBCUDACXX_TEMPLATE_VIS allocator<const _Tp>
     : private __non_trivial_if<!is_void<_Tp>::value, allocator<const _Tp> >
 {
     static_assert(!is_volatile<_Tp>::value, "std::allocator does not support volatile types");
@@ -184,73 +184,73 @@ class _LIBCPP_TEMPLATE_VIS allocator<const _Tp>
     typedef true_type   propagate_on_container_move_assignment;
     typedef true_type   is_always_equal;
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     allocator() _NOEXCEPT = default;
 
     template <class _Up>
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     allocator(const allocator<_Up>&) _NOEXCEPT { }
 
-    _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_NODISCARD_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     const _Tp* allocate(size_t __n) {
         if (__n > allocator_traits<allocator>::max_size(*this))
             __throw_bad_array_new_length();
-        if (__libcpp_is_constant_evaluated()) {
+        if (__LIBCUDACXX_is_constant_evaluated()) {
             return static_cast<const _Tp*>(::operator new(__n * sizeof(_Tp)));
         } else {
-            return static_cast<const _Tp*>(_VSTD::__libcpp_allocate(__n * sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp)));
+            return static_cast<const _Tp*>(_CUDA_VSTD::__LIBCUDACXX_allocate(__n * sizeof(_Tp), _LIBCUDACXX_ALIGNOF(_Tp)));
         }
     }
 
-#if _LIBCPP_STD_VER > 20
-    [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr
+#if _LIBCUDACXX_STD_VER > 20
+    [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI constexpr
     allocation_result<const _Tp*> allocate_at_least(size_t __n) {
         return {allocate(__n), __n};
     }
 #endif
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     void deallocate(const _Tp* __p, size_t __n) {
-        if (__libcpp_is_constant_evaluated()) {
+        if (__LIBCUDACXX_is_constant_evaluated()) {
             ::operator delete(const_cast<_Tp*>(__p));
         } else {
-            _VSTD::__libcpp_deallocate((void*) const_cast<_Tp *>(__p), __n * sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp));
+            _CUDA_VSTD::__LIBCUDACXX_deallocate((void*) const_cast<_Tp *>(__p), __n * sizeof(_Tp), _LIBCUDACXX_ALIGNOF(_Tp));
         }
     }
 
     // C++20 Removed members
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS)
-    _LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp* pointer;
-    _LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp* const_pointer;
-    _LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp& reference;
-    _LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp& const_reference;
+#if _LIBCUDACXX_STD_VER <= 17 || defined(_LIBCUDACXX_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS)
+    _LIBCUDACXX_DEPRECATED_IN_CXX17 typedef const _Tp* pointer;
+    _LIBCUDACXX_DEPRECATED_IN_CXX17 typedef const _Tp* const_pointer;
+    _LIBCUDACXX_DEPRECATED_IN_CXX17 typedef const _Tp& reference;
+    _LIBCUDACXX_DEPRECATED_IN_CXX17 typedef const _Tp& const_reference;
 
     template <class _Up>
-    struct _LIBCPP_DEPRECATED_IN_CXX17 rebind {
+    struct _LIBCUDACXX_DEPRECATED_IN_CXX17 rebind {
         typedef allocator<_Up> other;
     };
 
-    _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_DEPRECATED_IN_CXX17 _LIBCUDACXX_INLINE_VISIBILITY
     const_pointer address(const_reference __x) const _NOEXCEPT {
-        return _VSTD::addressof(__x);
+        return _CUDA_VSTD::addressof(__x);
     }
 
-    _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY _LIBCPP_DEPRECATED_IN_CXX17
+    _LIBCUDACXX_NODISCARD_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_DEPRECATED_IN_CXX17
     const _Tp* allocate(size_t __n, const void*) {
         return allocate(__n);
     }
 
-    _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY size_type max_size() const _NOEXCEPT {
+    _LIBCUDACXX_DEPRECATED_IN_CXX17 _LIBCUDACXX_INLINE_VISIBILITY size_type max_size() const _NOEXCEPT {
         return size_type(~0) / sizeof(_Tp);
     }
 
     template <class _Up, class... _Args>
-    _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_DEPRECATED_IN_CXX17 _LIBCUDACXX_INLINE_VISIBILITY
     void construct(_Up* __p, _Args&&... __args) {
-        ::new ((void*)__p) _Up(_VSTD::forward<_Args>(__args)...);
+        ::new ((void*)__p) _Up(_CUDA_VSTD::forward<_Args>(__args)...);
     }
 
-    _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_DEPRECATED_IN_CXX17 _LIBCUDACXX_INLINE_VISIBILITY
     void destroy(pointer __p) {
         __p->~_Tp();
     }
@@ -258,13 +258,13 @@ class _LIBCPP_TEMPLATE_VIS allocator<const _Tp>
 };
 
 template <class _Tp, class _Up>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 bool operator==(const allocator<_Tp>&, const allocator<_Up>&) _NOEXCEPT {return true;}
 
 template <class _Tp, class _Up>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 bool operator!=(const allocator<_Tp>&, const allocator<_Up>&) _NOEXCEPT {return false;}
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___MEMORY_ALLOCATOR_H
+#endif // _LIBCUDACXX___MEMORY_ALLOCATOR_H

diff  --git a/libcxx/include/__memory/allocator_arg_t.h b/libcxx/include/__memory/allocator_arg_t.h
index 2d63b1f905e5..36dd955b442c 100644
--- a/libcxx/include/__memory/allocator_arg_t.h
+++ b/libcxx/include/__memory/allocator_arg_t.h
@@ -7,36 +7,36 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___FUNCTIONAL_ALLOCATOR_ARG_T_H
-#define _LIBCPP___FUNCTIONAL_ALLOCATOR_ARG_T_H
+#ifndef _LIBCUDACXX___FUNCTIONAL_ALLOCATOR_ARG_T_H
+#define _LIBCUDACXX___FUNCTIONAL_ALLOCATOR_ARG_T_H
 
 #include <__config>
 #include <__memory/uses_allocator.h>
 #include <__utility/forward.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-struct _LIBCPP_TEMPLATE_VIS allocator_arg_t { explicit allocator_arg_t() = default; };
+struct _LIBCUDACXX_TEMPLATE_VIS allocator_arg_t { explicit allocator_arg_t() = default; };
 
-#if defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_LIBRARY)
-extern _LIBCPP_EXPORTED_FROM_ABI const allocator_arg_t allocator_arg;
+#if defined(_LIBCUDACXX_CXX03_LANG) || defined(_LIBCUDACXX_BUILDING_LIBRARY)
+extern _LIBCUDACXX_EXPORTED_FROM_ABI const allocator_arg_t allocator_arg;
 #else
 /* inline */ constexpr allocator_arg_t allocator_arg = allocator_arg_t();
 #endif
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
 // allocator construction
 
 template <class _Tp, class _Alloc, class ..._Args>
 struct __uses_alloc_ctor_imp
 {
-    typedef _LIBCPP_NODEBUG __uncvref_t<_Alloc> _RawAlloc;
+    typedef _LIBCUDACXX_NODEBUG __uncvref_t<_Alloc> _RawAlloc;
     static const bool __ua = uses_allocator<_Tp, _RawAlloc>::value;
     static const bool __ic =
         is_constructible<_Tp, allocator_arg_t, _Alloc, _Args...>::value;
@@ -49,30 +49,30 @@ struct __uses_alloc_ctor
     {};
 
 template <class _Tp, class _Allocator, class... _Args>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void __user_alloc_construct_impl (integral_constant<int, 0>, _Tp *__storage, const _Allocator &, _Args &&... __args )
 {
-    new (__storage) _Tp (_VSTD::forward<_Args>(__args)...);
+    new (__storage) _Tp (_CUDA_VSTD::forward<_Args>(__args)...);
 }
 
 // FIXME: This should have a version which takes a non-const alloc.
 template <class _Tp, class _Allocator, class... _Args>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void __user_alloc_construct_impl (integral_constant<int, 1>, _Tp *__storage, const _Allocator &__a, _Args &&... __args )
 {
-    new (__storage) _Tp (allocator_arg, __a, _VSTD::forward<_Args>(__args)...);
+    new (__storage) _Tp (allocator_arg, __a, _CUDA_VSTD::forward<_Args>(__args)...);
 }
 
 // FIXME: This should have a version which takes a non-const alloc.
 template <class _Tp, class _Allocator, class... _Args>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void __user_alloc_construct_impl (integral_constant<int, 2>, _Tp *__storage, const _Allocator &__a, _Args &&... __args )
 {
-    new (__storage) _Tp (_VSTD::forward<_Args>(__args)..., __a);
+    new (__storage) _Tp (_CUDA_VSTD::forward<_Args>(__args)..., __a);
 }
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___FUNCTIONAL_ALLOCATOR_ARG_T_H
+#endif // _LIBCUDACXX___FUNCTIONAL_ALLOCATOR_ARG_T_H

diff  --git a/libcxx/include/__memory/allocator_traits.h b/libcxx/include/__memory/allocator_traits.h
index 5215556cdf3c..04f953de7986 100644
--- a/libcxx/include/__memory/allocator_traits.h
+++ b/libcxx/include/__memory/allocator_traits.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___MEMORY_ALLOCATOR_TRAITS_H
-#define _LIBCPP___MEMORY_ALLOCATOR_TRAITS_H
+#ifndef _LIBCUDACXX___MEMORY_ALLOCATOR_TRAITS_H
+#define _LIBCUDACXX___MEMORY_ALLOCATOR_TRAITS_H
 
 #include <__config>
 #include <__memory/construct_at.h>
@@ -17,138 +17,138 @@
 #include <limits>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#define _LIBCPP_ALLOCATOR_TRAITS_HAS_XXX(NAME, PROPERTY)                \
+#define _LIBCUDACXX_ALLOCATOR_TRAITS_HAS_XXX(NAME, PROPERTY)                \
     template <class _Tp, class = void> struct NAME : false_type { };    \
     template <class _Tp>               struct NAME<_Tp, typename __void_t<typename _Tp:: PROPERTY >::type> : true_type { }
 
 // __pointer
-_LIBCPP_ALLOCATOR_TRAITS_HAS_XXX(__has_pointer, pointer);
+_LIBCUDACXX_ALLOCATOR_TRAITS_HAS_XXX(__has_pointer, pointer);
 template <class _Tp, class _Alloc,
           class _RawAlloc = typename remove_reference<_Alloc>::type,
           bool = __has_pointer<_RawAlloc>::value>
 struct __pointer {
-    using type _LIBCPP_NODEBUG = typename _RawAlloc::pointer;
+    using type _LIBCUDACXX_NODEBUG = typename _RawAlloc::pointer;
 };
 template <class _Tp, class _Alloc, class _RawAlloc>
 struct __pointer<_Tp, _Alloc, _RawAlloc, false> {
-    using type _LIBCPP_NODEBUG = _Tp*;
+    using type _LIBCUDACXX_NODEBUG = _Tp*;
 };
 
 // __const_pointer
-_LIBCPP_ALLOCATOR_TRAITS_HAS_XXX(__has_const_pointer, const_pointer);
+_LIBCUDACXX_ALLOCATOR_TRAITS_HAS_XXX(__has_const_pointer, const_pointer);
 template <class _Tp, class _Ptr, class _Alloc,
           bool = __has_const_pointer<_Alloc>::value>
 struct __const_pointer {
-    using type _LIBCPP_NODEBUG = typename _Alloc::const_pointer;
+    using type _LIBCUDACXX_NODEBUG = typename _Alloc::const_pointer;
 };
 template <class _Tp, class _Ptr, class _Alloc>
 struct __const_pointer<_Tp, _Ptr, _Alloc, false> {
-#ifdef _LIBCPP_CXX03_LANG
+#ifdef _LIBCUDACXX_CXX03_LANG
     using type = typename pointer_traits<_Ptr>::template rebind<const _Tp>::other;
 #else
-    using type _LIBCPP_NODEBUG = typename pointer_traits<_Ptr>::template rebind<const _Tp>;
+    using type _LIBCUDACXX_NODEBUG = typename pointer_traits<_Ptr>::template rebind<const _Tp>;
 #endif
 };
 
 // __void_pointer
-_LIBCPP_ALLOCATOR_TRAITS_HAS_XXX(__has_void_pointer, void_pointer);
+_LIBCUDACXX_ALLOCATOR_TRAITS_HAS_XXX(__has_void_pointer, void_pointer);
 template <class _Ptr, class _Alloc,
           bool = __has_void_pointer<_Alloc>::value>
 struct __void_pointer {
-    using type _LIBCPP_NODEBUG = typename _Alloc::void_pointer;
+    using type _LIBCUDACXX_NODEBUG = typename _Alloc::void_pointer;
 };
 template <class _Ptr, class _Alloc>
 struct __void_pointer<_Ptr, _Alloc, false> {
-#ifdef _LIBCPP_CXX03_LANG
-    using type _LIBCPP_NODEBUG = typename pointer_traits<_Ptr>::template rebind<void>::other;
+#ifdef _LIBCUDACXX_CXX03_LANG
+    using type _LIBCUDACXX_NODEBUG = typename pointer_traits<_Ptr>::template rebind<void>::other;
 #else
-    using type _LIBCPP_NODEBUG = typename pointer_traits<_Ptr>::template rebind<void>;
+    using type _LIBCUDACXX_NODEBUG = typename pointer_traits<_Ptr>::template rebind<void>;
 #endif
 };
 
 // __const_void_pointer
-_LIBCPP_ALLOCATOR_TRAITS_HAS_XXX(__has_const_void_pointer, const_void_pointer);
+_LIBCUDACXX_ALLOCATOR_TRAITS_HAS_XXX(__has_const_void_pointer, const_void_pointer);
 template <class _Ptr, class _Alloc,
           bool = __has_const_void_pointer<_Alloc>::value>
 struct __const_void_pointer {
-    using type _LIBCPP_NODEBUG = typename _Alloc::const_void_pointer;
+    using type _LIBCUDACXX_NODEBUG = typename _Alloc::const_void_pointer;
 };
 template <class _Ptr, class _Alloc>
 struct __const_void_pointer<_Ptr, _Alloc, false> {
-#ifdef _LIBCPP_CXX03_LANG
-    using type _LIBCPP_NODEBUG = typename pointer_traits<_Ptr>::template rebind<const void>::other;
+#ifdef _LIBCUDACXX_CXX03_LANG
+    using type _LIBCUDACXX_NODEBUG = typename pointer_traits<_Ptr>::template rebind<const void>::other;
 #else
-    using type _LIBCPP_NODEBUG = typename pointer_traits<_Ptr>::template rebind<const void>;
+    using type _LIBCUDACXX_NODEBUG = typename pointer_traits<_Ptr>::template rebind<const void>;
 #endif
 };
 
 // __size_type
-_LIBCPP_ALLOCATOR_TRAITS_HAS_XXX(__has_size_type, size_type);
+_LIBCUDACXX_ALLOCATOR_TRAITS_HAS_XXX(__has_size_type, size_type);
 template <class _Alloc, class _DiffType, bool = __has_size_type<_Alloc>::value>
 struct __size_type : make_unsigned<_DiffType> { };
 template <class _Alloc, class _DiffType>
 struct __size_type<_Alloc, _DiffType, true> {
-    using type _LIBCPP_NODEBUG = typename _Alloc::size_type;
+    using type _LIBCUDACXX_NODEBUG = typename _Alloc::size_type;
 };
 
 // __alloc_traits_
diff erence_type
-_LIBCPP_ALLOCATOR_TRAITS_HAS_XXX(__has_alloc_traits_
diff erence_type, 
diff erence_type);
+_LIBCUDACXX_ALLOCATOR_TRAITS_HAS_XXX(__has_alloc_traits_
diff erence_type, 
diff erence_type);
 template <class _Alloc, class _Ptr, bool = __has_alloc_traits_
diff erence_type<_Alloc>::value>
 struct __alloc_traits_
diff erence_type {
-    using type _LIBCPP_NODEBUG = typename pointer_traits<_Ptr>::
diff erence_type;
+    using type _LIBCUDACXX_NODEBUG = typename pointer_traits<_Ptr>::
diff erence_type;
 };
 template <class _Alloc, class _Ptr>
 struct __alloc_traits_
diff erence_type<_Alloc, _Ptr, true> {
-    using type _LIBCPP_NODEBUG = typename _Alloc::
diff erence_type;
+    using type _LIBCUDACXX_NODEBUG = typename _Alloc::
diff erence_type;
 };
 
 // __propagate_on_container_copy_assignment
-_LIBCPP_ALLOCATOR_TRAITS_HAS_XXX(__has_propagate_on_container_copy_assignment, propagate_on_container_copy_assignment);
+_LIBCUDACXX_ALLOCATOR_TRAITS_HAS_XXX(__has_propagate_on_container_copy_assignment, propagate_on_container_copy_assignment);
 template <class _Alloc, bool = __has_propagate_on_container_copy_assignment<_Alloc>::value>
 struct __propagate_on_container_copy_assignment : false_type { };
 template <class _Alloc>
 struct __propagate_on_container_copy_assignment<_Alloc, true> {
-    using type _LIBCPP_NODEBUG = typename _Alloc::propagate_on_container_copy_assignment;
+    using type _LIBCUDACXX_NODEBUG = typename _Alloc::propagate_on_container_copy_assignment;
 };
 
 // __propagate_on_container_move_assignment
-_LIBCPP_ALLOCATOR_TRAITS_HAS_XXX(__has_propagate_on_container_move_assignment, propagate_on_container_move_assignment);
+_LIBCUDACXX_ALLOCATOR_TRAITS_HAS_XXX(__has_propagate_on_container_move_assignment, propagate_on_container_move_assignment);
 template <class _Alloc, bool = __has_propagate_on_container_move_assignment<_Alloc>::value>
 struct __propagate_on_container_move_assignment : false_type { };
 template <class _Alloc>
 struct __propagate_on_container_move_assignment<_Alloc, true> {
-    using type _LIBCPP_NODEBUG = typename _Alloc::propagate_on_container_move_assignment;
+    using type _LIBCUDACXX_NODEBUG = typename _Alloc::propagate_on_container_move_assignment;
 };
 
 // __propagate_on_container_swap
-_LIBCPP_ALLOCATOR_TRAITS_HAS_XXX(__has_propagate_on_container_swap, propagate_on_container_swap);
+_LIBCUDACXX_ALLOCATOR_TRAITS_HAS_XXX(__has_propagate_on_container_swap, propagate_on_container_swap);
 template <class _Alloc, bool = __has_propagate_on_container_swap<_Alloc>::value>
 struct __propagate_on_container_swap : false_type { };
 template <class _Alloc>
 struct __propagate_on_container_swap<_Alloc, true> {
-    using type _LIBCPP_NODEBUG = typename _Alloc::propagate_on_container_swap;
+    using type _LIBCUDACXX_NODEBUG = typename _Alloc::propagate_on_container_swap;
 };
 
 // __is_always_equal
-_LIBCPP_ALLOCATOR_TRAITS_HAS_XXX(__has_is_always_equal, is_always_equal);
+_LIBCUDACXX_ALLOCATOR_TRAITS_HAS_XXX(__has_is_always_equal, is_always_equal);
 template <class _Alloc, bool = __has_is_always_equal<_Alloc>::value>
 struct __is_always_equal : is_empty<_Alloc> { };
 template <class _Alloc>
 struct __is_always_equal<_Alloc, true> {
-    using type _LIBCPP_NODEBUG = typename _Alloc::is_always_equal;
+    using type _LIBCUDACXX_NODEBUG = typename _Alloc::is_always_equal;
 };
 
 // __allocator_traits_rebind
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+_LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
 template <class _Tp, class _Up, class = void>
 struct __has_rebind_other : false_type { };
 template <class _Tp, class _Up>
@@ -158,22 +158,22 @@ struct __has_rebind_other<_Tp, _Up, typename __void_t<
 
 template <class _Tp, class _Up, bool = __has_rebind_other<_Tp, _Up>::value>
 struct __allocator_traits_rebind {
-    using type _LIBCPP_NODEBUG = typename _Tp::template rebind<_Up>::other;
+    using type _LIBCUDACXX_NODEBUG = typename _Tp::template rebind<_Up>::other;
 };
 template <template <class, class...> class _Alloc, class _Tp, class ..._Args, class _Up>
 struct __allocator_traits_rebind<_Alloc<_Tp, _Args...>, _Up, true> {
-    using type _LIBCPP_NODEBUG = typename _Alloc<_Tp, _Args...>::template rebind<_Up>::other;
+    using type _LIBCUDACXX_NODEBUG = typename _Alloc<_Tp, _Args...>::template rebind<_Up>::other;
 };
 template <template <class, class...> class _Alloc, class _Tp, class ..._Args, class _Up>
 struct __allocator_traits_rebind<_Alloc<_Tp, _Args...>, _Up, false> {
-    using type _LIBCPP_NODEBUG = _Alloc<_Up, _Args...>;
+    using type _LIBCUDACXX_NODEBUG = _Alloc<_Up, _Args...>;
 };
-_LIBCPP_SUPPRESS_DEPRECATED_POP
+_LIBCUDACXX_SUPPRESS_DEPRECATED_POP
 
 template<class _Alloc, class _Tp>
 using __allocator_traits_rebind_t = typename __allocator_traits_rebind<_Alloc, _Tp>::type;
 
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+_LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
 
 // __has_allocate_hint
 template <class _Alloc, class _SizeType, class _ConstVoidPtr, class = void>
@@ -223,10 +223,10 @@ struct __has_select_on_container_copy_construction<_Alloc, decltype(
     (void)declval<_Alloc>().select_on_container_copy_construction()
 )> : true_type { };
 
-_LIBCPP_SUPPRESS_DEPRECATED_POP
+_LIBCUDACXX_SUPPRESS_DEPRECATED_POP
 
 template <class _Alloc>
-struct _LIBCPP_TEMPLATE_VIS allocator_traits
+struct _LIBCUDACXX_TEMPLATE_VIS allocator_traits
 {
     using allocator_type = _Alloc;
     using value_type = typename allocator_type::value_type;
@@ -241,12 +241,12 @@ struct _LIBCPP_TEMPLATE_VIS allocator_traits
     using propagate_on_container_swap = typename __propagate_on_container_swap<allocator_type>::type;
     using is_always_equal = typename __is_always_equal<allocator_type>::type;
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
     template <class _Tp>
     using rebind_alloc = __allocator_traits_rebind_t<allocator_type, _Tp>;
     template <class _Tp>
     using rebind_traits = allocator_traits<rebind_alloc<_Tp> >;
-#else  // _LIBCPP_CXX03_LANG
+#else  // _LIBCUDACXX_CXX03_LANG
     template <class _Tp>
     struct rebind_alloc {
         using other = __allocator_traits_rebind_t<allocator_type, _Tp>;
@@ -255,66 +255,66 @@ struct _LIBCPP_TEMPLATE_VIS allocator_traits
     struct rebind_traits {
         using other = allocator_traits<typename rebind_alloc<_Tp>::other>;
     };
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
-    _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_NODISCARD_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     static pointer allocate(allocator_type& __a, size_type __n) {
         return __a.allocate(__n);
     }
 
     template <class _Ap = _Alloc, class =
         __enable_if_t<__has_allocate_hint<_Ap, size_type, const_void_pointer>::value> >
-    _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_NODISCARD_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     static pointer allocate(allocator_type& __a, size_type __n, const_void_pointer __hint) {
-        _LIBCPP_SUPPRESS_DEPRECATED_PUSH
+        _LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
         return __a.allocate(__n, __hint);
-        _LIBCPP_SUPPRESS_DEPRECATED_POP
+        _LIBCUDACXX_SUPPRESS_DEPRECATED_POP
     }
     template <class _Ap = _Alloc, class = void, class =
         __enable_if_t<!__has_allocate_hint<_Ap, size_type, const_void_pointer>::value> >
-    _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_NODISCARD_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     static pointer allocate(allocator_type& __a, size_type __n, const_void_pointer) {
         return __a.allocate(__n);
     }
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     static void deallocate(allocator_type& __a, pointer __p, size_type __n) _NOEXCEPT {
         __a.deallocate(__p, __n);
     }
 
     template <class _Tp, class... _Args, class =
         __enable_if_t<__has_construct<allocator_type, _Tp*, _Args...>::value> >
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     static void construct(allocator_type& __a, _Tp* __p, _Args&&... __args) {
-        _LIBCPP_SUPPRESS_DEPRECATED_PUSH
-        __a.construct(__p, _VSTD::forward<_Args>(__args)...);
-        _LIBCPP_SUPPRESS_DEPRECATED_POP
+        _LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
+        __a.construct(__p, _CUDA_VSTD::forward<_Args>(__args)...);
+        _LIBCUDACXX_SUPPRESS_DEPRECATED_POP
     }
     template <class _Tp, class... _Args, class = void, class =
         __enable_if_t<!__has_construct<allocator_type, _Tp*, _Args...>::value> >
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     static void construct(allocator_type&, _Tp* __p, _Args&&... __args) {
-#if _LIBCPP_STD_VER > 17
-        _VSTD::construct_at(__p, _VSTD::forward<_Args>(__args)...);
+#if _LIBCUDACXX_STD_VER > 17
+        _CUDA_VSTD::construct_at(__p, _CUDA_VSTD::forward<_Args>(__args)...);
 #else
-        ::new ((void*)__p) _Tp(_VSTD::forward<_Args>(__args)...);
+        ::new ((void*)__p) _Tp(_CUDA_VSTD::forward<_Args>(__args)...);
 #endif
     }
 
     template <class _Tp, class =
         __enable_if_t<__has_destroy<allocator_type, _Tp*>::value> >
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     static void destroy(allocator_type& __a, _Tp* __p) {
-        _LIBCPP_SUPPRESS_DEPRECATED_PUSH
+        _LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
         __a.destroy(__p);
-        _LIBCPP_SUPPRESS_DEPRECATED_POP
+        _LIBCUDACXX_SUPPRESS_DEPRECATED_POP
     }
     template <class _Tp, class = void, class =
         __enable_if_t<!__has_destroy<allocator_type, _Tp*>::value> >
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     static void destroy(allocator_type&, _Tp* __p) {
-#if _LIBCPP_STD_VER > 17
-        _VSTD::destroy_at(__p);
+#if _LIBCUDACXX_STD_VER > 17
+        _CUDA_VSTD::destroy_at(__p);
 #else
         __p->~_Tp();
 #endif
@@ -322,28 +322,28 @@ struct _LIBCPP_TEMPLATE_VIS allocator_traits
 
     template <class _Ap = _Alloc, class =
         __enable_if_t<__has_max_size<const _Ap>::value> >
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     static size_type max_size(const allocator_type& __a) _NOEXCEPT {
-        _LIBCPP_SUPPRESS_DEPRECATED_PUSH
+        _LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
         return __a.max_size();
-        _LIBCPP_SUPPRESS_DEPRECATED_POP
+        _LIBCUDACXX_SUPPRESS_DEPRECATED_POP
     }
     template <class _Ap = _Alloc, class = void, class =
         __enable_if_t<!__has_max_size<const _Ap>::value> >
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     static size_type max_size(const allocator_type&) _NOEXCEPT {
         return numeric_limits<size_type>::max() / sizeof(value_type);
     }
 
     template <class _Ap = _Alloc, class =
         __enable_if_t<__has_select_on_container_copy_construction<const _Ap>::value> >
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     static allocator_type select_on_container_copy_construction(const allocator_type& __a) {
         return __a.select_on_container_copy_construction();
     }
     template <class _Ap = _Alloc, class = void, class =
         __enable_if_t<!__has_select_on_container_copy_construction<const _Ap>::value> >
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     static allocator_type select_on_container_copy_construction(const allocator_type& __a) {
         return __a;
     }
@@ -351,8 +351,8 @@ struct _LIBCPP_TEMPLATE_VIS allocator_traits
 
 template <class _Traits, class _Tp>
 struct __rebind_alloc_helper {
-#ifndef _LIBCPP_CXX03_LANG
-    using type _LIBCPP_NODEBUG = typename _Traits::template rebind_alloc<_Tp>;
+#ifndef _LIBCUDACXX_CXX03_LANG
+    using type _LIBCUDACXX_NODEBUG = typename _Traits::template rebind_alloc<_Tp>;
 #else
     using type = typename _Traits::template rebind_alloc<_Tp>::other;
 #endif
@@ -396,10 +396,10 @@ struct __is_cpp17_copy_insertable<_Alloc, __enable_if_t<
     : __is_cpp17_move_insertable<_Alloc>
 { };
 
-#undef _LIBCPP_ALLOCATOR_TRAITS_HAS_XXX
+#undef _LIBCUDACXX_ALLOCATOR_TRAITS_HAS_XXX
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___MEMORY_ALLOCATOR_TRAITS_H
+#endif // _LIBCUDACXX___MEMORY_ALLOCATOR_TRAITS_H

diff  --git a/libcxx/include/__memory/assume_aligned.h b/libcxx/include/__memory/assume_aligned.h
index 0f12fb11fd86..e6d7c51a879a 100644
--- a/libcxx/include/__memory/assume_aligned.h
+++ b/libcxx/include/__memory/assume_aligned.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___MEMORY_ASSUME_ALIGNED_H
-#define _LIBCPP___MEMORY_ASSUME_ALIGNED_H
+#ifndef _LIBCUDACXX___MEMORY_ASSUME_ALIGNED_H
+#define _LIBCUDACXX___MEMORY_ASSUME_ALIGNED_H
 
 #include <__assert>
 #include <__config>
@@ -16,17 +16,17 @@
 #include <cstdint>
 #include <type_traits> // for is_constant_evaluated()
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 template <size_t _Np, class _Tp>
 [[nodiscard]]
-_LIBCPP_HIDE_FROM_ABI
+_LIBCUDACXX_HIDE_FROM_ABI
 constexpr _Tp* assume_aligned(_Tp* __ptr) {
   static_assert(_Np != 0 && (_Np & (_Np - 1)) == 0,
     "std::assume_aligned<N>(p) requires N to be a power of two");
@@ -34,13 +34,13 @@ constexpr _Tp* assume_aligned(_Tp* __ptr) {
   if (is_constant_evaluated()) {
     return __ptr;
   } else {
-    _LIBCPP_ASSERT(reinterpret_cast<uintptr_t>(__ptr) % _Np == 0, "Alignment assumption is violated");
+    _LIBCUDACXX_ASSERT(reinterpret_cast<uintptr_t>(__ptr) % _Np == 0, "Alignment assumption is violated");
     return static_cast<_Tp*>(__builtin_assume_aligned(__ptr, _Np));
   }
 }
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___MEMORY_ASSUME_ALIGNED_H
+#endif // _LIBCUDACXX___MEMORY_ASSUME_ALIGNED_H

diff  --git a/libcxx/include/__memory/auto_ptr.h b/libcxx/include/__memory/auto_ptr.h
index c007b4d21a5d..af5ac3be52ea 100644
--- a/libcxx/include/__memory/auto_ptr.h
+++ b/libcxx/include/__memory/auto_ptr.h
@@ -7,78 +7,78 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___MEMORY_AUTO_PTR_H
-#define _LIBCPP___MEMORY_AUTO_PTR_H
+#ifndef _LIBCUDACXX___MEMORY_AUTO_PTR_H
+#define _LIBCUDACXX___MEMORY_AUTO_PTR_H
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
+#if _LIBCUDACXX_STD_VER <= 14 || defined(_LIBCUDACXX_ENABLE_CXX17_REMOVED_AUTO_PTR)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Tp>
-struct _LIBCPP_DEPRECATED_IN_CXX11 auto_ptr_ref
+struct _LIBCUDACXX_DEPRECATED_IN_CXX11 auto_ptr_ref
 {
     _Tp* __ptr_;
 };
 
 template<class _Tp>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 auto_ptr
+class _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_DEPRECATED_IN_CXX11 auto_ptr
 {
 private:
     _Tp* __ptr_;
 public:
     typedef _Tp element_type;
 
-    _LIBCPP_INLINE_VISIBILITY explicit auto_ptr(_Tp* __p = 0) _NOEXCEPT : __ptr_(__p) {}
-    _LIBCPP_INLINE_VISIBILITY auto_ptr(auto_ptr& __p) _NOEXCEPT : __ptr_(__p.release()) {}
-    template<class _Up> _LIBCPP_INLINE_VISIBILITY auto_ptr(auto_ptr<_Up>& __p) _NOEXCEPT
+    _LIBCUDACXX_INLINE_VISIBILITY explicit auto_ptr(_Tp* __p = 0) _NOEXCEPT : __ptr_(__p) {}
+    _LIBCUDACXX_INLINE_VISIBILITY auto_ptr(auto_ptr& __p) _NOEXCEPT : __ptr_(__p.release()) {}
+    template<class _Up> _LIBCUDACXX_INLINE_VISIBILITY auto_ptr(auto_ptr<_Up>& __p) _NOEXCEPT
         : __ptr_(__p.release()) {}
-    _LIBCPP_INLINE_VISIBILITY auto_ptr& operator=(auto_ptr& __p) _NOEXCEPT
+    _LIBCUDACXX_INLINE_VISIBILITY auto_ptr& operator=(auto_ptr& __p) _NOEXCEPT
         {reset(__p.release()); return *this;}
-    template<class _Up> _LIBCPP_INLINE_VISIBILITY auto_ptr& operator=(auto_ptr<_Up>& __p) _NOEXCEPT
+    template<class _Up> _LIBCUDACXX_INLINE_VISIBILITY auto_ptr& operator=(auto_ptr<_Up>& __p) _NOEXCEPT
         {reset(__p.release()); return *this;}
-    _LIBCPP_INLINE_VISIBILITY auto_ptr& operator=(auto_ptr_ref<_Tp> __p) _NOEXCEPT
+    _LIBCUDACXX_INLINE_VISIBILITY auto_ptr& operator=(auto_ptr_ref<_Tp> __p) _NOEXCEPT
         {reset(__p.__ptr_); return *this;}
-    _LIBCPP_INLINE_VISIBILITY ~auto_ptr() _NOEXCEPT {delete __ptr_;}
+    _LIBCUDACXX_INLINE_VISIBILITY ~auto_ptr() _NOEXCEPT {delete __ptr_;}
 
-    _LIBCPP_INLINE_VISIBILITY _Tp& operator*() const _NOEXCEPT
+    _LIBCUDACXX_INLINE_VISIBILITY _Tp& operator*() const _NOEXCEPT
         {return *__ptr_;}
-    _LIBCPP_INLINE_VISIBILITY _Tp* operator->() const _NOEXCEPT {return __ptr_;}
-    _LIBCPP_INLINE_VISIBILITY _Tp* get() const _NOEXCEPT {return __ptr_;}
-    _LIBCPP_INLINE_VISIBILITY _Tp* release() _NOEXCEPT
+    _LIBCUDACXX_INLINE_VISIBILITY _Tp* operator->() const _NOEXCEPT {return __ptr_;}
+    _LIBCUDACXX_INLINE_VISIBILITY _Tp* get() const _NOEXCEPT {return __ptr_;}
+    _LIBCUDACXX_INLINE_VISIBILITY _Tp* release() _NOEXCEPT
     {
         _Tp* __t = __ptr_;
         __ptr_ = nullptr;
         return __t;
     }
-    _LIBCPP_INLINE_VISIBILITY void reset(_Tp* __p = 0) _NOEXCEPT
+    _LIBCUDACXX_INLINE_VISIBILITY void reset(_Tp* __p = 0) _NOEXCEPT
     {
         if (__ptr_ != __p)
             delete __ptr_;
         __ptr_ = __p;
     }
 
-    _LIBCPP_INLINE_VISIBILITY auto_ptr(auto_ptr_ref<_Tp> __p) _NOEXCEPT : __ptr_(__p.__ptr_) {}
-    template<class _Up> _LIBCPP_INLINE_VISIBILITY operator auto_ptr_ref<_Up>() _NOEXCEPT
+    _LIBCUDACXX_INLINE_VISIBILITY auto_ptr(auto_ptr_ref<_Tp> __p) _NOEXCEPT : __ptr_(__p.__ptr_) {}
+    template<class _Up> _LIBCUDACXX_INLINE_VISIBILITY operator auto_ptr_ref<_Up>() _NOEXCEPT
         {auto_ptr_ref<_Up> __t; __t.__ptr_ = release(); return __t;}
-    template<class _Up> _LIBCPP_INLINE_VISIBILITY operator auto_ptr<_Up>() _NOEXCEPT
+    template<class _Up> _LIBCUDACXX_INLINE_VISIBILITY operator auto_ptr<_Up>() _NOEXCEPT
         {return auto_ptr<_Up>(release());}
 };
 
 template <>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 auto_ptr<void>
+class _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_DEPRECATED_IN_CXX11 auto_ptr<void>
 {
 public:
     typedef void element_type;
 };
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
+#endif // _LIBCUDACXX_STD_VER <= 14 || defined(_LIBCUDACXX_ENABLE_CXX17_REMOVED_AUTO_PTR)
 
-#endif // _LIBCPP___MEMORY_AUTO_PTR_H
+#endif // _LIBCUDACXX___MEMORY_AUTO_PTR_H

diff  --git a/libcxx/include/__memory/compressed_pair.h b/libcxx/include/__memory/compressed_pair.h
index 89e5820e992a..a36967c9b2ff 100644
--- a/libcxx/include/__memory/compressed_pair.h
+++ b/libcxx/include/__memory/compressed_pair.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___MEMORY_COMPRESSED_PAIR_H
-#define _LIBCPP___MEMORY_COMPRESSED_PAIR_H
+#ifndef _LIBCUDACXX___MEMORY_COMPRESSED_PAIR_H
+#define _LIBCUDACXX___MEMORY_COMPRESSED_PAIR_H
 
 #include <__config>
 #include <__utility/forward.h>
@@ -16,38 +16,38 @@
 #include <tuple> // needed in c++03 for some constructors
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 // Tag used to default initialize one or both of the pair's elements.
 struct __default_init_tag {};
 struct __value_init_tag {};
 
-template <class _Tp, int _Idx, bool _CanBeEmptyBase = is_empty<_Tp>::value && !__libcpp_is_final<_Tp>::value>
+template <class _Tp, int _Idx, bool _CanBeEmptyBase = is_empty<_Tp>::value && !__LIBCUDACXX_is_final<_Tp>::value>
 struct __compressed_pair_elem {
   using _ParamT = _Tp;
   using reference = _Tp&;
   using const_reference = const _Tp&;
 
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR explicit __compressed_pair_elem(__default_init_tag) {}
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR explicit __compressed_pair_elem(__value_init_tag) : __value_() {}
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR explicit __compressed_pair_elem(__default_init_tag) {}
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR explicit __compressed_pair_elem(__value_init_tag) : __value_() {}
 
   template <class _Up, class = __enable_if_t<!is_same<__compressed_pair_elem, typename decay<_Up>::type>::value> >
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR
   explicit __compressed_pair_elem(_Up&& __u) : __value_(std::forward<_Up>(__u)) {}
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
   template <class... _Args, size_t... _Indices>
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
   explicit __compressed_pair_elem(piecewise_construct_t, tuple<_Args...> __args, __tuple_indices<_Indices...>)
       : __value_(std::forward<_Args>(std::get<_Indices>(__args))...) {}
 #endif
 
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 reference __get() _NOEXCEPT { return __value_; }
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR const_reference __get() const _NOEXCEPT { return __value_; }
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 reference __get() _NOEXCEPT { return __value_; }
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR const_reference __get() const _NOEXCEPT { return __value_; }
 
 private:
   _Tp __value_;
@@ -60,23 +60,23 @@ struct __compressed_pair_elem<_Tp, _Idx, true> : private _Tp {
   using const_reference = const _Tp&;
   using __value_type = _Tp;
 
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR explicit __compressed_pair_elem() = default;
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR explicit __compressed_pair_elem(__default_init_tag) {}
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR explicit __compressed_pair_elem(__value_init_tag) : __value_type() {}
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR explicit __compressed_pair_elem() = default;
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR explicit __compressed_pair_elem(__default_init_tag) {}
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR explicit __compressed_pair_elem(__value_init_tag) : __value_type() {}
 
   template <class _Up, class = __enable_if_t<!is_same<__compressed_pair_elem, typename decay<_Up>::type>::value> >
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR
   explicit __compressed_pair_elem(_Up&& __u) : __value_type(std::forward<_Up>(__u)) {}
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
   template <class... _Args, size_t... _Indices>
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
   __compressed_pair_elem(piecewise_construct_t, tuple<_Args...> __args, __tuple_indices<_Indices...>)
       : __value_type(std::forward<_Args>(std::get<_Indices>(__args))...) {}
 #endif
 
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 reference __get() _NOEXCEPT { return *this; }
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR const_reference __get() const _NOEXCEPT { return *this; }
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 reference __get() _NOEXCEPT { return *this; }
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR const_reference __get() const _NOEXCEPT { return *this; }
 };
 
 template <class _T1, class _T2>
@@ -91,8 +91,8 @@ class __compressed_pair : private __compressed_pair_elem<_T1, 0>,
     "__compressed_pair cannot be instantiated when T1 and T2 are the same type; "
     "The current implementation is NOT ABI-compatible with the previous implementation for this configuration");
 
-  using _Base1 _LIBCPP_NODEBUG = __compressed_pair_elem<_T1, 0>;
-  using _Base2 _LIBCPP_NODEBUG = __compressed_pair_elem<_T2, 1>;
+  using _Base1 _LIBCUDACXX_NODEBUG = __compressed_pair_elem<_T1, 0>;
+  using _Base2 _LIBCUDACXX_NODEBUG = __compressed_pair_elem<_T2, 1>;
 
   template <bool _Dummy = true,
     class = __enable_if_t<
@@ -100,52 +100,52 @@ class __compressed_pair : private __compressed_pair_elem<_T1, 0>,
         __dependent_type<is_default_constructible<_T2>, _Dummy>::value
     >
   >
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR
   explicit __compressed_pair() : _Base1(__value_init_tag()), _Base2(__value_init_tag()) {}
 
   template <class _U1, class _U2>
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR
   explicit __compressed_pair(_U1&& __t1, _U2&& __t2) : _Base1(std::forward<_U1>(__t1)), _Base2(std::forward<_U2>(__t2)) {}
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
   template <class... _Args1, class... _Args2>
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
   explicit __compressed_pair(piecewise_construct_t __pc, tuple<_Args1...> __first_args,
                              tuple<_Args2...> __second_args)
       : _Base1(__pc, std::move(__first_args), typename __make_tuple_indices<sizeof...(_Args1)>::type()),
         _Base2(__pc, std::move(__second_args), typename __make_tuple_indices<sizeof...(_Args2)>::type()) {}
 #endif
 
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
   typename _Base1::reference first() _NOEXCEPT {
     return static_cast<_Base1&>(*this).__get();
   }
 
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR
   typename _Base1::const_reference first() const _NOEXCEPT {
     return static_cast<_Base1 const&>(*this).__get();
   }
 
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
   typename _Base2::reference second() _NOEXCEPT {
     return static_cast<_Base2&>(*this).__get();
   }
 
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR
   typename _Base2::const_reference second() const _NOEXCEPT {
     return static_cast<_Base2 const&>(*this).__get();
   }
 
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR static
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR static
   _Base1* __get_first_base(__compressed_pair* __pair) _NOEXCEPT {
     return static_cast<_Base1*>(__pair);
   }
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR static
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR static
   _Base2* __get_second_base(__compressed_pair* __pair) _NOEXCEPT {
     return static_cast<_Base2*>(__pair);
   }
 
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
   void swap(__compressed_pair& __x)
       _NOEXCEPT_(__is_nothrow_swappable<_T1>::value && __is_nothrow_swappable<_T2>::value) {
     using std::swap;
@@ -155,12 +155,12 @@ class __compressed_pair : private __compressed_pair_elem<_T1, 0>,
 };
 
 template <class _T1, class _T2>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 void swap(__compressed_pair<_T1, _T2>& __x, __compressed_pair<_T1, _T2>& __y)
     _NOEXCEPT_(__is_nothrow_swappable<_T1>::value && __is_nothrow_swappable<_T2>::value) {
   __x.swap(__y);
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___MEMORY_COMPRESSED_PAIR_H
+#endif // _LIBCUDACXX___MEMORY_COMPRESSED_PAIR_H

diff  --git a/libcxx/include/__memory/concepts.h b/libcxx/include/__memory/concepts.h
index 88372d277d7f..c70a90197f2c 100644
--- a/libcxx/include/__memory/concepts.h
+++ b/libcxx/include/__memory/concepts.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___MEMORY_CONCEPTS_H
-#define _LIBCPP___MEMORY_CONCEPTS_H
+#ifndef _LIBCUDACXX___MEMORY_CONCEPTS_H
+#define _LIBCUDACXX___MEMORY_CONCEPTS_H
 
 #include <__config>
 #include <__iterator/concepts.h>
@@ -19,13 +19,13 @@
 #include <concepts>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
 namespace ranges {
 
@@ -61,8 +61,8 @@ concept __nothrow_forward_range =
 
 } // namespace ranges
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___MEMORY_CONCEPTS_H
+#endif // _LIBCUDACXX___MEMORY_CONCEPTS_H

diff  --git a/libcxx/include/__memory/construct_at.h b/libcxx/include/__memory/construct_at.h
index f5985b7731fd..f94c66306dcf 100644
--- a/libcxx/include/__memory/construct_at.h
+++ b/libcxx/include/__memory/construct_at.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___MEMORY_CONSTRUCT_AT_H
-#define _LIBCPP___MEMORY_CONSTRUCT_AT_H
+#ifndef _LIBCUDACXX___MEMORY_CONSTRUCT_AT_H
+#define _LIBCUDACXX___MEMORY_CONSTRUCT_AT_H
 
 #include <__assert>
 #include <__config>
@@ -19,30 +19,30 @@
 #include <__utility/move.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 // construct_at
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 template <class _Tp, class... _Args, class = decltype(::new(declval<void*>()) _Tp(declval<_Args>()...))>
-_LIBCPP_HIDE_FROM_ABI constexpr _Tp* construct_at(_Tp* __location, _Args&&... __args) {
-  _LIBCPP_ASSERT(__location != nullptr, "null pointer given to construct_at");
-  return ::new (_VSTD::__voidify(*__location)) _Tp(_VSTD::forward<_Args>(__args)...);
+_LIBCUDACXX_HIDE_FROM_ABI constexpr _Tp* construct_at(_Tp* __location, _Args&&... __args) {
+  _LIBCUDACXX_ASSERT(__location != nullptr, "null pointer given to construct_at");
+  return ::new (_CUDA_VSTD::__voidify(*__location)) _Tp(_CUDA_VSTD::forward<_Args>(__args)...);
 }
 
 #endif
 
 template <class _Tp, class... _Args, class = decltype(::new(declval<void*>()) _Tp(declval<_Args>()...))>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Tp* __construct_at(_Tp* __location, _Args&&... __args) {
-#if _LIBCPP_STD_VER > 17
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR _Tp* __construct_at(_Tp* __location, _Args&&... __args) {
+#if _LIBCUDACXX_STD_VER > 17
   return std::construct_at(__location, std::forward<_Args>(__args)...);
 #else
-  return _LIBCPP_ASSERT(__location != nullptr, "null pointer given to construct_at"),
+  return _LIBCUDACXX_ASSERT(__location != nullptr, "null pointer given to construct_at"),
          ::new (std::__voidify(*__location)) _Tp(std::forward<_Args>(__args)...);
 #endif
 }
@@ -53,65 +53,65 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Tp* __construct_at(_Tp* __location, _Ar
 // taking an array).
 
 template <class _ForwardIterator>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 _ForwardIterator __destroy(_ForwardIterator, _ForwardIterator);
 
 template <class _Tp, typename enable_if<!is_array<_Tp>::value, int>::type = 0>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void __destroy_at(_Tp* __loc) {
-    _LIBCPP_ASSERT(__loc != nullptr, "null pointer given to destroy_at");
+    _LIBCUDACXX_ASSERT(__loc != nullptr, "null pointer given to destroy_at");
     __loc->~_Tp();
 }
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 template <class _Tp, typename enable_if<is_array<_Tp>::value, int>::type = 0>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void __destroy_at(_Tp* __loc) {
-    _LIBCPP_ASSERT(__loc != nullptr, "null pointer given to destroy_at");
-    _VSTD::__destroy(_VSTD::begin(*__loc), _VSTD::end(*__loc));
+    _LIBCUDACXX_ASSERT(__loc != nullptr, "null pointer given to destroy_at");
+    _CUDA_VSTD::__destroy(_CUDA_VSTD::begin(*__loc), _CUDA_VSTD::end(*__loc));
 }
 #endif
 
 template <class _ForwardIterator>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 _ForwardIterator __destroy(_ForwardIterator __first, _ForwardIterator __last) {
     for (; __first != __last; ++__first)
-        _VSTD::__destroy_at(_VSTD::addressof(*__first));
+        _CUDA_VSTD::__destroy_at(_CUDA_VSTD::addressof(*__first));
     return __first;
 }
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 
 template <class _Tp, enable_if_t<!is_array_v<_Tp>, int> = 0>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void destroy_at(_Tp* __loc) {
-    _VSTD::__destroy_at(__loc);
+    _CUDA_VSTD::__destroy_at(__loc);
 }
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 template <class _Tp, enable_if_t<is_array_v<_Tp>, int> = 0>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void destroy_at(_Tp* __loc) {
-  _VSTD::__destroy_at(__loc);
+  _CUDA_VSTD::__destroy_at(__loc);
 }
 #endif
 
 template <class _ForwardIterator>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void destroy(_ForwardIterator __first, _ForwardIterator __last) {
-  (void)_VSTD::__destroy(_VSTD::move(__first), _VSTD::move(__last));
+  (void)_CUDA_VSTD::__destroy(_CUDA_VSTD::move(__first), _CUDA_VSTD::move(__last));
 }
 
 template <class _ForwardIterator, class _Size>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 _ForwardIterator destroy_n(_ForwardIterator __first, _Size __n) {
     for (; __n > 0; (void)++__first, --__n)
-        _VSTD::__destroy_at(_VSTD::addressof(*__first));
+        _CUDA_VSTD::__destroy_at(_CUDA_VSTD::addressof(*__first));
     return __first;
 }
 
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCUDACXX_STD_VER > 14
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___MEMORY_CONSTRUCT_AT_H
+#endif // _LIBCUDACXX___MEMORY_CONSTRUCT_AT_H

diff  --git a/libcxx/include/__memory/pointer_traits.h b/libcxx/include/__memory/pointer_traits.h
index 348f7323a41d..ddd4bbe23926 100644
--- a/libcxx/include/__memory/pointer_traits.h
+++ b/libcxx/include/__memory/pointer_traits.h
@@ -7,19 +7,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___MEMORY_POINTER_TRAITS_H
-#define _LIBCPP___MEMORY_POINTER_TRAITS_H
+#ifndef _LIBCUDACXX___MEMORY_POINTER_TRAITS_H
+#define _LIBCUDACXX___MEMORY_POINTER_TRAITS_H
 
 #include <__config>
 #include <__memory/addressof.h>
 #include <cstddef>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Tp, class = void>
 struct __has_element_type : false_type {};
@@ -34,19 +34,19 @@ struct __pointer_traits_element_type;
 template <class _Ptr>
 struct __pointer_traits_element_type<_Ptr, true>
 {
-    typedef _LIBCPP_NODEBUG typename _Ptr::element_type type;
+    typedef _LIBCUDACXX_NODEBUG typename _Ptr::element_type type;
 };
 
 template <template <class, class...> class _Sp, class _Tp, class ..._Args>
 struct __pointer_traits_element_type<_Sp<_Tp, _Args...>, true>
 {
-    typedef _LIBCPP_NODEBUG typename _Sp<_Tp, _Args...>::element_type type;
+    typedef _LIBCUDACXX_NODEBUG typename _Sp<_Tp, _Args...>::element_type type;
 };
 
 template <template <class, class...> class _Sp, class _Tp, class ..._Args>
 struct __pointer_traits_element_type<_Sp<_Tp, _Args...>, false>
 {
-    typedef _LIBCPP_NODEBUG _Tp type;
+    typedef _LIBCUDACXX_NODEBUG _Tp type;
 };
 
 template <class _Tp, class = void>
@@ -59,13 +59,13 @@ struct __has_
diff erence_type<_Tp,
 template <class _Ptr, bool = __has_
diff erence_type<_Ptr>::value>
 struct __pointer_traits_
diff erence_type
 {
-    typedef _LIBCPP_NODEBUG ptr
diff _t type;
+    typedef _LIBCUDACXX_NODEBUG ptr
diff _t type;
 };
 
 template <class _Ptr>
 struct __pointer_traits_
diff erence_type<_Ptr, true>
 {
-    typedef _LIBCPP_NODEBUG typename _Ptr::
diff erence_type type;
+    typedef _LIBCUDACXX_NODEBUG typename _Ptr::
diff erence_type type;
 };
 
 template <class _Tp, class _Up>
@@ -73,9 +73,9 @@ struct __has_rebind
 {
 private:
     template <class _Xp> static false_type __test(...);
-    _LIBCPP_SUPPRESS_DEPRECATED_PUSH
+    _LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
     template <class _Xp> static true_type __test(typename _Xp::template rebind<_Up>* = 0);
-    _LIBCPP_SUPPRESS_DEPRECATED_POP
+    _LIBCUDACXX_SUPPRESS_DEPRECATED_POP
 public:
     static const bool value = decltype(__test<_Tp>(0))::value;
 };
@@ -83,20 +83,20 @@ struct __has_rebind
 template <class _Tp, class _Up, bool = __has_rebind<_Tp, _Up>::value>
 struct __pointer_traits_rebind
 {
-#ifndef _LIBCPP_CXX03_LANG
-    typedef _LIBCPP_NODEBUG typename _Tp::template rebind<_Up> type;
+#ifndef _LIBCUDACXX_CXX03_LANG
+    typedef _LIBCUDACXX_NODEBUG typename _Tp::template rebind<_Up> type;
 #else
-    typedef _LIBCPP_NODEBUG typename _Tp::template rebind<_Up>::other type;
+    typedef _LIBCUDACXX_NODEBUG typename _Tp::template rebind<_Up>::other type;
 #endif
 };
 
 template <template <class, class...> class _Sp, class _Tp, class ..._Args, class _Up>
 struct __pointer_traits_rebind<_Sp<_Tp, _Args...>, _Up, true>
 {
-#ifndef _LIBCPP_CXX03_LANG
-    typedef _LIBCPP_NODEBUG typename _Sp<_Tp, _Args...>::template rebind<_Up> type;
+#ifndef _LIBCUDACXX_CXX03_LANG
+    typedef _LIBCUDACXX_NODEBUG typename _Sp<_Tp, _Args...>::template rebind<_Up> type;
 #else
-    typedef _LIBCPP_NODEBUG typename _Sp<_Tp, _Args...>::template rebind<_Up>::other type;
+    typedef _LIBCUDACXX_NODEBUG typename _Sp<_Tp, _Args...>::template rebind<_Up>::other type;
 #endif
 };
 
@@ -107,36 +107,36 @@ struct __pointer_traits_rebind<_Sp<_Tp, _Args...>, _Up, false>
 };
 
 template <class _Ptr>
-struct _LIBCPP_TEMPLATE_VIS pointer_traits
+struct _LIBCUDACXX_TEMPLATE_VIS pointer_traits
 {
     typedef _Ptr                                                     pointer;
     typedef typename __pointer_traits_element_type<pointer>::type    element_type;
     typedef typename __pointer_traits_
diff erence_type<pointer>::type 
diff erence_type;
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
     template <class _Up> using rebind = typename __pointer_traits_rebind<pointer, _Up>::type;
 #else
     template <class _Up> struct rebind
         {typedef typename __pointer_traits_rebind<pointer, _Up>::type other;};
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
 private:
     struct __nat {};
 public:
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     static pointer pointer_to(typename conditional<is_void<element_type>::value,
                                            __nat, element_type>::type& __r)
         {return pointer::pointer_to(__r);}
 };
 
 template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS pointer_traits<_Tp*>
+struct _LIBCUDACXX_TEMPLATE_VIS pointer_traits<_Tp*>
 {
     typedef _Tp*      pointer;
     typedef _Tp       element_type;
     typedef ptr
diff _t 
diff erence_type;
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
     template <class _Up> using rebind = _Up*;
 #else
     template <class _Up> struct rebind {typedef _Up* other;};
@@ -145,15 +145,15 @@ struct _LIBCPP_TEMPLATE_VIS pointer_traits<_Tp*>
 private:
     struct __nat {};
 public:
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     static pointer pointer_to(typename conditional<is_void<element_type>::value,
                                       __nat, element_type>::type& __r) _NOEXCEPT
-        {return _VSTD::addressof(__r);}
+        {return _CUDA_VSTD::addressof(__r);}
 };
 
 template <class _From, class _To>
 struct __rebind_pointer {
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
     typedef typename pointer_traits<_From>::template rebind<_To>        type;
 #else
     typedef typename pointer_traits<_From>::template rebind<_To>::other type;
@@ -166,7 +166,7 @@ template <class _Pointer, class = void>
 struct __to_address_helper;
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR
 _Tp* __to_address(_Tp* __p) _NOEXCEPT {
     static_assert(!is_function<_Tp>::value, "_Tp is a function type");
     return __p;
@@ -197,7 +197,7 @@ struct _IsFancyPointer {
 template <class _Pointer, class = __enable_if_t<
     _And<is_class<_Pointer>, _IsFancyPointer<_Pointer> >::value
 > >
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR
 typename decay<decltype(__to_address_helper<_Pointer>::__call(declval<const _Pointer&>()))>::type
 __to_address(const _Pointer& __p) _NOEXCEPT {
     return __to_address_helper<_Pointer>::__call(__p);
@@ -205,36 +205,36 @@ __to_address(const _Pointer& __p) _NOEXCEPT {
 
 template <class _Pointer, class>
 struct __to_address_helper {
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
-    static decltype(_VSTD::__to_address(declval<const _Pointer&>().operator->()))
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR
+    static decltype(_CUDA_VSTD::__to_address(declval<const _Pointer&>().operator->()))
     __call(const _Pointer& __p) _NOEXCEPT {
-        return _VSTD::__to_address(__p.operator->());
+        return _CUDA_VSTD::__to_address(__p.operator->());
     }
 };
 
 template <class _Pointer>
 struct __to_address_helper<_Pointer, decltype((void)pointer_traits<_Pointer>::to_address(declval<const _Pointer&>()))> {
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR
     static decltype(pointer_traits<_Pointer>::to_address(declval<const _Pointer&>()))
     __call(const _Pointer& __p) _NOEXCEPT {
         return pointer_traits<_Pointer>::to_address(__p);
     }
 };
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY constexpr
+inline _LIBCUDACXX_INLINE_VISIBILITY constexpr
 auto to_address(_Tp *__p) noexcept {
-    return _VSTD::__to_address(__p);
+    return _CUDA_VSTD::__to_address(__p);
 }
 
 template <class _Pointer>
-inline _LIBCPP_INLINE_VISIBILITY constexpr
+inline _LIBCUDACXX_INLINE_VISIBILITY constexpr
 auto to_address(const _Pointer& __p) noexcept -> decltype(std::__to_address(__p)) {
-    return _VSTD::__to_address(__p);
+    return _CUDA_VSTD::__to_address(__p);
 }
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___MEMORY_POINTER_TRAITS_H
+#endif // _LIBCUDACXX___MEMORY_POINTER_TRAITS_H

diff  --git a/libcxx/include/__memory/ranges_construct_at.h b/libcxx/include/__memory/ranges_construct_at.h
index 29258023e3f9..82a0c43d6406 100644
--- a/libcxx/include/__memory/ranges_construct_at.h
+++ b/libcxx/include/__memory/ranges_construct_at.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___MEMORY_RANGES_CONSTRUCT_AT_H
-#define _LIBCPP___MEMORY_RANGES_CONSTRUCT_AT_H
+#ifndef _LIBCUDACXX___MEMORY_RANGES_CONSTRUCT_AT_H
+#define _LIBCUDACXX___MEMORY_RANGES_CONSTRUCT_AT_H
 
 #include <__concepts/destructible.h>
 #include <__config>
@@ -23,13 +23,13 @@
 #include <__utility/forward.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 namespace ranges {
 
 // construct_at
@@ -40,9 +40,9 @@ struct __fn {
   template<class _Tp, class... _Args, class = decltype(
     ::new (declval<void*>()) _Tp(declval<_Args>()...)
   )>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr _Tp* operator()(_Tp* __location, _Args&& ...__args) const {
-    return _VSTD::construct_at(__location, _VSTD::forward<_Args>(__args)...);
+    return _CUDA_VSTD::construct_at(__location, _CUDA_VSTD::forward<_Args>(__args)...);
   }
 };
 
@@ -58,9 +58,9 @@ namespace __destroy_at {
 
 struct __fn {
   template <destructible _Tp>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr void operator()(_Tp* __location) const noexcept {
-    _VSTD::destroy_at(__location);
+    _CUDA_VSTD::destroy_at(__location);
   }
 };
 
@@ -77,14 +77,14 @@ namespace __destroy {
 struct __fn {
   template <__nothrow_input_iterator _InputIterator, __nothrow_sentinel_for<_InputIterator> _Sentinel>
     requires destructible<iter_value_t<_InputIterator>>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr _InputIterator operator()(_InputIterator __first, _Sentinel __last) const noexcept {
-    return _VSTD::__destroy(_VSTD::move(__first), _VSTD::move(__last));
+    return _CUDA_VSTD::__destroy(_CUDA_VSTD::move(__first), _CUDA_VSTD::move(__last));
   }
 
   template <__nothrow_input_range _InputRange>
     requires destructible<range_value_t<_InputRange>>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr borrowed_iterator_t<_InputRange> operator()(_InputRange&& __range) const noexcept {
     return (*this)(ranges::begin(__range), ranges::end(__range));
   }
@@ -103,9 +103,9 @@ namespace __destroy_n {
 struct __fn {
   template <__nothrow_input_iterator _InputIterator>
     requires destructible<iter_value_t<_InputIterator>>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr _InputIterator operator()(_InputIterator __first, iter_
diff erence_t<_InputIterator> __n) const noexcept {
-    return _VSTD::destroy_n(_VSTD::move(__first), __n);
+    return _CUDA_VSTD::destroy_n(_CUDA_VSTD::move(__first), __n);
   }
 };
 
@@ -117,8 +117,8 @@ inline namespace __cpo {
 
 } // namespace ranges
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___MEMORY_RANGES_CONSTRUCT_AT_H
+#endif // _LIBCUDACXX___MEMORY_RANGES_CONSTRUCT_AT_H

diff  --git a/libcxx/include/__memory/ranges_uninitialized_algorithms.h b/libcxx/include/__memory/ranges_uninitialized_algorithms.h
index 8072496c24d6..d5c6db96e25c 100644
--- a/libcxx/include/__memory/ranges_uninitialized_algorithms.h
+++ b/libcxx/include/__memory/ranges_uninitialized_algorithms.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___MEMORY_RANGES_UNINITIALIZED_ALGORITHMS_H
-#define _LIBCPP___MEMORY_RANGES_UNINITIALIZED_ALGORITHMS_H
+#ifndef _LIBCUDACXX___MEMORY_RANGES_UNINITIALIZED_ALGORITHMS_H
+#define _LIBCUDACXX___MEMORY_RANGES_UNINITIALIZED_ALGORITHMS_H
 
 #include <__algorithm/in_out_result.h>
 #include <__concepts/constructible.h>
@@ -26,13 +26,13 @@
 #include <__utility/move.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
 namespace ranges {
 
@@ -46,8 +46,8 @@ struct __fn {
     requires default_initializable<iter_value_t<_ForwardIterator>>
   _ForwardIterator operator()(_ForwardIterator __first, _Sentinel __last) const {
     using _ValueType = remove_reference_t<iter_reference_t<_ForwardIterator>>;
-    return _VSTD::__uninitialized_default_construct<_ValueType>(
-        _VSTD::move(__first), _VSTD::move(__last));
+    return _CUDA_VSTD::__uninitialized_default_construct<_ValueType>(
+        _CUDA_VSTD::move(__first), _CUDA_VSTD::move(__last));
   }
 
   template <__nothrow_forward_range _ForwardRange>
@@ -73,7 +73,7 @@ struct __fn {
   _ForwardIterator operator()(_ForwardIterator __first,
                               iter_
diff erence_t<_ForwardIterator> __n) const {
     using _ValueType = remove_reference_t<iter_reference_t<_ForwardIterator>>;
-    return _VSTD::__uninitialized_default_construct_n<_ValueType>(_VSTD::move(__first), __n);
+    return _CUDA_VSTD::__uninitialized_default_construct_n<_ValueType>(_CUDA_VSTD::move(__first), __n);
   }
 };
 
@@ -93,8 +93,8 @@ struct __fn {
     requires default_initializable<iter_value_t<_ForwardIterator>>
   _ForwardIterator operator()(_ForwardIterator __first, _Sentinel __last) const {
     using _ValueType = remove_reference_t<iter_reference_t<_ForwardIterator>>;
-    return _VSTD::__uninitialized_value_construct<_ValueType>(
-        _VSTD::move(__first), _VSTD::move(__last));
+    return _CUDA_VSTD::__uninitialized_value_construct<_ValueType>(
+        _CUDA_VSTD::move(__first), _CUDA_VSTD::move(__last));
   }
 
   template <__nothrow_forward_range _ForwardRange>
@@ -120,7 +120,7 @@ struct __fn {
   _ForwardIterator operator()(_ForwardIterator __first,
                               iter_
diff erence_t<_ForwardIterator> __n) const {
     using _ValueType = remove_reference_t<iter_reference_t<_ForwardIterator>>;
-    return _VSTD::__uninitialized_value_construct_n<_ValueType>(_VSTD::move(__first), __n);
+    return _CUDA_VSTD::__uninitialized_value_construct_n<_ValueType>(_CUDA_VSTD::move(__first), __n);
   }
 };
 
@@ -141,7 +141,7 @@ struct __fn {
     requires constructible_from<iter_value_t<_ForwardIterator>, const _Tp&>
   _ForwardIterator operator()(_ForwardIterator __first, _Sentinel __last, const _Tp& __x) const {
     using _ValueType = remove_reference_t<iter_reference_t<_ForwardIterator>>;
-    return _VSTD::__uninitialized_fill<_ValueType>(_VSTD::move(__first), _VSTD::move(__last), __x);
+    return _CUDA_VSTD::__uninitialized_fill<_ValueType>(_CUDA_VSTD::move(__first), _CUDA_VSTD::move(__last), __x);
   }
 
   template <__nothrow_forward_range _ForwardRange, class _Tp>
@@ -168,7 +168,7 @@ struct __fn {
                               iter_
diff erence_t<_ForwardIterator> __n,
                               const _Tp& __x) const {
     using _ValueType = remove_reference_t<iter_reference_t<_ForwardIterator>>;
-    return _VSTD::__uninitialized_fill_n<_ValueType>(_VSTD::move(__first), __n, __x);
+    return _CUDA_VSTD::__uninitialized_fill_n<_ValueType>(_CUDA_VSTD::move(__first), __n, __x);
   }
 };
 
@@ -195,9 +195,9 @@ struct __fn {
   operator()(_InputIterator __ifirst, _Sentinel1 __ilast, _OutputIterator __ofirst, _Sentinel2 __olast) const {
     using _ValueType = remove_reference_t<iter_reference_t<_OutputIterator>>;
 
-    auto __result = _VSTD::__uninitialized_copy<_ValueType>(_VSTD::move(__ifirst), _VSTD::move(__ilast),
-                                                            _VSTD::move(__ofirst), _VSTD::move(__olast));
-    return {_VSTD::move(__result.first), _VSTD::move(__result.second)};
+    auto __result = _CUDA_VSTD::__uninitialized_copy<_ValueType>(_CUDA_VSTD::move(__ifirst), _CUDA_VSTD::move(__ilast),
+                                                            _CUDA_VSTD::move(__ofirst), _CUDA_VSTD::move(__olast));
+    return {_CUDA_VSTD::move(__result.first), _CUDA_VSTD::move(__result.second)};
   }
 
   template <input_range _InputRange, __nothrow_forward_range _OutputRange>
@@ -231,9 +231,9 @@ struct __fn {
   operator()(_InputIterator __ifirst, iter_
diff erence_t<_InputIterator> __n,
              _OutputIterator __ofirst, _Sentinel __olast) const {
     using _ValueType = remove_reference_t<iter_reference_t<_OutputIterator>>;
-    auto __result = _VSTD::__uninitialized_copy_n<_ValueType>(_VSTD::move(__ifirst), __n,
-                                                              _VSTD::move(__ofirst), _VSTD::move(__olast));
-    return {_VSTD::move(__result.first), _VSTD::move(__result.second)};
+    auto __result = _CUDA_VSTD::__uninitialized_copy_n<_ValueType>(_CUDA_VSTD::move(__ifirst), __n,
+                                                              _CUDA_VSTD::move(__ofirst), _CUDA_VSTD::move(__olast));
+    return {_CUDA_VSTD::move(__result.first), _CUDA_VSTD::move(__result.second)};
   }
 };
 
@@ -260,9 +260,9 @@ struct __fn {
   operator()(_InputIterator __ifirst, _Sentinel1 __ilast, _OutputIterator __ofirst, _Sentinel2 __olast) const {
     using _ValueType = remove_reference_t<iter_reference_t<_OutputIterator>>;
     auto __iter_move = [](auto&& __iter) -> decltype(auto) { return ranges::iter_move(__iter); };
-    auto __result = _VSTD::__uninitialized_move<_ValueType>(_VSTD::move(__ifirst), _VSTD::move(__ilast),
-                                                            _VSTD::move(__ofirst), _VSTD::move(__olast), __iter_move);
-    return {_VSTD::move(__result.first), _VSTD::move(__result.second)};
+    auto __result = _CUDA_VSTD::__uninitialized_move<_ValueType>(_CUDA_VSTD::move(__ifirst), _CUDA_VSTD::move(__ilast),
+                                                            _CUDA_VSTD::move(__ofirst), _CUDA_VSTD::move(__olast), __iter_move);
+    return {_CUDA_VSTD::move(__result.first), _CUDA_VSTD::move(__result.second)};
   }
 
   template <input_range _InputRange, __nothrow_forward_range _OutputRange>
@@ -297,9 +297,9 @@ struct __fn {
              _OutputIterator __ofirst, _Sentinel __olast) const {
     using _ValueType = remove_reference_t<iter_reference_t<_OutputIterator>>;
     auto __iter_move = [](auto&& __iter) -> decltype(auto) { return ranges::iter_move(__iter); };
-    auto __result = _VSTD::__uninitialized_move_n<_ValueType>(_VSTD::move(__ifirst), __n,
-                                                              _VSTD::move(__ofirst), _VSTD::move(__olast), __iter_move);
-    return {_VSTD::move(__result.first), _VSTD::move(__result.second)};
+    auto __result = _CUDA_VSTD::__uninitialized_move_n<_ValueType>(_CUDA_VSTD::move(__ifirst), __n,
+                                                              _CUDA_VSTD::move(__ofirst), _CUDA_VSTD::move(__olast), __iter_move);
+    return {_CUDA_VSTD::move(__result.first), _CUDA_VSTD::move(__result.second)};
   }
 };
 
@@ -311,8 +311,8 @@ inline namespace __cpo {
 
 } // namespace ranges
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___MEMORY_RANGES_UNINITIALIZED_ALGORITHMS_H
+#endif // _LIBCUDACXX___MEMORY_RANGES_UNINITIALIZED_ALGORITHMS_H

diff  --git a/libcxx/include/__memory/raw_storage_iterator.h b/libcxx/include/__memory/raw_storage_iterator.h
index 9b6594b8883e..c1c784d6a8e1 100644
--- a/libcxx/include/__memory/raw_storage_iterator.h
+++ b/libcxx/include/__memory/raw_storage_iterator.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___MEMORY_RAW_STORAGE_ITERATOR_H
-#define _LIBCPP___MEMORY_RAW_STORAGE_ITERATOR_H
+#ifndef _LIBCUDACXX___MEMORY_RAW_STORAGE_ITERATOR_H
+#define _LIBCUDACXX___MEMORY_RAW_STORAGE_ITERATOR_H
 
 #include <__config>
 #include <__iterator/iterator.h>
@@ -17,28 +17,28 @@
 #include <__utility/move.h>
 #include <cstddef>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_RAW_STORAGE_ITERATOR)
+#if _LIBCUDACXX_STD_VER <= 17 || defined(_LIBCUDACXX_ENABLE_CXX20_REMOVED_RAW_STORAGE_ITERATOR)
 
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+_LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
 template <class _OutputIterator, class _Tp>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 raw_storage_iterator
-#if _LIBCPP_STD_VER <= 14 || !defined(_LIBCPP_ABI_NO_ITERATOR_BASES)
+class _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_DEPRECATED_IN_CXX17 raw_storage_iterator
+#if _LIBCUDACXX_STD_VER <= 14 || !defined(_LIBCUDACXX_ABI_NO_ITERATOR_BASES)
     : public iterator<output_iterator_tag, void, void, void, void>
 #endif
 {
-_LIBCPP_SUPPRESS_DEPRECATED_POP
+_LIBCUDACXX_SUPPRESS_DEPRECATED_POP
 private:
     _OutputIterator __x_;
 public:
     typedef output_iterator_tag iterator_category;
     typedef void                value_type;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
     typedef ptr
diff _t           
diff erence_type;
 #else
     typedef void                
diff erence_type;
@@ -46,24 +46,24 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
     typedef void                pointer;
     typedef void                reference;
 
-    _LIBCPP_INLINE_VISIBILITY explicit raw_storage_iterator(_OutputIterator __x) : __x_(__x) {}
-    _LIBCPP_INLINE_VISIBILITY raw_storage_iterator& operator*() {return *this;}
-    _LIBCPP_INLINE_VISIBILITY raw_storage_iterator& operator=(const _Tp& __element)
-        {::new ((void*)_VSTD::addressof(*__x_)) _Tp(__element); return *this;}
-#if _LIBCPP_STD_VER >= 14
-    _LIBCPP_INLINE_VISIBILITY raw_storage_iterator& operator=(_Tp&& __element)
-        {::new ((void*)_VSTD::addressof(*__x_)) _Tp(_VSTD::move(__element)); return *this;}
+    _LIBCUDACXX_INLINE_VISIBILITY explicit raw_storage_iterator(_OutputIterator __x) : __x_(__x) {}
+    _LIBCUDACXX_INLINE_VISIBILITY raw_storage_iterator& operator*() {return *this;}
+    _LIBCUDACXX_INLINE_VISIBILITY raw_storage_iterator& operator=(const _Tp& __element)
+        {::new ((void*)_CUDA_VSTD::addressof(*__x_)) _Tp(__element); return *this;}
+#if _LIBCUDACXX_STD_VER >= 14
+    _LIBCUDACXX_INLINE_VISIBILITY raw_storage_iterator& operator=(_Tp&& __element)
+        {::new ((void*)_CUDA_VSTD::addressof(*__x_)) _Tp(_CUDA_VSTD::move(__element)); return *this;}
 #endif
-    _LIBCPP_INLINE_VISIBILITY raw_storage_iterator& operator++() {++__x_; return *this;}
-    _LIBCPP_INLINE_VISIBILITY raw_storage_iterator  operator++(int)
+    _LIBCUDACXX_INLINE_VISIBILITY raw_storage_iterator& operator++() {++__x_; return *this;}
+    _LIBCUDACXX_INLINE_VISIBILITY raw_storage_iterator  operator++(int)
         {raw_storage_iterator __t(*this); ++__x_; return __t;}
-#if _LIBCPP_STD_VER >= 14
-    _LIBCPP_INLINE_VISIBILITY _OutputIterator base() const { return __x_; }
+#if _LIBCUDACXX_STD_VER >= 14
+    _LIBCUDACXX_INLINE_VISIBILITY _OutputIterator base() const { return __x_; }
 #endif
 };
 
-#endif // _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_RAW_STORAGE_ITERATOR)
+#endif // _LIBCUDACXX_STD_VER <= 17 || defined(_LIBCUDACXX_ENABLE_CXX20_REMOVED_RAW_STORAGE_ITERATOR)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___MEMORY_RAW_STORAGE_ITERATOR_H
+#endif // _LIBCUDACXX___MEMORY_RAW_STORAGE_ITERATOR_H

diff  --git a/libcxx/include/__memory/shared_ptr.h b/libcxx/include/__memory/shared_ptr.h
index 41a7c7fa7575..a26d0e034186 100644
--- a/libcxx/include/__memory/shared_ptr.h
+++ b/libcxx/include/__memory/shared_ptr.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___MEMORY_SHARED_PTR_H
-#define _LIBCPP___MEMORY_SHARED_PTR_H
+#ifndef _LIBCUDACXX___MEMORY_SHARED_PTR_H
+#define _LIBCUDACXX___MEMORY_SHARED_PTR_H
 
 #include <__availability>
 #include <__config>
@@ -35,32 +35,32 @@
 #include <stdexcept>
 #include <type_traits>
 #include <typeinfo>
-#if !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_ATOMIC_HEADER)
 #  include <atomic>
 #endif
 
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Alloc>
 class __allocator_destructor
 {
-    typedef _LIBCPP_NODEBUG allocator_traits<_Alloc> __alloc_traits;
+    typedef _LIBCUDACXX_NODEBUG allocator_traits<_Alloc> __alloc_traits;
 public:
-    typedef _LIBCPP_NODEBUG typename __alloc_traits::pointer pointer;
-    typedef _LIBCPP_NODEBUG typename __alloc_traits::size_type size_type;
+    typedef _LIBCUDACXX_NODEBUG typename __alloc_traits::pointer pointer;
+    typedef _LIBCUDACXX_NODEBUG typename __alloc_traits::size_type size_type;
 private:
     _Alloc& __alloc_;
     size_type __s_;
 public:
-    _LIBCPP_INLINE_VISIBILITY __allocator_destructor(_Alloc& __a, size_type __s)
+    _LIBCUDACXX_INLINE_VISIBILITY __allocator_destructor(_Alloc& __a, size_type __s)
              _NOEXCEPT
         : __alloc_(__a), __s_(__s) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void operator()(pointer __p) _NOEXCEPT
         {__alloc_traits::deallocate(__alloc_, __p, __s_);}
 };
@@ -71,17 +71,17 @@ class __allocator_destructor
 #if defined(__clang__) && __has_builtin(__atomic_add_fetch)          \
                        && defined(__ATOMIC_RELAXED)                  \
                        && defined(__ATOMIC_ACQ_REL)
-#   define _LIBCPP_HAS_BUILTIN_ATOMIC_SUPPORT
-#elif defined(_LIBCPP_COMPILER_GCC)
-#   define _LIBCPP_HAS_BUILTIN_ATOMIC_SUPPORT
+#   define _LIBCUDACXX_HAS_BUILTIN_ATOMIC_SUPPORT
+#elif defined(_LIBCUDACXX_COMPILER_GCC)
+#   define _LIBCUDACXX_HAS_BUILTIN_ATOMIC_SUPPORT
 #endif
 
 template <class _ValueType>
-inline _LIBCPP_INLINE_VISIBILITY
-_ValueType __libcpp_relaxed_load(_ValueType const* __value) {
-#if !defined(_LIBCPP_HAS_NO_THREADS) && \
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_ValueType __LIBCUDACXX_relaxed_load(_ValueType const* __value) {
+#if !defined(_LIBCUDACXX_HAS_NO_THREADS) && \
     defined(__ATOMIC_RELAXED) &&        \
-    (__has_builtin(__atomic_load_n) || defined(_LIBCPP_COMPILER_GCC))
+    (__has_builtin(__atomic_load_n) || defined(_LIBCUDACXX_COMPILER_GCC))
     return __atomic_load_n(__value, __ATOMIC_RELAXED);
 #else
     return *__value;
@@ -89,11 +89,11 @@ _ValueType __libcpp_relaxed_load(_ValueType const* __value) {
 }
 
 template <class _ValueType>
-inline _LIBCPP_INLINE_VISIBILITY
-_ValueType __libcpp_acquire_load(_ValueType const* __value) {
-#if !defined(_LIBCPP_HAS_NO_THREADS) && \
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_ValueType __LIBCUDACXX_acquire_load(_ValueType const* __value) {
+#if !defined(_LIBCUDACXX_HAS_NO_THREADS) && \
     defined(__ATOMIC_ACQUIRE) &&        \
-    (__has_builtin(__atomic_load_n) || defined(_LIBCPP_COMPILER_GCC))
+    (__has_builtin(__atomic_load_n) || defined(_LIBCUDACXX_COMPILER_GCC))
     return __atomic_load_n(__value, __ATOMIC_ACQUIRE);
 #else
     return *__value;
@@ -101,10 +101,10 @@ _ValueType __libcpp_acquire_load(_ValueType const* __value) {
 }
 
 template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _Tp
-__libcpp_atomic_refcount_increment(_Tp& __t) _NOEXCEPT
+inline _LIBCUDACXX_INLINE_VISIBILITY _Tp
+__LIBCUDACXX_atomic_refcount_increment(_Tp& __t) _NOEXCEPT
 {
-#if defined(_LIBCPP_HAS_BUILTIN_ATOMIC_SUPPORT) && !defined(_LIBCPP_HAS_NO_THREADS)
+#if defined(_LIBCUDACXX_HAS_BUILTIN_ATOMIC_SUPPORT) && !defined(_LIBCUDACXX_HAS_NO_THREADS)
     return __atomic_add_fetch(&__t, 1, __ATOMIC_RELAXED);
 #else
     return __t += 1;
@@ -112,17 +112,17 @@ __libcpp_atomic_refcount_increment(_Tp& __t) _NOEXCEPT
 }
 
 template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _Tp
-__libcpp_atomic_refcount_decrement(_Tp& __t) _NOEXCEPT
+inline _LIBCUDACXX_INLINE_VISIBILITY _Tp
+__LIBCUDACXX_atomic_refcount_decrement(_Tp& __t) _NOEXCEPT
 {
-#if defined(_LIBCPP_HAS_BUILTIN_ATOMIC_SUPPORT) && !defined(_LIBCPP_HAS_NO_THREADS)
+#if defined(_LIBCUDACXX_HAS_BUILTIN_ATOMIC_SUPPORT) && !defined(_LIBCUDACXX_HAS_NO_THREADS)
     return __atomic_add_fetch(&__t, -1, __ATOMIC_ACQ_REL);
 #else
     return __t -= 1;
 #endif
 }
 
-class _LIBCPP_EXCEPTION_ABI bad_weak_ptr
+class _LIBCUDACXX_EXCEPTION_ABI bad_weak_ptr
     : public std::exception
 {
 public:
@@ -132,19 +132,19 @@ class _LIBCPP_EXCEPTION_ABI bad_weak_ptr
     virtual const char* what() const  _NOEXCEPT;
 };
 
-_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_NORETURN inline _LIBCUDACXX_INLINE_VISIBILITY
 void __throw_bad_weak_ptr()
 {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     throw bad_weak_ptr();
 #else
-    _VSTD::abort();
+    _CUDA_VSTD::abort();
 #endif
 }
 
-template<class _Tp> class _LIBCPP_TEMPLATE_VIS weak_ptr;
+template<class _Tp> class _LIBCUDACXX_TEMPLATE_VIS weak_ptr;
 
-class _LIBCPP_TYPE_VIS __shared_count
+class _LIBCUDACXX_TYPE_VIS __shared_count
 {
     __shared_count(const __shared_count&);
     __shared_count& operator=(const __shared_count&);
@@ -156,40 +156,40 @@ class _LIBCPP_TYPE_VIS __shared_count
     virtual void __on_zero_shared() _NOEXCEPT = 0;
 
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __shared_count(long __refs = 0) _NOEXCEPT
         : __shared_owners_(__refs) {}
 
-#if defined(_LIBCPP_SHARED_PTR_DEFINE_LEGACY_INLINE_FUNCTIONS)
+#if defined(_LIBCUDACXX_SHARED_PTR_DEFINE_LEGACY_INLINE_FUNCTIONS)
     void __add_shared() noexcept;
     bool __release_shared() noexcept;
 #else
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __add_shared() _NOEXCEPT {
-      __libcpp_atomic_refcount_increment(__shared_owners_);
+      __LIBCUDACXX_atomic_refcount_increment(__shared_owners_);
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool __release_shared() _NOEXCEPT {
-      if (__libcpp_atomic_refcount_decrement(__shared_owners_) == -1) {
+      if (__LIBCUDACXX_atomic_refcount_decrement(__shared_owners_) == -1) {
         __on_zero_shared();
         return true;
       }
       return false;
     }
 #endif
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     long use_count() const _NOEXCEPT {
-        return __libcpp_relaxed_load(&__shared_owners_) + 1;
+        return __LIBCUDACXX_relaxed_load(&__shared_owners_) + 1;
     }
 };
 
-class _LIBCPP_TYPE_VIS __shared_weak_count
+class _LIBCUDACXX_TYPE_VIS __shared_weak_count
     : private __shared_count
 {
     long __shared_weak_owners_;
 
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __shared_weak_count(long __refs = 0) _NOEXCEPT
         : __shared_count(__refs),
           __shared_weak_owners_(__refs) {}
@@ -197,27 +197,27 @@ class _LIBCPP_TYPE_VIS __shared_weak_count
     virtual ~__shared_weak_count();
 
 public:
-#if defined(_LIBCPP_SHARED_PTR_DEFINE_LEGACY_INLINE_FUNCTIONS)
+#if defined(_LIBCUDACXX_SHARED_PTR_DEFINE_LEGACY_INLINE_FUNCTIONS)
     void __add_shared() noexcept;
     void __add_weak() noexcept;
     void __release_shared() noexcept;
 #else
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __add_shared() _NOEXCEPT {
       __shared_count::__add_shared();
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __add_weak() _NOEXCEPT {
-      __libcpp_atomic_refcount_increment(__shared_weak_owners_);
+      __LIBCUDACXX_atomic_refcount_increment(__shared_weak_owners_);
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __release_shared() _NOEXCEPT {
       if (__shared_count::__release_shared())
         __release_weak();
     }
 #endif
     void __release_weak() _NOEXCEPT;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     long use_count() const _NOEXCEPT {return __shared_count::use_count();}
     __shared_weak_count* lock() _NOEXCEPT;
 
@@ -232,11 +232,11 @@ class __shared_ptr_pointer
 {
     __compressed_pair<__compressed_pair<_Tp, _Dp>, _Alloc> __data_;
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __shared_ptr_pointer(_Tp __p, _Dp __d, _Alloc __a)
-        :  __data_(__compressed_pair<_Tp, _Dp>(__p, _VSTD::move(__d)), _VSTD::move(__a)) {}
+        :  __data_(__compressed_pair<_Tp, _Dp>(__p, _CUDA_VSTD::move(__d)), _CUDA_VSTD::move(__a)) {}
 
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCUDACXX_NO_RTTI
     virtual const void* __get_deleter(const type_info&) const _NOEXCEPT;
 #endif
 
@@ -245,16 +245,16 @@ class __shared_ptr_pointer
     virtual void __on_zero_shared_weak() _NOEXCEPT;
 };
 
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCUDACXX_NO_RTTI
 
 template <class _Tp, class _Dp, class _Alloc>
 const void*
 __shared_ptr_pointer<_Tp, _Dp, _Alloc>::__get_deleter(const type_info& __t) const _NOEXCEPT
 {
-    return __t == typeid(_Dp) ? _VSTD::addressof(__data_.first().second()) : nullptr;
+    return __t == typeid(_Dp) ? _CUDA_VSTD::addressof(__data_.first().second()) : nullptr;
 }
 
-#endif // _LIBCPP_NO_RTTI
+#endif // _LIBCUDACXX_NO_RTTI
 
 template <class _Tp, class _Dp, class _Alloc>
 void
@@ -282,28 +282,28 @@ struct __shared_ptr_emplace
     : __shared_weak_count
 {
     template<class ..._Args>
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     explicit __shared_ptr_emplace(_Alloc __a, _Args&& ...__args)
-        : __storage_(_VSTD::move(__a))
+        : __storage_(_CUDA_VSTD::move(__a))
     {
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
         using _TpAlloc = typename __allocator_traits_rebind<_Alloc, _Tp>::type;
         _TpAlloc __tmp(*__get_alloc());
-        allocator_traits<_TpAlloc>::construct(__tmp, __get_elem(), _VSTD::forward<_Args>(__args)...);
+        allocator_traits<_TpAlloc>::construct(__tmp, __get_elem(), _CUDA_VSTD::forward<_Args>(__args)...);
 #else
-        ::new ((void*)__get_elem()) _Tp(_VSTD::forward<_Args>(__args)...);
+        ::new ((void*)__get_elem()) _Tp(_CUDA_VSTD::forward<_Args>(__args)...);
 #endif
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     _Alloc* __get_alloc() _NOEXCEPT { return __storage_.__get_alloc(); }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     _Tp* __get_elem() _NOEXCEPT { return __storage_.__get_elem(); }
 
 private:
     virtual void __on_zero_shared() _NOEXCEPT {
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
         using _TpAlloc = typename __allocator_traits_rebind<_Alloc, _Tp>::type;
         _TpAlloc __tmp(*__get_alloc());
         allocator_traits<_TpAlloc>::destroy(__tmp, __get_elem());
@@ -333,10 +333,10 @@ struct __shared_ptr_emplace
     struct _ALIGNAS_TYPE(_CompressedPair) _Storage {
         char __blob_[sizeof(_CompressedPair)];
 
-        _LIBCPP_HIDE_FROM_ABI explicit _Storage(_Alloc&& __a) {
-            ::new ((void*)__get_alloc()) _Alloc(_VSTD::move(__a));
+        _LIBCUDACXX_HIDE_FROM_ABI explicit _Storage(_Alloc&& __a) {
+            ::new ((void*)__get_alloc()) _Alloc(_CUDA_VSTD::move(__a));
         }
-        _LIBCPP_HIDE_FROM_ABI ~_Storage() {
+        _LIBCUDACXX_HIDE_FROM_ABI ~_Storage() {
             __get_alloc()->~_Alloc();
         }
         _Alloc* __get_alloc() _NOEXCEPT {
@@ -345,7 +345,7 @@ struct __shared_ptr_emplace
             _Alloc *__alloc = reinterpret_cast<_Alloc*>(__first);
             return __alloc;
         }
-        _LIBCPP_NO_CFI _Tp* __get_elem() _NOEXCEPT {
+        _LIBCUDACXX_NO_CFI _Tp* __get_elem() _NOEXCEPT {
             _CompressedPair *__as_pair = reinterpret_cast<_CompressedPair*>(__blob_);
             typename _CompressedPair::_Base2* __second = _CompressedPair::__get_second_base(__as_pair);
             _Tp *__elem = reinterpret_cast<_Tp*>(__second);
@@ -353,14 +353,14 @@ struct __shared_ptr_emplace
         }
     };
 
-    static_assert(_LIBCPP_ALIGNOF(_Storage) == _LIBCPP_ALIGNOF(_CompressedPair), "");
+    static_assert(_LIBCUDACXX_ALIGNOF(_Storage) == _LIBCUDACXX_ALIGNOF(_CompressedPair), "");
     static_assert(sizeof(_Storage) == sizeof(_CompressedPair), "");
     _Storage __storage_;
 };
 
 struct __shared_ptr_dummy_rebind_allocator_type;
 template <>
-class _LIBCPP_TEMPLATE_VIS allocator<__shared_ptr_dummy_rebind_allocator_type>
+class _LIBCUDACXX_TEMPLATE_VIS allocator<__shared_ptr_dummy_rebind_allocator_type>
 {
 public:
     template <class _Other>
@@ -370,15 +370,15 @@ class _LIBCPP_TEMPLATE_VIS allocator<__shared_ptr_dummy_rebind_allocator_type>
     };
 };
 
-template<class _Tp> class _LIBCPP_TEMPLATE_VIS enable_shared_from_this;
+template<class _Tp> class _LIBCUDACXX_TEMPLATE_VIS enable_shared_from_this;
 
 template<class _Tp, class _Up>
 struct __compatible_with
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
     : is_convertible<remove_extent_t<_Tp>*, remove_extent_t<_Up>*> {};
 #else
     : is_convertible<_Tp*, _Up*> {};
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCUDACXX_STD_VER > 14
 
 template <class _Ptr, class = void>
 struct __is_deletable : false_type { };
@@ -408,17 +408,17 @@ struct __shared_ptr_deleter_ctor_reqs
                               __well_formed_deleter<_Dp, _Tp*>::value;
 };
 
-#if defined(_LIBCPP_ABI_ENABLE_SHARED_PTR_TRIVIAL_ABI)
-#  define _LIBCPP_SHARED_PTR_TRIVIAL_ABI __attribute__((trivial_abi))
+#if defined(_LIBCUDACXX_ABI_ENABLE_SHARED_PTR_TRIVIAL_ABI)
+#  define _LIBCUDACXX_SHARED_PTR_TRIVIAL_ABI __attribute__((trivial_abi))
 #else
-#  define _LIBCPP_SHARED_PTR_TRIVIAL_ABI
+#  define _LIBCUDACXX_SHARED_PTR_TRIVIAL_ABI
 #endif
 
 template<class _Tp>
-class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr
+class _LIBCUDACXX_SHARED_PTR_TRIVIAL_ABI _LIBCUDACXX_TEMPLATE_VIS shared_ptr
 {
 public:
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
     typedef weak_ptr<_Tp> weak_type;
     typedef remove_extent_t<_Tp> element_type;
 #else
@@ -430,14 +430,14 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr
     __shared_weak_count* __cntrl_;
 
 public:
-    _LIBCPP_HIDE_FROM_ABI
-    _LIBCPP_CONSTEXPR shared_ptr() _NOEXCEPT
+    _LIBCUDACXX_HIDE_FROM_ABI
+    _LIBCUDACXX_CONSTEXPR shared_ptr() _NOEXCEPT
         : __ptr_(nullptr),
           __cntrl_(nullptr)
     { }
 
-    _LIBCPP_HIDE_FROM_ABI
-    _LIBCPP_CONSTEXPR shared_ptr(nullptr_t) _NOEXCEPT
+    _LIBCUDACXX_HIDE_FROM_ABI
+    _LIBCUDACXX_CONSTEXPR shared_ptr(nullptr_t) _NOEXCEPT
         : __ptr_(nullptr),
           __cntrl_(nullptr)
     { }
@@ -448,7 +448,7 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr
             // In C++03 we get errors when trying to do SFINAE with the
             // delete operator, so we always pretend that it's deletable.
             // The same happens on GCC.
-#if !defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_COMPILER_GCC)
+#if !defined(_LIBCUDACXX_CXX03_LANG) && !defined(_LIBCUDACXX_COMPILER_GCC)
             , _If<is_array<_Tp>::value, __is_array_deletable<_Yp*>, __is_deletable<_Yp*> >
 #endif
         >::value
@@ -463,123 +463,123 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr
     }
 
     template<class _Yp, class _Dp, class = __enable_if_t<__shared_ptr_deleter_ctor_reqs<_Dp, _Yp, element_type>::value> >
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     shared_ptr(_Yp* __p, _Dp __d)
         : __ptr_(__p)
     {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         try
         {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
             typedef typename __shared_ptr_default_allocator<_Yp>::type _AllocT;
             typedef __shared_ptr_pointer<_Yp*, _Dp, _AllocT> _CntrlBlk;
-#ifndef _LIBCPP_CXX03_LANG
-            __cntrl_ = new _CntrlBlk(__p, _VSTD::move(__d), _AllocT());
+#ifndef _LIBCUDACXX_CXX03_LANG
+            __cntrl_ = new _CntrlBlk(__p, _CUDA_VSTD::move(__d), _AllocT());
 #else
             __cntrl_ = new _CntrlBlk(__p, __d, _AllocT());
-#endif // not _LIBCPP_CXX03_LANG
+#endif // not _LIBCUDACXX_CXX03_LANG
             __enable_weak_this(__p, __p);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         }
         catch (...)
         {
             __d(__p);
             throw;
         }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
     }
 
     template<class _Yp, class _Dp, class _Alloc, class = __enable_if_t<__shared_ptr_deleter_ctor_reqs<_Dp, _Yp, element_type>::value> >
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     shared_ptr(_Yp* __p, _Dp __d, _Alloc __a)
         : __ptr_(__p)
     {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         try
         {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
             typedef __shared_ptr_pointer<_Yp*, _Dp, _Alloc> _CntrlBlk;
             typedef typename __allocator_traits_rebind<_Alloc, _CntrlBlk>::type _A2;
             typedef __allocator_destructor<_A2> _D2;
             _A2 __a2(__a);
             unique_ptr<_CntrlBlk, _D2> __hold2(__a2.allocate(1), _D2(__a2, 1));
-            ::new ((void*)_VSTD::addressof(*__hold2.get()))
-#ifndef _LIBCPP_CXX03_LANG
-                _CntrlBlk(__p, _VSTD::move(__d), __a);
+            ::new ((void*)_CUDA_VSTD::addressof(*__hold2.get()))
+#ifndef _LIBCUDACXX_CXX03_LANG
+                _CntrlBlk(__p, _CUDA_VSTD::move(__d), __a);
 #else
                 _CntrlBlk(__p, __d, __a);
-#endif // not _LIBCPP_CXX03_LANG
-            __cntrl_ = _VSTD::addressof(*__hold2.release());
+#endif // not _LIBCUDACXX_CXX03_LANG
+            __cntrl_ = _CUDA_VSTD::addressof(*__hold2.release());
             __enable_weak_this(__p, __p);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         }
         catch (...)
         {
             __d(__p);
             throw;
         }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
     }
 
     template<class _Dp>
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     shared_ptr(nullptr_t __p, _Dp __d)
         : __ptr_(nullptr)
     {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         try
         {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
             typedef typename __shared_ptr_default_allocator<_Tp>::type _AllocT;
             typedef __shared_ptr_pointer<nullptr_t, _Dp, _AllocT> _CntrlBlk;
-#ifndef _LIBCPP_CXX03_LANG
-            __cntrl_ = new _CntrlBlk(__p, _VSTD::move(__d), _AllocT());
+#ifndef _LIBCUDACXX_CXX03_LANG
+            __cntrl_ = new _CntrlBlk(__p, _CUDA_VSTD::move(__d), _AllocT());
 #else
             __cntrl_ = new _CntrlBlk(__p, __d, _AllocT());
-#endif // not _LIBCPP_CXX03_LANG
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#endif // not _LIBCUDACXX_CXX03_LANG
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         }
         catch (...)
         {
             __d(__p);
             throw;
         }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
     }
 
     template<class _Dp, class _Alloc>
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     shared_ptr(nullptr_t __p, _Dp __d, _Alloc __a)
         : __ptr_(nullptr)
     {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         try
         {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
             typedef __shared_ptr_pointer<nullptr_t, _Dp, _Alloc> _CntrlBlk;
             typedef typename __allocator_traits_rebind<_Alloc, _CntrlBlk>::type _A2;
             typedef __allocator_destructor<_A2> _D2;
             _A2 __a2(__a);
             unique_ptr<_CntrlBlk, _D2> __hold2(__a2.allocate(1), _D2(__a2, 1));
-            ::new ((void*)_VSTD::addressof(*__hold2.get()))
-#ifndef _LIBCPP_CXX03_LANG
-                _CntrlBlk(__p, _VSTD::move(__d), __a);
+            ::new ((void*)_CUDA_VSTD::addressof(*__hold2.get()))
+#ifndef _LIBCUDACXX_CXX03_LANG
+                _CntrlBlk(__p, _CUDA_VSTD::move(__d), __a);
 #else
                 _CntrlBlk(__p, __d, __a);
-#endif // not _LIBCPP_CXX03_LANG
-            __cntrl_ = _VSTD::addressof(*__hold2.release());
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#endif // not _LIBCUDACXX_CXX03_LANG
+            __cntrl_ = _CUDA_VSTD::addressof(*__hold2.release());
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         }
         catch (...)
         {
             __d(__p);
             throw;
         }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
     }
 
     template<class _Yp>
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     shared_ptr(const shared_ptr<_Yp>& __r, element_type *__p) _NOEXCEPT
         : __ptr_(__p),
           __cntrl_(__r.__cntrl_)
@@ -588,7 +588,7 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr
             __cntrl_->__add_shared();
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     shared_ptr(const shared_ptr& __r) _NOEXCEPT
         : __ptr_(__r.__ptr_),
           __cntrl_(__r.__cntrl_)
@@ -598,7 +598,7 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr
     }
 
     template<class _Yp, class = __enable_if_t<__compatible_with<_Yp, _Tp>::value> >
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     shared_ptr(const shared_ptr<_Yp>& __r) _NOEXCEPT
         : __ptr_(__r.__ptr_),
           __cntrl_(__r.__cntrl_)
@@ -607,7 +607,7 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr
             __cntrl_->__add_shared();
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     shared_ptr(shared_ptr&& __r) _NOEXCEPT
         : __ptr_(__r.__ptr_),
           __cntrl_(__r.__cntrl_)
@@ -617,7 +617,7 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr
     }
 
     template<class _Yp, class = __enable_if_t<__compatible_with<_Yp, _Tp>::value> >
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     shared_ptr(shared_ptr<_Yp>&& __r) _NOEXCEPT
         : __ptr_(__r.__ptr_),
           __cntrl_(__r.__cntrl_)
@@ -627,7 +627,7 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr
     }
 
     template<class _Yp, class = __enable_if_t<__compatible_with<_Yp, _Tp>::value> >
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     explicit shared_ptr(const weak_ptr<_Yp>& __r)
         : __ptr_(__r.__ptr_),
           __cntrl_(__r.__cntrl_ ? __r.__cntrl_->lock() : __r.__cntrl_)
@@ -636,9 +636,9 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr
             __throw_bad_weak_ptr();
     }
 
-#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
+#if _LIBCUDACXX_STD_VER <= 14 || defined(_LIBCUDACXX_ENABLE_CXX17_REMOVED_AUTO_PTR)
     template<class _Yp, class = __enable_if_t<is_convertible<_Yp*, element_type*>::value> >
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     shared_ptr(auto_ptr<_Yp>&& __r)
         : __ptr_(__r.get())
     {
@@ -653,11 +653,11 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr
         !is_lvalue_reference<_Dp>::value &&
          is_convertible<typename unique_ptr<_Yp, _Dp>::pointer, element_type*>::value
     > >
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     shared_ptr(unique_ptr<_Yp, _Dp>&& __r)
         : __ptr_(__r.get())
     {
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
         if (__ptr_ == nullptr)
             __cntrl_ = nullptr;
         else
@@ -675,11 +675,11 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr
         is_lvalue_reference<_Dp>::value &&
         is_convertible<typename unique_ptr<_Yp, _Dp>::pointer, element_type*>::value
     > >
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     shared_ptr(unique_ptr<_Yp, _Dp>&& __r)
         : __ptr_(__r.get())
     {
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
         if (__ptr_ == nullptr)
             __cntrl_ = nullptr;
         else
@@ -689,20 +689,20 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr
             typedef __shared_ptr_pointer<typename unique_ptr<_Yp, _Dp>::pointer,
                                         reference_wrapper<typename remove_reference<_Dp>::type>,
                                         _AllocT> _CntrlBlk;
-            __cntrl_ = new _CntrlBlk(__r.get(), _VSTD::ref(__r.get_deleter()), _AllocT());
+            __cntrl_ = new _CntrlBlk(__r.get(), _CUDA_VSTD::ref(__r.get_deleter()), _AllocT());
             __enable_weak_this(__r.get(), __r.get());
         }
         __r.release();
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     ~shared_ptr()
     {
         if (__cntrl_)
             __cntrl_->__release_shared();
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     shared_ptr<_Tp>& operator=(const shared_ptr& __r) _NOEXCEPT
     {
         shared_ptr(__r).swap(*this);
@@ -710,37 +710,37 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr
     }
 
     template<class _Yp, class = __enable_if_t<__compatible_with<_Yp, _Tp>::value> >
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     shared_ptr<_Tp>& operator=(const shared_ptr<_Yp>& __r) _NOEXCEPT
     {
         shared_ptr(__r).swap(*this);
         return *this;
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     shared_ptr<_Tp>& operator=(shared_ptr&& __r) _NOEXCEPT
     {
-        shared_ptr(_VSTD::move(__r)).swap(*this);
+        shared_ptr(_CUDA_VSTD::move(__r)).swap(*this);
         return *this;
     }
 
     template<class _Yp, class = __enable_if_t<__compatible_with<_Yp, _Tp>::value> >
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     shared_ptr<_Tp>& operator=(shared_ptr<_Yp>&& __r)
     {
-        shared_ptr(_VSTD::move(__r)).swap(*this);
+        shared_ptr(_CUDA_VSTD::move(__r)).swap(*this);
         return *this;
     }
 
-#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
+#if _LIBCUDACXX_STD_VER <= 14 || defined(_LIBCUDACXX_ENABLE_CXX17_REMOVED_AUTO_PTR)
     template<class _Yp, class = __enable_if_t<
         !is_array<_Yp>::value &&
         is_convertible<_Yp*, typename shared_ptr<_Tp>::element_type*>::value
     > >
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     shared_ptr<_Tp>& operator=(auto_ptr<_Yp>&& __r)
     {
-        shared_ptr(_VSTD::move(__r)).swap(*this);
+        shared_ptr(_CUDA_VSTD::move(__r)).swap(*this);
         return *this;
     }
 #endif
@@ -748,21 +748,21 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr
     template <class _Yp, class _Dp, class = __enable_if_t<
         is_convertible<typename unique_ptr<_Yp, _Dp>::pointer, element_type*>::value
     > >
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     shared_ptr<_Tp>& operator=(unique_ptr<_Yp, _Dp>&& __r)
     {
-        shared_ptr(_VSTD::move(__r)).swap(*this);
+        shared_ptr(_CUDA_VSTD::move(__r)).swap(*this);
         return *this;
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     void swap(shared_ptr& __r) _NOEXCEPT
     {
-        _VSTD::swap(__ptr_, __r.__ptr_);
-        _VSTD::swap(__cntrl_, __r.__cntrl_);
+        _CUDA_VSTD::swap(__ptr_, __r.__ptr_);
+        _CUDA_VSTD::swap(__cntrl_, __r.__cntrl_);
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     void reset() _NOEXCEPT
     {
         shared_ptr().swap(*this);
@@ -771,7 +771,7 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr
     template<class _Yp, class = __enable_if_t<
         __compatible_with<_Yp, _Tp>::value
     > >
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     void reset(_Yp* __p)
     {
         shared_ptr(__p).swap(*this);
@@ -780,7 +780,7 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr
     template<class _Yp, class _Dp, class = __enable_if_t<
         __compatible_with<_Yp, _Tp>::value
     > >
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     void reset(_Yp* __p, _Dp __d)
     {
         shared_ptr(__p, __d).swap(*this);
@@ -789,25 +789,25 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr
     template<class _Yp, class _Dp, class _Alloc, class = __enable_if_t<
         __compatible_with<_Yp, _Tp>::value
     > >
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     void reset(_Yp* __p, _Dp __d, _Alloc __a)
     {
         shared_ptr(__p, __d, __a).swap(*this);
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     element_type* get() const _NOEXCEPT
     {
         return __ptr_;
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     typename add_lvalue_reference<element_type>::type operator*() const _NOEXCEPT
     {
         return *__ptr_;
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     element_type* operator->() const _NOEXCEPT
     {
         static_assert(!is_array<_Tp>::value,
@@ -815,46 +815,46 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr
         return __ptr_;
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     long use_count() const _NOEXCEPT
     {
         return __cntrl_ ? __cntrl_->use_count() : 0;
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     bool unique() const _NOEXCEPT
     {
         return use_count() == 1;
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     explicit operator bool() const _NOEXCEPT
     {
         return get() != nullptr;
     }
 
     template <class _Up>
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     bool owner_before(shared_ptr<_Up> const& __p) const _NOEXCEPT
     {
         return __cntrl_ < __p.__cntrl_;
     }
 
     template <class _Up>
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     bool owner_before(weak_ptr<_Up> const& __p) const _NOEXCEPT
     {
         return __cntrl_ < __p.__cntrl_;
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     bool __owner_equivalent(const shared_ptr& __p) const
     {
         return __cntrl_ == __p.__cntrl_;
     }
 
-#if _LIBCPP_STD_VER > 14
-    _LIBCPP_HIDE_FROM_ABI
+#if _LIBCUDACXX_STD_VER > 14
+    _LIBCUDACXX_HIDE_FROM_ABI
     typename add_lvalue_reference<element_type>::type operator[](ptr
diff _t __i) const
     {
             static_assert(is_array<_Tp>::value,
@@ -863,19 +863,19 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr
     }
 #endif
 
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCUDACXX_NO_RTTI
     template <class _Dp>
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     _Dp* __get_deleter() const _NOEXCEPT
     {
         return static_cast<_Dp*>(__cntrl_
                     ? const_cast<void *>(__cntrl_->__get_deleter(typeid(_Dp)))
                       : nullptr);
     }
-#endif // _LIBCPP_NO_RTTI
+#endif // _LIBCUDACXX_NO_RTTI
 
     template<class _Yp, class _CntrlBlk>
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     static shared_ptr<_Tp> __create_with_control_block(_Yp* __p, _CntrlBlk* __cntrl) _NOEXCEPT
     {
         shared_ptr<_Tp> __r;
@@ -901,7 +901,7 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr
     template <class _Yp, class _OrigPtr, class = __enable_if_t<
         is_convertible<_OrigPtr*, const enable_shared_from_this<_Yp>*>::value
     > >
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     void __enable_weak_this(const enable_shared_from_this<_Yp>* __e, _OrigPtr* __ptr) _NOEXCEPT
     {
         typedef typename remove_cv<_Yp>::type _RawYp;
@@ -912,7 +912,7 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr
         }
     }
 
-    _LIBCPP_HIDE_FROM_ABI void __enable_weak_this(...) _NOEXCEPT { }
+    _LIBCUDACXX_HIDE_FROM_ABI void __enable_weak_this(...) _NOEXCEPT { }
 
     template <class, class _Yp>
     struct __shared_ptr_default_delete
@@ -929,11 +929,11 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr
         : default_delete<_Yp[]>
     { };
 
-    template <class _Up> friend class _LIBCPP_TEMPLATE_VIS shared_ptr;
-    template <class _Up> friend class _LIBCPP_TEMPLATE_VIS weak_ptr;
+    template <class _Up> friend class _LIBCUDACXX_TEMPLATE_VIS shared_ptr;
+    template <class _Up> friend class _LIBCUDACXX_TEMPLATE_VIS weak_ptr;
 };
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template<class _Tp>
 shared_ptr(weak_ptr<_Tp>) -> shared_ptr<_Tp>;
 template<class _Tp, class _Dp>
@@ -944,25 +944,25 @@ shared_ptr(unique_ptr<_Tp, _Dp>) -> shared_ptr<_Tp>;
 // std::allocate_shared and std::make_shared
 //
 template<class _Tp, class _Alloc, class ..._Args, class = __enable_if_t<!is_array<_Tp>::value> >
-_LIBCPP_HIDE_FROM_ABI
+_LIBCUDACXX_HIDE_FROM_ABI
 shared_ptr<_Tp> allocate_shared(const _Alloc& __a, _Args&& ...__args)
 {
     using _ControlBlock = __shared_ptr_emplace<_Tp, _Alloc>;
     using _ControlBlockAllocator = typename __allocator_traits_rebind<_Alloc, _ControlBlock>::type;
     __allocation_guard<_ControlBlockAllocator> __guard(__a, 1);
-    ::new ((void*)_VSTD::addressof(*__guard.__get())) _ControlBlock(__a, _VSTD::forward<_Args>(__args)...);
+    ::new ((void*)_CUDA_VSTD::addressof(*__guard.__get())) _ControlBlock(__a, _CUDA_VSTD::forward<_Args>(__args)...);
     auto __control_block = __guard.__release_ptr();
-    return shared_ptr<_Tp>::__create_with_control_block((*__control_block).__get_elem(), _VSTD::addressof(*__control_block));
+    return shared_ptr<_Tp>::__create_with_control_block((*__control_block).__get_elem(), _CUDA_VSTD::addressof(*__control_block));
 }
 
 template<class _Tp, class ..._Args, class = __enable_if_t<!is_array<_Tp>::value> >
-_LIBCPP_HIDE_FROM_ABI
+_LIBCUDACXX_HIDE_FROM_ABI
 shared_ptr<_Tp> make_shared(_Args&& ...__args)
 {
-    return _VSTD::allocate_shared<_Tp>(allocator<_Tp>(), _VSTD::forward<_Args>(__args)...);
+    return _CUDA_VSTD::allocate_shared<_Tp>(allocator<_Tp>(), _CUDA_VSTD::forward<_Args>(__args)...);
 }
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 
 template <size_t _Alignment>
 struct __sp_aligned_storage {
@@ -975,17 +975,17 @@ struct __unbounded_array_control_block;
 template <class _Tp, class _Alloc>
 struct __unbounded_array_control_block<_Tp[], _Alloc> : __shared_weak_count
 {
-    _LIBCPP_HIDE_FROM_ABI constexpr
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr
     _Tp* __get_data() noexcept { return __data_; }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     explicit __unbounded_array_control_block(_Alloc const& __alloc, size_t __count, _Tp const& __arg)
         : __alloc_(__alloc), __count_(__count)
     {
         std::__uninitialized_allocator_fill_n(__alloc_, std::begin(__data_), __count_, __arg);
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     explicit __unbounded_array_control_block(_Alloc const& __alloc, size_t __count)
         : __alloc_(__alloc), __count_(__count)
     {
@@ -994,7 +994,7 @@ struct __unbounded_array_control_block<_Tp[], _Alloc> : __shared_weak_count
 
     // Returns the number of bytes required to store a control block followed by the given number
     // of elements of _Tp, with the whole storage being aligned to a multiple of _Tp's alignment.
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     static constexpr size_t __bytes_for(size_t __elements) {
         // When there's 0 elements, the control block alone is enough since it holds one element.
         // Otherwise, we allocate one fewer element than requested because the control block already
@@ -1008,7 +1008,7 @@ struct __unbounded_array_control_block<_Tp[], _Alloc> : __shared_weak_count
         return (__bytes + __align - 1) & ~(__align - 1);
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     ~__unbounded_array_control_block() override { } // can't be `= default` because of the sometimes-non-trivial union member __data_
 
 private:
@@ -1029,7 +1029,7 @@ struct __unbounded_array_control_block<_Tp[], _Alloc> : __shared_weak_count
         allocator_traits<_StorageAlloc>::deallocate(__tmp, _PointerTraits::pointer_to(*__storage), __size);
     }
 
-    _LIBCPP_NO_UNIQUE_ADDRESS _Alloc __alloc_;
+    _LIBCUDACXX_NO_UNIQUE_ADDRESS _Alloc __alloc_;
     size_t __count_;
     union {
         _Tp __data_[1];
@@ -1037,10 +1037,10 @@ struct __unbounded_array_control_block<_Tp[], _Alloc> : __shared_weak_count
 };
 
 template<class _Array, class _Alloc, class... _Arg>
-_LIBCPP_HIDE_FROM_ABI
+_LIBCUDACXX_HIDE_FROM_ABI
 shared_ptr<_Array> __allocate_shared_unbounded_array(const _Alloc& __a, size_t __n, _Arg&& ...__arg)
 {
-    static_assert(__libcpp_is_unbounded_array<_Array>::value);
+    static_assert(__LIBCUDACXX_is_unbounded_array<_Array>::value);
     // We compute the number of bytes necessary to hold the control block and the
     // array elements. Then, we allocate an array of properly-aligned dummy structs
     // large enough to hold the control block and array. This allows shifting the
@@ -1062,20 +1062,20 @@ template <class _Tp, size_t _Count, class _Alloc>
 struct __bounded_array_control_block<_Tp[_Count], _Alloc>
     : __shared_weak_count
 {
-    _LIBCPP_HIDE_FROM_ABI constexpr
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr
     _Tp* __get_data() noexcept { return __data_; }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     explicit __bounded_array_control_block(_Alloc const& __alloc, _Tp const& __arg) : __alloc_(__alloc) {
         std::__uninitialized_allocator_fill_n(__alloc_, std::addressof(__data_[0]), _Count, __arg);
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     explicit __bounded_array_control_block(_Alloc const& __alloc) : __alloc_(__alloc) {
         std::__uninitialized_allocator_value_construct_n(__alloc_, std::addressof(__data_[0]), _Count);
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     ~__bounded_array_control_block() override { } // can't be `= default` because of the sometimes-non-trivial union member __data_
 
 private:
@@ -1093,17 +1093,17 @@ struct __bounded_array_control_block<_Tp[_Count], _Alloc>
         allocator_traits<_ControlBlockAlloc>::deallocate(__tmp, _PointerTraits::pointer_to(*this), sizeof(*this));
     }
 
-    _LIBCPP_NO_UNIQUE_ADDRESS _Alloc __alloc_;
+    _LIBCUDACXX_NO_UNIQUE_ADDRESS _Alloc __alloc_;
     union {
         _Tp __data_[_Count];
     };
 };
 
 template<class _Array, class _Alloc, class... _Arg>
-_LIBCPP_HIDE_FROM_ABI
+_LIBCUDACXX_HIDE_FROM_ABI
 shared_ptr<_Array> __allocate_shared_bounded_array(const _Alloc& __a, _Arg&& ...__arg)
 {
-    static_assert(__libcpp_is_bounded_array<_Array>::value);
+    static_assert(__LIBCUDACXX_is_bounded_array<_Array>::value);
     using _ControlBlock = __bounded_array_control_block<_Array, _Alloc>;
     using _ControlBlockAlloc = __allocator_traits_rebind_t<_Alloc, _ControlBlock>;
 
@@ -1114,70 +1114,70 @@ shared_ptr<_Array> __allocate_shared_bounded_array(const _Alloc& __a, _Arg&& ...
     return shared_ptr<_Array>::__create_with_control_block(__control_block->__get_data(), __control_block);
 }
 
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCUDACXX_STD_VER > 14
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 template<class _Tp, class _Alloc, class = __enable_if_t<is_bounded_array<_Tp>::value>>
-_LIBCPP_HIDE_FROM_ABI
+_LIBCUDACXX_HIDE_FROM_ABI
 shared_ptr<_Tp> allocate_shared(const _Alloc& __a)
 {
     return std::__allocate_shared_bounded_array<_Tp>(__a);
 }
 
 template<class _Tp, class _Alloc, class = __enable_if_t<is_bounded_array<_Tp>::value>>
-_LIBCPP_HIDE_FROM_ABI
+_LIBCUDACXX_HIDE_FROM_ABI
 shared_ptr<_Tp> allocate_shared(const _Alloc& __a, const remove_extent_t<_Tp>& __u)
 {
     return std::__allocate_shared_bounded_array<_Tp>(__a, __u);
 }
 
 template<class _Tp, class _Alloc, class = __enable_if_t<is_unbounded_array<_Tp>::value>>
-_LIBCPP_HIDE_FROM_ABI
+_LIBCUDACXX_HIDE_FROM_ABI
 shared_ptr<_Tp> allocate_shared(const _Alloc& __a, size_t __n)
 {
     return std::__allocate_shared_unbounded_array<_Tp>(__a, __n);
 }
 
 template<class _Tp, class _Alloc, class = __enable_if_t<is_unbounded_array<_Tp>::value>>
-_LIBCPP_HIDE_FROM_ABI
+_LIBCUDACXX_HIDE_FROM_ABI
 shared_ptr<_Tp> allocate_shared(const _Alloc& __a, size_t __n, const remove_extent_t<_Tp>& __u)
 {
     return std::__allocate_shared_unbounded_array<_Tp>(__a, __n, __u);
 }
 
 template<class _Tp, class = __enable_if_t<is_bounded_array<_Tp>::value>>
-_LIBCPP_HIDE_FROM_ABI
+_LIBCUDACXX_HIDE_FROM_ABI
 shared_ptr<_Tp> make_shared()
 {
     return std::__allocate_shared_bounded_array<_Tp>(allocator<_Tp>());
 }
 
 template<class _Tp, class = __enable_if_t<is_bounded_array<_Tp>::value>>
-_LIBCPP_HIDE_FROM_ABI
+_LIBCUDACXX_HIDE_FROM_ABI
 shared_ptr<_Tp> make_shared(const remove_extent_t<_Tp>& __u)
 {
     return std::__allocate_shared_bounded_array<_Tp>(allocator<_Tp>(), __u);
 }
 
 template<class _Tp, class = __enable_if_t<is_unbounded_array<_Tp>::value>>
-_LIBCPP_HIDE_FROM_ABI
+_LIBCUDACXX_HIDE_FROM_ABI
 shared_ptr<_Tp> make_shared(size_t __n)
 {
     return std::__allocate_shared_unbounded_array<_Tp>(allocator<_Tp>(), __n);
 }
 
 template<class _Tp, class = __enable_if_t<is_unbounded_array<_Tp>::value>>
-_LIBCPP_HIDE_FROM_ABI
+_LIBCUDACXX_HIDE_FROM_ABI
 shared_ptr<_Tp> make_shared(size_t __n, const remove_extent_t<_Tp>& __u)
 {
     return std::__allocate_shared_unbounded_array<_Tp>(allocator<_Tp>(), __n, __u);
 }
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
 template<class _Tp, class _Up>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator==(const shared_ptr<_Tp>& __x, const shared_ptr<_Up>& __y) _NOEXCEPT
 {
@@ -1185,7 +1185,7 @@ operator==(const shared_ptr<_Tp>& __x, const shared_ptr<_Up>& __y) _NOEXCEPT
 }
 
 template<class _Tp, class _Up>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator!=(const shared_ptr<_Tp>& __x, const shared_ptr<_Up>& __y) _NOEXCEPT
 {
@@ -1193,11 +1193,11 @@ operator!=(const shared_ptr<_Tp>& __x, const shared_ptr<_Up>& __y) _NOEXCEPT
 }
 
 template<class _Tp, class _Up>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator<(const shared_ptr<_Tp>& __x, const shared_ptr<_Up>& __y) _NOEXCEPT
 {
-#if _LIBCPP_STD_VER <= 11
+#if _LIBCUDACXX_STD_VER <= 11
     typedef typename common_type<_Tp*, _Up*>::type _Vp;
     return less<_Vp>()(__x.get(), __y.get());
 #else
@@ -1207,7 +1207,7 @@ operator<(const shared_ptr<_Tp>& __x, const shared_ptr<_Up>& __y) _NOEXCEPT
 }
 
 template<class _Tp, class _Up>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator>(const shared_ptr<_Tp>& __x, const shared_ptr<_Up>& __y) _NOEXCEPT
 {
@@ -1215,7 +1215,7 @@ operator>(const shared_ptr<_Tp>& __x, const shared_ptr<_Up>& __y) _NOEXCEPT
 }
 
 template<class _Tp, class _Up>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator<=(const shared_ptr<_Tp>& __x, const shared_ptr<_Up>& __y) _NOEXCEPT
 {
@@ -1223,7 +1223,7 @@ operator<=(const shared_ptr<_Tp>& __x, const shared_ptr<_Up>& __y) _NOEXCEPT
 }
 
 template<class _Tp, class _Up>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator>=(const shared_ptr<_Tp>& __x, const shared_ptr<_Up>& __y) _NOEXCEPT
 {
@@ -1231,7 +1231,7 @@ operator>=(const shared_ptr<_Tp>& __x, const shared_ptr<_Up>& __y) _NOEXCEPT
 }
 
 template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator==(const shared_ptr<_Tp>& __x, nullptr_t) _NOEXCEPT
 {
@@ -1239,7 +1239,7 @@ operator==(const shared_ptr<_Tp>& __x, nullptr_t) _NOEXCEPT
 }
 
 template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator==(nullptr_t, const shared_ptr<_Tp>& __x) _NOEXCEPT
 {
@@ -1247,7 +1247,7 @@ operator==(nullptr_t, const shared_ptr<_Tp>& __x) _NOEXCEPT
 }
 
 template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator!=(const shared_ptr<_Tp>& __x, nullptr_t) _NOEXCEPT
 {
@@ -1255,7 +1255,7 @@ operator!=(const shared_ptr<_Tp>& __x, nullptr_t) _NOEXCEPT
 }
 
 template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator!=(nullptr_t, const shared_ptr<_Tp>& __x) _NOEXCEPT
 {
@@ -1263,7 +1263,7 @@ operator!=(nullptr_t, const shared_ptr<_Tp>& __x) _NOEXCEPT
 }
 
 template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator<(const shared_ptr<_Tp>& __x, nullptr_t) _NOEXCEPT
 {
@@ -1271,7 +1271,7 @@ operator<(const shared_ptr<_Tp>& __x, nullptr_t) _NOEXCEPT
 }
 
 template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator<(nullptr_t, const shared_ptr<_Tp>& __x) _NOEXCEPT
 {
@@ -1279,7 +1279,7 @@ operator<(nullptr_t, const shared_ptr<_Tp>& __x) _NOEXCEPT
 }
 
 template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator>(const shared_ptr<_Tp>& __x, nullptr_t) _NOEXCEPT
 {
@@ -1287,7 +1287,7 @@ operator>(const shared_ptr<_Tp>& __x, nullptr_t) _NOEXCEPT
 }
 
 template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator>(nullptr_t, const shared_ptr<_Tp>& __x) _NOEXCEPT
 {
@@ -1295,7 +1295,7 @@ operator>(nullptr_t, const shared_ptr<_Tp>& __x) _NOEXCEPT
 }
 
 template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator<=(const shared_ptr<_Tp>& __x, nullptr_t) _NOEXCEPT
 {
@@ -1303,7 +1303,7 @@ operator<=(const shared_ptr<_Tp>& __x, nullptr_t) _NOEXCEPT
 }
 
 template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator<=(nullptr_t, const shared_ptr<_Tp>& __x) _NOEXCEPT
 {
@@ -1311,7 +1311,7 @@ operator<=(nullptr_t, const shared_ptr<_Tp>& __x) _NOEXCEPT
 }
 
 template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator>=(const shared_ptr<_Tp>& __x, nullptr_t) _NOEXCEPT
 {
@@ -1319,7 +1319,7 @@ operator>=(const shared_ptr<_Tp>& __x, nullptr_t) _NOEXCEPT
 }
 
 template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator>=(nullptr_t, const shared_ptr<_Tp>& __x) _NOEXCEPT
 {
@@ -1327,7 +1327,7 @@ operator>=(nullptr_t, const shared_ptr<_Tp>& __x) _NOEXCEPT
 }
 
 template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 swap(shared_ptr<_Tp>& __x, shared_ptr<_Tp>& __y) _NOEXCEPT
 {
@@ -1335,7 +1335,7 @@ swap(shared_ptr<_Tp>& __x, shared_ptr<_Tp>& __y) _NOEXCEPT
 }
 
 template<class _Tp, class _Up>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 shared_ptr<_Tp>
 static_pointer_cast(const shared_ptr<_Up>& __r) _NOEXCEPT
 {
@@ -1345,7 +1345,7 @@ static_pointer_cast(const shared_ptr<_Up>& __r) _NOEXCEPT
 }
 
 template<class _Tp, class _Up>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 shared_ptr<_Tp>
 dynamic_pointer_cast(const shared_ptr<_Up>& __r) _NOEXCEPT
 {
@@ -1371,23 +1371,23 @@ reinterpret_pointer_cast(const shared_ptr<_Up>& __r) _NOEXCEPT
                                typename shared_ptr<_Tp>::element_type*>(__r.get()));
 }
 
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCUDACXX_NO_RTTI
 
 template<class _Dp, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 _Dp*
 get_deleter(const shared_ptr<_Tp>& __p) _NOEXCEPT
 {
     return __p.template __get_deleter<_Dp>();
 }
 
-#endif // _LIBCPP_NO_RTTI
+#endif // _LIBCUDACXX_NO_RTTI
 
 template<class _Tp>
-class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS weak_ptr
+class _LIBCUDACXX_SHARED_PTR_TRIVIAL_ABI _LIBCUDACXX_TEMPLATE_VIS weak_ptr
 {
 public:
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
     typedef remove_extent_t<_Tp> element_type;
 #else
     typedef _Tp element_type;
@@ -1398,25 +1398,25 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS weak_ptr
     __shared_weak_count* __cntrl_;
 
 public:
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR weak_ptr() _NOEXCEPT;
-    template<class _Yp> _LIBCPP_INLINE_VISIBILITY weak_ptr(shared_ptr<_Yp> const& __r,
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR weak_ptr() _NOEXCEPT;
+    template<class _Yp> _LIBCUDACXX_INLINE_VISIBILITY weak_ptr(shared_ptr<_Yp> const& __r,
                    typename enable_if<__compatible_with<_Yp, _Tp>::value, __nat*>::type = 0)
                         _NOEXCEPT;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     weak_ptr(weak_ptr const& __r) _NOEXCEPT;
-    template<class _Yp> _LIBCPP_INLINE_VISIBILITY weak_ptr(weak_ptr<_Yp> const& __r,
+    template<class _Yp> _LIBCUDACXX_INLINE_VISIBILITY weak_ptr(weak_ptr<_Yp> const& __r,
                    typename enable_if<__compatible_with<_Yp, _Tp>::value, __nat*>::type = 0)
                          _NOEXCEPT;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     weak_ptr(weak_ptr&& __r) _NOEXCEPT;
-    template<class _Yp> _LIBCPP_INLINE_VISIBILITY weak_ptr(weak_ptr<_Yp>&& __r,
+    template<class _Yp> _LIBCUDACXX_INLINE_VISIBILITY weak_ptr(weak_ptr<_Yp>&& __r,
                    typename enable_if<__compatible_with<_Yp, _Tp>::value, __nat*>::type = 0)
                          _NOEXCEPT;
     ~weak_ptr();
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     weak_ptr& operator=(weak_ptr const& __r) _NOEXCEPT;
     template<class _Yp>
         typename enable_if
@@ -1424,10 +1424,10 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS weak_ptr
             __compatible_with<_Yp, _Tp>::value,
             weak_ptr&
         >::type
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         operator=(weak_ptr<_Yp> const& __r) _NOEXCEPT;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     weak_ptr& operator=(weak_ptr&& __r) _NOEXCEPT;
     template<class _Yp>
         typename enable_if
@@ -1435,7 +1435,7 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS weak_ptr
             __compatible_with<_Yp, _Tp>::value,
             weak_ptr&
         >::type
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         operator=(weak_ptr<_Yp>&& __r) _NOEXCEPT;
 
     template<class _Yp>
@@ -1444,42 +1444,42 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS weak_ptr
             __compatible_with<_Yp, _Tp>::value,
             weak_ptr&
         >::type
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         operator=(shared_ptr<_Yp> const& __r) _NOEXCEPT;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void swap(weak_ptr& __r) _NOEXCEPT;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void reset() _NOEXCEPT;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     long use_count() const _NOEXCEPT
         {return __cntrl_ ? __cntrl_->use_count() : 0;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool expired() const _NOEXCEPT
         {return __cntrl_ == nullptr || __cntrl_->use_count() == 0;}
     shared_ptr<_Tp> lock() const _NOEXCEPT;
     template<class _Up>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         bool owner_before(const shared_ptr<_Up>& __r) const _NOEXCEPT
         {return __cntrl_ < __r.__cntrl_;}
     template<class _Up>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         bool owner_before(const weak_ptr<_Up>& __r) const _NOEXCEPT
         {return __cntrl_ < __r.__cntrl_;}
 
-    template <class _Up> friend class _LIBCPP_TEMPLATE_VIS weak_ptr;
-    template <class _Up> friend class _LIBCPP_TEMPLATE_VIS shared_ptr;
+    template <class _Up> friend class _LIBCUDACXX_TEMPLATE_VIS weak_ptr;
+    template <class _Up> friend class _LIBCUDACXX_TEMPLATE_VIS shared_ptr;
 };
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template<class _Tp>
 weak_ptr(shared_ptr<_Tp>) -> weak_ptr<_Tp>;
 #endif
 
 template<class _Tp>
 inline
-_LIBCPP_CONSTEXPR
+_LIBCUDACXX_CONSTEXPR
 weak_ptr<_Tp>::weak_ptr() _NOEXCEPT
     : __ptr_(nullptr),
       __cntrl_(nullptr)
@@ -1580,7 +1580,7 @@ inline
 weak_ptr<_Tp>&
 weak_ptr<_Tp>::operator=(weak_ptr&& __r) _NOEXCEPT
 {
-    weak_ptr(_VSTD::move(__r)).swap(*this);
+    weak_ptr(_CUDA_VSTD::move(__r)).swap(*this);
     return *this;
 }
 
@@ -1594,7 +1594,7 @@ typename enable_if
 >::type
 weak_ptr<_Tp>::operator=(weak_ptr<_Yp>&& __r) _NOEXCEPT
 {
-    weak_ptr(_VSTD::move(__r)).swap(*this);
+    weak_ptr(_CUDA_VSTD::move(__r)).swap(*this);
     return *this;
 }
 
@@ -1617,12 +1617,12 @@ inline
 void
 weak_ptr<_Tp>::swap(weak_ptr& __r) _NOEXCEPT
 {
-    _VSTD::swap(__ptr_, __r.__ptr_);
-    _VSTD::swap(__cntrl_, __r.__cntrl_);
+    _CUDA_VSTD::swap(__ptr_, __r.__ptr_);
+    _CUDA_VSTD::swap(__cntrl_, __r.__cntrl_);
 }
 
 template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 swap(weak_ptr<_Tp>& __x, weak_ptr<_Tp>& __y) _NOEXCEPT
 {
@@ -1648,7 +1648,7 @@ weak_ptr<_Tp>::lock() const _NOEXCEPT
     return __r;
 }
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp = void> struct owner_less;
 #else
 template <class _Tp> struct owner_less;
@@ -1656,53 +1656,53 @@ template <class _Tp> struct owner_less;
 
 
 template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS owner_less<shared_ptr<_Tp> >
+struct _LIBCUDACXX_TEMPLATE_VIS owner_less<shared_ptr<_Tp> >
     : __binary_function<shared_ptr<_Tp>, shared_ptr<_Tp>, bool>
 {
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool operator()(shared_ptr<_Tp> const& __x, shared_ptr<_Tp> const& __y) const _NOEXCEPT
         {return __x.owner_before(__y);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool operator()(shared_ptr<_Tp> const& __x,   weak_ptr<_Tp> const& __y) const _NOEXCEPT
         {return __x.owner_before(__y);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool operator()(  weak_ptr<_Tp> const& __x, shared_ptr<_Tp> const& __y) const _NOEXCEPT
         {return __x.owner_before(__y);}
 };
 
 template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS owner_less<weak_ptr<_Tp> >
+struct _LIBCUDACXX_TEMPLATE_VIS owner_less<weak_ptr<_Tp> >
     : __binary_function<weak_ptr<_Tp>, weak_ptr<_Tp>, bool>
 {
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool operator()(  weak_ptr<_Tp> const& __x,   weak_ptr<_Tp> const& __y) const _NOEXCEPT
         {return __x.owner_before(__y);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool operator()(shared_ptr<_Tp> const& __x,   weak_ptr<_Tp> const& __y) const _NOEXCEPT
         {return __x.owner_before(__y);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool operator()(  weak_ptr<_Tp> const& __x, shared_ptr<_Tp> const& __y) const _NOEXCEPT
         {return __x.owner_before(__y);}
 };
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <>
-struct _LIBCPP_TEMPLATE_VIS owner_less<void>
+struct _LIBCUDACXX_TEMPLATE_VIS owner_less<void>
 {
     template <class _Tp, class _Up>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool operator()( shared_ptr<_Tp> const& __x, shared_ptr<_Up> const& __y) const _NOEXCEPT
         {return __x.owner_before(__y);}
     template <class _Tp, class _Up>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool operator()( shared_ptr<_Tp> const& __x,   weak_ptr<_Up> const& __y) const _NOEXCEPT
         {return __x.owner_before(__y);}
     template <class _Tp, class _Up>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool operator()(   weak_ptr<_Tp> const& __x, shared_ptr<_Up> const& __y) const _NOEXCEPT
         {return __x.owner_before(__y);}
     template <class _Tp, class _Up>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool operator()(   weak_ptr<_Tp> const& __x,   weak_ptr<_Up> const& __y) const _NOEXCEPT
         {return __x.owner_before(__y);}
     typedef void is_transparent;
@@ -1710,51 +1710,51 @@ struct _LIBCPP_TEMPLATE_VIS owner_less<void>
 #endif
 
 template<class _Tp>
-class _LIBCPP_TEMPLATE_VIS enable_shared_from_this
+class _LIBCUDACXX_TEMPLATE_VIS enable_shared_from_this
 {
     mutable weak_ptr<_Tp> __weak_this_;
 protected:
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR
     enable_shared_from_this() _NOEXCEPT {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     enable_shared_from_this(enable_shared_from_this const&) _NOEXCEPT {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     enable_shared_from_this& operator=(enable_shared_from_this const&) _NOEXCEPT
         {return *this;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     ~enable_shared_from_this() {}
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     shared_ptr<_Tp> shared_from_this()
         {return shared_ptr<_Tp>(__weak_this_);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     shared_ptr<_Tp const> shared_from_this() const
         {return shared_ptr<const _Tp>(__weak_this_);}
 
-#if _LIBCPP_STD_VER > 14
-    _LIBCPP_INLINE_VISIBILITY
+#if _LIBCUDACXX_STD_VER > 14
+    _LIBCUDACXX_INLINE_VISIBILITY
     weak_ptr<_Tp> weak_from_this() _NOEXCEPT
        { return __weak_this_; }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     weak_ptr<const _Tp> weak_from_this() const _NOEXCEPT
         { return __weak_this_; }
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCUDACXX_STD_VER > 14
 
     template <class _Up> friend class shared_ptr;
 };
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS hash;
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS hash;
 
 template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS hash<shared_ptr<_Tp> >
+struct _LIBCUDACXX_TEMPLATE_VIS hash<shared_ptr<_Tp> >
 {
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
-    _LIBCPP_DEPRECATED_IN_CXX17 typedef shared_ptr<_Tp> argument_type;
-    _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t          result_type;
+#if _LIBCUDACXX_STD_VER <= 17 || defined(_LIBCUDACXX_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+    _LIBCUDACXX_DEPRECATED_IN_CXX17 typedef shared_ptr<_Tp> argument_type;
+    _LIBCUDACXX_DEPRECATED_IN_CXX17 typedef size_t          result_type;
 #endif
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t operator()(const shared_ptr<_Tp>& __ptr) const _NOEXCEPT
     {
         return hash<typename shared_ptr<_Tp>::element_type*>()(__ptr.get());
@@ -1762,14 +1762,14 @@ struct _LIBCPP_TEMPLATE_VIS hash<shared_ptr<_Tp> >
 };
 
 template<class _CharT, class _Traits, class _Yp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 basic_ostream<_CharT, _Traits>&
 operator<<(basic_ostream<_CharT, _Traits>& __os, shared_ptr<_Yp> const& __p);
 
 
-#if !defined(_LIBCPP_HAS_NO_THREADS)
+#if !defined(_LIBCUDACXX_HAS_NO_THREADS)
 
-class _LIBCPP_TYPE_VIS __sp_mut
+class _LIBCUDACXX_TYPE_VIS __sp_mut
 {
     void* __lx;
 public:
@@ -1777,18 +1777,18 @@ class _LIBCPP_TYPE_VIS __sp_mut
     void unlock() _NOEXCEPT;
 
 private:
-    _LIBCPP_CONSTEXPR __sp_mut(void*) _NOEXCEPT;
+    _LIBCUDACXX_CONSTEXPR __sp_mut(void*) _NOEXCEPT;
     __sp_mut(const __sp_mut&);
     __sp_mut& operator=(const __sp_mut&);
 
-    friend _LIBCPP_FUNC_VIS __sp_mut& __get_sp_mut(const void*);
+    friend _LIBCUDACXX_FUNC_VIS __sp_mut& __get_sp_mut(const void*);
 };
 
-_LIBCPP_FUNC_VIS _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
+_LIBCUDACXX_FUNC_VIS _LIBCUDACXX_AVAILABILITY_ATOMIC_SHARED_PTR
 __sp_mut& __get_sp_mut(const void*);
 
 template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 atomic_is_lock_free(const shared_ptr<_Tp>*)
 {
@@ -1796,7 +1796,7 @@ atomic_is_lock_free(const shared_ptr<_Tp>*)
 }
 
 template <class _Tp>
-_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
+_LIBCUDACXX_AVAILABILITY_ATOMIC_SHARED_PTR
 shared_ptr<_Tp>
 atomic_load(const shared_ptr<_Tp>* __p)
 {
@@ -1808,8 +1808,8 @@ atomic_load(const shared_ptr<_Tp>* __p)
 }
 
 template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_AVAILABILITY_ATOMIC_SHARED_PTR
 shared_ptr<_Tp>
 atomic_load_explicit(const shared_ptr<_Tp>* __p, memory_order)
 {
@@ -1817,7 +1817,7 @@ atomic_load_explicit(const shared_ptr<_Tp>* __p, memory_order)
 }
 
 template <class _Tp>
-_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
+_LIBCUDACXX_AVAILABILITY_ATOMIC_SHARED_PTR
 void
 atomic_store(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r)
 {
@@ -1828,8 +1828,8 @@ atomic_store(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r)
 }
 
 template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_AVAILABILITY_ATOMIC_SHARED_PTR
 void
 atomic_store_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r, memory_order)
 {
@@ -1837,7 +1837,7 @@ atomic_store_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r, memory_order)
 }
 
 template <class _Tp>
-_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
+_LIBCUDACXX_AVAILABILITY_ATOMIC_SHARED_PTR
 shared_ptr<_Tp>
 atomic_exchange(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r)
 {
@@ -1849,8 +1849,8 @@ atomic_exchange(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r)
 }
 
 template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_AVAILABILITY_ATOMIC_SHARED_PTR
 shared_ptr<_Tp>
 atomic_exchange_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r, memory_order)
 {
@@ -1858,7 +1858,7 @@ atomic_exchange_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r, memory_order
 }
 
 template <class _Tp>
-_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
+_LIBCUDACXX_AVAILABILITY_ATOMIC_SHARED_PTR
 bool
 atomic_compare_exchange_strong(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v, shared_ptr<_Tp> __w)
 {
@@ -1867,20 +1867,20 @@ atomic_compare_exchange_strong(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v, share
     __m.lock();
     if (__p->__owner_equivalent(*__v))
     {
-        _VSTD::swap(__temp, *__p);
+        _CUDA_VSTD::swap(__temp, *__p);
         *__p = __w;
         __m.unlock();
         return true;
     }
-    _VSTD::swap(__temp, *__v);
+    _CUDA_VSTD::swap(__temp, *__v);
     *__v = *__p;
     __m.unlock();
     return false;
 }
 
 template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_AVAILABILITY_ATOMIC_SHARED_PTR
 bool
 atomic_compare_exchange_weak(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v, shared_ptr<_Tp> __w)
 {
@@ -1888,8 +1888,8 @@ atomic_compare_exchange_weak(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v, shared_
 }
 
 template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_AVAILABILITY_ATOMIC_SHARED_PTR
 bool
 atomic_compare_exchange_strong_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v,
                                         shared_ptr<_Tp> __w, memory_order, memory_order)
@@ -1898,8 +1898,8 @@ atomic_compare_exchange_strong_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* _
 }
 
 template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_AVAILABILITY_ATOMIC_SHARED_PTR
 bool
 atomic_compare_exchange_weak_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v,
                                       shared_ptr<_Tp> __w, memory_order, memory_order)
@@ -1907,8 +1907,8 @@ atomic_compare_exchange_weak_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v
     return atomic_compare_exchange_weak(__p, __v, __w);
 }
 
-#endif // !defined(_LIBCPP_HAS_NO_THREADS)
+#endif // !defined(_LIBCUDACXX_HAS_NO_THREADS)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___MEMORY_SHARED_PTR_H
+#endif // _LIBCUDACXX___MEMORY_SHARED_PTR_H

diff  --git a/libcxx/include/__memory/swap_allocator.h b/libcxx/include/__memory/swap_allocator.h
index 64970fa9e2f4..57893c470640 100644
--- a/libcxx/include/__memory/swap_allocator.h
+++ b/libcxx/include/__memory/swap_allocator.h
@@ -6,48 +6,48 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___MEMORY_SWAP_ALLOCATOR_H
-#define _LIBCPP___MEMORY_SWAP_ALLOCATOR_H
+#ifndef _LIBCUDACXX___MEMORY_SWAP_ALLOCATOR_H
+#define _LIBCUDACXX___MEMORY_SWAP_ALLOCATOR_H
 
 #include <__config>
 #include <__memory/allocator_traits.h>
 #include <__type_traits/integral_constant.h>
 #include <__utility/swap.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <typename _Alloc>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 void __swap_allocator(_Alloc& __a1, _Alloc& __a2, true_type)
-#if _LIBCPP_STD_VER > 11
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 void __swap_allocator(_Alloc& __a1, _Alloc& __a2, true_type)
+#if _LIBCUDACXX_STD_VER > 11
     _NOEXCEPT
 #else
     _NOEXCEPT_(__is_nothrow_swappable<_Alloc>::value)
 #endif
 {
-  using _VSTD::swap;
+  using _CUDA_VSTD::swap;
   swap(__a1, __a2);
 }
 
 template <typename _Alloc>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 void
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 void
 __swap_allocator(_Alloc&, _Alloc&, false_type) _NOEXCEPT {}
 
 template <typename _Alloc>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 void __swap_allocator(_Alloc& __a1, _Alloc& __a2)
-#if _LIBCPP_STD_VER > 11
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 void __swap_allocator(_Alloc& __a1, _Alloc& __a2)
+#if _LIBCUDACXX_STD_VER > 11
     _NOEXCEPT
 #else
     _NOEXCEPT_(__is_nothrow_swappable<_Alloc>::value)
 #endif
 {
-  _VSTD::__swap_allocator(
+  _CUDA_VSTD::__swap_allocator(
       __a1, __a2, integral_constant<bool, allocator_traits<_Alloc>::propagate_on_container_swap::value>());
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___MEMORY_SWAP_ALLOCATOR_H
+#endif // _LIBCUDACXX___MEMORY_SWAP_ALLOCATOR_H

diff  --git a/libcxx/include/__memory/temporary_buffer.h b/libcxx/include/__memory/temporary_buffer.h
index b1f7a126299f..2f5cdb78ae4f 100644
--- a/libcxx/include/__memory/temporary_buffer.h
+++ b/libcxx/include/__memory/temporary_buffer.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___MEMORY_TEMPORARY_BUFFER_H
-#define _LIBCPP___MEMORY_TEMPORARY_BUFFER_H
+#ifndef _LIBCUDACXX___MEMORY_TEMPORARY_BUFFER_H
+#define _LIBCUDACXX___MEMORY_TEMPORARY_BUFFER_H
 
 #include <__config>
 #include <__type_traits/alignment_of.h>
@@ -16,14 +16,14 @@
 #include <cstddef>
 #include <new>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Tp>
-_LIBCPP_NODISCARD_EXT _LIBCPP_NO_CFI _LIBCPP_DEPRECATED_IN_CXX17
+_LIBCUDACXX_NODISCARD_EXT _LIBCUDACXX_NO_CFI _LIBCUDACXX_DEPRECATED_IN_CXX17
 pair<_Tp*, ptr
diff _t>
 get_temporary_buffer(ptr
diff _t __n) _NOEXCEPT
 {
@@ -35,8 +35,8 @@ get_temporary_buffer(ptr
diff _t __n) _NOEXCEPT
         __n = __m;
     while (__n > 0)
     {
-#if !defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION)
-    if (__is_overaligned_for_new(_LIBCPP_ALIGNOF(_Tp)))
+#if !defined(_LIBCUDACXX_HAS_NO_ALIGNED_ALLOCATION)
+    if (__is_overaligned_for_new(_LIBCUDACXX_ALIGNOF(_Tp)))
         {
             align_val_t __al =
                 align_val_t(alignment_of<_Tp>::value);
@@ -47,7 +47,7 @@ get_temporary_buffer(ptr
diff _t __n) _NOEXCEPT
                 __n * sizeof(_Tp), nothrow));
         }
 #else
-    if (__is_overaligned_for_new(_LIBCPP_ALIGNOF(_Tp)))
+    if (__is_overaligned_for_new(_LIBCUDACXX_ALIGNOF(_Tp)))
         {
             // Since aligned operator new is unavailable, return an empty
             // buffer rather than one with invalid alignment.
@@ -68,20 +68,20 @@ get_temporary_buffer(ptr
diff _t __n) _NOEXCEPT
 }
 
 template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_DEPRECATED_IN_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_DEPRECATED_IN_CXX17
 void return_temporary_buffer(_Tp* __p) _NOEXCEPT
 {
-  _VSTD::__libcpp_deallocate_unsized((void*)__p, _LIBCPP_ALIGNOF(_Tp));
+  _CUDA_VSTD::__LIBCUDACXX_deallocate_unsized((void*)__p, _LIBCUDACXX_ALIGNOF(_Tp));
 }
 
 struct __return_temporary_buffer
 {
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+_LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
     template <class _Tp>
-    _LIBCPP_INLINE_VISIBILITY void operator()(_Tp* __p) const {_VSTD::return_temporary_buffer(__p);}
-_LIBCPP_SUPPRESS_DEPRECATED_POP
+    _LIBCUDACXX_INLINE_VISIBILITY void operator()(_Tp* __p) const {_CUDA_VSTD::return_temporary_buffer(__p);}
+_LIBCUDACXX_SUPPRESS_DEPRECATED_POP
 };
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___MEMORY_TEMPORARY_BUFFER_H
+#endif // _LIBCUDACXX___MEMORY_TEMPORARY_BUFFER_H

diff  --git a/libcxx/include/__memory/uninitialized_algorithms.h b/libcxx/include/__memory/uninitialized_algorithms.h
index 4f3d4e90cb6e..64cf0df60f33 100644
--- a/libcxx/include/__memory/uninitialized_algorithms.h
+++ b/libcxx/include/__memory/uninitialized_algorithms.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___MEMORY_UNINITIALIZED_ALGORITHMS_H
-#define _LIBCPP___MEMORY_UNINITIALIZED_ALGORITHMS_H
+#ifndef _LIBCUDACXX___MEMORY_UNINITIALIZED_ALGORITHMS_H
+#define _LIBCUDACXX___MEMORY_UNINITIALIZED_ALGORITHMS_H
 
 #include <__algorithm/copy.h>
 #include <__algorithm/move.h>
@@ -26,17 +26,17 @@
 #include <__utility/transaction.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 // This is a simplified version of C++20 `unreachable_sentinel` that doesn't use concepts and thus can be used in any
 // language mode.
 struct __unreachable_sentinel {
   template <class _Iter>
-  _LIBCPP_HIDE_FROM_ABI friend _LIBCPP_CONSTEXPR bool operator!=(const _Iter&, __unreachable_sentinel) _NOEXCEPT {
+  _LIBCUDACXX_HIDE_FROM_ABI friend _LIBCUDACXX_CONSTEXPR bool operator!=(const _Iter&, __unreachable_sentinel) _NOEXCEPT {
     return true;
   }
 };
@@ -44,83 +44,83 @@ struct __unreachable_sentinel {
 // uninitialized_copy
 
 template <class _ValueType, class _InputIterator, class _Sentinel1, class _ForwardIterator, class _Sentinel2>
-inline _LIBCPP_HIDE_FROM_ABI pair<_InputIterator, _ForwardIterator>
+inline _LIBCUDACXX_HIDE_FROM_ABI pair<_InputIterator, _ForwardIterator>
 __uninitialized_copy(_InputIterator __ifirst, _Sentinel1 __ilast,
                      _ForwardIterator __ofirst, _Sentinel2 __olast) {
   _ForwardIterator __idx = __ofirst;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
   try {
 #endif
     for (; __ifirst != __ilast && __idx != __olast; ++__ifirst, (void)++__idx)
-      ::new (_VSTD::__voidify(*__idx)) _ValueType(*__ifirst);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+      ::new (_CUDA_VSTD::__voidify(*__idx)) _ValueType(*__ifirst);
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
   } catch (...) {
-    _VSTD::__destroy(__ofirst, __idx);
+    _CUDA_VSTD::__destroy(__ofirst, __idx);
     throw;
   }
 #endif
 
-  return pair<_InputIterator, _ForwardIterator>(_VSTD::move(__ifirst), _VSTD::move(__idx));
+  return pair<_InputIterator, _ForwardIterator>(_CUDA_VSTD::move(__ifirst), _CUDA_VSTD::move(__idx));
 }
 
 template <class _InputIterator, class _ForwardIterator>
 _ForwardIterator uninitialized_copy(_InputIterator __ifirst, _InputIterator __ilast,
                                     _ForwardIterator __ofirst) {
   typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType;
-  auto __result = _VSTD::__uninitialized_copy<_ValueType>(_VSTD::move(__ifirst), _VSTD::move(__ilast),
-                                                          _VSTD::move(__ofirst), __unreachable_sentinel());
-  return _VSTD::move(__result.second);
+  auto __result = _CUDA_VSTD::__uninitialized_copy<_ValueType>(_CUDA_VSTD::move(__ifirst), _CUDA_VSTD::move(__ilast),
+                                                          _CUDA_VSTD::move(__ofirst), __unreachable_sentinel());
+  return _CUDA_VSTD::move(__result.second);
 }
 
 // uninitialized_copy_n
 
 template <class _ValueType, class _InputIterator, class _Size, class _ForwardIterator, class _Sentinel>
-inline _LIBCPP_HIDE_FROM_ABI pair<_InputIterator, _ForwardIterator>
+inline _LIBCUDACXX_HIDE_FROM_ABI pair<_InputIterator, _ForwardIterator>
 __uninitialized_copy_n(_InputIterator __ifirst, _Size __n,
                        _ForwardIterator __ofirst, _Sentinel __olast) {
   _ForwardIterator __idx = __ofirst;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
   try {
 #endif
     for (; __n > 0 && __idx != __olast; ++__ifirst, (void)++__idx, (void)--__n)
-      ::new (_VSTD::__voidify(*__idx)) _ValueType(*__ifirst);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+      ::new (_CUDA_VSTD::__voidify(*__idx)) _ValueType(*__ifirst);
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
   } catch (...) {
-    _VSTD::__destroy(__ofirst, __idx);
+    _CUDA_VSTD::__destroy(__ofirst, __idx);
     throw;
   }
 #endif
 
-  return pair<_InputIterator, _ForwardIterator>(_VSTD::move(__ifirst), _VSTD::move(__idx));
+  return pair<_InputIterator, _ForwardIterator>(_CUDA_VSTD::move(__ifirst), _CUDA_VSTD::move(__idx));
 }
 
 template <class _InputIterator, class _Size, class _ForwardIterator>
-inline _LIBCPP_HIDE_FROM_ABI _ForwardIterator uninitialized_copy_n(_InputIterator __ifirst, _Size __n,
+inline _LIBCUDACXX_HIDE_FROM_ABI _ForwardIterator uninitialized_copy_n(_InputIterator __ifirst, _Size __n,
                                                                    _ForwardIterator __ofirst) {
   typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType;
-  auto __result = _VSTD::__uninitialized_copy_n<_ValueType>(_VSTD::move(__ifirst), __n, _VSTD::move(__ofirst),
+  auto __result = _CUDA_VSTD::__uninitialized_copy_n<_ValueType>(_CUDA_VSTD::move(__ifirst), __n, _CUDA_VSTD::move(__ofirst),
                                                             __unreachable_sentinel());
-  return _VSTD::move(__result.second);
+  return _CUDA_VSTD::move(__result.second);
 }
 
 // uninitialized_fill
 
 template <class _ValueType, class _ForwardIterator, class _Sentinel, class _Tp>
-inline _LIBCPP_HIDE_FROM_ABI
+inline _LIBCUDACXX_HIDE_FROM_ABI
 _ForwardIterator __uninitialized_fill(_ForwardIterator __first, _Sentinel __last, const _Tp& __x)
 {
     _ForwardIterator __idx = __first;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     try
     {
 #endif
         for (; __idx != __last; ++__idx)
-            ::new (_VSTD::__voidify(*__idx)) _ValueType(__x);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+            ::new (_CUDA_VSTD::__voidify(*__idx)) _ValueType(__x);
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     }
     catch (...)
     {
-        _VSTD::__destroy(__first, __idx);
+        _CUDA_VSTD::__destroy(__first, __idx);
         throw;
     }
 #endif
@@ -129,31 +129,31 @@ _ForwardIterator __uninitialized_fill(_ForwardIterator __first, _Sentinel __last
 }
 
 template <class _ForwardIterator, class _Tp>
-inline _LIBCPP_HIDE_FROM_ABI
+inline _LIBCUDACXX_HIDE_FROM_ABI
 void uninitialized_fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __x)
 {
     typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType;
-    (void)_VSTD::__uninitialized_fill<_ValueType>(__first, __last, __x);
+    (void)_CUDA_VSTD::__uninitialized_fill<_ValueType>(__first, __last, __x);
 }
 
 // uninitialized_fill_n
 
 template <class _ValueType, class _ForwardIterator, class _Size, class _Tp>
-inline _LIBCPP_HIDE_FROM_ABI
+inline _LIBCUDACXX_HIDE_FROM_ABI
 _ForwardIterator __uninitialized_fill_n(_ForwardIterator __first, _Size __n, const _Tp& __x)
 {
     _ForwardIterator __idx = __first;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     try
     {
 #endif
         for (; __n > 0; ++__idx, (void) --__n)
-            ::new (_VSTD::__voidify(*__idx)) _ValueType(__x);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+            ::new (_CUDA_VSTD::__voidify(*__idx)) _ValueType(__x);
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     }
     catch (...)
     {
-        _VSTD::__destroy(__first, __idx);
+        _CUDA_VSTD::__destroy(__first, __idx);
         throw;
     }
 #endif
@@ -162,29 +162,29 @@ _ForwardIterator __uninitialized_fill_n(_ForwardIterator __first, _Size __n, con
 }
 
 template <class _ForwardIterator, class _Size, class _Tp>
-inline _LIBCPP_HIDE_FROM_ABI
+inline _LIBCUDACXX_HIDE_FROM_ABI
 _ForwardIterator uninitialized_fill_n(_ForwardIterator __first, _Size __n, const _Tp& __x)
 {
     typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType;
-    return _VSTD::__uninitialized_fill_n<_ValueType>(__first, __n, __x);
+    return _CUDA_VSTD::__uninitialized_fill_n<_ValueType>(__first, __n, __x);
 }
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 
 // uninitialized_default_construct
 
 template <class _ValueType, class _ForwardIterator, class _Sentinel>
-inline _LIBCPP_HIDE_FROM_ABI
+inline _LIBCUDACXX_HIDE_FROM_ABI
 _ForwardIterator __uninitialized_default_construct(_ForwardIterator __first, _Sentinel __last) {
     auto __idx = __first;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     try {
 #endif
     for (; __idx != __last; ++__idx)
-        ::new (_VSTD::__voidify(*__idx)) _ValueType;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+        ::new (_CUDA_VSTD::__voidify(*__idx)) _ValueType;
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     } catch (...) {
-        _VSTD::__destroy(__first, __idx);
+        _CUDA_VSTD::__destroy(__first, __idx);
         throw;
     }
 #endif
@@ -193,27 +193,27 @@ _ForwardIterator __uninitialized_default_construct(_ForwardIterator __first, _Se
 }
 
 template <class _ForwardIterator>
-inline _LIBCPP_HIDE_FROM_ABI
+inline _LIBCUDACXX_HIDE_FROM_ABI
 void uninitialized_default_construct(_ForwardIterator __first, _ForwardIterator __last) {
     using _ValueType = typename iterator_traits<_ForwardIterator>::value_type;
-    (void)_VSTD::__uninitialized_default_construct<_ValueType>(
-        _VSTD::move(__first), _VSTD::move(__last));
+    (void)_CUDA_VSTD::__uninitialized_default_construct<_ValueType>(
+        _CUDA_VSTD::move(__first), _CUDA_VSTD::move(__last));
 }
 
 // uninitialized_default_construct_n
 
 template <class _ValueType, class _ForwardIterator, class _Size>
-inline _LIBCPP_HIDE_FROM_ABI
+inline _LIBCUDACXX_HIDE_FROM_ABI
 _ForwardIterator __uninitialized_default_construct_n(_ForwardIterator __first, _Size __n) {
     auto __idx = __first;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     try {
 #endif
     for (; __n > 0; ++__idx, (void) --__n)
-        ::new (_VSTD::__voidify(*__idx)) _ValueType;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+        ::new (_CUDA_VSTD::__voidify(*__idx)) _ValueType;
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     } catch (...) {
-        _VSTD::__destroy(__first, __idx);
+        _CUDA_VSTD::__destroy(__first, __idx);
         throw;
     }
 #endif
@@ -222,26 +222,26 @@ _ForwardIterator __uninitialized_default_construct_n(_ForwardIterator __first, _
 }
 
 template <class _ForwardIterator, class _Size>
-inline _LIBCPP_HIDE_FROM_ABI
+inline _LIBCUDACXX_HIDE_FROM_ABI
 _ForwardIterator uninitialized_default_construct_n(_ForwardIterator __first, _Size __n) {
     using _ValueType = typename iterator_traits<_ForwardIterator>::value_type;
-    return _VSTD::__uninitialized_default_construct_n<_ValueType>(_VSTD::move(__first), __n);
+    return _CUDA_VSTD::__uninitialized_default_construct_n<_ValueType>(_CUDA_VSTD::move(__first), __n);
 }
 
 // uninitialized_value_construct
 
 template <class _ValueType, class _ForwardIterator, class _Sentinel>
-inline _LIBCPP_HIDE_FROM_ABI
+inline _LIBCUDACXX_HIDE_FROM_ABI
 _ForwardIterator __uninitialized_value_construct(_ForwardIterator __first, _Sentinel __last) {
     auto __idx = __first;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     try {
 #endif
     for (; __idx != __last; ++__idx)
-        ::new (_VSTD::__voidify(*__idx)) _ValueType();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+        ::new (_CUDA_VSTD::__voidify(*__idx)) _ValueType();
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     } catch (...) {
-        _VSTD::__destroy(__first, __idx);
+        _CUDA_VSTD::__destroy(__first, __idx);
         throw;
     }
 #endif
@@ -250,27 +250,27 @@ _ForwardIterator __uninitialized_value_construct(_ForwardIterator __first, _Sent
 }
 
 template <class _ForwardIterator>
-inline _LIBCPP_HIDE_FROM_ABI
+inline _LIBCUDACXX_HIDE_FROM_ABI
 void uninitialized_value_construct(_ForwardIterator __first, _ForwardIterator __last) {
     using _ValueType = typename iterator_traits<_ForwardIterator>::value_type;
-    (void)_VSTD::__uninitialized_value_construct<_ValueType>(
-        _VSTD::move(__first), _VSTD::move(__last));
+    (void)_CUDA_VSTD::__uninitialized_value_construct<_ValueType>(
+        _CUDA_VSTD::move(__first), _CUDA_VSTD::move(__last));
 }
 
 // uninitialized_value_construct_n
 
 template <class _ValueType, class _ForwardIterator, class _Size>
-inline _LIBCPP_HIDE_FROM_ABI
+inline _LIBCUDACXX_HIDE_FROM_ABI
 _ForwardIterator __uninitialized_value_construct_n(_ForwardIterator __first, _Size __n) {
     auto __idx = __first;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     try {
 #endif
     for (; __n > 0; ++__idx, (void) --__n)
-        ::new (_VSTD::__voidify(*__idx)) _ValueType();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+        ::new (_CUDA_VSTD::__voidify(*__idx)) _ValueType();
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     } catch (...) {
-        _VSTD::__destroy(__first, __idx);
+        _CUDA_VSTD::__destroy(__first, __idx);
         throw;
     }
 #endif
@@ -279,76 +279,76 @@ _ForwardIterator __uninitialized_value_construct_n(_ForwardIterator __first, _Si
 }
 
 template <class _ForwardIterator, class _Size>
-inline _LIBCPP_HIDE_FROM_ABI
+inline _LIBCUDACXX_HIDE_FROM_ABI
 _ForwardIterator uninitialized_value_construct_n(_ForwardIterator __first, _Size __n) {
     using _ValueType = typename iterator_traits<_ForwardIterator>::value_type;
-    return __uninitialized_value_construct_n<_ValueType>(_VSTD::move(__first), __n);
+    return __uninitialized_value_construct_n<_ValueType>(_CUDA_VSTD::move(__first), __n);
 }
 
 // uninitialized_move
 
 template <class _ValueType, class _InputIterator, class _Sentinel1, class _ForwardIterator, class _Sentinel2,
           class _IterMove>
-inline _LIBCPP_HIDE_FROM_ABI pair<_InputIterator, _ForwardIterator>
+inline _LIBCUDACXX_HIDE_FROM_ABI pair<_InputIterator, _ForwardIterator>
 __uninitialized_move(_InputIterator __ifirst, _Sentinel1 __ilast,
                      _ForwardIterator __ofirst, _Sentinel2 __olast, _IterMove __iter_move) {
   auto __idx = __ofirst;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
   try {
 #endif
     for (; __ifirst != __ilast && __idx != __olast; ++__idx, (void)++__ifirst) {
-      ::new (_VSTD::__voidify(*__idx)) _ValueType(__iter_move(__ifirst));
+      ::new (_CUDA_VSTD::__voidify(*__idx)) _ValueType(__iter_move(__ifirst));
     }
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
   } catch (...) {
-    _VSTD::__destroy(__ofirst, __idx);
+    _CUDA_VSTD::__destroy(__ofirst, __idx);
     throw;
   }
 #endif
 
-  return {_VSTD::move(__ifirst), _VSTD::move(__idx)};
+  return {_CUDA_VSTD::move(__ifirst), _CUDA_VSTD::move(__idx)};
 }
 
 template <class _InputIterator, class _ForwardIterator>
-inline _LIBCPP_HIDE_FROM_ABI _ForwardIterator uninitialized_move(_InputIterator __ifirst, _InputIterator __ilast,
+inline _LIBCUDACXX_HIDE_FROM_ABI _ForwardIterator uninitialized_move(_InputIterator __ifirst, _InputIterator __ilast,
                                                                  _ForwardIterator __ofirst) {
   using _ValueType = typename iterator_traits<_ForwardIterator>::value_type;
-  auto __iter_move = [](auto&& __iter) -> decltype(auto) { return _VSTD::move(*__iter); };
+  auto __iter_move = [](auto&& __iter) -> decltype(auto) { return _CUDA_VSTD::move(*__iter); };
 
-  auto __result = _VSTD::__uninitialized_move<_ValueType>(_VSTD::move(__ifirst), _VSTD::move(__ilast),
-                                                          _VSTD::move(__ofirst), __unreachable_sentinel(), __iter_move);
-  return _VSTD::move(__result.second);
+  auto __result = _CUDA_VSTD::__uninitialized_move<_ValueType>(_CUDA_VSTD::move(__ifirst), _CUDA_VSTD::move(__ilast),
+                                                          _CUDA_VSTD::move(__ofirst), __unreachable_sentinel(), __iter_move);
+  return _CUDA_VSTD::move(__result.second);
 }
 
 // uninitialized_move_n
 
 template <class _ValueType, class _InputIterator, class _Size, class _ForwardIterator, class _Sentinel, class _IterMove>
-inline _LIBCPP_HIDE_FROM_ABI pair<_InputIterator, _ForwardIterator>
+inline _LIBCUDACXX_HIDE_FROM_ABI pair<_InputIterator, _ForwardIterator>
 __uninitialized_move_n(_InputIterator __ifirst, _Size __n,
                        _ForwardIterator __ofirst, _Sentinel __olast, _IterMove __iter_move) {
   auto __idx = __ofirst;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
   try {
 #endif
     for (; __n > 0 && __idx != __olast; ++__idx, (void)++__ifirst, --__n)
-      ::new (_VSTD::__voidify(*__idx)) _ValueType(__iter_move(__ifirst));
-#ifndef _LIBCPP_NO_EXCEPTIONS
+      ::new (_CUDA_VSTD::__voidify(*__idx)) _ValueType(__iter_move(__ifirst));
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
   } catch (...) {
-    _VSTD::__destroy(__ofirst, __idx);
+    _CUDA_VSTD::__destroy(__ofirst, __idx);
     throw;
   }
 #endif
 
-  return {_VSTD::move(__ifirst), _VSTD::move(__idx)};
+  return {_CUDA_VSTD::move(__ifirst), _CUDA_VSTD::move(__idx)};
 }
 
 template <class _InputIterator, class _Size, class _ForwardIterator>
-inline _LIBCPP_HIDE_FROM_ABI pair<_InputIterator, _ForwardIterator>
+inline _LIBCUDACXX_HIDE_FROM_ABI pair<_InputIterator, _ForwardIterator>
 uninitialized_move_n(_InputIterator __ifirst, _Size __n, _ForwardIterator __ofirst) {
   using _ValueType = typename iterator_traits<_ForwardIterator>::value_type;
-  auto __iter_move = [](auto&& __iter) -> decltype(auto) { return _VSTD::move(*__iter); };
+  auto __iter_move = [](auto&& __iter) -> decltype(auto) { return _CUDA_VSTD::move(*__iter); };
 
-  return _VSTD::__uninitialized_move_n<_ValueType>(_VSTD::move(__ifirst), __n, _VSTD::move(__ofirst),
+  return _CUDA_VSTD::__uninitialized_move_n<_ValueType>(_CUDA_VSTD::move(__ifirst), __n, _CUDA_VSTD::move(__ofirst),
                                                    __unreachable_sentinel(), __iter_move);
 }
 
@@ -362,7 +362,7 @@ uninitialized_move_n(_InputIterator __ifirst, _Size __n, _ForwardIterator __ofir
 template<class _Alloc, class _BidirIter, class = __enable_if_t<
     __is_cpp17_bidirectional_iterator<_BidirIter>::value
 >>
-_LIBCPP_HIDE_FROM_ABI
+_LIBCUDACXX_HIDE_FROM_ABI
 constexpr void __allocator_destroy_multidimensional(_Alloc& __alloc, _BidirIter __first, _BidirIter __last) noexcept {
     using _ValueType = typename iterator_traits<_BidirIter>::value_type;
     static_assert(is_same_v<typename allocator_traits<_Alloc>::value_type, _ValueType>,
@@ -372,7 +372,7 @@ constexpr void __allocator_destroy_multidimensional(_Alloc& __alloc, _BidirIter
         return;
 
     if constexpr (is_array_v<_ValueType>) {
-        static_assert(!__libcpp_is_unbounded_array<_ValueType>::value,
+        static_assert(!__LIBCUDACXX_is_unbounded_array<_ValueType>::value,
             "arrays of unbounded arrays don't exist, but if they did we would mess up here");
 
         using _Element = remove_extent_t<_ValueType>;
@@ -398,7 +398,7 @@ constexpr void __allocator_destroy_multidimensional(_Alloc& __alloc, _BidirIter
 //
 // This function assumes that the allocator is bound to the correct type.
 template<class _Alloc, class _Tp>
-_LIBCPP_HIDE_FROM_ABI
+_LIBCUDACXX_HIDE_FROM_ABI
 constexpr void __allocator_construct_at(_Alloc& __alloc, _Tp* __loc) {
     static_assert(is_same_v<typename allocator_traits<_Alloc>::value_type, _Tp>,
         "The allocator should already be rebound to the correct type");
@@ -431,7 +431,7 @@ constexpr void __allocator_construct_at(_Alloc& __alloc, _Tp* __loc) {
 //
 // This function assumes that the allocator is bound to the correct type.
 template<class _Alloc, class _Tp, class _Arg>
-_LIBCPP_HIDE_FROM_ABI
+_LIBCUDACXX_HIDE_FROM_ABI
 constexpr void __allocator_construct_at(_Alloc& __alloc, _Tp* __loc, _Arg const& __arg) {
     static_assert(is_same_v<typename allocator_traits<_Alloc>::value_type, _Tp>,
         "The allocator should already be rebound to the correct type");
@@ -465,7 +465,7 @@ constexpr void __allocator_construct_at(_Alloc& __alloc, _Tp* __loc, _Arg const&
 // initialization using allocator_traits destruction. If the elements in the range are C-style
 // arrays, they are initialized element-wise using allocator construction, and recursively so.
 template<class _Alloc, class _BidirIter, class _Tp, class _Size = typename iterator_traits<_BidirIter>::
diff erence_type>
-_LIBCPP_HIDE_FROM_ABI
+_LIBCUDACXX_HIDE_FROM_ABI
 constexpr void __uninitialized_allocator_fill_n(_Alloc& __alloc, _BidirIter __it, _Size __n, _Tp const& __value) {
     using _ValueType = typename iterator_traits<_BidirIter>::value_type;
     __allocator_traits_rebind_t<_Alloc, _ValueType> __value_alloc(__alloc);
@@ -482,7 +482,7 @@ constexpr void __uninitialized_allocator_fill_n(_Alloc& __alloc, _BidirIter __it
 // Same as __uninitialized_allocator_fill_n, but doesn't pass any initialization argument
 // to the allocator's construct method, which results in value initialization.
 template<class _Alloc, class _BidirIter, class _Size = typename iterator_traits<_BidirIter>::
diff erence_type>
-_LIBCPP_HIDE_FROM_ABI
+_LIBCUDACXX_HIDE_FROM_ABI
 constexpr void __uninitialized_allocator_value_construct_n(_Alloc& __alloc, _BidirIter __it, _Size __n) {
     using _ValueType = typename iterator_traits<_BidirIter>::value_type;
     __allocator_traits_rebind_t<_Alloc, _ValueType> __value_alloc(__alloc);
@@ -496,11 +496,11 @@ constexpr void __uninitialized_allocator_value_construct_n(_Alloc& __alloc, _Bid
     __guard.__complete();
 }
 
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCUDACXX_STD_VER > 14
 
 // Destroy all elements in [__first, __last) from left to right using allocator destruction.
 template <class _Alloc, class _Iter, class _Sent>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 void
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 void
 __allocator_destroy(_Alloc& __alloc, _Iter __first, _Sent __last) {
   for (; __first != __last; ++__first)
      allocator_traits<_Alloc>::destroy(__alloc, std::__to_address(__first));
@@ -509,11 +509,11 @@ __allocator_destroy(_Alloc& __alloc, _Iter __first, _Sent __last) {
 template <class _Alloc, class _Iter>
 class _AllocatorDestroyRangeReverse {
 public:
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
   _AllocatorDestroyRangeReverse(_Alloc& __alloc, _Iter& __first, _Iter& __last)
       : __alloc_(__alloc), __first_(__first), __last_(__last) {}
 
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 void operator()() const {
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 void operator()() const {
     std::__allocator_destroy(__alloc_, std::reverse_iterator<_Iter>(__last_), std::reverse_iterator<_Iter>(__first_));
   }
 
@@ -528,9 +528,9 @@ class _AllocatorDestroyRangeReverse {
 // The caller has to ensure that __first2 can hold at least N uninitialized elements. If an exception is thrown the
 // already copied elements are destroyed in reverse order of their construction.
 template <class _Alloc, class _Iter1, class _Sent1, class _Iter2>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _Iter2
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _Iter2
 __uninitialized_allocator_copy(_Alloc& __alloc, _Iter1 __first1, _Sent1 __last1, _Iter2 __first2) {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
   auto __destruct_first = __first2;
   try {
 #endif
@@ -539,7 +539,7 @@ __uninitialized_allocator_copy(_Alloc& __alloc, _Iter1 __first1, _Sent1 __last1,
     ++__first1;
     ++__first2;
   }
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
   } catch (...) {
     _AllocatorDestroyRangeReverse<_Alloc, _Iter2>(__alloc, __destruct_first, __first2)();
     throw;
@@ -561,10 +561,10 @@ template <class _Alloc,
               // using _RawType because of the allocator<T const> extension
               is_trivially_copy_constructible<_RawType>::value && is_trivially_copy_assignable<_RawType>::value &&
               __allocator_has_trivial_copy_construct<_Alloc, _RawType>::value>* = nullptr>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _Type*
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _Type*
 __uninitialized_allocator_copy(_Alloc&, const _Type* __first1, const _Type* __last1, _Type* __first2) {
   // TODO: Remove the const_cast once we drop support for std::allocator<T const>
-  if (__libcpp_is_constant_evaluated()) {
+  if (__LIBCUDACXX_is_constant_evaluated()) {
     while (__first1 != __last1) {
       std::__construct_at(std::__to_address(__first2), *__first1);
       ++__first1;
@@ -582,16 +582,16 @@ __uninitialized_allocator_copy(_Alloc&, const _Type* __first1, const _Type* __la
 // Otherwise try to copy all elements. If an exception is thrown the already copied
 // elements are destroyed in reverse order of their construction.
 template <class _Alloc, class _Iter1, class _Sent1, class _Iter2>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _Iter2 __uninitialized_allocator_move_if_noexcept(
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _Iter2 __uninitialized_allocator_move_if_noexcept(
     _Alloc& __alloc, _Iter1 __first1, _Sent1 __last1, _Iter2 __first2) {
   static_assert(__is_cpp17_move_insertable<_Alloc>::value,
                 "The specified type does not meet the requirements of Cpp17MoveInsertable");
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
   auto __destruct_first = __first2;
   try {
 #endif
   while (__first1 != __last1) {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     allocator_traits<_Alloc>::construct(__alloc, std::__to_address(__first2), std::move_if_noexcept(*__first1));
 #else
     allocator_traits<_Alloc>::construct(__alloc, std::__to_address(__first2), std::move(*__first1));
@@ -599,7 +599,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _Iter2 __uninitialized_alloc
     ++__first1;
     ++__first2;
   }
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
   } catch (...) {
     _AllocatorDestroyRangeReverse<_Alloc, _Iter2>(__alloc, __destruct_first, __first2)();
     throw;
@@ -614,7 +614,7 @@ struct __allocator_has_trivial_move_construct : _Not<__has_construct<_Alloc, _Ty
 template <class _Type>
 struct __allocator_has_trivial_move_construct<allocator<_Type>, _Type> : true_type {};
 
-#ifndef _LIBCPP_COMPILER_GCC
+#ifndef _LIBCUDACXX_COMPILER_GCC
 template <
     class _Alloc,
     class _Iter1,
@@ -622,9 +622,9 @@ template <
     class _Type = typename iterator_traits<_Iter1>::value_type,
     class = __enable_if_t<is_trivially_move_constructible<_Type>::value && is_trivially_move_assignable<_Type>::value &&
                           __allocator_has_trivial_move_construct<_Alloc, _Type>::value> >
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _Iter2
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _Iter2
 __uninitialized_allocator_move_if_noexcept(_Alloc&, _Iter1 __first1, _Iter1 __last1, _Iter2 __first2) {
-  if (__libcpp_is_constant_evaluated()) {
+  if (__LIBCUDACXX_is_constant_evaluated()) {
     while (__first1 != __last1) {
       std::__construct_at(std::__to_address(__first2), std::move(*__first1));
       ++__first1;
@@ -635,8 +635,8 @@ __uninitialized_allocator_move_if_noexcept(_Alloc&, _Iter1 __first1, _Iter1 __la
     return std::move(__first1, __last1, __first2);
   }
 }
-#endif // _LIBCPP_COMPILER_GCC
+#endif // _LIBCUDACXX_COMPILER_GCC
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___MEMORY_UNINITIALIZED_ALGORITHMS_H
+#endif // _LIBCUDACXX___MEMORY_UNINITIALIZED_ALGORITHMS_H

diff  --git a/libcxx/include/__memory/unique_ptr.h b/libcxx/include/__memory/unique_ptr.h
index 1de64de30b23..bd9fd3069763 100644
--- a/libcxx/include/__memory/unique_ptr.h
+++ b/libcxx/include/__memory/unique_ptr.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___MEMORY_UNIQUE_PTR_H
-#define _LIBCPP___MEMORY_UNIQUE_PTR_H
+#ifndef _LIBCUDACXX___MEMORY_UNIQUE_PTR_H
+#define _LIBCUDACXX___MEMORY_UNIQUE_PTR_H
 
 #include <__config>
 #include <__functional/hash.h>
@@ -21,28 +21,28 @@
 #include <cstddef>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS default_delete {
+struct _LIBCUDACXX_TEMPLATE_VIS default_delete {
     static_assert(!is_function<_Tp>::value,
                   "default_delete cannot be instantiated for function types");
-#ifndef _LIBCPP_CXX03_LANG
-  _LIBCPP_INLINE_VISIBILITY constexpr default_delete() _NOEXCEPT = default;
+#ifndef _LIBCUDACXX_CXX03_LANG
+  _LIBCUDACXX_INLINE_VISIBILITY constexpr default_delete() _NOEXCEPT = default;
 #else
-  _LIBCPP_INLINE_VISIBILITY default_delete() {}
+  _LIBCUDACXX_INLINE_VISIBILITY default_delete() {}
 #endif
   template <class _Up>
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   default_delete(const default_delete<_Up>&,
                  typename enable_if<is_convertible<_Up*, _Tp*>::value>::type* =
                      0) _NOEXCEPT {}
 
-  _LIBCPP_INLINE_VISIBILITY void operator()(_Tp* __ptr) const _NOEXCEPT {
+  _LIBCUDACXX_INLINE_VISIBILITY void operator()(_Tp* __ptr) const _NOEXCEPT {
     static_assert(sizeof(_Tp) >= 0, "cannot delete an incomplete type");
     static_assert(!is_void<_Tp>::value, "cannot delete an incomplete type");
     delete __ptr;
@@ -50,26 +50,26 @@ struct _LIBCPP_TEMPLATE_VIS default_delete {
 };
 
 template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS default_delete<_Tp[]> {
+struct _LIBCUDACXX_TEMPLATE_VIS default_delete<_Tp[]> {
 private:
   template <class _Up>
   struct _EnableIfConvertible
       : enable_if<is_convertible<_Up(*)[], _Tp(*)[]>::value> {};
 
 public:
-#ifndef _LIBCPP_CXX03_LANG
-  _LIBCPP_INLINE_VISIBILITY constexpr default_delete() _NOEXCEPT = default;
+#ifndef _LIBCUDACXX_CXX03_LANG
+  _LIBCUDACXX_INLINE_VISIBILITY constexpr default_delete() _NOEXCEPT = default;
 #else
-  _LIBCPP_INLINE_VISIBILITY default_delete() {}
+  _LIBCUDACXX_INLINE_VISIBILITY default_delete() {}
 #endif
 
   template <class _Up>
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   default_delete(const default_delete<_Up[]>&,
                  typename _EnableIfConvertible<_Up>::type* = 0) _NOEXCEPT {}
 
   template <class _Up>
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   typename _EnableIfConvertible<_Up>::type
   operator()(_Up* __ptr) const _NOEXCEPT {
     static_assert(sizeof(_Up) >= 0, "cannot delete an incomplete type");
@@ -99,18 +99,18 @@ struct __unique_ptr_deleter_sfinae<_Deleter&> {
   typedef false_type __enable_rval_overload;
 };
 
-#if defined(_LIBCPP_ABI_ENABLE_UNIQUE_PTR_TRIVIAL_ABI)
-#  define _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI __attribute__((trivial_abi))
+#if defined(_LIBCUDACXX_ABI_ENABLE_UNIQUE_PTR_TRIVIAL_ABI)
+#  define _LIBCUDACXX_UNIQUE_PTR_TRIVIAL_ABI __attribute__((trivial_abi))
 #else
-#  define _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI
+#  define _LIBCUDACXX_UNIQUE_PTR_TRIVIAL_ABI
 #endif
 
 template <class _Tp, class _Dp = default_delete<_Tp> >
-class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr {
+class _LIBCUDACXX_UNIQUE_PTR_TRIVIAL_ABI _LIBCUDACXX_TEMPLATE_VIS unique_ptr {
 public:
   typedef _Tp element_type;
   typedef _Dp deleter_type;
-  typedef _LIBCPP_NODEBUG typename __pointer<_Tp, deleter_type>::type pointer;
+  typedef _LIBCUDACXX_NODEBUG typename __pointer<_Tp, deleter_type>::type pointer;
 
   static_assert(!is_rvalue_reference<deleter_type>::value,
                 "the specified deleter type cannot be an rvalue reference");
@@ -120,38 +120,38 @@ class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr {
 
   struct __nat { int __for_bool_; };
 
-  typedef _LIBCPP_NODEBUG __unique_ptr_deleter_sfinae<_Dp> _DeleterSFINAE;
+  typedef _LIBCUDACXX_NODEBUG __unique_ptr_deleter_sfinae<_Dp> _DeleterSFINAE;
 
   template <bool _Dummy>
-  using _LValRefType _LIBCPP_NODEBUG =
+  using _LValRefType _LIBCUDACXX_NODEBUG =
       typename __dependent_type<_DeleterSFINAE, _Dummy>::__lval_ref_type;
 
   template <bool _Dummy>
-  using _GoodRValRefType _LIBCPP_NODEBUG =
+  using _GoodRValRefType _LIBCUDACXX_NODEBUG =
       typename __dependent_type<_DeleterSFINAE, _Dummy>::__good_rval_ref_type;
 
   template <bool _Dummy>
-  using _BadRValRefType _LIBCPP_NODEBUG =
+  using _BadRValRefType _LIBCUDACXX_NODEBUG =
       typename __dependent_type<_DeleterSFINAE, _Dummy>::__bad_rval_ref_type;
 
   template <bool _Dummy, class _Deleter = typename __dependent_type<
                              __type_identity<deleter_type>, _Dummy>::type>
-  using _EnableIfDeleterDefaultConstructible _LIBCPP_NODEBUG =
+  using _EnableIfDeleterDefaultConstructible _LIBCUDACXX_NODEBUG =
       typename enable_if<is_default_constructible<_Deleter>::value &&
                          !is_pointer<_Deleter>::value>::type;
 
   template <class _ArgType>
-  using _EnableIfDeleterConstructible _LIBCPP_NODEBUG =
+  using _EnableIfDeleterConstructible _LIBCUDACXX_NODEBUG =
       typename enable_if<is_constructible<deleter_type, _ArgType>::value>::type;
 
   template <class _UPtr, class _Up>
-  using _EnableIfMoveConvertible _LIBCPP_NODEBUG = typename enable_if<
+  using _EnableIfMoveConvertible _LIBCUDACXX_NODEBUG = typename enable_if<
       is_convertible<typename _UPtr::pointer, pointer>::value &&
       !is_array<_Up>::value
   >::type;
 
   template <class _UDel>
-  using _EnableIfDeleterConvertible _LIBCPP_NODEBUG = typename enable_if<
+  using _EnableIfDeleterConvertible _LIBCUDACXX_NODEBUG = typename enable_if<
       (is_reference<_Dp>::value && is_same<_Dp, _UDel>::value) ||
       (!is_reference<_Dp>::value && is_convertible<_UDel, _Dp>::value)
     >::type;
@@ -164,55 +164,55 @@ class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr {
 public:
   template <bool _Dummy = true,
             class = _EnableIfDeleterDefaultConstructible<_Dummy> >
-  _LIBCPP_INLINE_VISIBILITY
-  _LIBCPP_CONSTEXPR unique_ptr() _NOEXCEPT : __ptr_(__value_init_tag(), __value_init_tag()) {}
+  _LIBCUDACXX_INLINE_VISIBILITY
+  _LIBCUDACXX_CONSTEXPR unique_ptr() _NOEXCEPT : __ptr_(__value_init_tag(), __value_init_tag()) {}
 
   template <bool _Dummy = true,
             class = _EnableIfDeleterDefaultConstructible<_Dummy> >
-  _LIBCPP_INLINE_VISIBILITY
-  _LIBCPP_CONSTEXPR unique_ptr(nullptr_t) _NOEXCEPT : __ptr_(__value_init_tag(), __value_init_tag()) {}
+  _LIBCUDACXX_INLINE_VISIBILITY
+  _LIBCUDACXX_CONSTEXPR unique_ptr(nullptr_t) _NOEXCEPT : __ptr_(__value_init_tag(), __value_init_tag()) {}
 
   template <bool _Dummy = true,
             class = _EnableIfDeleterDefaultConstructible<_Dummy> >
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   explicit unique_ptr(pointer __p) _NOEXCEPT : __ptr_(__p, __value_init_tag()) {}
 
   template <bool _Dummy = true,
             class = _EnableIfDeleterConstructible<_LValRefType<_Dummy> > >
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   unique_ptr(pointer __p, _LValRefType<_Dummy> __d) _NOEXCEPT
       : __ptr_(__p, __d) {}
 
   template <bool _Dummy = true,
             class = _EnableIfDeleterConstructible<_GoodRValRefType<_Dummy> > >
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   unique_ptr(pointer __p, _GoodRValRefType<_Dummy> __d) _NOEXCEPT
-      : __ptr_(__p, _VSTD::move(__d)) {
+      : __ptr_(__p, _CUDA_VSTD::move(__d)) {
     static_assert(!is_reference<deleter_type>::value,
                   "rvalue deleter bound to reference");
   }
 
   template <bool _Dummy = true,
             class = _EnableIfDeleterConstructible<_BadRValRefType<_Dummy> > >
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   unique_ptr(pointer __p, _BadRValRefType<_Dummy> __d) = delete;
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   unique_ptr(unique_ptr&& __u) _NOEXCEPT
-      : __ptr_(__u.release(), _VSTD::forward<deleter_type>(__u.get_deleter())) {
+      : __ptr_(__u.release(), _CUDA_VSTD::forward<deleter_type>(__u.get_deleter())) {
   }
 
   template <class _Up, class _Ep,
       class = _EnableIfMoveConvertible<unique_ptr<_Up, _Ep>, _Up>,
       class = _EnableIfDeleterConvertible<_Ep>
   >
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   unique_ptr(unique_ptr<_Up, _Ep>&& __u) _NOEXCEPT
-      : __ptr_(__u.release(), _VSTD::forward<_Ep>(__u.get_deleter())) {}
+      : __ptr_(__u.release(), _CUDA_VSTD::forward<_Ep>(__u.get_deleter())) {}
 
-#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
+#if _LIBCUDACXX_STD_VER <= 14 || defined(_LIBCUDACXX_ENABLE_CXX17_REMOVED_AUTO_PTR)
   template <class _Up>
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   unique_ptr(auto_ptr<_Up>&& __p,
              typename enable_if<is_convertible<_Up*, _Tp*>::value &&
                                     is_same<_Dp, default_delete<_Tp> >::value,
@@ -220,10 +220,10 @@ class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr {
       : __ptr_(__p.release(), __value_init_tag()) {}
 #endif
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   unique_ptr& operator=(unique_ptr&& __u) _NOEXCEPT {
     reset(__u.release());
-    __ptr_.second() = _VSTD::forward<deleter_type>(__u.get_deleter());
+    __ptr_.second() = _CUDA_VSTD::forward<deleter_type>(__u.get_deleter());
     return *this;
   }
 
@@ -231,16 +231,16 @@ class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr {
       class = _EnableIfMoveConvertible<unique_ptr<_Up, _Ep>, _Up>,
       class = _EnableIfDeleterAssignable<_Ep>
   >
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   unique_ptr& operator=(unique_ptr<_Up, _Ep>&& __u) _NOEXCEPT {
     reset(__u.release());
-    __ptr_.second() = _VSTD::forward<_Ep>(__u.get_deleter());
+    __ptr_.second() = _CUDA_VSTD::forward<_Ep>(__u.get_deleter());
     return *this;
   }
 
-#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
+#if _LIBCUDACXX_STD_VER <= 14 || defined(_LIBCUDACXX_ENABLE_CXX17_REMOVED_AUTO_PTR)
   template <class _Up>
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
       typename enable_if<is_convertible<_Up*, _Tp*>::value &&
                              is_same<_Dp, default_delete<_Tp> >::value,
                          unique_ptr&>::type
@@ -250,54 +250,54 @@ class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr {
   }
 #endif
 
-#ifdef _LIBCPP_CXX03_LANG
+#ifdef _LIBCUDACXX_CXX03_LANG
   unique_ptr(unique_ptr const&) = delete;
   unique_ptr& operator=(unique_ptr const&) = delete;
 #endif
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   ~unique_ptr() { reset(); }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   unique_ptr& operator=(nullptr_t) _NOEXCEPT {
     reset();
     return *this;
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   typename add_lvalue_reference<_Tp>::type
   operator*() const {
     return *__ptr_.first();
   }
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   pointer operator->() const _NOEXCEPT {
     return __ptr_.first();
   }
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   pointer get() const _NOEXCEPT {
     return __ptr_.first();
   }
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   deleter_type& get_deleter() _NOEXCEPT {
     return __ptr_.second();
   }
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   const deleter_type& get_deleter() const _NOEXCEPT {
     return __ptr_.second();
   }
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   explicit operator bool() const _NOEXCEPT {
     return __ptr_.first() != nullptr;
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   pointer release() _NOEXCEPT {
     pointer __t = __ptr_.first();
     __ptr_.first() = pointer();
     return __t;
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   void reset(pointer __p = pointer()) _NOEXCEPT {
     pointer __tmp = __ptr_.first();
     __ptr_.first() = __p;
@@ -305,7 +305,7 @@ class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr {
       __ptr_.second()(__tmp);
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   void swap(unique_ptr& __u) _NOEXCEPT {
     __ptr_.swap(__u.__ptr_);
   }
@@ -313,7 +313,7 @@ class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr {
 
 
 template <class _Tp, class _Dp>
-class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp> {
+class _LIBCUDACXX_UNIQUE_PTR_TRIVIAL_ABI _LIBCUDACXX_TEMPLATE_VIS unique_ptr<_Tp[], _Dp> {
 public:
   typedef _Tp element_type;
   typedef _Dp deleter_type;
@@ -337,35 +337,35 @@ class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp>
   typedef __unique_ptr_deleter_sfinae<_Dp> _DeleterSFINAE;
 
   template <bool _Dummy>
-  using _LValRefType _LIBCPP_NODEBUG =
+  using _LValRefType _LIBCUDACXX_NODEBUG =
       typename __dependent_type<_DeleterSFINAE, _Dummy>::__lval_ref_type;
 
   template <bool _Dummy>
-  using _GoodRValRefType _LIBCPP_NODEBUG =
+  using _GoodRValRefType _LIBCUDACXX_NODEBUG =
       typename __dependent_type<_DeleterSFINAE, _Dummy>::__good_rval_ref_type;
 
   template <bool _Dummy>
-  using _BadRValRefType _LIBCPP_NODEBUG =
+  using _BadRValRefType _LIBCUDACXX_NODEBUG =
       typename __dependent_type<_DeleterSFINAE, _Dummy>::__bad_rval_ref_type;
 
   template <bool _Dummy, class _Deleter = typename __dependent_type<
                              __type_identity<deleter_type>, _Dummy>::type>
-  using _EnableIfDeleterDefaultConstructible _LIBCPP_NODEBUG =
+  using _EnableIfDeleterDefaultConstructible _LIBCUDACXX_NODEBUG =
       typename enable_if<is_default_constructible<_Deleter>::value &&
                          !is_pointer<_Deleter>::value>::type;
 
   template <class _ArgType>
-  using _EnableIfDeleterConstructible _LIBCPP_NODEBUG =
+  using _EnableIfDeleterConstructible _LIBCUDACXX_NODEBUG =
       typename enable_if<is_constructible<deleter_type, _ArgType>::value>::type;
 
   template <class _Pp>
-  using _EnableIfPointerConvertible _LIBCPP_NODEBUG = typename enable_if<
+  using _EnableIfPointerConvertible _LIBCUDACXX_NODEBUG = typename enable_if<
       _CheckArrayPointerConversion<_Pp>::value
   >::type;
 
   template <class _UPtr, class _Up,
         class _ElemT = typename _UPtr::element_type>
-  using _EnableIfMoveConvertible _LIBCPP_NODEBUG = typename enable_if<
+  using _EnableIfMoveConvertible _LIBCUDACXX_NODEBUG = typename enable_if<
       is_array<_Up>::value &&
       is_same<pointer, element_type*>::value &&
       is_same<typename _UPtr::pointer, _ElemT*>::value &&
@@ -373,62 +373,62 @@ class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp>
     >::type;
 
   template <class _UDel>
-  using _EnableIfDeleterConvertible _LIBCPP_NODEBUG = typename enable_if<
+  using _EnableIfDeleterConvertible _LIBCUDACXX_NODEBUG = typename enable_if<
       (is_reference<_Dp>::value && is_same<_Dp, _UDel>::value) ||
       (!is_reference<_Dp>::value && is_convertible<_UDel, _Dp>::value)
     >::type;
 
   template <class _UDel>
-  using _EnableIfDeleterAssignable _LIBCPP_NODEBUG = typename enable_if<
+  using _EnableIfDeleterAssignable _LIBCUDACXX_NODEBUG = typename enable_if<
       is_assignable<_Dp&, _UDel&&>::value
     >::type;
 
 public:
   template <bool _Dummy = true,
             class = _EnableIfDeleterDefaultConstructible<_Dummy> >
-  _LIBCPP_INLINE_VISIBILITY
-  _LIBCPP_CONSTEXPR unique_ptr() _NOEXCEPT : __ptr_(__value_init_tag(), __value_init_tag()) {}
+  _LIBCUDACXX_INLINE_VISIBILITY
+  _LIBCUDACXX_CONSTEXPR unique_ptr() _NOEXCEPT : __ptr_(__value_init_tag(), __value_init_tag()) {}
 
   template <bool _Dummy = true,
             class = _EnableIfDeleterDefaultConstructible<_Dummy> >
-  _LIBCPP_INLINE_VISIBILITY
-  _LIBCPP_CONSTEXPR unique_ptr(nullptr_t) _NOEXCEPT : __ptr_(__value_init_tag(), __value_init_tag()) {}
+  _LIBCUDACXX_INLINE_VISIBILITY
+  _LIBCUDACXX_CONSTEXPR unique_ptr(nullptr_t) _NOEXCEPT : __ptr_(__value_init_tag(), __value_init_tag()) {}
 
   template <class _Pp, bool _Dummy = true,
             class = _EnableIfDeleterDefaultConstructible<_Dummy>,
             class = _EnableIfPointerConvertible<_Pp> >
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   explicit unique_ptr(_Pp __p) _NOEXCEPT
       : __ptr_(__p, __value_init_tag()) {}
 
   template <class _Pp, bool _Dummy = true,
             class = _EnableIfDeleterConstructible<_LValRefType<_Dummy> >,
             class = _EnableIfPointerConvertible<_Pp> >
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   unique_ptr(_Pp __p, _LValRefType<_Dummy> __d) _NOEXCEPT
       : __ptr_(__p, __d) {}
 
   template <bool _Dummy = true,
             class = _EnableIfDeleterConstructible<_LValRefType<_Dummy> > >
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   unique_ptr(nullptr_t, _LValRefType<_Dummy> __d) _NOEXCEPT
       : __ptr_(nullptr, __d) {}
 
   template <class _Pp, bool _Dummy = true,
             class = _EnableIfDeleterConstructible<_GoodRValRefType<_Dummy> >,
             class = _EnableIfPointerConvertible<_Pp> >
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   unique_ptr(_Pp __p, _GoodRValRefType<_Dummy> __d) _NOEXCEPT
-      : __ptr_(__p, _VSTD::move(__d)) {
+      : __ptr_(__p, _CUDA_VSTD::move(__d)) {
     static_assert(!is_reference<deleter_type>::value,
                   "rvalue deleter bound to reference");
   }
 
   template <bool _Dummy = true,
             class = _EnableIfDeleterConstructible<_GoodRValRefType<_Dummy> > >
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   unique_ptr(nullptr_t, _GoodRValRefType<_Dummy> __d) _NOEXCEPT
-      : __ptr_(nullptr, _VSTD::move(__d)) {
+      : __ptr_(nullptr, _CUDA_VSTD::move(__d)) {
     static_assert(!is_reference<deleter_type>::value,
                   "rvalue deleter bound to reference");
   }
@@ -436,18 +436,18 @@ class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp>
   template <class _Pp, bool _Dummy = true,
             class = _EnableIfDeleterConstructible<_BadRValRefType<_Dummy> >,
             class = _EnableIfPointerConvertible<_Pp> >
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   unique_ptr(_Pp __p, _BadRValRefType<_Dummy> __d) = delete;
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   unique_ptr(unique_ptr&& __u) _NOEXCEPT
-      : __ptr_(__u.release(), _VSTD::forward<deleter_type>(__u.get_deleter())) {
+      : __ptr_(__u.release(), _CUDA_VSTD::forward<deleter_type>(__u.get_deleter())) {
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   unique_ptr& operator=(unique_ptr&& __u) _NOEXCEPT {
     reset(__u.release());
-    __ptr_.second() = _VSTD::forward<deleter_type>(__u.get_deleter());
+    __ptr_.second() = _CUDA_VSTD::forward<deleter_type>(__u.get_deleter());
     return *this;
   }
 
@@ -455,62 +455,62 @@ class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp>
       class = _EnableIfMoveConvertible<unique_ptr<_Up, _Ep>, _Up>,
       class = _EnableIfDeleterConvertible<_Ep>
   >
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   unique_ptr(unique_ptr<_Up, _Ep>&& __u) _NOEXCEPT
-      : __ptr_(__u.release(), _VSTD::forward<_Ep>(__u.get_deleter())) {
+      : __ptr_(__u.release(), _CUDA_VSTD::forward<_Ep>(__u.get_deleter())) {
   }
 
   template <class _Up, class _Ep,
       class = _EnableIfMoveConvertible<unique_ptr<_Up, _Ep>, _Up>,
       class = _EnableIfDeleterAssignable<_Ep>
   >
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   unique_ptr&
   operator=(unique_ptr<_Up, _Ep>&& __u) _NOEXCEPT {
     reset(__u.release());
-    __ptr_.second() = _VSTD::forward<_Ep>(__u.get_deleter());
+    __ptr_.second() = _CUDA_VSTD::forward<_Ep>(__u.get_deleter());
     return *this;
   }
 
-#ifdef _LIBCPP_CXX03_LANG
+#ifdef _LIBCUDACXX_CXX03_LANG
   unique_ptr(unique_ptr const&) = delete;
   unique_ptr& operator=(unique_ptr const&) = delete;
 #endif
 public:
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   ~unique_ptr() { reset(); }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   unique_ptr& operator=(nullptr_t) _NOEXCEPT {
     reset();
     return *this;
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   typename add_lvalue_reference<_Tp>::type
   operator[](size_t __i) const {
     return __ptr_.first()[__i];
   }
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   pointer get() const _NOEXCEPT {
     return __ptr_.first();
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   deleter_type& get_deleter() _NOEXCEPT {
     return __ptr_.second();
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   const deleter_type& get_deleter() const _NOEXCEPT {
     return __ptr_.second();
   }
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   explicit operator bool() const _NOEXCEPT {
     return __ptr_.first() != nullptr;
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   pointer release() _NOEXCEPT {
     pointer __t = __ptr_.first();
     __ptr_.first() = pointer();
@@ -518,7 +518,7 @@ class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp>
   }
 
   template <class _Pp>
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   typename enable_if<
       _CheckArrayPointerConversion<_Pp>::value
   >::type
@@ -529,7 +529,7 @@ class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp>
       __ptr_.second()(__tmp);
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   void reset(nullptr_t = nullptr) _NOEXCEPT {
     pointer __tmp = __ptr_.first();
     __ptr_.first() = nullptr;
@@ -537,7 +537,7 @@ class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp>
       __ptr_.second()(__tmp);
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   void swap(unique_ptr& __u) _NOEXCEPT {
     __ptr_.swap(__u.__ptr_);
   }
@@ -545,7 +545,7 @@ class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp>
 };
 
 template <class _Tp, class _Dp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename enable_if<
     __is_swappable<_Dp>::value,
     void
@@ -553,17 +553,17 @@ typename enable_if<
 swap(unique_ptr<_Tp, _Dp>& __x, unique_ptr<_Tp, _Dp>& __y) _NOEXCEPT {__x.swap(__y);}
 
 template <class _T1, class _D1, class _T2, class _D2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator==(const unique_ptr<_T1, _D1>& __x, const unique_ptr<_T2, _D2>& __y) {return __x.get() == __y.get();}
 
 template <class _T1, class _D1, class _T2, class _D2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator!=(const unique_ptr<_T1, _D1>& __x, const unique_ptr<_T2, _D2>& __y) {return !(__x == __y);}
 
 template <class _T1, class _D1, class _T2, class _D2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator< (const unique_ptr<_T1, _D1>& __x, const unique_ptr<_T2, _D2>& __y)
 {
@@ -574,22 +574,22 @@ operator< (const unique_ptr<_T1, _D1>& __x, const unique_ptr<_T2, _D2>& __y)
 }
 
 template <class _T1, class _D1, class _T2, class _D2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator> (const unique_ptr<_T1, _D1>& __x, const unique_ptr<_T2, _D2>& __y) {return __y < __x;}
 
 template <class _T1, class _D1, class _T2, class _D2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator<=(const unique_ptr<_T1, _D1>& __x, const unique_ptr<_T2, _D2>& __y) {return !(__y < __x);}
 
 template <class _T1, class _D1, class _T2, class _D2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator>=(const unique_ptr<_T1, _D1>& __x, const unique_ptr<_T2, _D2>& __y) {return !(__x < __y);}
 
 template <class _T1, class _D1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator==(const unique_ptr<_T1, _D1>& __x, nullptr_t) _NOEXCEPT
 {
@@ -597,7 +597,7 @@ operator==(const unique_ptr<_T1, _D1>& __x, nullptr_t) _NOEXCEPT
 }
 
 template <class _T1, class _D1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator==(nullptr_t, const unique_ptr<_T1, _D1>& __x) _NOEXCEPT
 {
@@ -605,7 +605,7 @@ operator==(nullptr_t, const unique_ptr<_T1, _D1>& __x) _NOEXCEPT
 }
 
 template <class _T1, class _D1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator!=(const unique_ptr<_T1, _D1>& __x, nullptr_t) _NOEXCEPT
 {
@@ -613,7 +613,7 @@ operator!=(const unique_ptr<_T1, _D1>& __x, nullptr_t) _NOEXCEPT
 }
 
 template <class _T1, class _D1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator!=(nullptr_t, const unique_ptr<_T1, _D1>& __x) _NOEXCEPT
 {
@@ -621,7 +621,7 @@ operator!=(nullptr_t, const unique_ptr<_T1, _D1>& __x) _NOEXCEPT
 }
 
 template <class _T1, class _D1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator<(const unique_ptr<_T1, _D1>& __x, nullptr_t)
 {
@@ -630,7 +630,7 @@ operator<(const unique_ptr<_T1, _D1>& __x, nullptr_t)
 }
 
 template <class _T1, class _D1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator<(nullptr_t, const unique_ptr<_T1, _D1>& __x)
 {
@@ -639,7 +639,7 @@ operator<(nullptr_t, const unique_ptr<_T1, _D1>& __x)
 }
 
 template <class _T1, class _D1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator>(const unique_ptr<_T1, _D1>& __x, nullptr_t)
 {
@@ -647,7 +647,7 @@ operator>(const unique_ptr<_T1, _D1>& __x, nullptr_t)
 }
 
 template <class _T1, class _D1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator>(nullptr_t, const unique_ptr<_T1, _D1>& __x)
 {
@@ -655,7 +655,7 @@ operator>(nullptr_t, const unique_ptr<_T1, _D1>& __x)
 }
 
 template <class _T1, class _D1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator<=(const unique_ptr<_T1, _D1>& __x, nullptr_t)
 {
@@ -663,7 +663,7 @@ operator<=(const unique_ptr<_T1, _D1>& __x, nullptr_t)
 }
 
 template <class _T1, class _D1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator<=(nullptr_t, const unique_ptr<_T1, _D1>& __x)
 {
@@ -671,7 +671,7 @@ operator<=(nullptr_t, const unique_ptr<_T1, _D1>& __x)
 }
 
 template <class _T1, class _D1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator>=(const unique_ptr<_T1, _D1>& __x, nullptr_t)
 {
@@ -679,14 +679,14 @@ operator>=(const unique_ptr<_T1, _D1>& __x, nullptr_t)
 }
 
 template <class _T1, class _D1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator>=(nullptr_t, const unique_ptr<_T1, _D1>& __x)
 {
     return !(nullptr < __x);
 }
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 
 template<class _Tp>
 struct __unique_if
@@ -707,15 +707,15 @@ struct __unique_if<_Tp[_Np]>
 };
 
 template<class _Tp, class... _Args>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename __unique_if<_Tp>::__unique_single
 make_unique(_Args&&... __args)
 {
-    return unique_ptr<_Tp>(new _Tp(_VSTD::forward<_Args>(__args)...));
+    return unique_ptr<_Tp>(new _Tp(_CUDA_VSTD::forward<_Args>(__args)...));
 }
 
 template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename __unique_if<_Tp>::__unique_array_unknown_bound
 make_unique(size_t __n)
 {
@@ -727,24 +727,24 @@ template<class _Tp, class... _Args>
     typename __unique_if<_Tp>::__unique_array_known_bound
     make_unique(_Args&&...) = delete;
 
-#endif // _LIBCPP_STD_VER > 11
+#endif // _LIBCUDACXX_STD_VER > 11
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS hash;
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS hash;
 
 template <class _Tp, class _Dp>
-#ifdef _LIBCPP_CXX03_LANG
-struct _LIBCPP_TEMPLATE_VIS hash<unique_ptr<_Tp, _Dp> >
+#ifdef _LIBCUDACXX_CXX03_LANG
+struct _LIBCUDACXX_TEMPLATE_VIS hash<unique_ptr<_Tp, _Dp> >
 #else
-struct _LIBCPP_TEMPLATE_VIS hash<__enable_hash_helper<
+struct _LIBCUDACXX_TEMPLATE_VIS hash<__enable_hash_helper<
     unique_ptr<_Tp, _Dp>, typename unique_ptr<_Tp, _Dp>::pointer> >
 #endif
 {
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
-    _LIBCPP_DEPRECATED_IN_CXX17 typedef unique_ptr<_Tp, _Dp> argument_type;
-    _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t               result_type;
+#if _LIBCUDACXX_STD_VER <= 17 || defined(_LIBCUDACXX_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+    _LIBCUDACXX_DEPRECATED_IN_CXX17 typedef unique_ptr<_Tp, _Dp> argument_type;
+    _LIBCUDACXX_DEPRECATED_IN_CXX17 typedef size_t               result_type;
 #endif
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t operator()(const unique_ptr<_Tp, _Dp>& __ptr) const
     {
         typedef typename unique_ptr<_Tp, _Dp>::pointer pointer;
@@ -752,6 +752,6 @@ struct _LIBCPP_TEMPLATE_VIS hash<__enable_hash_helper<
     }
 };
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___MEMORY_UNIQUE_PTR_H
+#endif // _LIBCUDACXX___MEMORY_UNIQUE_PTR_H

diff  --git a/libcxx/include/__memory/uses_allocator.h b/libcxx/include/__memory/uses_allocator.h
index 4a07a4a52121..4379ac90b058 100644
--- a/libcxx/include/__memory/uses_allocator.h
+++ b/libcxx/include/__memory/uses_allocator.h
@@ -7,18 +7,18 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___MEMORY_USES_ALLOCATOR_H
-#define _LIBCPP___MEMORY_USES_ALLOCATOR_H
+#ifndef _LIBCUDACXX___MEMORY_USES_ALLOCATOR_H
+#define _LIBCUDACXX___MEMORY_USES_ALLOCATOR_H
 
 #include <__config>
 #include <cstddef>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Tp>
 struct __has_allocator_type
@@ -44,16 +44,16 @@ struct __uses_allocator<_Tp, _Alloc, false>
 };
 
 template <class _Tp, class _Alloc>
-struct _LIBCPP_TEMPLATE_VIS uses_allocator
+struct _LIBCUDACXX_TEMPLATE_VIS uses_allocator
     : public __uses_allocator<_Tp, _Alloc>
 {
 };
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp, class _Alloc>
 inline constexpr size_t uses_allocator_v = uses_allocator<_Tp, _Alloc>::value;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___MEMORY_USES_ALLOCATOR_H
+#endif // _LIBCUDACXX___MEMORY_USES_ALLOCATOR_H

diff  --git a/libcxx/include/__memory/voidify.h b/libcxx/include/__memory/voidify.h
index 3a65c0e83fb7..c9145df7e1c5 100644
--- a/libcxx/include/__memory/voidify.h
+++ b/libcxx/include/__memory/voidify.h
@@ -7,24 +7,24 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___MEMORY_VOIDIFY_H
-#define _LIBCPP___MEMORY_VOIDIFY_H
+#ifndef _LIBCUDACXX___MEMORY_VOIDIFY_H
+#define _LIBCUDACXX___MEMORY_VOIDIFY_H
 
 #include <__config>
 #include <__memory/addressof.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <typename _Tp>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 void* __voidify(_Tp& __from) {
+_LIBCUDACXX_ALWAYS_INLINE _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 void* __voidify(_Tp& __from) {
   // Cast away cv-qualifiers to allow modifying elements of a range through const iterators.
-  return const_cast<void*>(static_cast<const volatile void*>(_VSTD::addressof(__from)));
+  return const_cast<void*>(static_cast<const volatile void*>(_CUDA_VSTD::addressof(__from)));
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___MEMORY_VOIDIFY_H
+#endif // _LIBCUDACXX___MEMORY_VOIDIFY_H

diff  --git a/libcxx/include/__mutex_base b/libcxx/include/__mutex_base
index ac0d090b7d19..62af983aaf64 100644
--- a/libcxx/include/__mutex_base
+++ b/libcxx/include/__mutex_base
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___MUTEX_BASE
-#define _LIBCPP___MUTEX_BASE
+#ifndef _LIBCUDACXX___MUTEX_BASE
+#define _LIBCUDACXX___MUTEX_BASE
 
 #include <__chrono/duration.h>
 #include <__chrono/steady_clock.h>
@@ -20,55 +20,55 @@
 #include <system_error>
 #include <time.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#ifndef _LIBCPP_HAS_NO_THREADS
+#ifndef _LIBCUDACXX_HAS_NO_THREADS
 
-class _LIBCPP_TYPE_VIS _LIBCPP_THREAD_SAFETY_ANNOTATION(capability("mutex")) mutex
+class _LIBCUDACXX_TYPE_VIS _LIBCUDACXX_THREAD_SAFETY_ANNOTATION(capability("mutex")) mutex
 {
-    __libcpp_mutex_t __m_ = _LIBCPP_MUTEX_INITIALIZER;
+    __LIBCUDACXX_mutex_t __m_ = _LIBCUDACXX_MUTEX_INITIALIZER;
 
 public:
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR mutex() = default;
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR mutex() = default;
 
     mutex(const mutex&) = delete;
     mutex& operator=(const mutex&) = delete;
 
-#if defined(_LIBCPP_HAS_TRIVIAL_MUTEX_DESTRUCTION)
+#if defined(_LIBCUDACXX_HAS_TRIVIAL_MUTEX_DESTRUCTION)
     ~mutex() = default;
 #else
     ~mutex() _NOEXCEPT;
 #endif
 
-    void lock() _LIBCPP_THREAD_SAFETY_ANNOTATION(acquire_capability());
-    bool try_lock() _NOEXCEPT _LIBCPP_THREAD_SAFETY_ANNOTATION(try_acquire_capability(true));
-    void unlock() _NOEXCEPT _LIBCPP_THREAD_SAFETY_ANNOTATION(release_capability());
+    void lock() _LIBCUDACXX_THREAD_SAFETY_ANNOTATION(acquire_capability());
+    bool try_lock() _NOEXCEPT _LIBCUDACXX_THREAD_SAFETY_ANNOTATION(try_acquire_capability(true));
+    void unlock() _NOEXCEPT _LIBCUDACXX_THREAD_SAFETY_ANNOTATION(release_capability());
 
-    typedef __libcpp_mutex_t* native_handle_type;
-    _LIBCPP_INLINE_VISIBILITY native_handle_type native_handle() {return &__m_;}
+    typedef __LIBCUDACXX_mutex_t* native_handle_type;
+    _LIBCUDACXX_INLINE_VISIBILITY native_handle_type native_handle() {return &__m_;}
 };
 
 static_assert(is_nothrow_default_constructible<mutex>::value,
               "the default constructor for std::mutex must be nothrow");
 
-struct _LIBCPP_TYPE_VIS defer_lock_t { explicit defer_lock_t() = default; };
-struct _LIBCPP_TYPE_VIS try_to_lock_t { explicit try_to_lock_t() = default; };
-struct _LIBCPP_TYPE_VIS adopt_lock_t { explicit adopt_lock_t() = default; };
+struct _LIBCUDACXX_TYPE_VIS defer_lock_t { explicit defer_lock_t() = default; };
+struct _LIBCUDACXX_TYPE_VIS try_to_lock_t { explicit try_to_lock_t() = default; };
+struct _LIBCUDACXX_TYPE_VIS adopt_lock_t { explicit adopt_lock_t() = default; };
 
-#if defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_LIBRARY)
+#if defined(_LIBCUDACXX_CXX03_LANG) || defined(_LIBCUDACXX_BUILDING_LIBRARY)
 
-extern _LIBCPP_EXPORTED_FROM_ABI const defer_lock_t  defer_lock;
-extern _LIBCPP_EXPORTED_FROM_ABI const try_to_lock_t try_to_lock;
-extern _LIBCPP_EXPORTED_FROM_ABI const adopt_lock_t  adopt_lock;
+extern _LIBCUDACXX_EXPORTED_FROM_ABI const defer_lock_t  defer_lock;
+extern _LIBCUDACXX_EXPORTED_FROM_ABI const try_to_lock_t try_to_lock;
+extern _LIBCUDACXX_EXPORTED_FROM_ABI const adopt_lock_t  adopt_lock;
 
 #else
 
@@ -79,7 +79,7 @@ extern _LIBCPP_EXPORTED_FROM_ABI const adopt_lock_t  adopt_lock;
 #endif
 
 template <class _Mutex>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_THREAD_SAFETY_ANNOTATION(scoped_lockable)
+class _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_THREAD_SAFETY_ANNOTATION(scoped_lockable)
 lock_guard
 {
 public:
@@ -89,15 +89,15 @@ private:
     mutex_type& __m_;
 public:
 
-    _LIBCPP_NODISCARD_EXT _LIBCPP_INLINE_VISIBILITY
-    explicit lock_guard(mutex_type& __m) _LIBCPP_THREAD_SAFETY_ANNOTATION(acquire_capability(__m))
+    _LIBCUDACXX_NODISCARD_EXT _LIBCUDACXX_INLINE_VISIBILITY
+    explicit lock_guard(mutex_type& __m) _LIBCUDACXX_THREAD_SAFETY_ANNOTATION(acquire_capability(__m))
         : __m_(__m) {__m_.lock();}
 
-    _LIBCPP_NODISCARD_EXT _LIBCPP_INLINE_VISIBILITY
-    lock_guard(mutex_type& __m, adopt_lock_t) _LIBCPP_THREAD_SAFETY_ANNOTATION(requires_capability(__m))
+    _LIBCUDACXX_NODISCARD_EXT _LIBCUDACXX_INLINE_VISIBILITY
+    lock_guard(mutex_type& __m, adopt_lock_t) _LIBCUDACXX_THREAD_SAFETY_ANNOTATION(requires_capability(__m))
         : __m_(__m) {}
-    _LIBCPP_INLINE_VISIBILITY
-    ~lock_guard() _LIBCPP_THREAD_SAFETY_ANNOTATION(release_capability()) {__m_.unlock();}
+    _LIBCUDACXX_INLINE_VISIBILITY
+    ~lock_guard() _LIBCUDACXX_THREAD_SAFETY_ANNOTATION(release_capability()) {__m_.unlock();}
 
 private:
     lock_guard(lock_guard const&) = delete;
@@ -105,7 +105,7 @@ private:
 };
 
 template <class _Mutex>
-class _LIBCPP_TEMPLATE_VIS unique_lock
+class _LIBCUDACXX_TEMPLATE_VIS unique_lock
 {
 public:
     typedef _Mutex mutex_type;
@@ -115,29 +115,29 @@ private:
     bool __owns_;
 
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     unique_lock() _NOEXCEPT : __m_(nullptr), __owns_(false) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit unique_lock(mutex_type& __m)
-        : __m_(_VSTD::addressof(__m)), __owns_(true) {__m_->lock();}
-    _LIBCPP_INLINE_VISIBILITY
+        : __m_(_CUDA_VSTD::addressof(__m)), __owns_(true) {__m_->lock();}
+    _LIBCUDACXX_INLINE_VISIBILITY
     unique_lock(mutex_type& __m, defer_lock_t) _NOEXCEPT
-        : __m_(_VSTD::addressof(__m)), __owns_(false) {}
-    _LIBCPP_INLINE_VISIBILITY
+        : __m_(_CUDA_VSTD::addressof(__m)), __owns_(false) {}
+    _LIBCUDACXX_INLINE_VISIBILITY
     unique_lock(mutex_type& __m, try_to_lock_t)
-        : __m_(_VSTD::addressof(__m)), __owns_(__m.try_lock()) {}
-    _LIBCPP_INLINE_VISIBILITY
+        : __m_(_CUDA_VSTD::addressof(__m)), __owns_(__m.try_lock()) {}
+    _LIBCUDACXX_INLINE_VISIBILITY
     unique_lock(mutex_type& __m, adopt_lock_t)
-        : __m_(_VSTD::addressof(__m)), __owns_(true) {}
+        : __m_(_CUDA_VSTD::addressof(__m)), __owns_(true) {}
     template <class _Clock, class _Duration>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
         unique_lock(mutex_type& __m, const chrono::time_point<_Clock, _Duration>& __t)
-            : __m_(_VSTD::addressof(__m)), __owns_(__m.try_lock_until(__t)) {}
+            : __m_(_CUDA_VSTD::addressof(__m)), __owns_(__m.try_lock_until(__t)) {}
     template <class _Rep, class _Period>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
         unique_lock(mutex_type& __m, const chrono::duration<_Rep, _Period>& __d)
-            : __m_(_VSTD::addressof(__m)), __owns_(__m.try_lock_for(__d)) {}
-    _LIBCPP_INLINE_VISIBILITY
+            : __m_(_CUDA_VSTD::addressof(__m)), __owns_(__m.try_lock_for(__d)) {}
+    _LIBCUDACXX_INLINE_VISIBILITY
     ~unique_lock()
     {
         if (__owns_)
@@ -147,11 +147,11 @@ public:
     unique_lock(unique_lock const&) = delete;
     unique_lock& operator=(unique_lock const&) = delete;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     unique_lock(unique_lock&& __u) _NOEXCEPT
         : __m_(__u.__m_), __owns_(__u.__owns_)
         {__u.__m_ = nullptr; __u.__owns_ = false;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     unique_lock& operator=(unique_lock&& __u) _NOEXCEPT
         {
             if (__owns_)
@@ -173,13 +173,13 @@ public:
 
     void unlock();
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void swap(unique_lock& __u) _NOEXCEPT
     {
-        _VSTD::swap(__m_, __u.__m_);
-        _VSTD::swap(__owns_, __u.__owns_);
+        _CUDA_VSTD::swap(__m_, __u.__m_);
+        _CUDA_VSTD::swap(__owns_, __u.__owns_);
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     mutex_type* release() _NOEXCEPT
     {
         mutex_type* __m = __m_;
@@ -188,11 +188,11 @@ public:
         return __m;
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool owns_lock() const _NOEXCEPT {return __owns_;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit operator bool() const _NOEXCEPT {return __owns_;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     mutex_type* mutex() const _NOEXCEPT {return __m_;}
 };
 
@@ -257,27 +257,27 @@ unique_lock<_Mutex>::unlock()
 }
 
 template <class _Mutex>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 swap(unique_lock<_Mutex>& __x, unique_lock<_Mutex>& __y) _NOEXCEPT
     {__x.swap(__y);}
 
 //enum class cv_status
-_LIBCPP_DECLARE_STRONG_ENUM(cv_status)
+_LIBCUDACXX_DECLARE_STRONG_ENUM(cv_status)
 {
     no_timeout,
     timeout
 };
-_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(cv_status)
+_LIBCUDACXX_DECLARE_STRONG_ENUM_EPILOG(cv_status)
 
-class _LIBCPP_TYPE_VIS condition_variable
+class _LIBCUDACXX_TYPE_VIS condition_variable
 {
-    __libcpp_condvar_t __cv_ = _LIBCPP_CONDVAR_INITIALIZER;
+    __LIBCUDACXX_condvar_t __cv_ = _LIBCUDACXX_CONDVAR_INITIALIZER;
 public:
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR condition_variable() _NOEXCEPT = default;
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR condition_variable() _NOEXCEPT = default;
 
-#ifdef _LIBCPP_HAS_TRIVIAL_CONDVAR_DESTRUCTION
+#ifdef _LIBCUDACXX_HAS_TRIVIAL_CONDVAR_DESTRUCTION
     ~condition_variable() = default;
 #else
     ~condition_variable();
@@ -291,42 +291,42 @@ public:
 
     void wait(unique_lock<mutex>& __lk) _NOEXCEPT;
     template <class _Predicate>
-        _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
+        _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
         void wait(unique_lock<mutex>& __lk, _Predicate __pred);
 
     template <class _Clock, class _Duration>
-        _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
+        _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
         cv_status
         wait_until(unique_lock<mutex>& __lk,
                    const chrono::time_point<_Clock, _Duration>& __t);
 
     template <class _Clock, class _Duration, class _Predicate>
-        _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
+        _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
         bool
         wait_until(unique_lock<mutex>& __lk,
                    const chrono::time_point<_Clock, _Duration>& __t,
                    _Predicate __pred);
 
     template <class _Rep, class _Period>
-        _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
+        _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
         cv_status
         wait_for(unique_lock<mutex>& __lk,
                  const chrono::duration<_Rep, _Period>& __d);
 
     template <class _Rep, class _Period, class _Predicate>
         bool
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         wait_for(unique_lock<mutex>& __lk,
                  const chrono::duration<_Rep, _Period>& __d,
                  _Predicate __pred);
 
-    typedef __libcpp_condvar_t* native_handle_type;
-    _LIBCPP_INLINE_VISIBILITY native_handle_type native_handle() {return &__cv_;}
+    typedef __LIBCUDACXX_condvar_t* native_handle_type;
+    _LIBCUDACXX_INLINE_VISIBILITY native_handle_type native_handle() {return &__cv_;}
 
 private:
     void __do_timed_wait(unique_lock<mutex>& __lk,
        chrono::time_point<chrono::system_clock, chrono::nanoseconds>) _NOEXCEPT;
-#if defined(_LIBCPP_HAS_COND_CLOCKWAIT)
+#if defined(_LIBCUDACXX_HAS_COND_CLOCKWAIT)
     void __do_timed_wait(unique_lock<mutex>& __lk,
        chrono::time_point<chrono::steady_clock, chrono::nanoseconds>) _NOEXCEPT;
 #endif
@@ -334,10 +334,10 @@ private:
     void __do_timed_wait(unique_lock<mutex>& __lk,
        chrono::time_point<_Clock, chrono::nanoseconds>) _NOEXCEPT;
 };
-#endif // !_LIBCPP_HAS_NO_THREADS
+#endif // !_LIBCUDACXX_HAS_NO_THREADS
 
 template <class _Rep, class _Period>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 __enable_if_t<is_floating_point<_Rep>::value, chrono::nanoseconds>
 __safe_nanosecond_cast(chrono::duration<_Rep, _Period> __d)
 {
@@ -360,7 +360,7 @@ __safe_nanosecond_cast(chrono::duration<_Rep, _Period> __d)
 }
 
 template <class _Rep, class _Period>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 __enable_if_t<!is_floating_point<_Rep>::value, chrono::nanoseconds>
 __safe_nanosecond_cast(chrono::duration<_Rep, _Period> __d)
 {
@@ -389,7 +389,7 @@ __safe_nanosecond_cast(chrono::duration<_Rep, _Period> __d)
     return nanoseconds(__result);
 }
 
-#ifndef _LIBCPP_HAS_NO_THREADS
+#ifndef _LIBCUDACXX_HAS_NO_THREADS
 template <class _Predicate>
 void
 condition_variable::wait(unique_lock<mutex>& __lk, _Predicate __pred)
@@ -410,7 +410,7 @@ condition_variable::wait_until(unique_lock<mutex>& __lk,
     if (__t <= __now)
         return cv_status::timeout;
 
-    __clock_tp_ns __t_ns = __clock_tp_ns(_VSTD::__safe_nanosecond_cast(__t.time_since_epoch()));
+    __clock_tp_ns __t_ns = __clock_tp_ns(_CUDA_VSTD::__safe_nanosecond_cast(__t.time_since_epoch()));
 
     __do_timed_wait(__lk, __t_ns);
     return _Clock::now() < __t ? cv_status::no_timeout : cv_status::timeout;
@@ -441,15 +441,15 @@ condition_variable::wait_for(unique_lock<mutex>& __lk,
     using __ns_rep = nanoseconds::rep;
     steady_clock::time_point __c_now = steady_clock::now();
 
-#if defined(_LIBCPP_HAS_COND_CLOCKWAIT)
+#if defined(_LIBCUDACXX_HAS_COND_CLOCKWAIT)
     using __clock_tp_ns = time_point<steady_clock, nanoseconds>;
-    __ns_rep __now_count_ns = _VSTD::__safe_nanosecond_cast(__c_now.time_since_epoch()).count();
+    __ns_rep __now_count_ns = _CUDA_VSTD::__safe_nanosecond_cast(__c_now.time_since_epoch()).count();
 #else
     using __clock_tp_ns = time_point<system_clock, nanoseconds>;
-    __ns_rep __now_count_ns = _VSTD::__safe_nanosecond_cast(system_clock::now().time_since_epoch()).count();
+    __ns_rep __now_count_ns = _CUDA_VSTD::__safe_nanosecond_cast(system_clock::now().time_since_epoch()).count();
 #endif
 
-    __ns_rep __d_ns_count = _VSTD::__safe_nanosecond_cast(__d).count();
+    __ns_rep __d_ns_count = _CUDA_VSTD::__safe_nanosecond_cast(__d).count();
 
     if (__now_count_ns > numeric_limits<__ns_rep>::max() - __d_ns_count) {
         __do_timed_wait(__lk, __clock_tp_ns::max());
@@ -469,10 +469,10 @@ condition_variable::wait_for(unique_lock<mutex>& __lk,
                              _Predicate __pred)
 {
     return wait_until(__lk, chrono::steady_clock::now() + __d,
-                      _VSTD::move(__pred));
+                      _CUDA_VSTD::move(__pred));
 }
 
-#if defined(_LIBCPP_HAS_COND_CLOCKWAIT)
+#if defined(_LIBCUDACXX_HAS_COND_CLOCKWAIT)
 inline
 void
 condition_variable::__do_timed_wait(unique_lock<mutex>& __lk,
@@ -501,7 +501,7 @@ condition_variable::__do_timed_wait(unique_lock<mutex>& __lk,
     if (__ec != 0 && __ec != ETIMEDOUT)
         __throw_system_error(__ec, "condition_variable timed_wait failed");
 }
-#endif // _LIBCPP_HAS_COND_CLOCKWAIT
+#endif // _LIBCUDACXX_HAS_COND_CLOCKWAIT
 
 template <class _Clock>
 inline
@@ -512,10 +512,10 @@ condition_variable::__do_timed_wait(unique_lock<mutex>& __lk,
     wait_for(__lk, __tp - _Clock::now());
 }
 
-#endif // !_LIBCPP_HAS_NO_THREADS
+#endif // !_LIBCUDACXX_HAS_NO_THREADS
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___MUTEX_BASE
+#endif // _LIBCUDACXX___MUTEX_BASE

diff  --git a/libcxx/include/__node_handle b/libcxx/include/__node_handle
index 71309be62f3c..e5b00ea7ab3d 100644
--- a/libcxx/include/__node_handle
+++ b/libcxx/include/__node_handle
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___NODE_HANDLE
-#define _LIBCPP___NODE_HANDLE
+#ifndef _LIBCUDACXX___NODE_HANDLE
+#define _LIBCUDACXX___NODE_HANDLE
 
 /*
 
@@ -63,13 +63,13 @@ public:
 #include <memory>
 #include <optional>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 
 // Specialized in __tree & __hash_table for their _NodeType.
 template <class _NodeType, class _Alloc>
@@ -77,7 +77,7 @@ struct __generic_container_node_destructor;
 
 template <class _NodeType, class _Alloc,
           template <class, class> class _MapOrSetSpecifics>
-class _LIBCPP_TEMPLATE_VIS __basic_node_handle
+class _LIBCUDACXX_TEMPLATE_VIS __basic_node_handle
     : public _MapOrSetSpecifics<
           _NodeType,
           __basic_node_handle<_NodeType, _Alloc, _MapOrSetSpecifics>>
@@ -101,14 +101,14 @@ private:
     __node_pointer_type __ptr_ = nullptr;
     optional<allocator_type> __alloc_;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __release_ptr()
     {
         __ptr_ = nullptr;
-        __alloc_ = _VSTD::nullopt;
+        __alloc_ = _CUDA_VSTD::nullopt;
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __destroy_node_pointer()
     {
         if (__ptr_ != nullptr)
@@ -122,7 +122,7 @@ private:
         }
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __basic_node_handle(__node_pointer_type __ptr,
                         allocator_type const& __alloc)
             : __ptr_(__ptr), __alloc_(__alloc)
@@ -130,23 +130,23 @@ private:
     }
 
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __basic_node_handle() = default;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __basic_node_handle(__basic_node_handle&& __other) noexcept
             : __ptr_(__other.__ptr_),
-              __alloc_(_VSTD::move(__other.__alloc_))
+              __alloc_(_CUDA_VSTD::move(__other.__alloc_))
     {
         __other.__ptr_ = nullptr;
-        __other.__alloc_ = _VSTD::nullopt;
+        __other.__alloc_ = _CUDA_VSTD::nullopt;
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __basic_node_handle& operator=(__basic_node_handle&& __other)
     {
-        _LIBCPP_ASSERT(
-            __alloc_ == _VSTD::nullopt ||
+        _LIBCUDACXX_ASSERT(
+            __alloc_ == _CUDA_VSTD::nullopt ||
             __alloc_traits::propagate_on_container_move_assignment::value ||
             __alloc_ == __other.__alloc_,
             "node_type with incompatible allocator passed to "
@@ -156,41 +156,41 @@ public:
         __ptr_ = __other.__ptr_;
 
         if (__alloc_traits::propagate_on_container_move_assignment::value ||
-            __alloc_ == _VSTD::nullopt)
-            __alloc_ = _VSTD::move(__other.__alloc_);
+            __alloc_ == _CUDA_VSTD::nullopt)
+            __alloc_ = _CUDA_VSTD::move(__other.__alloc_);
 
         __other.__ptr_ = nullptr;
-        __other.__alloc_ = _VSTD::nullopt;
+        __other.__alloc_ = _CUDA_VSTD::nullopt;
 
         return *this;
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     allocator_type get_allocator() const { return *__alloc_; }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit operator bool() const { return __ptr_ != nullptr; }
 
-    _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_NODISCARD_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY
     bool empty() const { return __ptr_ == nullptr; }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void swap(__basic_node_handle& __other) noexcept(
         __alloc_traits::propagate_on_container_swap::value ||
         __alloc_traits::is_always_equal::value)
     {
-        using _VSTD::swap;
+        using _CUDA_VSTD::swap;
         swap(__ptr_, __other.__ptr_);
         if (__alloc_traits::propagate_on_container_swap::value ||
-            __alloc_ == _VSTD::nullopt || __other.__alloc_ == _VSTD::nullopt)
+            __alloc_ == _CUDA_VSTD::nullopt || __other.__alloc_ == _CUDA_VSTD::nullopt)
             swap(__alloc_, __other.__alloc_);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     friend void swap(__basic_node_handle& __a, __basic_node_handle& __b)
         noexcept(noexcept(__a.swap(__b))) { __a.swap(__b); }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     ~__basic_node_handle()
     {
         __destroy_node_pointer();
@@ -202,7 +202,7 @@ struct __set_node_handle_specifics
 {
     typedef typename _NodeType::__node_value_type value_type;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     value_type& value() const
     {
         return static_cast<_Derived const*>(this)->__ptr_->__value_;
@@ -215,14 +215,14 @@ struct __map_node_handle_specifics
     typedef typename _NodeType::__node_value_type::key_type key_type;
     typedef typename _NodeType::__node_value_type::mapped_type mapped_type;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     key_type& key() const
     {
         return static_cast<_Derived const*>(this)->
             __ptr_->__value_.__ref().first;
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     mapped_type& mapped() const
     {
         return static_cast<_Derived const*>(this)->
@@ -239,15 +239,15 @@ using __map_node_handle =
     __basic_node_handle< _NodeType, _Alloc, __map_node_handle_specifics>;
 
 template <class _Iterator, class _NodeType>
-struct _LIBCPP_TEMPLATE_VIS __insert_return_type
+struct _LIBCUDACXX_TEMPLATE_VIS __insert_return_type
 {
     _Iterator position;
     bool inserted;
     _NodeType node;
 };
 
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCUDACXX_STD_VER > 14
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif  // _LIBCPP___NODE_HANDLE
+#endif  // _LIBCUDACXX___NODE_HANDLE

diff  --git a/libcxx/include/__numeric/accumulate.h b/libcxx/include/__numeric/accumulate.h
index fa759872ce77..c26b1fb1e4c0 100644
--- a/libcxx/include/__numeric/accumulate.h
+++ b/libcxx/include/__numeric/accumulate.h
@@ -7,26 +7,26 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___NUMERIC_ACCUMULATE_H
-#define _LIBCPP___NUMERIC_ACCUMULATE_H
+#ifndef _LIBCUDACXX___NUMERIC_ACCUMULATE_H
+#define _LIBCUDACXX___NUMERIC_ACCUMULATE_H
 
 #include <__config>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _InputIterator, class _Tp>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 _Tp
 accumulate(_InputIterator __first, _InputIterator __last, _Tp __init)
 {
     for (; __first != __last; ++__first)
-#if _LIBCPP_STD_VER > 17
-        __init = _VSTD::move(__init) + *__first;
+#if _LIBCUDACXX_STD_VER > 17
+        __init = _CUDA_VSTD::move(__init) + *__first;
 #else
         __init = __init + *__first;
 #endif
@@ -34,19 +34,19 @@ accumulate(_InputIterator __first, _InputIterator __last, _Tp __init)
 }
 
 template <class _InputIterator, class _Tp, class _BinaryOperation>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 _Tp
 accumulate(_InputIterator __first, _InputIterator __last, _Tp __init, _BinaryOperation __binary_op)
 {
     for (; __first != __last; ++__first)
-#if _LIBCPP_STD_VER > 17
-        __init = __binary_op(_VSTD::move(__init), *__first);
+#if _LIBCUDACXX_STD_VER > 17
+        __init = __binary_op(_CUDA_VSTD::move(__init), *__first);
 #else
         __init = __binary_op(__init, *__first);
 #endif
     return __init;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___NUMERIC_ACCUMULATE_H
+#endif // _LIBCUDACXX___NUMERIC_ACCUMULATE_H

diff  --git a/libcxx/include/__numeric/adjacent_
diff erence.h b/libcxx/include/__numeric/adjacent_
diff erence.h
index 5c712ecdf77d..bdafac97eb33 100644
--- a/libcxx/include/__numeric/adjacent_
diff erence.h
+++ b/libcxx/include/__numeric/adjacent_
diff erence.h
@@ -7,21 +7,21 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___NUMERIC_ADJACENT_DIFFERENCE_H
-#define _LIBCPP___NUMERIC_ADJACENT_DIFFERENCE_H
+#ifndef _LIBCUDACXX___NUMERIC_ADJACENT_DIFFERENCE_H
+#define _LIBCUDACXX___NUMERIC_ADJACENT_DIFFERENCE_H
 
 #include <__config>
 #include <__iterator/iterator_traits.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _InputIterator, class _OutputIterator>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 _OutputIterator
 adjacent_
diff erence(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
 {
@@ -32,19 +32,19 @@ adjacent_
diff erence(_InputIterator __first, _InputIterator __last, _OutputIterat
         for (++__first, (void) ++__result; __first != __last; ++__first, (void) ++__result)
         {
             typename iterator_traits<_InputIterator>::value_type __val(*__first);
-#if _LIBCPP_STD_VER > 17
-            *__result = __val - _VSTD::move(__acc);
+#if _LIBCUDACXX_STD_VER > 17
+            *__result = __val - _CUDA_VSTD::move(__acc);
 #else
             *__result = __val - __acc;
 #endif
-            __acc = _VSTD::move(__val);
+            __acc = _CUDA_VSTD::move(__val);
         }
     }
     return __result;
 }
 
 template <class _InputIterator, class _OutputIterator, class _BinaryOperation>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 _OutputIterator
 adjacent_
diff erence(_InputIterator __first, _InputIterator __last, _OutputIterator __result,
                       _BinaryOperation __binary_op)
@@ -56,17 +56,17 @@ adjacent_
diff erence(_InputIterator __first, _InputIterator __last, _OutputIterat
         for (++__first, (void) ++__result; __first != __last; ++__first, (void) ++__result)
         {
             typename iterator_traits<_InputIterator>::value_type __val(*__first);
-#if _LIBCPP_STD_VER > 17
-            *__result = __binary_op(__val, _VSTD::move(__acc));
+#if _LIBCUDACXX_STD_VER > 17
+            *__result = __binary_op(__val, _CUDA_VSTD::move(__acc));
 #else
             *__result = __binary_op(__val, __acc);
 #endif
-            __acc = _VSTD::move(__val);
+            __acc = _CUDA_VSTD::move(__val);
         }
     }
     return __result;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___NUMERIC_ADJACENT_DIFFERENCE_H
+#endif // _LIBCUDACXX___NUMERIC_ADJACENT_DIFFERENCE_H

diff  --git a/libcxx/include/__numeric/exclusive_scan.h b/libcxx/include/__numeric/exclusive_scan.h
index c0c89b38805d..cab15b214d90 100644
--- a/libcxx/include/__numeric/exclusive_scan.h
+++ b/libcxx/include/__numeric/exclusive_scan.h
@@ -7,33 +7,33 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___NUMERIC_EXCLUSIVE_SCAN_H
-#define _LIBCPP___NUMERIC_EXCLUSIVE_SCAN_H
+#ifndef _LIBCUDACXX___NUMERIC_EXCLUSIVE_SCAN_H
+#define _LIBCUDACXX___NUMERIC_EXCLUSIVE_SCAN_H
 
 #include <__config>
 #include <__functional/operations.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 
 template <class _InputIterator, class _OutputIterator, class _Tp, class _BinaryOp>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _OutputIterator
 exclusive_scan(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _Tp __init, _BinaryOp __b) {
   if (__first != __last) {
     _Tp __tmp(__b(__init, *__first));
     while (true) {
-      *__result = _VSTD::move(__init);
+      *__result = _CUDA_VSTD::move(__init);
       ++__result;
       ++__first;
       if (__first == __last)
         break;
-      __init = _VSTD::move(__tmp);
+      __init = _CUDA_VSTD::move(__tmp);
       __tmp = __b(__init, *__first);
     }
   }
@@ -41,13 +41,13 @@ exclusive_scan(_InputIterator __first, _InputIterator __last, _OutputIterator __
 }
 
 template <class _InputIterator, class _OutputIterator, class _Tp>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _OutputIterator
 exclusive_scan(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _Tp __init) {
-  return _VSTD::exclusive_scan(__first, __last, __result, __init, _VSTD::plus<>());
+  return _CUDA_VSTD::exclusive_scan(__first, __last, __result, __init, _CUDA_VSTD::plus<>());
 }
 
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCUDACXX_STD_VER > 14
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___NUMERIC_EXCLUSIVE_SCAN_H
+#endif // _LIBCUDACXX___NUMERIC_EXCLUSIVE_SCAN_H

diff  --git a/libcxx/include/__numeric/gcd_lcm.h b/libcxx/include/__numeric/gcd_lcm.h
index 9a53a001f211..6e1de7dcd501 100644
--- a/libcxx/include/__numeric/gcd_lcm.h
+++ b/libcxx/include/__numeric/gcd_lcm.h
@@ -7,30 +7,30 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___NUMERIC_GCD_LCM_H
-#define _LIBCPP___NUMERIC_GCD_LCM_H
+#ifndef _LIBCUDACXX___NUMERIC_GCD_LCM_H
+#define _LIBCUDACXX___NUMERIC_GCD_LCM_H
 
 #include <__assert>
 #include <__config>
 #include <limits>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 
 template <typename _Result, typename _Source, bool _IsSigned = is_signed<_Source>::value> struct __ct_abs;
 
 template <typename _Result, typename _Source>
 struct __ct_abs<_Result, _Source, true> {
-    _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR _LIBCUDACXX_INLINE_VISIBILITY
     _Result operator()(_Source __t) const noexcept
     {
         if (__t >= 0) return __t;
@@ -41,21 +41,21 @@ struct __ct_abs<_Result, _Source, true> {
 
 template <typename _Result, typename _Source>
 struct __ct_abs<_Result, _Source, false> {
-    _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR _LIBCUDACXX_INLINE_VISIBILITY
     _Result operator()(_Source __t) const noexcept { return __t; }
 };
 
 
 template<class _Tp>
-_LIBCPP_CONSTEXPR _LIBCPP_HIDDEN
+_LIBCUDACXX_CONSTEXPR _LIBCUDACXX_HIDDEN
 _Tp __gcd(_Tp __m, _Tp __n)
 {
     static_assert((!is_signed<_Tp>::value), "");
-    return __n == 0 ? __m : _VSTD::__gcd<_Tp>(__n, __m % __n);
+    return __n == 0 ? __m : _CUDA_VSTD::__gcd<_Tp>(__n, __m % __n);
 }
 
 template<class _Tp, class _Up>
-_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR _LIBCUDACXX_INLINE_VISIBILITY
 common_type_t<_Tp,_Up>
 gcd(_Tp __m, _Up __n)
 {
@@ -64,13 +64,13 @@ gcd(_Tp __m, _Up __n)
     static_assert((!is_same<typename remove_cv<_Up>::type, bool>::value), "Second argument to gcd cannot be bool" );
     using _Rp = common_type_t<_Tp,_Up>;
     using _Wp = make_unsigned_t<_Rp>;
-    return static_cast<_Rp>(_VSTD::__gcd(
+    return static_cast<_Rp>(_CUDA_VSTD::__gcd(
         static_cast<_Wp>(__ct_abs<_Rp, _Tp>()(__m)),
         static_cast<_Wp>(__ct_abs<_Rp, _Up>()(__n))));
 }
 
 template<class _Tp, class _Up>
-_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR _LIBCUDACXX_INLINE_VISIBILITY
 common_type_t<_Tp,_Up>
 lcm(_Tp __m, _Up __n)
 {
@@ -81,16 +81,16 @@ lcm(_Tp __m, _Up __n)
         return 0;
 
     using _Rp = common_type_t<_Tp,_Up>;
-    _Rp __val1 = __ct_abs<_Rp, _Tp>()(__m) / _VSTD::gcd(__m, __n);
+    _Rp __val1 = __ct_abs<_Rp, _Tp>()(__m) / _CUDA_VSTD::gcd(__m, __n);
     _Rp __val2 = __ct_abs<_Rp, _Up>()(__n);
-    _LIBCPP_ASSERT((numeric_limits<_Rp>::max() / __val1 > __val2), "Overflow in lcm");
+    _LIBCUDACXX_ASSERT((numeric_limits<_Rp>::max() / __val1 > __val2), "Overflow in lcm");
     return __val1 * __val2;
 }
 
-#endif // _LIBCPP_STD_VER
+#endif // _LIBCUDACXX_STD_VER
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___NUMERIC_GCD_LCM_H
+#endif // _LIBCUDACXX___NUMERIC_GCD_LCM_H

diff  --git a/libcxx/include/__numeric/inclusive_scan.h b/libcxx/include/__numeric/inclusive_scan.h
index a6b005075835..6f0d2d75a755 100644
--- a/libcxx/include/__numeric/inclusive_scan.h
+++ b/libcxx/include/__numeric/inclusive_scan.h
@@ -7,24 +7,24 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___NUMERIC_INCLUSIVE_SCAN_H
-#define _LIBCPP___NUMERIC_INCLUSIVE_SCAN_H
+#ifndef _LIBCUDACXX___NUMERIC_INCLUSIVE_SCAN_H
+#define _LIBCUDACXX___NUMERIC_INCLUSIVE_SCAN_H
 
 #include <__config>
 #include <__functional/operations.h>
 #include <__iterator/iterator_traits.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 
 template <class _InputIterator, class _OutputIterator, class _Tp, class _BinaryOp>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _OutputIterator
 inclusive_scan(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _BinaryOp __b, _Tp __init) {
   for (; __first != __last; ++__first, (void)++__result) {
     __init = __b(__init, *__first);
@@ -34,27 +34,27 @@ inclusive_scan(_InputIterator __first, _InputIterator __last, _OutputIterator __
 }
 
 template <class _InputIterator, class _OutputIterator, class _BinaryOp>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _OutputIterator
 inclusive_scan(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _BinaryOp __b) {
   if (__first != __last) {
     typename iterator_traits<_InputIterator>::value_type __init = *__first;
     *__result++ = __init;
     if (++__first != __last)
-      return _VSTD::inclusive_scan(__first, __last, __result, __b, __init);
+      return _CUDA_VSTD::inclusive_scan(__first, __last, __result, __b, __init);
   }
 
   return __result;
 }
 
 template <class _InputIterator, class _OutputIterator>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator inclusive_scan(_InputIterator __first,
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _OutputIterator inclusive_scan(_InputIterator __first,
                                                                                        _InputIterator __last,
                                                                                        _OutputIterator __result) {
-  return _VSTD::inclusive_scan(__first, __last, __result, _VSTD::plus<>());
+  return _CUDA_VSTD::inclusive_scan(__first, __last, __result, _CUDA_VSTD::plus<>());
 }
 
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCUDACXX_STD_VER > 14
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___NUMERIC_INCLUSIVE_SCAN_H
+#endif // _LIBCUDACXX___NUMERIC_INCLUSIVE_SCAN_H

diff  --git a/libcxx/include/__numeric/inner_product.h b/libcxx/include/__numeric/inner_product.h
index 6fe18bb2b19e..531bf6a77f5e 100644
--- a/libcxx/include/__numeric/inner_product.h
+++ b/libcxx/include/__numeric/inner_product.h
@@ -7,26 +7,26 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___NUMERIC_INNER_PRODUCT_H
-#define _LIBCPP___NUMERIC_INNER_PRODUCT_H
+#ifndef _LIBCUDACXX___NUMERIC_INNER_PRODUCT_H
+#define _LIBCUDACXX___NUMERIC_INNER_PRODUCT_H
 
 #include <__config>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _InputIterator1, class _InputIterator2, class _Tp>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 _Tp
 inner_product(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _Tp __init)
 {
     for (; __first1 != __last1; ++__first1, (void) ++__first2)
-#if _LIBCPP_STD_VER > 17
-        __init = _VSTD::move(__init) + *__first1 * *__first2;
+#if _LIBCUDACXX_STD_VER > 17
+        __init = _CUDA_VSTD::move(__init) + *__first1 * *__first2;
 #else
         __init = __init + *__first1 * *__first2;
 #endif
@@ -34,20 +34,20 @@ inner_product(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2
 }
 
 template <class _InputIterator1, class _InputIterator2, class _Tp, class _BinaryOperation1, class _BinaryOperation2>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 _Tp
 inner_product(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2,
               _Tp __init, _BinaryOperation1 __binary_op1, _BinaryOperation2 __binary_op2)
 {
     for (; __first1 != __last1; ++__first1, (void) ++__first2)
-#if _LIBCPP_STD_VER > 17
-        __init = __binary_op1(_VSTD::move(__init), __binary_op2(*__first1, *__first2));
+#if _LIBCUDACXX_STD_VER > 17
+        __init = __binary_op1(_CUDA_VSTD::move(__init), __binary_op2(*__first1, *__first2));
 #else
         __init = __binary_op1(__init, __binary_op2(*__first1, *__first2));
 #endif
     return __init;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___NUMERIC_INNER_PRODUCT_H
+#endif // _LIBCUDACXX___NUMERIC_INNER_PRODUCT_H

diff  --git a/libcxx/include/__numeric/iota.h b/libcxx/include/__numeric/iota.h
index b7127a11cb75..c4ec66d3adc7 100644
--- a/libcxx/include/__numeric/iota.h
+++ b/libcxx/include/__numeric/iota.h
@@ -7,19 +7,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___NUMERIC_IOTA_H
-#define _LIBCPP___NUMERIC_IOTA_H
+#ifndef _LIBCUDACXX___NUMERIC_IOTA_H
+#define _LIBCUDACXX___NUMERIC_IOTA_H
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _ForwardIterator, class _Tp>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void
 iota(_ForwardIterator __first, _ForwardIterator __last, _Tp __value)
 {
@@ -27,6 +27,6 @@ iota(_ForwardIterator __first, _ForwardIterator __last, _Tp __value)
         *__first = __value;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___NUMERIC_IOTA_H
+#endif // _LIBCUDACXX___NUMERIC_IOTA_H

diff  --git a/libcxx/include/__numeric/midpoint.h b/libcxx/include/__numeric/midpoint.h
index 668030c46bcb..641f9bad9bce 100644
--- a/libcxx/include/__numeric/midpoint.h
+++ b/libcxx/include/__numeric/midpoint.h
@@ -7,28 +7,28 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___NUMERIC_MIDPOINT_H
-#define _LIBCPP___NUMERIC_MIDPOINT_H
+#ifndef _LIBCUDACXX___NUMERIC_MIDPOINT_H
+#define _LIBCUDACXX___NUMERIC_MIDPOINT_H
 
 #include <__config>
 #include <limits>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY constexpr
+_LIBCUDACXX_INLINE_VISIBILITY constexpr
 enable_if_t<is_integral_v<_Tp> && !is_same_v<bool, _Tp> && !is_null_pointer_v<_Tp>, _Tp>
 midpoint(_Tp __a, _Tp __b) noexcept
-_LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
+_LIBCUDACXX_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
 {
     using _Up = make_unsigned_t<_Tp>;
     constexpr _Up __bitshift = numeric_limits<_Up>::digits - 1;
@@ -43,14 +43,14 @@ _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
 
 
 template <class _TPtr>
-_LIBCPP_INLINE_VISIBILITY constexpr
+_LIBCUDACXX_INLINE_VISIBILITY constexpr
 enable_if_t<is_pointer_v<_TPtr>
              && is_object_v<remove_pointer_t<_TPtr>>
              && ! is_void_v<remove_pointer_t<_TPtr>>
              && (sizeof(remove_pointer_t<_TPtr>) > 0), _TPtr>
 midpoint(_TPtr __a, _TPtr __b) noexcept
 {
-    return __a + _VSTD::midpoint(ptr
diff _t(0), __b - __a);
+    return __a + _CUDA_VSTD::midpoint(ptr
diff _t(0), __b - __a);
 }
 
 
@@ -63,7 +63,7 @@ template <typename _Fp>
 constexpr _Fp __fp_abs(_Fp __f) { return __f >= 0 ? __f : -__f; }
 
 template <class _Fp>
-_LIBCPP_INLINE_VISIBILITY constexpr
+_LIBCUDACXX_INLINE_VISIBILITY constexpr
 enable_if_t<is_floating_point_v<_Fp>, _Fp>
 midpoint(_Fp __a, _Fp __b) noexcept
 {
@@ -76,10 +76,10 @@ midpoint(_Fp __a, _Fp __b) noexcept
       __a/2 + __b/2;                                         // otherwise correctly rounded
 }
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___NUMERIC_MIDPOINT_H
+#endif // _LIBCUDACXX___NUMERIC_MIDPOINT_H

diff  --git a/libcxx/include/__numeric/partial_sum.h b/libcxx/include/__numeric/partial_sum.h
index 9acee3afc2b0..e67771919aed 100644
--- a/libcxx/include/__numeric/partial_sum.h
+++ b/libcxx/include/__numeric/partial_sum.h
@@ -7,21 +7,21 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___NUMERIC_PARTIAL_SUM_H
-#define _LIBCPP___NUMERIC_PARTIAL_SUM_H
+#ifndef _LIBCUDACXX___NUMERIC_PARTIAL_SUM_H
+#define _LIBCUDACXX___NUMERIC_PARTIAL_SUM_H
 
 #include <__config>
 #include <__iterator/iterator_traits.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _InputIterator, class _OutputIterator>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 _OutputIterator
 partial_sum(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
 {
@@ -31,8 +31,8 @@ partial_sum(_InputIterator __first, _InputIterator __last, _OutputIterator __res
         *__result = __t;
         for (++__first, (void) ++__result; __first != __last; ++__first, (void) ++__result)
         {
-#if _LIBCPP_STD_VER > 17
-            __t = _VSTD::move(__t) + *__first;
+#if _LIBCUDACXX_STD_VER > 17
+            __t = _CUDA_VSTD::move(__t) + *__first;
 #else
             __t = __t + *__first;
 #endif
@@ -43,7 +43,7 @@ partial_sum(_InputIterator __first, _InputIterator __last, _OutputIterator __res
 }
 
 template <class _InputIterator, class _OutputIterator, class _BinaryOperation>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 _OutputIterator
 partial_sum(_InputIterator __first, _InputIterator __last, _OutputIterator __result,
               _BinaryOperation __binary_op)
@@ -54,8 +54,8 @@ partial_sum(_InputIterator __first, _InputIterator __last, _OutputIterator __res
         *__result = __t;
         for (++__first, (void) ++__result; __first != __last; ++__first, (void) ++__result)
         {
-#if _LIBCPP_STD_VER > 17
-            __t = __binary_op(_VSTD::move(__t), *__first);
+#if _LIBCUDACXX_STD_VER > 17
+            __t = __binary_op(_CUDA_VSTD::move(__t), *__first);
 #else
             __t = __binary_op(__t, *__first);
 #endif
@@ -65,6 +65,6 @@ partial_sum(_InputIterator __first, _InputIterator __last, _OutputIterator __res
     return __result;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___NUMERIC_PARTIAL_SUM_H
+#endif // _LIBCUDACXX___NUMERIC_PARTIAL_SUM_H

diff  --git a/libcxx/include/__numeric/reduce.h b/libcxx/include/__numeric/reduce.h
index 90e4d238d868..42321ffa964f 100644
--- a/libcxx/include/__numeric/reduce.h
+++ b/libcxx/include/__numeric/reduce.h
@@ -7,22 +7,22 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___NUMERIC_REDUCE_H
-#define _LIBCPP___NUMERIC_REDUCE_H
+#ifndef _LIBCUDACXX___NUMERIC_REDUCE_H
+#define _LIBCUDACXX___NUMERIC_REDUCE_H
 
 #include <__config>
 #include <__functional/operations.h>
 #include <__iterator/iterator_traits.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _InputIterator, class _Tp, class _BinaryOp>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _Tp reduce(_InputIterator __first, _InputIterator __last,
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _Tp reduce(_InputIterator __first, _InputIterator __last,
                                                                    _Tp __init, _BinaryOp __b) {
   for (; __first != __last; ++__first)
     __init = __b(__init, *__first);
@@ -30,18 +30,18 @@ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _Tp reduce(_InputIterato
 }
 
 template <class _InputIterator, class _Tp>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _Tp reduce(_InputIterator __first, _InputIterator __last,
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _Tp reduce(_InputIterator __first, _InputIterator __last,
                                                                    _Tp __init) {
-  return _VSTD::reduce(__first, __last, __init, _VSTD::plus<>());
+  return _CUDA_VSTD::reduce(__first, __last, __init, _CUDA_VSTD::plus<>());
 }
 
 template <class _InputIterator>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 typename iterator_traits<_InputIterator>::value_type
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 typename iterator_traits<_InputIterator>::value_type
 reduce(_InputIterator __first, _InputIterator __last) {
-  return _VSTD::reduce(__first, __last, typename iterator_traits<_InputIterator>::value_type{});
+  return _CUDA_VSTD::reduce(__first, __last, typename iterator_traits<_InputIterator>::value_type{});
 }
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___NUMERIC_REDUCE_H
+#endif // _LIBCUDACXX___NUMERIC_REDUCE_H

diff  --git a/libcxx/include/__numeric/transform_exclusive_scan.h b/libcxx/include/__numeric/transform_exclusive_scan.h
index 45b3077f6649..9fb04bf8ac8a 100644
--- a/libcxx/include/__numeric/transform_exclusive_scan.h
+++ b/libcxx/include/__numeric/transform_exclusive_scan.h
@@ -7,22 +7,22 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___NUMERIC_TRANSFORM_EXCLUSIVE_SCAN_H
-#define _LIBCPP___NUMERIC_TRANSFORM_EXCLUSIVE_SCAN_H
+#ifndef _LIBCUDACXX___NUMERIC_TRANSFORM_EXCLUSIVE_SCAN_H
+#define _LIBCUDACXX___NUMERIC_TRANSFORM_EXCLUSIVE_SCAN_H
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 
 template <class _InputIterator, class _OutputIterator, class _Tp,
           class _BinaryOp, class _UnaryOp>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 _OutputIterator
 transform_exclusive_scan(_InputIterator __first, _InputIterator __last,
                            _OutputIterator __result, _Tp __init,
@@ -42,8 +42,8 @@ transform_exclusive_scan(_InputIterator __first, _InputIterator __last,
     return __result;
 }
 
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCUDACXX_STD_VER > 14
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___NUMERIC_TRANSFORM_EXCLUSIVE_SCAN_H
+#endif // _LIBCUDACXX___NUMERIC_TRANSFORM_EXCLUSIVE_SCAN_H

diff  --git a/libcxx/include/__numeric/transform_inclusive_scan.h b/libcxx/include/__numeric/transform_inclusive_scan.h
index b0d4ab5a88fd..f975eb00c52d 100644
--- a/libcxx/include/__numeric/transform_inclusive_scan.h
+++ b/libcxx/include/__numeric/transform_inclusive_scan.h
@@ -7,22 +7,22 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___NUMERIC_TRANSFORM_INCLUSIVE_SCAN_H
-#define _LIBCPP___NUMERIC_TRANSFORM_INCLUSIVE_SCAN_H
+#ifndef _LIBCUDACXX___NUMERIC_TRANSFORM_INCLUSIVE_SCAN_H
+#define _LIBCUDACXX___NUMERIC_TRANSFORM_INCLUSIVE_SCAN_H
 
 #include <__config>
 #include <__iterator/iterator_traits.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 
 template <class _InputIterator, class _OutputIterator, class _Tp, class _BinaryOp, class _UnaryOp>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 _OutputIterator
 transform_inclusive_scan(_InputIterator __first, _InputIterator __last,
                            _OutputIterator __result, _BinaryOp __b, _UnaryOp __u, _Tp __init)
@@ -36,7 +36,7 @@ transform_inclusive_scan(_InputIterator __first, _InputIterator __last,
 }
 
 template <class _InputIterator, class _OutputIterator, class _BinaryOp, class _UnaryOp>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 _OutputIterator
 transform_inclusive_scan(_InputIterator __first, _InputIterator __last,
                                _OutputIterator __result, _BinaryOp __b, _UnaryOp __u)
@@ -45,14 +45,14 @@ transform_inclusive_scan(_InputIterator __first, _InputIterator __last,
         typename iterator_traits<_InputIterator>::value_type __init = __u(*__first);
         *__result++ = __init;
         if (++__first != __last)
-            return _VSTD::transform_inclusive_scan(__first, __last, __result, __b, __u, __init);
+            return _CUDA_VSTD::transform_inclusive_scan(__first, __last, __result, __b, __u, __init);
     }
 
     return __result;
 }
 
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCUDACXX_STD_VER > 14
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___NUMERIC_TRANSFORM_INCLUSIVE_SCAN_H
+#endif // _LIBCUDACXX___NUMERIC_TRANSFORM_INCLUSIVE_SCAN_H

diff  --git a/libcxx/include/__numeric/transform_reduce.h b/libcxx/include/__numeric/transform_reduce.h
index da5a77988c38..b2f8875b4846 100644
--- a/libcxx/include/__numeric/transform_reduce.h
+++ b/libcxx/include/__numeric/transform_reduce.h
@@ -7,22 +7,22 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___NUMERIC_TRANSFORM_REDUCE_H
-#define _LIBCPP___NUMERIC_TRANSFORM_REDUCE_H
+#ifndef _LIBCUDACXX___NUMERIC_TRANSFORM_REDUCE_H
+#define _LIBCUDACXX___NUMERIC_TRANSFORM_REDUCE_H
 
 #include <__config>
 #include <__functional/operations.h>
 #include <__utility/move.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _InputIterator, class _Tp, class _BinaryOp, class _UnaryOp>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _Tp transform_reduce(_InputIterator __first,
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _Tp transform_reduce(_InputIterator __first,
                                                                              _InputIterator __last, _Tp __init,
                                                                              _BinaryOp __b, _UnaryOp __u) {
   for (; __first != __last; ++__first)
@@ -31,7 +31,7 @@ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _Tp transform_reduce(_In
 }
 
 template <class _InputIterator1, class _InputIterator2, class _Tp, class _BinaryOp1, class _BinaryOp2>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _Tp transform_reduce(_InputIterator1 __first1,
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _Tp transform_reduce(_InputIterator1 __first1,
                                                                              _InputIterator1 __last1,
                                                                              _InputIterator2 __first2, _Tp __init,
                                                                              _BinaryOp1 __b1, _BinaryOp2 __b2) {
@@ -41,14 +41,14 @@ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _Tp transform_reduce(_In
 }
 
 template <class _InputIterator1, class _InputIterator2, class _Tp>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _Tp transform_reduce(_InputIterator1 __first1,
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _Tp transform_reduce(_InputIterator1 __first1,
                                                                              _InputIterator1 __last1,
                                                                              _InputIterator2 __first2, _Tp __init) {
-  return _VSTD::transform_reduce(__first1, __last1, __first2, _VSTD::move(__init), _VSTD::plus<>(),
-                                 _VSTD::multiplies<>());
+  return _CUDA_VSTD::transform_reduce(__first1, __last1, __first2, _CUDA_VSTD::move(__init), _CUDA_VSTD::plus<>(),
+                                 _CUDA_VSTD::multiplies<>());
 }
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___NUMERIC_TRANSFORM_REDUCE_H
+#endif // _LIBCUDACXX___NUMERIC_TRANSFORM_REDUCE_H

diff  --git a/libcxx/include/__random/bernoulli_distribution.h b/libcxx/include/__random/bernoulli_distribution.h
index e97d53f5a421..b4474c02afe2 100644
--- a/libcxx/include/__random/bernoulli_distribution.h
+++ b/libcxx/include/__random/bernoulli_distribution.h
@@ -6,45 +6,45 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___RANDOM_BERNOULLI_DISTRIBUTION_H
-#define _LIBCPP___RANDOM_BERNOULLI_DISTRIBUTION_H
+#ifndef _LIBCUDACXX___RANDOM_BERNOULLI_DISTRIBUTION_H
+#define _LIBCUDACXX___RANDOM_BERNOULLI_DISTRIBUTION_H
 
 #include <__config>
 #include <__random/is_valid.h>
 #include <__random/uniform_real_distribution.h>
 #include <iosfwd>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-class _LIBCPP_TEMPLATE_VIS bernoulli_distribution
+class _LIBCUDACXX_TEMPLATE_VIS bernoulli_distribution
 {
 public:
     // types
     typedef bool result_type;
 
-    class _LIBCPP_TEMPLATE_VIS param_type
+    class _LIBCUDACXX_TEMPLATE_VIS param_type
     {
         double __p_;
     public:
         typedef bernoulli_distribution distribution_type;
 
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         explicit param_type(double __p = 0.5) : __p_(__p) {}
 
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         double p() const {return __p_;}
 
-        friend _LIBCPP_INLINE_VISIBILITY
+        friend _LIBCUDACXX_INLINE_VISIBILITY
             bool operator==(const param_type& __x, const param_type& __y)
             {return __x.__p_ == __y.__p_;}
-        friend _LIBCPP_INLINE_VISIBILITY
+        friend _LIBCUDACXX_INLINE_VISIBILITY
             bool operator!=(const param_type& __x, const param_type& __y)
             {return !(__x == __y);}
     };
@@ -54,46 +54,46 @@ class _LIBCPP_TEMPLATE_VIS bernoulli_distribution
 
 public:
     // constructors and reset functions
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     bernoulli_distribution() : bernoulli_distribution(0.5) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit bernoulli_distribution(double __p) : __p_(param_type(__p)) {}
 #else
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit bernoulli_distribution(double __p = 0.5) : __p_(param_type(__p)) {}
 #endif
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit bernoulli_distribution(const param_type& __p) : __p_(__p) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void reset() {}
 
     // generating functions
     template<class _URNG>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         result_type operator()(_URNG& __g)
         {return (*this)(__g, __p_);}
-    template<class _URNG> _LIBCPP_INLINE_VISIBILITY result_type operator()(_URNG& __g, const param_type& __p);
+    template<class _URNG> _LIBCUDACXX_INLINE_VISIBILITY result_type operator()(_URNG& __g, const param_type& __p);
 
     // property functions
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     double p() const {return __p_.p();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     param_type param() const {return __p_;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void param(const param_type& __p) {__p_ = __p;}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type min() const {return false;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type max() const {return true;}
 
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator==(const bernoulli_distribution& __x,
                         const bernoulli_distribution& __y)
         {return __x.__p_ == __y.__p_;}
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator!=(const bernoulli_distribution& __x,
                         const bernoulli_distribution& __y)
         {return !(__x == __y);}
@@ -104,7 +104,7 @@ inline
 bernoulli_distribution::result_type
 bernoulli_distribution::operator()(_URNG& __g, const param_type& __p)
 {
-    static_assert(__libcpp_random_is_valid_urng<_URNG>::value, "");
+    static_assert(__LIBCUDACXX_random_is_valid_urng<_URNG>::value, "");
     uniform_real_distribution<double> __gen;
     return __gen(__g) < __p.p();
 }
@@ -138,8 +138,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is, bernoulli_distribution& __x)
     return __is;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___RANDOM_BERNOULLI_DISTRIBUTION_H
+#endif // _LIBCUDACXX___RANDOM_BERNOULLI_DISTRIBUTION_H

diff  --git a/libcxx/include/__random/binomial_distribution.h b/libcxx/include/__random/binomial_distribution.h
index af60fa2a38e0..25d4c2966400 100644
--- a/libcxx/include/__random/binomial_distribution.h
+++ b/libcxx/include/__random/binomial_distribution.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___RANDOM_BINOMIAL_DISTRIBUTION_H
-#define _LIBCPP___RANDOM_BINOMIAL_DISTRIBUTION_H
+#ifndef _LIBCUDACXX___RANDOM_BINOMIAL_DISTRIBUTION_H
+#define _LIBCUDACXX___RANDOM_BINOMIAL_DISTRIBUTION_H
 
 #include <__config>
 #include <__random/is_valid.h>
@@ -15,24 +15,24 @@
 #include <cmath>
 #include <iosfwd>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template<class _IntType = int>
-class _LIBCPP_TEMPLATE_VIS binomial_distribution
+class _LIBCUDACXX_TEMPLATE_VIS binomial_distribution
 {
-    static_assert(__libcpp_random_is_valid_inttype<_IntType>::value, "IntType must be a supported integer type");
+    static_assert(__LIBCUDACXX_random_is_valid_inttype<_IntType>::value, "IntType must be a supported integer type");
 public:
     // types
     typedef _IntType result_type;
 
-    class _LIBCPP_TEMPLATE_VIS param_type
+    class _LIBCUDACXX_TEMPLATE_VIS param_type
     {
         result_type __t_;
         double __p_;
@@ -44,15 +44,15 @@ class _LIBCPP_TEMPLATE_VIS binomial_distribution
 
         explicit param_type(result_type __t = 1, double __p = 0.5);
 
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         result_type t() const {return __t_;}
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         double p() const {return __p_;}
 
-        friend _LIBCPP_INLINE_VISIBILITY
+        friend _LIBCUDACXX_INLINE_VISIBILITY
             bool operator==(const param_type& __x, const param_type& __y)
             {return __x.__t_ == __y.__t_ && __x.__p_ == __y.__p_;}
-        friend _LIBCPP_INLINE_VISIBILITY
+        friend _LIBCUDACXX_INLINE_VISIBILITY
             bool operator!=(const param_type& __x, const param_type& __y)
             {return !(__x == __y);}
 
@@ -64,61 +64,61 @@ class _LIBCPP_TEMPLATE_VIS binomial_distribution
 
 public:
     // constructors and reset functions
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     binomial_distribution() : binomial_distribution(1) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit binomial_distribution(result_type __t, double __p = 0.5)
         : __p_(param_type(__t, __p)) {}
 #else
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit binomial_distribution(result_type __t = 1, double __p = 0.5)
         : __p_(param_type(__t, __p)) {}
 #endif
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit binomial_distribution(const param_type& __p) : __p_(__p) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void reset() {}
 
     // generating functions
     template<class _URNG>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         result_type operator()(_URNG& __g)
         {return (*this)(__g, __p_);}
     template<class _URNG> result_type operator()(_URNG& __g, const param_type& __p);
 
     // property functions
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type t() const {return __p_.t();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     double p() const {return __p_.p();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     param_type param() const {return __p_;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void param(const param_type& __p) {__p_ = __p;}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type min() const {return 0;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type max() const {return t();}
 
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator==(const binomial_distribution& __x,
                         const binomial_distribution& __y)
         {return __x.__p_ == __y.__p_;}
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator!=(const binomial_distribution& __x,
                         const binomial_distribution& __y)
         {return !(__x == __y);}
 };
 
-#ifndef _LIBCPP_MSVCRT_LIKE
+#ifndef _LIBCUDACXX_MSVCRT_LIKE
 extern "C" double lgamma_r(double, int *);
 #endif
 
-inline _LIBCPP_INLINE_VISIBILITY double __libcpp_lgamma(double __d) {
-#if defined(_LIBCPP_MSVCRT_LIKE)
+inline _LIBCUDACXX_INLINE_VISIBILITY double __LIBCUDACXX_lgamma(double __d) {
+#if defined(_LIBCUDACXX_MSVCRT_LIKE)
   return lgamma(__d);
 #else
   int __sign;
@@ -133,10 +133,10 @@ binomial_distribution<_IntType>::param_type::param_type(result_type __t, double
     if (0 < __p_ && __p_ < 1)
     {
         __r0_ = static_cast<result_type>((__t_ + 1) * __p_);
-        __pr_ = _VSTD::exp(__libcpp_lgamma(__t_ + 1.) -
-                           __libcpp_lgamma(__r0_ + 1.) -
-                           __libcpp_lgamma(__t_ - __r0_ + 1.) + __r0_ * _VSTD::log(__p_) +
-                           (__t_ - __r0_) * _VSTD::log(1 - __p_));
+        __pr_ = _CUDA_VSTD::exp(__LIBCUDACXX_lgamma(__t_ + 1.) -
+                           __LIBCUDACXX_lgamma(__r0_ + 1.) -
+                           __LIBCUDACXX_lgamma(__t_ - __r0_ + 1.) + __r0_ * _CUDA_VSTD::log(__p_) +
+                           (__t_ - __r0_) * _CUDA_VSTD::log(1 - __p_));
         __odds_ratio_ = __p_ / (1 - __p_);
     }
 }
@@ -148,7 +148,7 @@ template<class _URNG>
 _IntType
 binomial_distribution<_IntType>::operator()(_URNG& __g, const param_type& __pr)
 {
-    static_assert(__libcpp_random_is_valid_urng<_URNG>::value, "");
+    static_assert(__LIBCUDACXX_random_is_valid_urng<_URNG>::value, "");
     if (__pr.__t_ == 0 || __pr.__p_ == 0)
         return 0;
     if (__pr.__p_ == 1)
@@ -221,8 +221,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
     return __is;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___RANDOM_BINOMIAL_DISTRIBUTION_H
+#endif // _LIBCUDACXX___RANDOM_BINOMIAL_DISTRIBUTION_H

diff  --git a/libcxx/include/__random/cauchy_distribution.h b/libcxx/include/__random/cauchy_distribution.h
index 5bc44ee8dd4c..1f30b9764acd 100644
--- a/libcxx/include/__random/cauchy_distribution.h
+++ b/libcxx/include/__random/cauchy_distribution.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___RANDOM_CAUCHY_DISTRIBUTION_H
-#define _LIBCPP___RANDOM_CAUCHY_DISTRIBUTION_H
+#ifndef _LIBCUDACXX___RANDOM_CAUCHY_DISTRIBUTION_H
+#define _LIBCUDACXX___RANDOM_CAUCHY_DISTRIBUTION_H
 
 #include <__config>
 #include <__random/is_valid.h>
@@ -16,42 +16,42 @@
 #include <iosfwd>
 #include <limits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template<class _RealType = double>
-class _LIBCPP_TEMPLATE_VIS cauchy_distribution
+class _LIBCUDACXX_TEMPLATE_VIS cauchy_distribution
 {
 public:
     // types
     typedef _RealType result_type;
 
-    class _LIBCPP_TEMPLATE_VIS param_type
+    class _LIBCUDACXX_TEMPLATE_VIS param_type
     {
         result_type __a_;
         result_type __b_;
     public:
         typedef cauchy_distribution distribution_type;
 
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         explicit param_type(result_type __a = 0, result_type __b = 1)
             : __a_(__a), __b_(__b) {}
 
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         result_type a() const {return __a_;}
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         result_type b() const {return __b_;}
 
-        friend _LIBCPP_INLINE_VISIBILITY
+        friend _LIBCUDACXX_INLINE_VISIBILITY
             bool operator==(const param_type& __x, const param_type& __y)
             {return __x.__a_ == __y.__a_ && __x.__b_ == __y.__b_;}
-        friend _LIBCPP_INLINE_VISIBILITY
+        friend _LIBCUDACXX_INLINE_VISIBILITY
             bool operator!=(const param_type& __x, const param_type& __y)
             {return !(__x == __y);}
     };
@@ -61,51 +61,51 @@ class _LIBCPP_TEMPLATE_VIS cauchy_distribution
 
 public:
     // constructor and reset functions
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     cauchy_distribution() : cauchy_distribution(0) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit cauchy_distribution(result_type __a, result_type __b = 1)
         : __p_(param_type(__a, __b)) {}
 #else
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit cauchy_distribution(result_type __a = 0, result_type __b = 1)
         : __p_(param_type(__a, __b)) {}
 #endif
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit cauchy_distribution(const param_type& __p)
         : __p_(__p) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void reset() {}
 
     // generating functions
     template<class _URNG>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         result_type operator()(_URNG& __g)
         {return (*this)(__g, __p_);}
-    template<class _URNG> _LIBCPP_INLINE_VISIBILITY result_type operator()(_URNG& __g, const param_type& __p);
+    template<class _URNG> _LIBCUDACXX_INLINE_VISIBILITY result_type operator()(_URNG& __g, const param_type& __p);
 
     // property functions
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type a() const {return __p_.a();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type b() const {return __p_.b();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     param_type param() const {return __p_;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void param(const param_type& __p) {__p_ = __p;}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type min() const {return -numeric_limits<result_type>::infinity();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type max() const {return numeric_limits<result_type>::infinity();}
 
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator==(const cauchy_distribution& __x,
                         const cauchy_distribution& __y)
         {return __x.__p_ == __y.__p_;}
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator!=(const cauchy_distribution& __x,
                         const cauchy_distribution& __y)
         {return !(__x == __y);}
@@ -117,10 +117,10 @@ inline
 _RealType
 cauchy_distribution<_RealType>::operator()(_URNG& __g, const param_type& __p)
 {
-    static_assert(__libcpp_random_is_valid_urng<_URNG>::value, "");
+    static_assert(__LIBCUDACXX_random_is_valid_urng<_URNG>::value, "");
     uniform_real_distribution<result_type> __gen;
     // purposefully let tan arg get as close to pi/2 as it wants, tan will return a finite
-    return __p.a() + __p.b() * _VSTD::tan(3.1415926535897932384626433832795 * __gen(__g));
+    return __p.a() + __p.b() * _CUDA_VSTD::tan(3.1415926535897932384626433832795 * __gen(__g));
 }
 
 template <class _CharT, class _Traits, class _RT>
@@ -157,8 +157,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
     return __is;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___RANDOM_CAUCHY_DISTRIBUTION_H
+#endif // _LIBCUDACXX___RANDOM_CAUCHY_DISTRIBUTION_H

diff  --git a/libcxx/include/__random/chi_squared_distribution.h b/libcxx/include/__random/chi_squared_distribution.h
index b98488c20d28..5f8b6addebff 100644
--- a/libcxx/include/__random/chi_squared_distribution.h
+++ b/libcxx/include/__random/chi_squared_distribution.h
@@ -6,46 +6,46 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___RANDOM_CHI_SQUARED_DISTRIBUTION_H
-#define _LIBCPP___RANDOM_CHI_SQUARED_DISTRIBUTION_H
+#ifndef _LIBCUDACXX___RANDOM_CHI_SQUARED_DISTRIBUTION_H
+#define _LIBCUDACXX___RANDOM_CHI_SQUARED_DISTRIBUTION_H
 
 #include <__config>
 #include <__random/gamma_distribution.h>
 #include <iosfwd>
 #include <limits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template<class _RealType = double>
-class _LIBCPP_TEMPLATE_VIS chi_squared_distribution
+class _LIBCUDACXX_TEMPLATE_VIS chi_squared_distribution
 {
 public:
     // types
     typedef _RealType result_type;
 
-    class _LIBCPP_TEMPLATE_VIS param_type
+    class _LIBCUDACXX_TEMPLATE_VIS param_type
     {
         result_type __n_;
     public:
         typedef chi_squared_distribution distribution_type;
 
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         explicit param_type(result_type __n = 1) : __n_(__n) {}
 
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         result_type n() const {return __n_;}
 
-        friend _LIBCPP_INLINE_VISIBILITY
+        friend _LIBCUDACXX_INLINE_VISIBILITY
             bool operator==(const param_type& __x, const param_type& __y)
             {return __x.__n_ == __y.__n_;}
-        friend _LIBCPP_INLINE_VISIBILITY
+        friend _LIBCUDACXX_INLINE_VISIBILITY
             bool operator!=(const param_type& __x, const param_type& __y)
             {return !(__x == __y);}
     };
@@ -55,52 +55,52 @@ class _LIBCPP_TEMPLATE_VIS chi_squared_distribution
 
 public:
     // constructor and reset functions
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     chi_squared_distribution() : chi_squared_distribution(1) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit chi_squared_distribution(result_type __n)
         : __p_(param_type(__n)) {}
 #else
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit chi_squared_distribution(result_type __n = 1)
         : __p_(param_type(__n)) {}
 #endif
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit chi_squared_distribution(const param_type& __p)
         : __p_(__p) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void reset() {}
 
     // generating functions
     template<class _URNG>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         result_type operator()(_URNG& __g)
         {return (*this)(__g, __p_);}
     template<class _URNG>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         result_type operator()(_URNG& __g, const param_type& __p)
         {return gamma_distribution<result_type>(__p.n() / 2, 2)(__g);}
 
     // property functions
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type n() const {return __p_.n();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     param_type param() const {return __p_;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void param(const param_type& __p) {__p_ = __p;}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type min() const {return 0;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type max() const {return numeric_limits<result_type>::infinity();}
 
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator==(const chi_squared_distribution& __x,
                         const chi_squared_distribution& __y)
         {return __x.__p_ == __y.__p_;}
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator!=(const chi_squared_distribution& __x,
                         const chi_squared_distribution& __y)
         {return !(__x == __y);}
@@ -137,8 +137,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
     return __is;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___RANDOM_CHI_SQUARED_DISTRIBUTION_H
+#endif // _LIBCUDACXX___RANDOM_CHI_SQUARED_DISTRIBUTION_H

diff  --git a/libcxx/include/__random/clamp_to_integral.h b/libcxx/include/__random/clamp_to_integral.h
index 7d44ff9cfcad..f847e096476f 100644
--- a/libcxx/include/__random/clamp_to_integral.h
+++ b/libcxx/include/__random/clamp_to_integral.h
@@ -6,28 +6,28 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___RANDOM_CLAMP_TO_INTEGRAL_H
-#define _LIBCPP___RANDOM_CLAMP_TO_INTEGRAL_H
+#ifndef _LIBCUDACXX___RANDOM_CLAMP_TO_INTEGRAL_H
+#define _LIBCUDACXX___RANDOM_CLAMP_TO_INTEGRAL_H
 
 #include <__config>
 #include <cmath>
 #include <limits>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _IntT, class _FloatT,
     bool _FloatBigger = (numeric_limits<_FloatT>::digits > numeric_limits<_IntT>::digits),
     int _Bits = (numeric_limits<_IntT>::digits - numeric_limits<_FloatT>::digits)>
-_LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR _IntT __max_representable_int_for_float() _NOEXCEPT {
+_LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR _IntT __max_representable_int_for_float() _NOEXCEPT {
   static_assert(is_floating_point<_FloatT>::value, "must be a floating point type");
   static_assert(is_integral<_IntT>::value, "must be an integral type");
   static_assert(numeric_limits<_FloatT>::radix == 2, "FloatT has incorrect radix");
@@ -41,7 +41,7 @@ _LIBCPP_CONSTEXPR _IntT __max_representable_int_for_float() _NOEXCEPT {
 //
 // The behavior is undefined if `__r` is NaN.
 template <class _IntT, class _RealT>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _IntT __clamp_to_integral(_RealT __r) _NOEXCEPT {
   using _Lim = numeric_limits<_IntT>;
   const _IntT _MaxVal = __max_representable_int_for_float<_IntT, _RealT>();
@@ -53,8 +53,8 @@ _IntT __clamp_to_integral(_RealT __r) _NOEXCEPT {
   return static_cast<_IntT>(__r);
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___RANDOM_CLAMP_TO_INTEGRAL_H
+#endif // _LIBCUDACXX___RANDOM_CLAMP_TO_INTEGRAL_H

diff  --git a/libcxx/include/__random/default_random_engine.h b/libcxx/include/__random/default_random_engine.h
index 89792f4f0d43..3393cbc1f955 100644
--- a/libcxx/include/__random/default_random_engine.h
+++ b/libcxx/include/__random/default_random_engine.h
@@ -6,20 +6,20 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___RANDOM_DEFAULT_RANDOM_ENGINE_H
-#define _LIBCPP___RANDOM_DEFAULT_RANDOM_ENGINE_H
+#ifndef _LIBCUDACXX___RANDOM_DEFAULT_RANDOM_ENGINE_H
+#define _LIBCUDACXX___RANDOM_DEFAULT_RANDOM_ENGINE_H
 
 #include <__config>
 #include <__random/linear_congruential_engine.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 typedef minstd_rand default_random_engine;
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___RANDOM_DEFAULT_RANDOM_ENGINE_H
+#endif // _LIBCUDACXX___RANDOM_DEFAULT_RANDOM_ENGINE_H

diff  --git a/libcxx/include/__random/discard_block_engine.h b/libcxx/include/__random/discard_block_engine.h
index c58d66b58869..f07507f72ee2 100644
--- a/libcxx/include/__random/discard_block_engine.h
+++ b/libcxx/include/__random/discard_block_engine.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___RANDOM_DISCARD_BLOCK_ENGINE_H
-#define _LIBCPP___RANDOM_DISCARD_BLOCK_ENGINE_H
+#ifndef _LIBCUDACXX___RANDOM_DISCARD_BLOCK_ENGINE_H
+#define _LIBCUDACXX___RANDOM_DISCARD_BLOCK_ENGINE_H
 
 #include <__config>
 #include <__random/is_seed_sequence.h>
@@ -16,17 +16,17 @@
 #include <iosfwd>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template<class _Engine, size_t __p, size_t __r>
-class _LIBCPP_TEMPLATE_VIS discard_block_engine
+class _LIBCUDACXX_TEMPLATE_VIS discard_block_engine
 {
     _Engine __e_;
     int     __n_;
@@ -39,47 +39,47 @@ class _LIBCPP_TEMPLATE_VIS discard_block_engine
     typedef typename _Engine::result_type result_type;
 
     // engine characteristics
-    static _LIBCPP_CONSTEXPR const size_t block_size = __p;
-    static _LIBCPP_CONSTEXPR const size_t used_block = __r;
+    static _LIBCUDACXX_CONSTEXPR const size_t block_size = __p;
+    static _LIBCUDACXX_CONSTEXPR const size_t used_block = __r;
 
-#ifdef _LIBCPP_CXX03_LANG
+#ifdef _LIBCUDACXX_CXX03_LANG
     static const result_type _Min = _Engine::_Min;
     static const result_type _Max = _Engine::_Max;
 #else
-    static _LIBCPP_CONSTEXPR const result_type _Min = _Engine::min();
-    static _LIBCPP_CONSTEXPR const result_type _Max = _Engine::max();
+    static _LIBCUDACXX_CONSTEXPR const result_type _Min = _Engine::min();
+    static _LIBCUDACXX_CONSTEXPR const result_type _Max = _Engine::max();
 #endif
 
-    _LIBCPP_INLINE_VISIBILITY
-    static _LIBCPP_CONSTEXPR result_type min() { return _Engine::min(); }
-    _LIBCPP_INLINE_VISIBILITY
-    static _LIBCPP_CONSTEXPR result_type max() { return _Engine::max(); }
+    _LIBCUDACXX_INLINE_VISIBILITY
+    static _LIBCUDACXX_CONSTEXPR result_type min() { return _Engine::min(); }
+    _LIBCUDACXX_INLINE_VISIBILITY
+    static _LIBCUDACXX_CONSTEXPR result_type max() { return _Engine::max(); }
 
     // constructors and seeding functions
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     discard_block_engine() : __n_(0) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit discard_block_engine(const _Engine& __e)
         : __e_(__e), __n_(0) {}
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit discard_block_engine(_Engine&& __e)
-        : __e_(_VSTD::move(__e)), __n_(0) {}
-#endif // _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+        : __e_(_CUDA_VSTD::move(__e)), __n_(0) {}
+#endif // _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit discard_block_engine(result_type __sd) : __e_(__sd), __n_(0) {}
     template<class _Sseq>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         explicit discard_block_engine(_Sseq& __q,
         typename enable_if<__is_seed_sequence<_Sseq, discard_block_engine>::value &&
                            !is_convertible<_Sseq, _Engine>::value>::type* = 0)
         : __e_(__q), __n_(0) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void seed() {__e_.seed(); __n_ = 0;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void seed(result_type __sd) {__e_.seed(__sd); __n_ = 0;}
     template<class _Sseq>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         typename enable_if
         <
             __is_seed_sequence<_Sseq, discard_block_engine>::value,
@@ -89,11 +89,11 @@ class _LIBCPP_TEMPLATE_VIS discard_block_engine
 
     // generating functions
     result_type operator()();
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void discard(unsigned long long __z) {for (; __z; --__z) operator()();}
 
     // property functions
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const _Engine& base() const _NOEXCEPT {return __e_;}
 
     template<class _Eng, size_t _Pp, size_t _Rp>
@@ -126,10 +126,10 @@ class _LIBCPP_TEMPLATE_VIS discard_block_engine
 };
 
 template<class _Engine, size_t __p, size_t __r>
-    _LIBCPP_CONSTEXPR const size_t discard_block_engine<_Engine, __p, __r>::block_size;
+    _LIBCUDACXX_CONSTEXPR const size_t discard_block_engine<_Engine, __p, __r>::block_size;
 
 template<class _Engine, size_t __p, size_t __r>
-    _LIBCPP_CONSTEXPR const size_t discard_block_engine<_Engine, __p, __r>::used_block;
+    _LIBCUDACXX_CONSTEXPR const size_t discard_block_engine<_Engine, __p, __r>::used_block;
 
 template<class _Engine, size_t __p, size_t __r>
 typename discard_block_engine<_Engine, __p, __r>::result_type
@@ -145,7 +145,7 @@ discard_block_engine<_Engine, __p, __r>::operator()()
 }
 
 template<class _Eng, size_t _Pp, size_t _Rp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator==(const discard_block_engine<_Eng, _Pp, _Rp>& __x,
            const discard_block_engine<_Eng, _Pp, _Rp>& __y)
@@ -154,7 +154,7 @@ operator==(const discard_block_engine<_Eng, _Pp, _Rp>& __x,
 }
 
 template<class _Eng, size_t _Pp, size_t _Rp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator!=(const discard_block_engine<_Eng, _Pp, _Rp>& __x,
            const discard_block_engine<_Eng, _Pp, _Rp>& __y)
@@ -196,8 +196,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
     return __is;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___RANDOM_DISCARD_BLOCK_ENGINE_H
+#endif // _LIBCUDACXX___RANDOM_DISCARD_BLOCK_ENGINE_H

diff  --git a/libcxx/include/__random/discrete_distribution.h b/libcxx/include/__random/discrete_distribution.h
index 8dc63c0e98b4..4a89136a2dd8 100644
--- a/libcxx/include/__random/discrete_distribution.h
+++ b/libcxx/include/__random/discrete_distribution.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___RANDOM_DISCRETE_DISTRIBUTION_H
-#define _LIBCPP___RANDOM_DISCRETE_DISTRIBUTION_H
+#ifndef _LIBCUDACXX___RANDOM_DISCRETE_DISTRIBUTION_H
+#define _LIBCUDACXX___RANDOM_DISCRETE_DISTRIBUTION_H
 
 #include <__algorithm/upper_bound.h>
 #include <__config>
@@ -18,50 +18,50 @@
 #include <numeric>
 #include <vector>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template<class _IntType = int>
-class _LIBCPP_TEMPLATE_VIS discrete_distribution
+class _LIBCUDACXX_TEMPLATE_VIS discrete_distribution
 {
-    static_assert(__libcpp_random_is_valid_inttype<_IntType>::value, "IntType must be a supported integer type");
+    static_assert(__LIBCUDACXX_random_is_valid_inttype<_IntType>::value, "IntType must be a supported integer type");
 public:
     // types
     typedef _IntType result_type;
 
-    class _LIBCPP_TEMPLATE_VIS param_type
+    class _LIBCUDACXX_TEMPLATE_VIS param_type
     {
         vector<double> __p_;
     public:
         typedef discrete_distribution distribution_type;
 
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         param_type() {}
         template<class _InputIterator>
-            _LIBCPP_INLINE_VISIBILITY
+            _LIBCUDACXX_INLINE_VISIBILITY
             param_type(_InputIterator __f, _InputIterator __l)
             : __p_(__f, __l) {__init();}
-#ifndef _LIBCPP_CXX03_LANG
-        _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_CXX03_LANG
+        _LIBCUDACXX_INLINE_VISIBILITY
         param_type(initializer_list<double> __wl)
             : __p_(__wl.begin(), __wl.end()) {__init();}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
         template<class _UnaryOperation>
             param_type(size_t __nw, double __xmin, double __xmax,
                        _UnaryOperation __fw);
 
         vector<double> probabilities() const;
 
-        friend _LIBCPP_INLINE_VISIBILITY
+        friend _LIBCUDACXX_INLINE_VISIBILITY
             bool operator==(const param_type& __x, const param_type& __y)
             {return __x.__p_ == __y.__p_;}
-        friend _LIBCPP_INLINE_VISIBILITY
+        friend _LIBCUDACXX_INLINE_VISIBILITY
             bool operator!=(const param_type& __x, const param_type& __y)
             {return !(__x == __y);}
 
@@ -88,54 +88,54 @@ class _LIBCPP_TEMPLATE_VIS discrete_distribution
 
 public:
     // constructor and reset functions
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     discrete_distribution() {}
     template<class _InputIterator>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         discrete_distribution(_InputIterator __f, _InputIterator __l)
             : __p_(__f, __l) {}
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     discrete_distribution(initializer_list<double> __wl)
         : __p_(__wl) {}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
     template<class _UnaryOperation>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         discrete_distribution(size_t __nw, double __xmin, double __xmax,
                               _UnaryOperation __fw)
         : __p_(__nw, __xmin, __xmax, __fw) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit discrete_distribution(const param_type& __p)
         : __p_(__p) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void reset() {}
 
     // generating functions
     template<class _URNG>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         result_type operator()(_URNG& __g)
         {return (*this)(__g, __p_);}
     template<class _URNG> result_type operator()(_URNG& __g, const param_type& __p);
 
     // property functions
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     vector<double> probabilities() const {return __p_.probabilities();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     param_type param() const {return __p_;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void param(const param_type& __p) {__p_ = __p;}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type min() const {return 0;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type max() const {return __p_.__p_.size();}
 
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator==(const discrete_distribution& __x,
                         const discrete_distribution& __y)
         {return __x.__p_ == __y.__p_;}
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator!=(const discrete_distribution& __x,
                         const discrete_distribution& __y)
         {return !(__x == __y);}
@@ -179,11 +179,11 @@ discrete_distribution<_IntType>::param_type::__init()
     {
         if (__p_.size() > 1)
         {
-            double __s = _VSTD::accumulate(__p_.begin(), __p_.end(), 0.0);
+            double __s = _CUDA_VSTD::accumulate(__p_.begin(), __p_.end(), 0.0);
             for (vector<double>::iterator __i = __p_.begin(), __e = __p_.end(); __i < __e; ++__i)
                 *__i /= __s;
             vector<double> __t(__p_.size() - 1);
-            _VSTD::partial_sum(__p_.begin(), __p_.end() - 1, __t.begin());
+            _CUDA_VSTD::partial_sum(__p_.begin(), __p_.end() - 1, __t.begin());
             swap(__p_, __t);
         }
         else
@@ -200,7 +200,7 @@ discrete_distribution<_IntType>::param_type::probabilities() const
 {
     size_t __n = __p_.size();
     vector<double> __p(__n+1);
-    _VSTD::adjacent_
diff erence(__p_.begin(), __p_.end(), __p.begin());
+    _CUDA_VSTD::adjacent_
diff erence(__p_.begin(), __p_.end(), __p.begin());
     if (__n > 0)
         __p[__n] = 1 - __p_[__n-1];
     else
@@ -213,10 +213,10 @@ template<class _URNG>
 _IntType
 discrete_distribution<_IntType>::operator()(_URNG& __g, const param_type& __p)
 {
-    static_assert(__libcpp_random_is_valid_urng<_URNG>::value, "");
+    static_assert(__LIBCUDACXX_random_is_valid_urng<_URNG>::value, "");
     uniform_real_distribution<double> __gen;
     return static_cast<_IntType>(
-           _VSTD::upper_bound(__p.__p_.begin(), __p.__p_.end(), __gen(__g)) -
+           _CUDA_VSTD::upper_bound(__p.__p_.begin(), __p.__p_.end(), __gen(__g)) -
                                                               __p.__p_.begin());
 }
 
@@ -256,8 +256,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
     return __is;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___RANDOM_DISCRETE_DISTRIBUTION_H
+#endif // _LIBCUDACXX___RANDOM_DISCRETE_DISTRIBUTION_H

diff  --git a/libcxx/include/__random/exponential_distribution.h b/libcxx/include/__random/exponential_distribution.h
index 1c9e9e0d9ef1..53b07e2486b1 100644
--- a/libcxx/include/__random/exponential_distribution.h
+++ b/libcxx/include/__random/exponential_distribution.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___RANDOM_EXPONENTIAL_DISTRIBUTION_H
-#define _LIBCPP___RANDOM_EXPONENTIAL_DISTRIBUTION_H
+#ifndef _LIBCUDACXX___RANDOM_EXPONENTIAL_DISTRIBUTION_H
+#define _LIBCUDACXX___RANDOM_EXPONENTIAL_DISTRIBUTION_H
 
 #include <__config>
 #include <__random/generate_canonical.h>
@@ -17,38 +17,38 @@
 #include <iosfwd>
 #include <limits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template<class _RealType = double>
-class _LIBCPP_TEMPLATE_VIS exponential_distribution
+class _LIBCUDACXX_TEMPLATE_VIS exponential_distribution
 {
 public:
     // types
     typedef _RealType result_type;
 
-    class _LIBCPP_TEMPLATE_VIS param_type
+    class _LIBCUDACXX_TEMPLATE_VIS param_type
     {
         result_type __lambda_;
     public:
         typedef exponential_distribution distribution_type;
 
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         explicit param_type(result_type __lambda = 1) : __lambda_(__lambda) {}
 
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         result_type lambda() const {return __lambda_;}
 
-        friend _LIBCPP_INLINE_VISIBILITY
+        friend _LIBCUDACXX_INLINE_VISIBILITY
             bool operator==(const param_type& __x, const param_type& __y)
             {return __x.__lambda_ == __y.__lambda_;}
-        friend _LIBCPP_INLINE_VISIBILITY
+        friend _LIBCUDACXX_INLINE_VISIBILITY
             bool operator!=(const param_type& __x, const param_type& __y)
             {return !(__x == __y);}
     };
@@ -58,48 +58,48 @@ class _LIBCPP_TEMPLATE_VIS exponential_distribution
 
 public:
     // constructors and reset functions
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     exponential_distribution() : exponential_distribution(1) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit exponential_distribution(result_type __lambda)
         : __p_(param_type(__lambda)) {}
 #else
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit exponential_distribution(result_type __lambda = 1)
         : __p_(param_type(__lambda)) {}
 #endif
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit exponential_distribution(const param_type& __p) : __p_(__p) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void reset() {}
 
     // generating functions
     template<class _URNG>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         result_type operator()(_URNG& __g)
         {return (*this)(__g, __p_);}
     template<class _URNG> result_type operator()(_URNG& __g, const param_type& __p);
 
     // property functions
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type lambda() const {return __p_.lambda();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     param_type param() const {return __p_;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void param(const param_type& __p) {__p_ = __p;}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type min() const {return 0;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type max() const {return numeric_limits<result_type>::infinity();}
 
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator==(const exponential_distribution& __x,
                         const exponential_distribution& __y)
         {return __x.__p_ == __y.__p_;}
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator!=(const exponential_distribution& __x,
                         const exponential_distribution& __y)
         {return !(__x == __y);}
@@ -110,11 +110,11 @@ template<class _URNG>
 _RealType
 exponential_distribution<_RealType>::operator()(_URNG& __g, const param_type& __p)
 {
-    static_assert(__libcpp_random_is_valid_urng<_URNG>::value, "");
-    return -_VSTD::log
+    static_assert(__LIBCUDACXX_random_is_valid_urng<_URNG>::value, "");
+    return -_CUDA_VSTD::log
                   (
                       result_type(1) -
-                      _VSTD::generate_canonical<result_type,
+                      _CUDA_VSTD::generate_canonical<result_type,
                                        numeric_limits<result_type>::digits>(__g)
                   )
                   / __p.lambda();
@@ -150,8 +150,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
     return __is;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___RANDOM_EXPONENTIAL_DISTRIBUTION_H
+#endif // _LIBCUDACXX___RANDOM_EXPONENTIAL_DISTRIBUTION_H

diff  --git a/libcxx/include/__random/extreme_value_distribution.h b/libcxx/include/__random/extreme_value_distribution.h
index ba30aa5b88c3..9af62ef83110 100644
--- a/libcxx/include/__random/extreme_value_distribution.h
+++ b/libcxx/include/__random/extreme_value_distribution.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___RANDOM_EXTREME_VALUE_DISTRIBUTION_H
-#define _LIBCPP___RANDOM_EXTREME_VALUE_DISTRIBUTION_H
+#ifndef _LIBCUDACXX___RANDOM_EXTREME_VALUE_DISTRIBUTION_H
+#define _LIBCUDACXX___RANDOM_EXTREME_VALUE_DISTRIBUTION_H
 
 #include <__config>
 #include <__random/is_valid.h>
@@ -16,42 +16,42 @@
 #include <iosfwd>
 #include <limits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template<class _RealType = double>
-class _LIBCPP_TEMPLATE_VIS extreme_value_distribution
+class _LIBCUDACXX_TEMPLATE_VIS extreme_value_distribution
 {
 public:
     // types
     typedef _RealType result_type;
 
-    class _LIBCPP_TEMPLATE_VIS param_type
+    class _LIBCUDACXX_TEMPLATE_VIS param_type
     {
         result_type __a_;
         result_type __b_;
     public:
         typedef extreme_value_distribution distribution_type;
 
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         explicit param_type(result_type __a = 0, result_type __b = 1)
             : __a_(__a), __b_(__b) {}
 
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         result_type a() const {return __a_;}
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         result_type b() const {return __b_;}
 
-        friend _LIBCPP_INLINE_VISIBILITY
+        friend _LIBCUDACXX_INLINE_VISIBILITY
             bool operator==(const param_type& __x, const param_type& __y)
             {return __x.__a_ == __y.__a_ && __x.__b_ == __y.__b_;}
-        friend _LIBCPP_INLINE_VISIBILITY
+        friend _LIBCUDACXX_INLINE_VISIBILITY
             bool operator!=(const param_type& __x, const param_type& __y)
             {return !(__x == __y);}
     };
@@ -61,52 +61,52 @@ class _LIBCPP_TEMPLATE_VIS extreme_value_distribution
 
 public:
     // constructor and reset functions
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     extreme_value_distribution() : extreme_value_distribution(0) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit extreme_value_distribution(result_type __a, result_type __b = 1)
         : __p_(param_type(__a, __b)) {}
 #else
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit extreme_value_distribution(result_type __a = 0,
                                         result_type __b = 1)
         : __p_(param_type(__a, __b)) {}
 #endif
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit extreme_value_distribution(const param_type& __p)
         : __p_(__p) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void reset() {}
 
     // generating functions
     template<class _URNG>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         result_type operator()(_URNG& __g)
         {return (*this)(__g, __p_);}
     template<class _URNG> result_type operator()(_URNG& __g, const param_type& __p);
 
     // property functions
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type a() const {return __p_.a();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type b() const {return __p_.b();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     param_type param() const {return __p_;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void param(const param_type& __p) {__p_ = __p;}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type min() const {return -numeric_limits<result_type>::infinity();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type max() const {return numeric_limits<result_type>::infinity();}
 
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator==(const extreme_value_distribution& __x,
                         const extreme_value_distribution& __y)
         {return __x.__p_ == __y.__p_;}
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator!=(const extreme_value_distribution& __x,
                         const extreme_value_distribution& __y)
         {return !(__x == __y);}
@@ -117,9 +117,9 @@ template<class _URNG>
 _RealType
 extreme_value_distribution<_RealType>::operator()(_URNG& __g, const param_type& __p)
 {
-    static_assert(__libcpp_random_is_valid_urng<_URNG>::value, "");
+    static_assert(__LIBCUDACXX_random_is_valid_urng<_URNG>::value, "");
     return __p.a() - __p.b() *
-         _VSTD::log(-_VSTD::log(1-uniform_real_distribution<result_type>()(__g)));
+         _CUDA_VSTD::log(-_CUDA_VSTD::log(1-uniform_real_distribution<result_type>()(__g)));
 }
 
 template <class _CharT, class _Traits, class _RT>
@@ -156,8 +156,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
     return __is;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___RANDOM_EXTREME_VALUE_DISTRIBUTION_H
+#endif // _LIBCUDACXX___RANDOM_EXTREME_VALUE_DISTRIBUTION_H

diff  --git a/libcxx/include/__random/fisher_f_distribution.h b/libcxx/include/__random/fisher_f_distribution.h
index 60c7f28c0bb0..7449e0dc654c 100644
--- a/libcxx/include/__random/fisher_f_distribution.h
+++ b/libcxx/include/__random/fisher_f_distribution.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___RANDOM_FISHER_F_DISTRIBUTION_H
-#define _LIBCPP___RANDOM_FISHER_F_DISTRIBUTION_H
+#ifndef _LIBCUDACXX___RANDOM_FISHER_F_DISTRIBUTION_H
+#define _LIBCUDACXX___RANDOM_FISHER_F_DISTRIBUTION_H
 
 #include <__config>
 #include <__random/gamma_distribution.h>
@@ -15,42 +15,42 @@
 #include <iosfwd>
 #include <limits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template<class _RealType = double>
-class _LIBCPP_TEMPLATE_VIS fisher_f_distribution
+class _LIBCUDACXX_TEMPLATE_VIS fisher_f_distribution
 {
 public:
     // types
     typedef _RealType result_type;
 
-    class _LIBCPP_TEMPLATE_VIS param_type
+    class _LIBCUDACXX_TEMPLATE_VIS param_type
     {
         result_type __m_;
         result_type __n_;
     public:
         typedef fisher_f_distribution distribution_type;
 
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         explicit param_type(result_type __m = 1, result_type __n = 1)
             : __m_(__m), __n_(__n) {}
 
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         result_type m() const {return __m_;}
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         result_type n() const {return __n_;}
 
-        friend _LIBCPP_INLINE_VISIBILITY
+        friend _LIBCUDACXX_INLINE_VISIBILITY
             bool operator==(const param_type& __x, const param_type& __y)
             {return __x.__m_ == __y.__m_ && __x.__n_ == __y.__n_;}
-        friend _LIBCPP_INLINE_VISIBILITY
+        friend _LIBCUDACXX_INLINE_VISIBILITY
             bool operator!=(const param_type& __x, const param_type& __y)
             {return !(__x == __y);}
     };
@@ -60,51 +60,51 @@ class _LIBCPP_TEMPLATE_VIS fisher_f_distribution
 
 public:
     // constructor and reset functions
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     fisher_f_distribution() : fisher_f_distribution(1) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit fisher_f_distribution(result_type __m, result_type __n = 1)
         : __p_(param_type(__m, __n)) {}
 #else
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit fisher_f_distribution(result_type __m = 1, result_type __n = 1)
         : __p_(param_type(__m, __n)) {}
 #endif
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit fisher_f_distribution(const param_type& __p)
         : __p_(__p) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void reset() {}
 
     // generating functions
     template<class _URNG>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         result_type operator()(_URNG& __g)
         {return (*this)(__g, __p_);}
     template<class _URNG> result_type operator()(_URNG& __g, const param_type& __p);
 
     // property functions
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type m() const {return __p_.m();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type n() const {return __p_.n();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     param_type param() const {return __p_;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void param(const param_type& __p) {__p_ = __p;}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type min() const {return 0;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type max() const {return numeric_limits<result_type>::infinity();}
 
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator==(const fisher_f_distribution& __x,
                         const fisher_f_distribution& __y)
         {return __x.__p_ == __y.__p_;}
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator!=(const fisher_f_distribution& __x,
                         const fisher_f_distribution& __y)
         {return !(__x == __y);}
@@ -115,7 +115,7 @@ template<class _URNG>
 _RealType
 fisher_f_distribution<_RealType>::operator()(_URNG& __g, const param_type& __p)
 {
-    static_assert(__libcpp_random_is_valid_urng<_URNG>::value, "");
+    static_assert(__LIBCUDACXX_random_is_valid_urng<_URNG>::value, "");
     gamma_distribution<result_type> __gdm(__p.m() * result_type(.5));
     gamma_distribution<result_type> __gdn(__p.n() * result_type(.5));
     return __p.n() * __gdm(__g) / (__p.m() * __gdn(__g));
@@ -155,8 +155,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
     return __is;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___RANDOM_FISHER_F_DISTRIBUTION_H
+#endif // _LIBCUDACXX___RANDOM_FISHER_F_DISTRIBUTION_H

diff  --git a/libcxx/include/__random/gamma_distribution.h b/libcxx/include/__random/gamma_distribution.h
index 986d79b67aa3..b4fe478baa34 100644
--- a/libcxx/include/__random/gamma_distribution.h
+++ b/libcxx/include/__random/gamma_distribution.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___RANDOM_GAMMA_DISTRIBUTION_H
-#define _LIBCPP___RANDOM_GAMMA_DISTRIBUTION_H
+#ifndef _LIBCUDACXX___RANDOM_GAMMA_DISTRIBUTION_H
+#define _LIBCUDACXX___RANDOM_GAMMA_DISTRIBUTION_H
 
 #include <__config>
 #include <__random/exponential_distribution.h>
@@ -17,42 +17,42 @@
 #include <iosfwd>
 #include <limits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template<class _RealType = double>
-class _LIBCPP_TEMPLATE_VIS gamma_distribution
+class _LIBCUDACXX_TEMPLATE_VIS gamma_distribution
 {
 public:
     // types
     typedef _RealType result_type;
 
-    class _LIBCPP_TEMPLATE_VIS param_type
+    class _LIBCUDACXX_TEMPLATE_VIS param_type
     {
         result_type __alpha_;
         result_type __beta_;
     public:
         typedef gamma_distribution distribution_type;
 
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         explicit param_type(result_type __alpha = 1, result_type __beta = 1)
             : __alpha_(__alpha), __beta_(__beta) {}
 
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         result_type alpha() const {return __alpha_;}
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         result_type beta() const {return __beta_;}
 
-        friend _LIBCPP_INLINE_VISIBILITY
+        friend _LIBCUDACXX_INLINE_VISIBILITY
             bool operator==(const param_type& __x, const param_type& __y)
             {return __x.__alpha_ == __y.__alpha_ && __x.__beta_ == __y.__beta_;}
-        friend _LIBCPP_INLINE_VISIBILITY
+        friend _LIBCUDACXX_INLINE_VISIBILITY
             bool operator!=(const param_type& __x, const param_type& __y)
             {return !(__x == __y);}
     };
@@ -62,52 +62,52 @@ class _LIBCPP_TEMPLATE_VIS gamma_distribution
 
 public:
     // constructors and reset functions
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     gamma_distribution() : gamma_distribution(1) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit gamma_distribution(result_type __alpha, result_type __beta = 1)
         : __p_(param_type(__alpha, __beta)) {}
 #else
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit gamma_distribution(result_type __alpha = 1,
                                 result_type __beta = 1)
         : __p_(param_type(__alpha, __beta)) {}
 #endif
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit gamma_distribution(const param_type& __p)
         : __p_(__p) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void reset() {}
 
     // generating functions
     template<class _URNG>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         result_type operator()(_URNG& __g)
         {return (*this)(__g, __p_);}
     template<class _URNG> result_type operator()(_URNG& __g, const param_type& __p);
 
     // property functions
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type alpha() const {return __p_.alpha();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type beta() const {return __p_.beta();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     param_type param() const {return __p_;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void param(const param_type& __p) {__p_ = __p;}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type min() const {return 0;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type max() const {return numeric_limits<result_type>::infinity();}
 
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator==(const gamma_distribution& __x,
                         const gamma_distribution& __y)
         {return __x.__p_ == __y.__p_;}
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator!=(const gamma_distribution& __x,
                         const gamma_distribution& __y)
         {return !(__x == __y);}
@@ -118,7 +118,7 @@ template<class _URNG>
 _RealType
 gamma_distribution<_RealType>::operator()(_URNG& __g, const param_type& __p)
 {
-    static_assert(__libcpp_random_is_valid_urng<_URNG>::value, "");
+    static_assert(__LIBCUDACXX_random_is_valid_urng<_URNG>::value, "");
     result_type __a = __p.alpha();
     uniform_real_distribution<result_type> __gen(0, 1);
     exponential_distribution<result_type> __egen;
@@ -136,7 +136,7 @@ gamma_distribution<_RealType>::operator()(_URNG& __g, const param_type& __p)
             const result_type __w = __u * (1 - __u);
             if (__w != 0)
             {
-                const result_type __y = _VSTD::sqrt(__c / __w) *
+                const result_type __y = _CUDA_VSTD::sqrt(__c / __w) *
                                         (__u - result_type(0.5));
                 __x = __b + __y;
                 if (__x >= 0)
@@ -144,7 +144,7 @@ gamma_distribution<_RealType>::operator()(_URNG& __g, const param_type& __p)
                     const result_type __z = 64 * __w * __w * __w * __v * __v;
                     if (__z <= 1 - 2 * __y * __y / __x)
                         break;
-                    if (_VSTD::log(__z) <= 2 * (__b * _VSTD::log(__x / __b) - __y))
+                    if (_CUDA_VSTD::log(__z) <= 2 * (__b * _CUDA_VSTD::log(__x / __b) - __y))
                         break;
                 }
             }
@@ -158,14 +158,14 @@ gamma_distribution<_RealType>::operator()(_URNG& __g, const param_type& __p)
             const result_type __es = __egen(__g);
             if (__u <= 1 - __a)
             {
-                __x = _VSTD::pow(__u, 1 / __a);
+                __x = _CUDA_VSTD::pow(__u, 1 / __a);
                 if (__x <= __es)
                     break;
             }
             else
             {
-                const result_type __e = -_VSTD::log((1-__u)/__a);
-                __x = _VSTD::pow(1 - __a + __a * __e, 1 / __a);
+                const result_type __e = -_CUDA_VSTD::log((1-__u)/__a);
+                __x = _CUDA_VSTD::pow(1 - __a + __a * __e, 1 / __a);
                 if (__x <= __e + __es)
                     break;
             }
@@ -208,8 +208,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
     return __is;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___RANDOM_GAMMA_DISTRIBUTION_H
+#endif // _LIBCUDACXX___RANDOM_GAMMA_DISTRIBUTION_H

diff  --git a/libcxx/include/__random/generate_canonical.h b/libcxx/include/__random/generate_canonical.h
index 84efa7803c94..5f44b2c27069 100644
--- a/libcxx/include/__random/generate_canonical.h
+++ b/libcxx/include/__random/generate_canonical.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___RANDOM_GENERATE_CANONICAL_H
-#define _LIBCPP___RANDOM_GENERATE_CANONICAL_H
+#ifndef _LIBCUDACXX___RANDOM_GENERATE_CANONICAL_H
+#define _LIBCUDACXX___RANDOM_GENERATE_CANONICAL_H
 
 #include <__config>
 #include <__random/log2.h>
@@ -15,14 +15,14 @@
 #include <initializer_list>
 #include <limits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 // generate_canonical
 
@@ -32,7 +32,7 @@ generate_canonical(_URNG& __g)
 {
     const size_t _Dt = numeric_limits<_RealType>::digits;
     const size_t __b = _Dt < __bits ? _Dt : __bits;
-#ifdef _LIBCPP_CXX03_LANG
+#ifdef _LIBCUDACXX_CXX03_LANG
     const size_t __logR = __log2<uint64_t, _URNG::_Max - _URNG::_Min + uint64_t(1)>::value;
 #else
     const size_t __logR = __log2<uint64_t, _URNG::max() - _URNG::min() + uint64_t(1)>::value;
@@ -46,8 +46,8 @@ generate_canonical(_URNG& __g)
     return _Sp / __base;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___RANDOM_GENERATE_CANONICAL_H
+#endif // _LIBCUDACXX___RANDOM_GENERATE_CANONICAL_H

diff  --git a/libcxx/include/__random/geometric_distribution.h b/libcxx/include/__random/geometric_distribution.h
index 751cf7860e66..3dc936b841aa 100644
--- a/libcxx/include/__random/geometric_distribution.h
+++ b/libcxx/include/__random/geometric_distribution.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___RANDOM_GEOMETRIC_DISTRIBUTION_H
-#define _LIBCPP___RANDOM_GEOMETRIC_DISTRIBUTION_H
+#ifndef _LIBCUDACXX___RANDOM_GEOMETRIC_DISTRIBUTION_H
+#define _LIBCUDACXX___RANDOM_GEOMETRIC_DISTRIBUTION_H
 
 #include <__config>
 #include <__random/is_valid.h>
@@ -15,39 +15,39 @@
 #include <iosfwd>
 #include <limits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template<class _IntType = int>
-class _LIBCPP_TEMPLATE_VIS geometric_distribution
+class _LIBCUDACXX_TEMPLATE_VIS geometric_distribution
 {
-    static_assert(__libcpp_random_is_valid_inttype<_IntType>::value, "IntType must be a supported integer type");
+    static_assert(__LIBCUDACXX_random_is_valid_inttype<_IntType>::value, "IntType must be a supported integer type");
 public:
     // types
     typedef _IntType result_type;
 
-    class _LIBCPP_TEMPLATE_VIS param_type
+    class _LIBCUDACXX_TEMPLATE_VIS param_type
     {
         double __p_;
     public:
         typedef geometric_distribution distribution_type;
 
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         explicit param_type(double __p = 0.5) : __p_(__p) {}
 
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         double p() const {return __p_;}
 
-        friend _LIBCPP_INLINE_VISIBILITY
+        friend _LIBCUDACXX_INLINE_VISIBILITY
             bool operator==(const param_type& __x, const param_type& __y)
             {return __x.__p_ == __y.__p_;}
-        friend _LIBCPP_INLINE_VISIBILITY
+        friend _LIBCUDACXX_INLINE_VISIBILITY
             bool operator!=(const param_type& __x, const param_type& __y)
             {return !(__x == __y);}
     };
@@ -57,51 +57,51 @@ class _LIBCPP_TEMPLATE_VIS geometric_distribution
 
 public:
     // constructors and reset functions
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     geometric_distribution() : geometric_distribution(0.5) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit geometric_distribution(double __p)
         : __p_(__p) {}
 #else
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit geometric_distribution(double __p = 0.5)
         : __p_(__p) {}
 #endif
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit geometric_distribution(const param_type& __p) : __p_(__p) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void reset() {}
 
     // generating functions
     template<class _URNG>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         result_type operator()(_URNG& __g)
         {return (*this)(__g, __p_);}
     template<class _URNG>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         result_type operator()(_URNG& __g, const param_type& __p)
         {return negative_binomial_distribution<result_type>(1, __p.p())(__g);}
 
     // property functions
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     double p() const {return __p_.p();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     param_type param() const {return __p_;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void param(const param_type& __p) {__p_ = __p;}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type min() const {return 0;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type max() const {return numeric_limits<result_type>::max();}
 
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator==(const geometric_distribution& __x,
                         const geometric_distribution& __y)
         {return __x.__p_ == __y.__p_;}
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator!=(const geometric_distribution& __x,
                         const geometric_distribution& __y)
         {return !(__x == __y);}
@@ -136,8 +136,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
     return __is;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___RANDOM_GEOMETRIC_DISTRIBUTION_H
+#endif // _LIBCUDACXX___RANDOM_GEOMETRIC_DISTRIBUTION_H

diff  --git a/libcxx/include/__random/independent_bits_engine.h b/libcxx/include/__random/independent_bits_engine.h
index e80d6eec49cb..e9224b1cbf79 100644
--- a/libcxx/include/__random/independent_bits_engine.h
+++ b/libcxx/include/__random/independent_bits_engine.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___RANDOM_INDEPENDENT_BITS_ENGINE_H
-#define _LIBCPP___RANDOM_INDEPENDENT_BITS_ENGINE_H
+#ifndef _LIBCUDACXX___RANDOM_INDEPENDENT_BITS_ENGINE_H
+#define _LIBCUDACXX___RANDOM_INDEPENDENT_BITS_ENGINE_H
 
 #include <__config>
 #include <__random/is_seed_sequence.h>
@@ -17,27 +17,27 @@
 #include <limits>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template<class _Engine, size_t __w, class _UIntType>
-class _LIBCPP_TEMPLATE_VIS independent_bits_engine
+class _LIBCUDACXX_TEMPLATE_VIS independent_bits_engine
 {
     template <class _UInt, _UInt _R0, size_t _Wp, size_t _Mp>
     class __get_n
     {
-        static _LIBCPP_CONSTEXPR const size_t _Dt = numeric_limits<_UInt>::digits;
-        static _LIBCPP_CONSTEXPR const size_t _Np = _Wp / _Mp + (_Wp % _Mp != 0);
-        static _LIBCPP_CONSTEXPR const size_t _W0 = _Wp / _Np;
-        static _LIBCPP_CONSTEXPR const _UInt _Y0 = _W0 >= _Dt ? 0 : (_R0 >> _W0) << _W0;
+        static _LIBCUDACXX_CONSTEXPR const size_t _Dt = numeric_limits<_UInt>::digits;
+        static _LIBCUDACXX_CONSTEXPR const size_t _Np = _Wp / _Mp + (_Wp % _Mp != 0);
+        static _LIBCUDACXX_CONSTEXPR const size_t _W0 = _Wp / _Np;
+        static _LIBCUDACXX_CONSTEXPR const _UInt _Y0 = _W0 >= _Dt ? 0 : (_R0 >> _W0) << _W0;
     public:
-        static _LIBCPP_CONSTEXPR const size_t value = _R0 - _Y0 > _Y0 / _Np ? _Np + 1 : _Np;
+        static _LIBCUDACXX_CONSTEXPR const size_t value = _R0 - _Y0 > _Y0 / _Np ? _Np + 1 : _Np;
     };
 public:
     // types
@@ -46,7 +46,7 @@ class _LIBCPP_TEMPLATE_VIS independent_bits_engine
 private:
     _Engine __e_;
 
-    static _LIBCPP_CONSTEXPR const result_type _Dt = numeric_limits<result_type>::digits;
+    static _LIBCUDACXX_CONSTEXPR const result_type _Dt = numeric_limits<result_type>::digits;
     static_assert(  0 <  __w, "independent_bits_engine invalid parameters");
     static_assert(__w <= _Dt, "independent_bits_engine invalid parameters");
 
@@ -57,66 +57,66 @@ class _LIBCPP_TEMPLATE_VIS independent_bits_engine
                 result_type,
                 _Engine_result_type
         >::type _Working_result_type;
-#ifdef _LIBCPP_CXX03_LANG
+#ifdef _LIBCUDACXX_CXX03_LANG
     static const _Working_result_type _Rp = _Engine::_Max - _Engine::_Min
                                           + _Working_result_type(1);
 #else
-    static _LIBCPP_CONSTEXPR const _Working_result_type _Rp = _Engine::max() - _Engine::min()
+    static _LIBCUDACXX_CONSTEXPR const _Working_result_type _Rp = _Engine::max() - _Engine::min()
                                                             + _Working_result_type(1);
 #endif
-    static _LIBCPP_CONSTEXPR const size_t __m = __log2<_Working_result_type, _Rp>::value;
-    static _LIBCPP_CONSTEXPR const size_t __n = __get_n<_Working_result_type, _Rp, __w, __m>::value;
-    static _LIBCPP_CONSTEXPR const size_t __w0 = __w / __n;
-    static _LIBCPP_CONSTEXPR const size_t __n0 = __n - __w % __n;
-    static _LIBCPP_CONSTEXPR const size_t _WDt = numeric_limits<_Working_result_type>::digits;
-    static _LIBCPP_CONSTEXPR const size_t _EDt = numeric_limits<_Engine_result_type>::digits;
-    static _LIBCPP_CONSTEXPR const _Working_result_type __y0 = __w0 >= _WDt ? 0 :
+    static _LIBCUDACXX_CONSTEXPR const size_t __m = __log2<_Working_result_type, _Rp>::value;
+    static _LIBCUDACXX_CONSTEXPR const size_t __n = __get_n<_Working_result_type, _Rp, __w, __m>::value;
+    static _LIBCUDACXX_CONSTEXPR const size_t __w0 = __w / __n;
+    static _LIBCUDACXX_CONSTEXPR const size_t __n0 = __n - __w % __n;
+    static _LIBCUDACXX_CONSTEXPR const size_t _WDt = numeric_limits<_Working_result_type>::digits;
+    static _LIBCUDACXX_CONSTEXPR const size_t _EDt = numeric_limits<_Engine_result_type>::digits;
+    static _LIBCUDACXX_CONSTEXPR const _Working_result_type __y0 = __w0 >= _WDt ? 0 :
                                                                (_Rp >> __w0) << __w0;
-    static _LIBCPP_CONSTEXPR const _Working_result_type __y1 = __w0 >= _WDt - 1 ? 0 :
+    static _LIBCUDACXX_CONSTEXPR const _Working_result_type __y1 = __w0 >= _WDt - 1 ? 0 :
                                                                (_Rp >> (__w0+1)) << (__w0+1);
-    static _LIBCPP_CONSTEXPR const _Engine_result_type __mask0 = __w0 > 0 ?
+    static _LIBCUDACXX_CONSTEXPR const _Engine_result_type __mask0 = __w0 > 0 ?
                                 _Engine_result_type(~0) >> (_EDt - __w0) :
                                 _Engine_result_type(0);
-    static _LIBCPP_CONSTEXPR const _Engine_result_type __mask1 = __w0 < _EDt - 1 ?
+    static _LIBCUDACXX_CONSTEXPR const _Engine_result_type __mask1 = __w0 < _EDt - 1 ?
                                 _Engine_result_type(~0) >> (_EDt - (__w0 + 1)) :
                                 _Engine_result_type(~0);
 public:
-    static _LIBCPP_CONSTEXPR const result_type _Min = 0;
-    static _LIBCPP_CONSTEXPR const result_type _Max = __w == _Dt ? result_type(~0) :
+    static _LIBCUDACXX_CONSTEXPR const result_type _Min = 0;
+    static _LIBCUDACXX_CONSTEXPR const result_type _Max = __w == _Dt ? result_type(~0) :
                                                       (result_type(1) << __w) - result_type(1);
     static_assert(_Min < _Max, "independent_bits_engine invalid parameters");
 
     // engine characteristics
-    _LIBCPP_INLINE_VISIBILITY
-    static _LIBCPP_CONSTEXPR result_type min() { return _Min; }
-    _LIBCPP_INLINE_VISIBILITY
-    static _LIBCPP_CONSTEXPR result_type max() { return _Max; }
+    _LIBCUDACXX_INLINE_VISIBILITY
+    static _LIBCUDACXX_CONSTEXPR result_type min() { return _Min; }
+    _LIBCUDACXX_INLINE_VISIBILITY
+    static _LIBCUDACXX_CONSTEXPR result_type max() { return _Max; }
 
     // constructors and seeding functions
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     independent_bits_engine() {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit independent_bits_engine(const _Engine& __e)
         : __e_(__e) {}
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit independent_bits_engine(_Engine&& __e)
-        : __e_(_VSTD::move(__e)) {}
-#endif // _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+        : __e_(_CUDA_VSTD::move(__e)) {}
+#endif // _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit independent_bits_engine(result_type __sd) : __e_(__sd) {}
     template<class _Sseq>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         explicit independent_bits_engine(_Sseq& __q,
         typename enable_if<__is_seed_sequence<_Sseq, independent_bits_engine>::value &&
                            !is_convertible<_Sseq, _Engine>::value>::type* = 0)
          : __e_(__q) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void seed() {__e_.seed();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void seed(result_type __sd) {__e_.seed(__sd);}
     template<class _Sseq>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         typename enable_if
         <
             __is_seed_sequence<_Sseq, independent_bits_engine>::value,
@@ -125,13 +125,13 @@ class _LIBCPP_TEMPLATE_VIS independent_bits_engine
         seed(_Sseq& __q) {__e_.seed(__q);}
 
     // generating functions
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type operator()() {return __eval(integral_constant<bool, _Rp != 0>());}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void discard(unsigned long long __z) {for (; __z; --__z) operator()();}
 
     // property functions
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const _Engine& base() const _NOEXCEPT {return __e_;}
 
     template<class _Eng, size_t _Wp, class _UInt>
@@ -163,12 +163,12 @@ class _LIBCPP_TEMPLATE_VIS independent_bits_engine
                independent_bits_engine<_Eng, _Wp, _UInt>& __x);
 
 private:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type __eval(false_type);
     result_type __eval(true_type);
 
     template <size_t __count>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         static
         typename enable_if
         <
@@ -178,7 +178,7 @@ class _LIBCPP_TEMPLATE_VIS independent_bits_engine
         __lshift(result_type __x) {return __x << __count;}
 
     template <size_t __count>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         static
         typename enable_if
         <
@@ -223,7 +223,7 @@ independent_bits_engine<_Engine, __w, _UIntType>::__eval(true_type)
 }
 
 template<class _Eng, size_t _Wp, class _UInt>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator==(
     const independent_bits_engine<_Eng, _Wp, _UInt>& __x,
@@ -233,7 +233,7 @@ operator==(
 }
 
 template<class _Eng, size_t _Wp, class _UInt>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator!=(
     const independent_bits_engine<_Eng, _Wp, _UInt>& __x,
@@ -264,8 +264,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
     return __is;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___RANDOM_INDEPENDENT_BITS_ENGINE_H
+#endif // _LIBCUDACXX___RANDOM_INDEPENDENT_BITS_ENGINE_H

diff  --git a/libcxx/include/__random/is_seed_sequence.h b/libcxx/include/__random/is_seed_sequence.h
index a6832f51c1ee..96216247e84b 100644
--- a/libcxx/include/__random/is_seed_sequence.h
+++ b/libcxx/include/__random/is_seed_sequence.h
@@ -6,26 +6,26 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___RANDOM_IS_SEED_SEQUENCE_H
-#define _LIBCPP___RANDOM_IS_SEED_SEQUENCE_H
+#ifndef _LIBCUDACXX___RANDOM_IS_SEED_SEQUENCE_H
+#define _LIBCUDACXX___RANDOM_IS_SEED_SEQUENCE_H
 
 #include <__config>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Sseq, class _Engine>
 struct __is_seed_sequence
 {
-    static _LIBCPP_CONSTEXPR const bool value =
+    static _LIBCUDACXX_CONSTEXPR const bool value =
               !is_convertible<_Sseq, typename _Engine::result_type>::value &&
               !is_same<typename remove_cv<_Sseq>::type, _Engine>::value;
 };
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___RANDOM_IS_SEED_SEQUENCE_H
+#endif // _LIBCUDACXX___RANDOM_IS_SEED_SEQUENCE_H

diff  --git a/libcxx/include/__random/is_valid.h b/libcxx/include/__random/is_valid.h
index be3b61b8dc01..e365f7c71cf9 100644
--- a/libcxx/include/__random/is_valid.h
+++ b/libcxx/include/__random/is_valid.h
@@ -6,18 +6,18 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___RANDOM_IS_VALID_H
-#define _LIBCPP___RANDOM_IS_VALID_H
+#ifndef _LIBCUDACXX___RANDOM_IS_VALID_H
+#define _LIBCUDACXX___RANDOM_IS_VALID_H
 
 #include <__config>
 #include <cstdint>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 // [rand.req.genl]/1.5:
 // The effect of instantiating a template that has a template type parameter
@@ -25,22 +25,22 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 // cv-unqualified and is one of short, int, long, long long, unsigned short,
 // unsigned int, unsigned long, or unsigned long long.
 
-template<class> struct __libcpp_random_is_valid_inttype : false_type {};
-template<> struct __libcpp_random_is_valid_inttype<int8_t> : true_type {}; // extension
-template<> struct __libcpp_random_is_valid_inttype<short> : true_type {};
-template<> struct __libcpp_random_is_valid_inttype<int> : true_type {};
-template<> struct __libcpp_random_is_valid_inttype<long> : true_type {};
-template<> struct __libcpp_random_is_valid_inttype<long long> : true_type {};
-template<> struct __libcpp_random_is_valid_inttype<uint8_t> : true_type {}; // extension
-template<> struct __libcpp_random_is_valid_inttype<unsigned short> : true_type {};
-template<> struct __libcpp_random_is_valid_inttype<unsigned int> : true_type {};
-template<> struct __libcpp_random_is_valid_inttype<unsigned long> : true_type {};
-template<> struct __libcpp_random_is_valid_inttype<unsigned long long> : true_type {};
-
-#ifndef _LIBCPP_HAS_NO_INT128
-template<> struct __libcpp_random_is_valid_inttype<__int128_t> : true_type {}; // extension
-template<> struct __libcpp_random_is_valid_inttype<__uint128_t> : true_type {}; // extension
-#endif // _LIBCPP_HAS_NO_INT128
+template<class> struct __LIBCUDACXX_random_is_valid_inttype : false_type {};
+template<> struct __LIBCUDACXX_random_is_valid_inttype<int8_t> : true_type {}; // extension
+template<> struct __LIBCUDACXX_random_is_valid_inttype<short> : true_type {};
+template<> struct __LIBCUDACXX_random_is_valid_inttype<int> : true_type {};
+template<> struct __LIBCUDACXX_random_is_valid_inttype<long> : true_type {};
+template<> struct __LIBCUDACXX_random_is_valid_inttype<long long> : true_type {};
+template<> struct __LIBCUDACXX_random_is_valid_inttype<uint8_t> : true_type {}; // extension
+template<> struct __LIBCUDACXX_random_is_valid_inttype<unsigned short> : true_type {};
+template<> struct __LIBCUDACXX_random_is_valid_inttype<unsigned int> : true_type {};
+template<> struct __LIBCUDACXX_random_is_valid_inttype<unsigned long> : true_type {};
+template<> struct __LIBCUDACXX_random_is_valid_inttype<unsigned long long> : true_type {};
+
+#ifndef _LIBCUDACXX_HAS_NO_INT128
+template<> struct __LIBCUDACXX_random_is_valid_inttype<__int128_t> : true_type {}; // extension
+template<> struct __LIBCUDACXX_random_is_valid_inttype<__uint128_t> : true_type {}; // extension
+#endif // _LIBCUDACXX_HAS_NO_INT128
 
 // [rand.req.urng]/3:
 // A class G meets the uniform random bit generator requirements if G models
@@ -50,12 +50,12 @@ template<> struct __libcpp_random_is_valid_inttype<__uint128_t> : true_type {};
 // (In particular, reject URNGs with signed result_types; our distributions cannot
 // handle such generator types.)
 
-template<class, class = void> struct __libcpp_random_is_valid_urng : false_type {};
-template<class _Gp> struct __libcpp_random_is_valid_urng<_Gp, __enable_if_t<
+template<class, class = void> struct __LIBCUDACXX_random_is_valid_urng : false_type {};
+template<class _Gp> struct __LIBCUDACXX_random_is_valid_urng<_Gp, __enable_if_t<
     is_unsigned<typename _Gp::result_type>::value &&
     _IsSame<decltype(declval<_Gp&>()()), typename _Gp::result_type>::value
 > > : true_type {};
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___RANDOM_IS_VALID_H
+#endif // _LIBCUDACXX___RANDOM_IS_VALID_H

diff  --git a/libcxx/include/__random/knuth_b.h b/libcxx/include/__random/knuth_b.h
index f5b31cb64fa4..63217b0fc881 100644
--- a/libcxx/include/__random/knuth_b.h
+++ b/libcxx/include/__random/knuth_b.h
@@ -6,21 +6,21 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___RANDOM_KNUTH_B_H
-#define _LIBCPP___RANDOM_KNUTH_B_H
+#ifndef _LIBCUDACXX___RANDOM_KNUTH_B_H
+#define _LIBCUDACXX___RANDOM_KNUTH_B_H
 
 #include <__config>
 #include <__random/linear_congruential_engine.h>
 #include <__random/shuffle_order_engine.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 typedef shuffle_order_engine<minstd_rand0, 256> knuth_b;
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___RANDOM_KNUTH_B_H
+#endif // _LIBCUDACXX___RANDOM_KNUTH_B_H

diff  --git a/libcxx/include/__random/linear_congruential_engine.h b/libcxx/include/__random/linear_congruential_engine.h
index 42b40813e0ac..9fe9e0f96cc3 100644
--- a/libcxx/include/__random/linear_congruential_engine.h
+++ b/libcxx/include/__random/linear_congruential_engine.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___RANDOM_LINEAR_CONGRUENTIAL_ENGINE_H
-#define _LIBCPP___RANDOM_LINEAR_CONGRUENTIAL_ENGINE_H
+#ifndef _LIBCUDACXX___RANDOM_LINEAR_CONGRUENTIAL_ENGINE_H
+#define _LIBCUDACXX___RANDOM_LINEAR_CONGRUENTIAL_ENGINE_H
 
 #include <__config>
 #include <__random/is_seed_sequence.h>
@@ -15,14 +15,14 @@
 #include <iosfwd>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <unsigned long long __a, unsigned long long __c,
           unsigned long long __m, unsigned long long _Mp,
@@ -35,7 +35,7 @@ struct __lce_alg_picker
                   "The current values of a, c, and m cannot generate a number "
                   "within bounds of linear_congruential_engine.");
 
-    static _LIBCPP_CONSTEXPR const bool __use_schrage = _MightOverflow &&
+    static _LIBCUDACXX_CONSTEXPR const bool __use_schrage = _MightOverflow &&
                                                         !_OverflowOK &&
                                                         _SchrageOK;
 };
@@ -51,7 +51,7 @@ template <unsigned long long __a, unsigned long long __c, unsigned long long __m
 struct __lce_ta<__a, __c, __m, (unsigned long long)(~0), true>
 {
     typedef unsigned long long result_type;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     static result_type next(result_type __x)
     {
         // Schrage's algorithm
@@ -69,7 +69,7 @@ template <unsigned long long __a, unsigned long long __m>
 struct __lce_ta<__a, 0, __m, (unsigned long long)(~0), true>
 {
     typedef unsigned long long result_type;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     static result_type next(result_type __x)
     {
         // Schrage's algorithm
@@ -86,7 +86,7 @@ template <unsigned long long __a, unsigned long long __c, unsigned long long __m
 struct __lce_ta<__a, __c, __m, (unsigned long long)(~0), false>
 {
     typedef unsigned long long result_type;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     static result_type next(result_type __x)
     {
         return (__a * __x + __c) % __m;
@@ -97,7 +97,7 @@ template <unsigned long long __a, unsigned long long __c>
 struct __lce_ta<__a, __c, 0, (unsigned long long)(~0), false>
 {
     typedef unsigned long long result_type;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     static result_type next(result_type __x)
     {
         return __a * __x + __c;
@@ -110,7 +110,7 @@ template <unsigned long long _Ap, unsigned long long _Cp, unsigned long long _Mp
 struct __lce_ta<_Ap, _Cp, _Mp, unsigned(~0), true>
 {
     typedef unsigned result_type;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     static result_type next(result_type __x)
     {
         const result_type __a = static_cast<result_type>(_Ap);
@@ -131,7 +131,7 @@ template <unsigned long long _Ap, unsigned long long _Mp>
 struct __lce_ta<_Ap, 0, _Mp, unsigned(~0), true>
 {
     typedef unsigned result_type;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     static result_type next(result_type __x)
     {
         const result_type __a = static_cast<result_type>(_Ap);
@@ -150,7 +150,7 @@ template <unsigned long long _Ap, unsigned long long _Cp, unsigned long long _Mp
 struct __lce_ta<_Ap, _Cp, _Mp, unsigned(~0), false>
 {
     typedef unsigned result_type;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     static result_type next(result_type __x)
     {
         const result_type __a = static_cast<result_type>(_Ap);
@@ -164,7 +164,7 @@ template <unsigned long long _Ap, unsigned long long _Cp>
 struct __lce_ta<_Ap, _Cp, 0, unsigned(~0), false>
 {
     typedef unsigned result_type;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     static result_type next(result_type __x)
     {
         const result_type __a = static_cast<result_type>(_Ap);
@@ -179,7 +179,7 @@ template <unsigned long long __a, unsigned long long __c, unsigned long long __m
 struct __lce_ta<__a, __c, __m, (unsigned short)(~0), __b>
 {
     typedef unsigned short result_type;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     static result_type next(result_type __x)
     {
         return static_cast<result_type>(__lce_ta<__a, __c, __m, unsigned(~0)>::next(__x));
@@ -187,11 +187,11 @@ struct __lce_ta<__a, __c, __m, (unsigned short)(~0), __b>
 };
 
 template <class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
-class _LIBCPP_TEMPLATE_VIS linear_congruential_engine;
+class _LIBCUDACXX_TEMPLATE_VIS linear_congruential_engine;
 
 template <class _CharT, class _Traits,
           class _Up, _Up _Ap, _Up _Cp, _Up _Np>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 basic_ostream<_CharT, _Traits>&
 operator<<(basic_ostream<_CharT, _Traits>& __os,
            const linear_congruential_engine<_Up, _Ap, _Cp, _Np>&);
@@ -203,7 +203,7 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
            linear_congruential_engine<_Up, _Ap, _Cp, _Np>& __x);
 
 template <class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
-class _LIBCPP_TEMPLATE_VIS linear_congruential_engine
+class _LIBCUDACXX_TEMPLATE_VIS linear_congruential_engine
 {
 public:
     // types
@@ -212,49 +212,49 @@ class _LIBCPP_TEMPLATE_VIS linear_congruential_engine
 private:
     result_type __x_;
 
-    static _LIBCPP_CONSTEXPR const result_type _Mp = result_type(~0);
+    static _LIBCUDACXX_CONSTEXPR const result_type _Mp = result_type(~0);
 
     static_assert(__m == 0 || __a < __m, "linear_congruential_engine invalid parameters");
     static_assert(__m == 0 || __c < __m, "linear_congruential_engine invalid parameters");
     static_assert(is_unsigned<_UIntType>::value, "_UIntType must be unsigned type");
 public:
-    static _LIBCPP_CONSTEXPR const result_type _Min = __c == 0u ? 1u : 0u;
-    static _LIBCPP_CONSTEXPR const result_type _Max = __m - _UIntType(1u);
+    static _LIBCUDACXX_CONSTEXPR const result_type _Min = __c == 0u ? 1u : 0u;
+    static _LIBCUDACXX_CONSTEXPR const result_type _Max = __m - _UIntType(1u);
     static_assert(_Min < _Max,           "linear_congruential_engine invalid parameters");
 
     // engine characteristics
-    static _LIBCPP_CONSTEXPR const result_type multiplier = __a;
-    static _LIBCPP_CONSTEXPR const result_type increment = __c;
-    static _LIBCPP_CONSTEXPR const result_type modulus = __m;
-    _LIBCPP_INLINE_VISIBILITY
-    static _LIBCPP_CONSTEXPR result_type min() {return _Min;}
-    _LIBCPP_INLINE_VISIBILITY
-    static _LIBCPP_CONSTEXPR result_type max() {return _Max;}
-    static _LIBCPP_CONSTEXPR const result_type default_seed = 1u;
+    static _LIBCUDACXX_CONSTEXPR const result_type multiplier = __a;
+    static _LIBCUDACXX_CONSTEXPR const result_type increment = __c;
+    static _LIBCUDACXX_CONSTEXPR const result_type modulus = __m;
+    _LIBCUDACXX_INLINE_VISIBILITY
+    static _LIBCUDACXX_CONSTEXPR result_type min() {return _Min;}
+    _LIBCUDACXX_INLINE_VISIBILITY
+    static _LIBCUDACXX_CONSTEXPR result_type max() {return _Max;}
+    static _LIBCUDACXX_CONSTEXPR const result_type default_seed = 1u;
 
     // constructors and seeding functions
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     linear_congruential_engine() : linear_congruential_engine(default_seed) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit linear_congruential_engine(result_type __s) { seed(__s); }
 #else
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit linear_congruential_engine(result_type __s = default_seed) {
       seed(__s);
     }
 #endif
     template<class _Sseq>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         explicit linear_congruential_engine(_Sseq& __q,
         typename enable_if<__is_seed_sequence<_Sseq, linear_congruential_engine>::value>::type* = 0)
         {seed(__q);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void seed(result_type __s = default_seed)
         {seed(integral_constant<bool, __m == 0>(),
               integral_constant<bool, __c == 0>(), __s);}
     template<class _Sseq>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         typename enable_if
         <
             __is_seed_sequence<_Sseq, linear_congruential_engine>::value,
@@ -266,31 +266,31 @@ class _LIBCPP_TEMPLATE_VIS linear_congruential_engine
                              :  (__m > 0x100000000ull))>());}
 
     // generating functions
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type operator()()
         {return __x_ = static_cast<result_type>(__lce_ta<__a, __c, __m, _Mp>::next(__x_));}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void discard(unsigned long long __z) {for (; __z; --__z) operator()();}
 
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
     bool operator==(const linear_congruential_engine& __x,
                     const linear_congruential_engine& __y)
         {return __x.__x_ == __y.__x_;}
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
     bool operator!=(const linear_congruential_engine& __x,
                     const linear_congruential_engine& __y)
         {return !(__x == __y);}
 
 private:
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void seed(true_type, true_type, result_type __s) {__x_ = __s == 0 ? 1 : __s;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void seed(true_type, false_type, result_type __s) {__x_ = __s;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void seed(false_type, true_type, result_type __s) {__x_ = __s % __m == 0 ?
                                                                  1 : __s % __m;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void seed(false_type, false_type, result_type __s) {__x_ = __s % __m;}
 
     template<class _Sseq>
@@ -314,19 +314,19 @@ class _LIBCPP_TEMPLATE_VIS linear_congruential_engine
 };
 
 template <class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
-    _LIBCPP_CONSTEXPR const typename linear_congruential_engine<_UIntType, __a, __c, __m>::result_type
+    _LIBCUDACXX_CONSTEXPR const typename linear_congruential_engine<_UIntType, __a, __c, __m>::result_type
     linear_congruential_engine<_UIntType, __a, __c, __m>::multiplier;
 
 template <class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
-    _LIBCPP_CONSTEXPR const typename linear_congruential_engine<_UIntType, __a, __c, __m>::result_type
+    _LIBCUDACXX_CONSTEXPR const typename linear_congruential_engine<_UIntType, __a, __c, __m>::result_type
     linear_congruential_engine<_UIntType, __a, __c, __m>::increment;
 
 template <class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
-    _LIBCPP_CONSTEXPR const typename linear_congruential_engine<_UIntType, __a, __c, __m>::result_type
+    _LIBCUDACXX_CONSTEXPR const typename linear_congruential_engine<_UIntType, __a, __c, __m>::result_type
     linear_congruential_engine<_UIntType, __a, __c, __m>::modulus;
 
 template <class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
-    _LIBCPP_CONSTEXPR const typename linear_congruential_engine<_UIntType, __a, __c, __m>::result_type
+    _LIBCUDACXX_CONSTEXPR const typename linear_congruential_engine<_UIntType, __a, __c, __m>::result_type
     linear_congruential_engine<_UIntType, __a, __c, __m>::default_seed;
 
 template <class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
@@ -358,7 +358,7 @@ linear_congruential_engine<_UIntType, __a, __c, __m>::__seed(_Sseq& __q,
 
 template <class _CharT, class _Traits,
           class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 basic_ostream<_CharT, _Traits>&
 operator<<(basic_ostream<_CharT, _Traits>& __os,
            const linear_congruential_engine<_UIntType, __a, __c, __m>& __x)
@@ -391,8 +391,8 @@ typedef linear_congruential_engine<uint_fast32_t, 16807, 0, 2147483647>
 typedef linear_congruential_engine<uint_fast32_t, 48271, 0, 2147483647>
                                                                     minstd_rand;
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___RANDOM_LINEAR_CONGRUENTIAL_ENGINE_H
+#endif // _LIBCUDACXX___RANDOM_LINEAR_CONGRUENTIAL_ENGINE_H

diff  --git a/libcxx/include/__random/log2.h b/libcxx/include/__random/log2.h
index b077d211cefa..67d572656abd 100644
--- a/libcxx/include/__random/log2.h
+++ b/libcxx/include/__random/log2.h
@@ -6,18 +6,18 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___RANDOM_LOG2_H
-#define _LIBCPP___RANDOM_LOG2_H
+#ifndef _LIBCUDACXX___RANDOM_LOG2_H
+#define _LIBCUDACXX___RANDOM_LOG2_H
 
 #include <__config>
 #include <cstddef>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _UIntType, _UIntType _Xp, size_t _Rp>
 struct __log2_imp;
@@ -41,7 +41,7 @@ struct __log2_imp<unsigned long long, 0, _Rp>
     static const size_t value = _Rp + 1;
 };
 
-#ifndef _LIBCPP_HAS_NO_INT128
+#ifndef _LIBCUDACXX_HAS_NO_INT128
 
 template <__uint128_t _Xp, size_t _Rp>
 struct __log2_imp<__uint128_t, _Xp, _Rp>
@@ -51,13 +51,13 @@ struct __log2_imp<__uint128_t, _Xp, _Rp>
         : __log2_imp<unsigned long long, _Xp, 63>::value;
 };
 
-#endif // _LIBCPP_HAS_NO_INT128
+#endif // _LIBCUDACXX_HAS_NO_INT128
 
 template <class _UIntType, _UIntType _Xp>
 struct __log2
 {
     static const size_t value = __log2_imp<
-#ifndef _LIBCPP_HAS_NO_INT128
+#ifndef _LIBCUDACXX_HAS_NO_INT128
         typename conditional<
                 sizeof(_UIntType) <= sizeof(unsigned long long),
                     unsigned long long,
@@ -65,10 +65,10 @@ struct __log2
             >::type,
 #else
         unsigned long long,
-#endif // _LIBCPP_HAS_NO_INT128
+#endif // _LIBCUDACXX_HAS_NO_INT128
         _Xp, sizeof(_UIntType) * __CHAR_BIT__ - 1>::value;
 };
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___RANDOM_LOG2_H
+#endif // _LIBCUDACXX___RANDOM_LOG2_H

diff  --git a/libcxx/include/__random/lognormal_distribution.h b/libcxx/include/__random/lognormal_distribution.h
index 048d7dade9eb..e42f52796225 100644
--- a/libcxx/include/__random/lognormal_distribution.h
+++ b/libcxx/include/__random/lognormal_distribution.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___RANDOM_LOGNORMAL_DISTRIBUTION_H
-#define _LIBCPP___RANDOM_LOGNORMAL_DISTRIBUTION_H
+#ifndef _LIBCUDACXX___RANDOM_LOGNORMAL_DISTRIBUTION_H
+#define _LIBCUDACXX___RANDOM_LOGNORMAL_DISTRIBUTION_H
 
 #include <__config>
 #include <__random/normal_distribution.h>
@@ -15,43 +15,43 @@
 #include <iosfwd>
 #include <limits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#ifdef _LIBCPP_ABI_OLD_LOGNORMAL_DISTRIBUTION
+#ifdef _LIBCUDACXX_ABI_OLD_LOGNORMAL_DISTRIBUTION
 
 template<class _RealType = double>
-class _LIBCPP_TEMPLATE_VIS lognormal_distribution
+class _LIBCUDACXX_TEMPLATE_VIS lognormal_distribution
 {
 public:
     // types
     typedef _RealType result_type;
 
-    class _LIBCPP_TEMPLATE_VIS param_type
+    class _LIBCUDACXX_TEMPLATE_VIS param_type
     {
         normal_distribution<result_type> __nd_;
     public:
         typedef lognormal_distribution distribution_type;
 
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         explicit param_type(result_type __m = 0, result_type __s = 1)
             : __nd_(__m, __s) {}
 
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         result_type m() const {return __nd_.mean();}
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         result_type s() const {return __nd_.stddev();}
 
-        friend _LIBCPP_INLINE_VISIBILITY
+        friend _LIBCUDACXX_INLINE_VISIBILITY
             bool operator==(const param_type& __x, const param_type& __y)
             {return __x.__nd_ == __y.__nd_;}
-        friend _LIBCPP_INLINE_VISIBILITY
+        friend _LIBCUDACXX_INLINE_VISIBILITY
             bool operator!=(const param_type& __x, const param_type& __y)
             {return !(__x == __y);}
         friend class lognormal_distribution;
@@ -74,55 +74,55 @@ class _LIBCPP_TEMPLATE_VIS lognormal_distribution
 
 public:
     // constructor and reset functions
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     lognormal_distribution() : lognormal_distribution(0) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit lognormal_distribution(result_type __m, result_type __s = 1)
         : __p_(param_type(__m, __s)) {}
 #else
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit lognormal_distribution(result_type __m = 0,
                                     result_type __s = 1)
         : __p_(param_type(__m, __s)) {}
 #endif
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit lognormal_distribution(const param_type& __p)
         : __p_(__p) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void reset() {__p_.__nd_.reset();}
 
     // generating functions
     template<class _URNG>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         result_type operator()(_URNG& __g)
         {return (*this)(__g, __p_);}
     template<class _URNG>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         result_type operator()(_URNG& __g, const param_type& __p)
-        {return _VSTD::exp(const_cast<normal_distribution<result_type>&>(__p.__nd_)(__g));}
+        {return _CUDA_VSTD::exp(const_cast<normal_distribution<result_type>&>(__p.__nd_)(__g));}
 
     // property functions
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type m() const {return __p_.m();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type s() const {return __p_.s();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     param_type param() const {return __p_;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void param(const param_type& __p) {__p_ = __p;}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type min() const {return 0;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type max() const {return numeric_limits<result_type>::infinity();}
 
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator==(const lognormal_distribution& __x,
                         const lognormal_distribution& __y)
         {return __x.__p_ == __y.__p_;}
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator!=(const lognormal_distribution& __x,
                         const lognormal_distribution& __y)
         {return !(__x == __y);}
@@ -141,7 +141,7 @@ class _LIBCPP_TEMPLATE_VIS lognormal_distribution
 };
 
 template <class _CharT, class _Traits, class _RT>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 basic_ostream<_CharT, _Traits>&
 operator<<(basic_ostream<_CharT, _Traits>& __os,
            const lognormal_distribution<_RT>& __x)
@@ -150,7 +150,7 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
 }
 
 template <class _CharT, class _Traits, class _RT>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 basic_istream<_CharT, _Traits>&
 operator>>(basic_istream<_CharT, _Traits>& __is,
            lognormal_distribution<_RT>& __x)
@@ -158,35 +158,35 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
     return __is >> __x.__p_.__nd_;
 }
 
-#else // _LIBCPP_ABI_OLD_LOGNORMAL_DISTRIBUTION
+#else // _LIBCUDACXX_ABI_OLD_LOGNORMAL_DISTRIBUTION
 
 template<class _RealType = double>
-class _LIBCPP_TEMPLATE_VIS lognormal_distribution
+class _LIBCUDACXX_TEMPLATE_VIS lognormal_distribution
 {
 public:
     // types
     typedef _RealType result_type;
 
-    class _LIBCPP_TEMPLATE_VIS param_type
+    class _LIBCUDACXX_TEMPLATE_VIS param_type
     {
         result_type __m_;
         result_type __s_;
     public:
         typedef lognormal_distribution distribution_type;
 
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         explicit param_type(result_type __m = 0, result_type __s = 1)
             : __m_(__m), __s_(__s) {}
 
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         result_type m() const {return __m_;}
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         result_type s() const {return __s_;}
 
-        friend _LIBCPP_INLINE_VISIBILITY
+        friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator==(const param_type& __x, const param_type& __y)
             {return __x.__m_ == __y.__m_ && __x.__s_ == __y.__s_;}
-        friend _LIBCPP_INLINE_VISIBILITY
+        friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator!=(const param_type& __x, const param_type& __y)
             {return !(__x == __y);}
     };
@@ -196,65 +196,65 @@ class _LIBCPP_TEMPLATE_VIS lognormal_distribution
 
 public:
     // constructor and reset functions
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     lognormal_distribution() : lognormal_distribution(0) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit lognormal_distribution(result_type __m, result_type __s = 1)
         : __nd_(__m, __s) {}
 #else
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit lognormal_distribution(result_type __m = 0,
                                     result_type __s = 1)
         : __nd_(__m, __s) {}
 #endif
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit lognormal_distribution(const param_type& __p)
         : __nd_(__p.m(), __p.s()) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void reset() {__nd_.reset();}
 
     // generating functions
     template<class _URNG>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type operator()(_URNG& __g)
     {
-        return _VSTD::exp(__nd_(__g));
+        return _CUDA_VSTD::exp(__nd_(__g));
     }
 
     template<class _URNG>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type operator()(_URNG& __g, const param_type& __p)
     {
         typename normal_distribution<result_type>::param_type __pn(__p.m(), __p.s());
-        return _VSTD::exp(__nd_(__g, __pn));
+        return _CUDA_VSTD::exp(__nd_(__g, __pn));
     }
 
     // property functions
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type m() const {return __nd_.mean();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type s() const {return __nd_.stddev();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     param_type param() const {return param_type(__nd_.mean(), __nd_.stddev());}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void param(const param_type& __p)
     {
         typename normal_distribution<result_type>::param_type __pn(__p.m(), __p.s());
         __nd_.param(__pn);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type min() const {return 0;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type max() const {return numeric_limits<result_type>::infinity();}
 
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator==(const lognormal_distribution& __x,
                         const lognormal_distribution& __y)
         {return __x.__nd_ == __y.__nd_;}
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator!=(const lognormal_distribution& __x,
                         const lognormal_distribution& __y)
         {return !(__x == __y);}
@@ -273,7 +273,7 @@ class _LIBCPP_TEMPLATE_VIS lognormal_distribution
 };
 
 template <class _CharT, class _Traits, class _RT>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 basic_ostream<_CharT, _Traits>&
 operator<<(basic_ostream<_CharT, _Traits>& __os,
            const lognormal_distribution<_RT>& __x)
@@ -282,7 +282,7 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
 }
 
 template <class _CharT, class _Traits, class _RT>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 basic_istream<_CharT, _Traits>&
 operator>>(basic_istream<_CharT, _Traits>& __is,
            lognormal_distribution<_RT>& __x)
@@ -290,10 +290,10 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
     return __is >> __x.__nd_;
 }
 
-#endif // _LIBCPP_ABI_OLD_LOGNORMAL_DISTRIBUTION
+#endif // _LIBCUDACXX_ABI_OLD_LOGNORMAL_DISTRIBUTION
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___RANDOM_LOGNORMAL_DISTRIBUTION_H
+#endif // _LIBCUDACXX___RANDOM_LOGNORMAL_DISTRIBUTION_H

diff  --git a/libcxx/include/__random/mersenne_twister_engine.h b/libcxx/include/__random/mersenne_twister_engine.h
index 8bceac05dce9..893d95968b8e 100644
--- a/libcxx/include/__random/mersenne_twister_engine.h
+++ b/libcxx/include/__random/mersenne_twister_engine.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___RANDOM_MERSENNE_TWISTER_ENGINE_H
-#define _LIBCPP___RANDOM_MERSENNE_TWISTER_ENGINE_H
+#ifndef _LIBCUDACXX___RANDOM_MERSENNE_TWISTER_ENGINE_H
+#define _LIBCUDACXX___RANDOM_MERSENNE_TWISTER_ENGINE_H
 
 #include <__algorithm/equal.h>
 #include <__algorithm/min.h>
@@ -19,19 +19,19 @@
 #include <limits>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r,
           _UIntType __a, size_t __u, _UIntType __d, size_t __s,
           _UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f>
-class _LIBCPP_TEMPLATE_VIS mersenne_twister_engine;
+class _LIBCUDACXX_TEMPLATE_VIS mersenne_twister_engine;
 
 template <class _UInt, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp,
           _UInt _Ap, size_t _Up, _UInt _Dp, size_t _Sp,
@@ -45,7 +45,7 @@ operator==(const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _D
 template <class _UInt, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp,
           _UInt _Ap, size_t _Up, _UInt _Dp, size_t _Sp,
           _UInt _Bp, size_t _Tp, _UInt _Cp, size_t _Lp, _UInt _Fp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator!=(const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp,
                                          _Bp, _Tp, _Cp, _Lp, _Fp>& __x,
@@ -73,7 +73,7 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
 template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r,
           _UIntType __a, size_t __u, _UIntType __d, size_t __s,
           _UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f>
-class _LIBCPP_TEMPLATE_VIS mersenne_twister_engine
+class _LIBCUDACXX_TEMPLATE_VIS mersenne_twister_engine
 {
 public:
     // types
@@ -85,7 +85,7 @@ class _LIBCPP_TEMPLATE_VIS mersenne_twister_engine
 
     static_assert(  0 <  __m, "mersenne_twister_engine invalid parameters");
     static_assert(__m <= __n, "mersenne_twister_engine invalid parameters");
-    static _LIBCPP_CONSTEXPR const result_type _Dt = numeric_limits<result_type>::digits;
+    static _LIBCUDACXX_CONSTEXPR const result_type _Dt = numeric_limits<result_type>::digits;
     static_assert(__w <= _Dt, "mersenne_twister_engine invalid parameters");
     static_assert(  2 <= __w, "mersenne_twister_engine invalid parameters");
     static_assert(__r <= __w, "mersenne_twister_engine invalid parameters");
@@ -94,8 +94,8 @@ class _LIBCPP_TEMPLATE_VIS mersenne_twister_engine
     static_assert(__t <= __w, "mersenne_twister_engine invalid parameters");
     static_assert(__l <= __w, "mersenne_twister_engine invalid parameters");
 public:
-    static _LIBCPP_CONSTEXPR const result_type _Min = 0;
-    static _LIBCPP_CONSTEXPR const result_type _Max = __w == _Dt ? result_type(~0) :
+    static _LIBCUDACXX_CONSTEXPR const result_type _Min = 0;
+    static _LIBCUDACXX_CONSTEXPR const result_type _Max = __w == _Dt ? result_type(~0) :
                                                       (result_type(1) << __w) - result_type(1);
     static_assert(_Min < _Max, "mersenne_twister_engine invalid parameters");
     static_assert(__a <= _Max, "mersenne_twister_engine invalid parameters");
@@ -105,45 +105,45 @@ class _LIBCPP_TEMPLATE_VIS mersenne_twister_engine
     static_assert(__f <= _Max, "mersenne_twister_engine invalid parameters");
 
     // engine characteristics
-    static _LIBCPP_CONSTEXPR const size_t word_size = __w;
-    static _LIBCPP_CONSTEXPR const size_t state_size = __n;
-    static _LIBCPP_CONSTEXPR const size_t shift_size = __m;
-    static _LIBCPP_CONSTEXPR const size_t mask_bits = __r;
-    static _LIBCPP_CONSTEXPR const result_type xor_mask = __a;
-    static _LIBCPP_CONSTEXPR const size_t tempering_u = __u;
-    static _LIBCPP_CONSTEXPR const result_type tempering_d = __d;
-    static _LIBCPP_CONSTEXPR const size_t tempering_s = __s;
-    static _LIBCPP_CONSTEXPR const result_type tempering_b = __b;
-    static _LIBCPP_CONSTEXPR const size_t tempering_t = __t;
-    static _LIBCPP_CONSTEXPR const result_type tempering_c = __c;
-    static _LIBCPP_CONSTEXPR const size_t tempering_l = __l;
-    static _LIBCPP_CONSTEXPR const result_type initialization_multiplier = __f;
-    _LIBCPP_INLINE_VISIBILITY
-    static _LIBCPP_CONSTEXPR result_type min() { return _Min; }
-    _LIBCPP_INLINE_VISIBILITY
-    static _LIBCPP_CONSTEXPR result_type max() { return _Max; }
-    static _LIBCPP_CONSTEXPR const result_type default_seed = 5489u;
+    static _LIBCUDACXX_CONSTEXPR const size_t word_size = __w;
+    static _LIBCUDACXX_CONSTEXPR const size_t state_size = __n;
+    static _LIBCUDACXX_CONSTEXPR const size_t shift_size = __m;
+    static _LIBCUDACXX_CONSTEXPR const size_t mask_bits = __r;
+    static _LIBCUDACXX_CONSTEXPR const result_type xor_mask = __a;
+    static _LIBCUDACXX_CONSTEXPR const size_t tempering_u = __u;
+    static _LIBCUDACXX_CONSTEXPR const result_type tempering_d = __d;
+    static _LIBCUDACXX_CONSTEXPR const size_t tempering_s = __s;
+    static _LIBCUDACXX_CONSTEXPR const result_type tempering_b = __b;
+    static _LIBCUDACXX_CONSTEXPR const size_t tempering_t = __t;
+    static _LIBCUDACXX_CONSTEXPR const result_type tempering_c = __c;
+    static _LIBCUDACXX_CONSTEXPR const size_t tempering_l = __l;
+    static _LIBCUDACXX_CONSTEXPR const result_type initialization_multiplier = __f;
+    _LIBCUDACXX_INLINE_VISIBILITY
+    static _LIBCUDACXX_CONSTEXPR result_type min() { return _Min; }
+    _LIBCUDACXX_INLINE_VISIBILITY
+    static _LIBCUDACXX_CONSTEXPR result_type max() { return _Max; }
+    static _LIBCUDACXX_CONSTEXPR const result_type default_seed = 5489u;
 
     // constructors and seeding functions
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     mersenne_twister_engine() : mersenne_twister_engine(default_seed) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit mersenne_twister_engine(result_type __sd) { seed(__sd); }
 #else
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit mersenne_twister_engine(result_type __sd = default_seed) {
       seed(__sd);
     }
 #endif
     template<class _Sseq>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         explicit mersenne_twister_engine(_Sseq& __q,
         typename enable_if<__is_seed_sequence<_Sseq, mersenne_twister_engine>::value>::type* = 0)
         {seed(__q);}
     void seed(result_type __sd = default_seed);
     template<class _Sseq>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         typename enable_if
         <
             __is_seed_sequence<_Sseq, mersenne_twister_engine>::value,
@@ -154,7 +154,7 @@ class _LIBCPP_TEMPLATE_VIS mersenne_twister_engine
 
     // generating functions
     result_type operator()();
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void discard(unsigned long long __z) {for (; __z; --__z) operator()();}
 
     template <class _UInt, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp,
@@ -204,7 +204,7 @@ class _LIBCPP_TEMPLATE_VIS mersenne_twister_engine
         void __seed(_Sseq& __q, integral_constant<unsigned, 2>);
 
     template <size_t __count>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         static
         typename enable_if
         <
@@ -214,7 +214,7 @@ class _LIBCPP_TEMPLATE_VIS mersenne_twister_engine
         __lshift(result_type __x) {return (__x << __count) & _Max;}
 
     template <size_t __count>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         static
         typename enable_if
         <
@@ -224,7 +224,7 @@ class _LIBCPP_TEMPLATE_VIS mersenne_twister_engine
         __lshift(result_type) {return result_type(0);}
 
     template <size_t __count>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         static
         typename enable_if
         <
@@ -234,7 +234,7 @@ class _LIBCPP_TEMPLATE_VIS mersenne_twister_engine
         __rshift(result_type __x) {return __x >> __count;}
 
     template <size_t __count>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         static
         typename enable_if
         <
@@ -247,85 +247,85 @@ class _LIBCPP_TEMPLATE_VIS mersenne_twister_engine
 template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r,
           _UIntType __a, size_t __u, _UIntType __d, size_t __s,
           _UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f>
-    _LIBCPP_CONSTEXPR const size_t
+    _LIBCUDACXX_CONSTEXPR const size_t
     mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::word_size;
 
 template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r,
           _UIntType __a, size_t __u, _UIntType __d, size_t __s,
           _UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f>
-    _LIBCPP_CONSTEXPR const size_t
+    _LIBCUDACXX_CONSTEXPR const size_t
     mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::state_size;
 
 template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r,
           _UIntType __a, size_t __u, _UIntType __d, size_t __s,
           _UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f>
-    _LIBCPP_CONSTEXPR const size_t
+    _LIBCUDACXX_CONSTEXPR const size_t
     mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::shift_size;
 
 template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r,
           _UIntType __a, size_t __u, _UIntType __d, size_t __s,
           _UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f>
-    _LIBCPP_CONSTEXPR const size_t
+    _LIBCUDACXX_CONSTEXPR const size_t
     mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::mask_bits;
 
 template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r,
           _UIntType __a, size_t __u, _UIntType __d, size_t __s,
           _UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f>
-    _LIBCPP_CONSTEXPR const typename mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::result_type
+    _LIBCUDACXX_CONSTEXPR const typename mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::result_type
     mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::xor_mask;
 
 template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r,
           _UIntType __a, size_t __u, _UIntType __d, size_t __s,
           _UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f>
-    _LIBCPP_CONSTEXPR const size_t
+    _LIBCUDACXX_CONSTEXPR const size_t
     mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_u;
 
 template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r,
           _UIntType __a, size_t __u, _UIntType __d, size_t __s,
           _UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f>
-    _LIBCPP_CONSTEXPR const typename mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::result_type
+    _LIBCUDACXX_CONSTEXPR const typename mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::result_type
     mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_d;
 
 template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r,
           _UIntType __a, size_t __u, _UIntType __d, size_t __s,
           _UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f>
-    _LIBCPP_CONSTEXPR const size_t
+    _LIBCUDACXX_CONSTEXPR const size_t
     mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_s;
 
 template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r,
           _UIntType __a, size_t __u, _UIntType __d, size_t __s,
           _UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f>
-    _LIBCPP_CONSTEXPR const typename mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::result_type
+    _LIBCUDACXX_CONSTEXPR const typename mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::result_type
     mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_b;
 
 template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r,
           _UIntType __a, size_t __u, _UIntType __d, size_t __s,
           _UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f>
-    _LIBCPP_CONSTEXPR const size_t
+    _LIBCUDACXX_CONSTEXPR const size_t
     mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_t;
 
 template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r,
           _UIntType __a, size_t __u, _UIntType __d, size_t __s,
           _UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f>
-    _LIBCPP_CONSTEXPR const typename mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::result_type
+    _LIBCUDACXX_CONSTEXPR const typename mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::result_type
     mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_c;
 
 template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r,
           _UIntType __a, size_t __u, _UIntType __d, size_t __s,
           _UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f>
-    _LIBCPP_CONSTEXPR const size_t
+    _LIBCUDACXX_CONSTEXPR const size_t
     mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_l;
 
 template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r,
           _UIntType __a, size_t __u, _UIntType __d, size_t __s,
           _UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f>
-    _LIBCPP_CONSTEXPR const typename mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::result_type
+    _LIBCUDACXX_CONSTEXPR const typename mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::result_type
     mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::initialization_multiplier;
 
 template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r,
           _UIntType __a, size_t __u, _UIntType __d, size_t __s,
           _UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f>
-    _LIBCPP_CONSTEXPR const typename mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::result_type
+    _LIBCUDACXX_CONSTEXPR const typename mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::result_type
     mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::default_seed;
 
 template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r,
@@ -334,7 +334,7 @@ template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r,
 void
 mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b,
     __t, __c, __l, __f>::seed(result_type __sd)
-    _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
+    _LIBCUDACXX_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
 {   // __w >= 2
     __x_[0] = __sd & _Max;
     for (size_t __i = 1; __i < __n; ++__i)
@@ -423,44 +423,44 @@ operator==(const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _D
                                          _Bp, _Tp, _Cp, _Lp, _Fp>& __y)
 {
     if (__x.__i_ == __y.__i_)
-        return _VSTD::equal(__x.__x_, __x.__x_ + _Np, __y.__x_);
+        return _CUDA_VSTD::equal(__x.__x_, __x.__x_ + _Np, __y.__x_);
     if (__x.__i_ == 0 || __y.__i_ == 0)
     {
-        size_t __j = _VSTD::min(_Np - __x.__i_, _Np - __y.__i_);
-        if (!_VSTD::equal(__x.__x_ + __x.__i_, __x.__x_ + __x.__i_ + __j,
+        size_t __j = _CUDA_VSTD::min(_Np - __x.__i_, _Np - __y.__i_);
+        if (!_CUDA_VSTD::equal(__x.__x_ + __x.__i_, __x.__x_ + __x.__i_ + __j,
                          __y.__x_ + __y.__i_))
             return false;
         if (__x.__i_ == 0)
-            return _VSTD::equal(__x.__x_ + __j, __x.__x_ + _Np, __y.__x_);
-        return _VSTD::equal(__x.__x_, __x.__x_ + (_Np - __j), __y.__x_ + __j);
+            return _CUDA_VSTD::equal(__x.__x_ + __j, __x.__x_ + _Np, __y.__x_);
+        return _CUDA_VSTD::equal(__x.__x_, __x.__x_ + (_Np - __j), __y.__x_ + __j);
     }
     if (__x.__i_ < __y.__i_)
     {
         size_t __j = _Np - __y.__i_;
-        if (!_VSTD::equal(__x.__x_ + __x.__i_, __x.__x_ + (__x.__i_ + __j),
+        if (!_CUDA_VSTD::equal(__x.__x_ + __x.__i_, __x.__x_ + (__x.__i_ + __j),
                          __y.__x_ + __y.__i_))
             return false;
-        if (!_VSTD::equal(__x.__x_ + (__x.__i_ + __j), __x.__x_ + _Np,
+        if (!_CUDA_VSTD::equal(__x.__x_ + (__x.__i_ + __j), __x.__x_ + _Np,
                          __y.__x_))
             return false;
-        return _VSTD::equal(__x.__x_, __x.__x_ + __x.__i_,
+        return _CUDA_VSTD::equal(__x.__x_, __x.__x_ + __x.__i_,
                            __y.__x_ + (_Np - (__x.__i_ + __j)));
     }
     size_t __j = _Np - __x.__i_;
-    if (!_VSTD::equal(__y.__x_ + __y.__i_, __y.__x_ + (__y.__i_ + __j),
+    if (!_CUDA_VSTD::equal(__y.__x_ + __y.__i_, __y.__x_ + (__y.__i_ + __j),
                      __x.__x_ + __x.__i_))
         return false;
-    if (!_VSTD::equal(__y.__x_ + (__y.__i_ + __j), __y.__x_ + _Np,
+    if (!_CUDA_VSTD::equal(__y.__x_ + (__y.__i_ + __j), __y.__x_ + _Np,
                      __x.__x_))
         return false;
-    return _VSTD::equal(__y.__x_, __y.__x_ + __y.__i_,
+    return _CUDA_VSTD::equal(__y.__x_, __y.__x_ + __y.__i_,
                        __x.__x_ + (_Np - (__y.__i_ + __j)));
 }
 
 template <class _UInt, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp,
           _UInt _Ap, size_t _Up, _UInt _Dp, size_t _Sp,
           _UInt _Bp, size_t _Tp, _UInt _Cp, size_t _Lp, _UInt _Fp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator!=(const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp,
                                          _Bp, _Tp, _Cp, _Lp, _Fp>& __x,
@@ -527,8 +527,8 @@ typedef mersenne_twister_engine<uint_fast64_t, 64, 312, 156, 31,
                                 37, 0xfff7eee000000000ULL,
                                 43, 6364136223846793005ULL>          mt19937_64;
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___RANDOM_MERSENNE_TWISTER_ENGINE_H
+#endif // _LIBCUDACXX___RANDOM_MERSENNE_TWISTER_ENGINE_H

diff  --git a/libcxx/include/__random/negative_binomial_distribution.h b/libcxx/include/__random/negative_binomial_distribution.h
index 90d3f0178914..b512b4cce4ac 100644
--- a/libcxx/include/__random/negative_binomial_distribution.h
+++ b/libcxx/include/__random/negative_binomial_distribution.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___RANDOM_NEGATIVE_BINOMIAL_DISTRIBUTION_H
-#define _LIBCPP___RANDOM_NEGATIVE_BINOMIAL_DISTRIBUTION_H
+#ifndef _LIBCUDACXX___RANDOM_NEGATIVE_BINOMIAL_DISTRIBUTION_H
+#define _LIBCUDACXX___RANDOM_NEGATIVE_BINOMIAL_DISTRIBUTION_H
 
 #include <__config>
 #include <__random/bernoulli_distribution.h>
@@ -17,43 +17,43 @@
 #include <iosfwd>
 #include <limits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template<class _IntType = int>
-class _LIBCPP_TEMPLATE_VIS negative_binomial_distribution
+class _LIBCUDACXX_TEMPLATE_VIS negative_binomial_distribution
 {
-    static_assert(__libcpp_random_is_valid_inttype<_IntType>::value, "IntType must be a supported integer type");
+    static_assert(__LIBCUDACXX_random_is_valid_inttype<_IntType>::value, "IntType must be a supported integer type");
 public:
     // types
     typedef _IntType result_type;
 
-    class _LIBCPP_TEMPLATE_VIS param_type
+    class _LIBCUDACXX_TEMPLATE_VIS param_type
     {
         result_type __k_;
         double __p_;
     public:
         typedef negative_binomial_distribution distribution_type;
 
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         explicit param_type(result_type __k = 1, double __p = 0.5)
             : __k_(__k), __p_(__p) {}
 
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         result_type k() const {return __k_;}
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         double p() const {return __p_;}
 
-        friend _LIBCPP_INLINE_VISIBILITY
+        friend _LIBCUDACXX_INLINE_VISIBILITY
             bool operator==(const param_type& __x, const param_type& __y)
             {return __x.__k_ == __y.__k_ && __x.__p_ == __y.__p_;}
-        friend _LIBCPP_INLINE_VISIBILITY
+        friend _LIBCUDACXX_INLINE_VISIBILITY
             bool operator!=(const param_type& __x, const param_type& __y)
             {return !(__x == __y);}
     };
@@ -63,51 +63,51 @@ class _LIBCPP_TEMPLATE_VIS negative_binomial_distribution
 
 public:
     // constructor and reset functions
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     negative_binomial_distribution() : negative_binomial_distribution(1) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit negative_binomial_distribution(result_type __k, double __p = 0.5)
         : __p_(__k, __p) {}
 #else
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit negative_binomial_distribution(result_type __k = 1,
                                             double __p = 0.5)
         : __p_(__k, __p) {}
 #endif
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit negative_binomial_distribution(const param_type& __p) : __p_(__p) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void reset() {}
 
     // generating functions
     template<class _URNG>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         result_type operator()(_URNG& __g)
         {return (*this)(__g, __p_);}
     template<class _URNG> result_type operator()(_URNG& __g, const param_type& __p);
 
     // property functions
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type k() const {return __p_.k();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     double p() const {return __p_.p();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     param_type param() const {return __p_;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void param(const param_type& __p) {__p_ = __p;}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type min() const {return 0;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type max() const {return numeric_limits<result_type>::max();}
 
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator==(const negative_binomial_distribution& __x,
                         const negative_binomial_distribution& __y)
         {return __x.__p_ == __y.__p_;}
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator!=(const negative_binomial_distribution& __x,
                         const negative_binomial_distribution& __y)
         {return !(__x == __y);}
@@ -118,7 +118,7 @@ template<class _URNG>
 _IntType
 negative_binomial_distribution<_IntType>::operator()(_URNG& __urng, const param_type& __pr)
 {
-    static_assert(__libcpp_random_is_valid_urng<_URNG>::value, "");
+    static_assert(__LIBCUDACXX_random_is_valid_urng<_URNG>::value, "");
     result_type __k = __pr.k();
     double __p = __pr.p();
     // When the number of bits in _IntType is small, we are too likely to
@@ -135,7 +135,7 @@ negative_binomial_distribution<_IntType>::operator()(_URNG& __urng, const param_
             else
                 ++__f;
         }
-        _LIBCPP_ASSERT(__f >= 0, "std::negative_binomial_distribution should never produce negative values. "
+        _LIBCUDACXX_ASSERT(__f >= 0, "std::negative_binomial_distribution should never produce negative values. "
                                  "This is almost certainly a signed integer overflow issue on __f.");
         return __f;
     }
@@ -176,8 +176,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
     return __is;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___RANDOM_NEGATIVE_BINOMIAL_DISTRIBUTION_H
+#endif // _LIBCUDACXX___RANDOM_NEGATIVE_BINOMIAL_DISTRIBUTION_H

diff  --git a/libcxx/include/__random/normal_distribution.h b/libcxx/include/__random/normal_distribution.h
index 0431df927200..1e82b5ba70d0 100644
--- a/libcxx/include/__random/normal_distribution.h
+++ b/libcxx/include/__random/normal_distribution.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___RANDOM_NORMAL_DISTRIBUTION_H
-#define _LIBCPP___RANDOM_NORMAL_DISTRIBUTION_H
+#ifndef _LIBCUDACXX___RANDOM_NORMAL_DISTRIBUTION_H
+#define _LIBCUDACXX___RANDOM_NORMAL_DISTRIBUTION_H
 
 #include <__config>
 #include <__random/is_valid.h>
@@ -16,42 +16,42 @@
 #include <iosfwd>
 #include <limits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template<class _RealType = double>
-class _LIBCPP_TEMPLATE_VIS normal_distribution
+class _LIBCUDACXX_TEMPLATE_VIS normal_distribution
 {
 public:
     // types
     typedef _RealType result_type;
 
-    class _LIBCPP_TEMPLATE_VIS param_type
+    class _LIBCUDACXX_TEMPLATE_VIS param_type
     {
         result_type __mean_;
         result_type __stddev_;
     public:
         typedef normal_distribution distribution_type;
 
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         explicit param_type(result_type __mean = 0, result_type __stddev = 1)
             : __mean_(__mean), __stddev_(__stddev) {}
 
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         result_type mean() const {return __mean_;}
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         result_type stddev() const {return __stddev_;}
 
-        friend _LIBCPP_INLINE_VISIBILITY
+        friend _LIBCUDACXX_INLINE_VISIBILITY
             bool operator==(const param_type& __x, const param_type& __y)
             {return __x.__mean_ == __y.__mean_ && __x.__stddev_ == __y.__stddev_;}
-        friend _LIBCPP_INLINE_VISIBILITY
+        friend _LIBCUDACXX_INLINE_VISIBILITY
             bool operator!=(const param_type& __x, const param_type& __y)
             {return !(__x == __y);}
     };
@@ -63,53 +63,53 @@ class _LIBCPP_TEMPLATE_VIS normal_distribution
 
 public:
     // constructors and reset functions
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     normal_distribution() : normal_distribution(0) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit normal_distribution(result_type __mean, result_type __stddev = 1)
         : __p_(param_type(__mean, __stddev)), _V_hot_(false) {}
 #else
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit normal_distribution(result_type __mean = 0,
                                  result_type __stddev = 1)
         : __p_(param_type(__mean, __stddev)), _V_hot_(false) {}
 #endif
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit normal_distribution(const param_type& __p)
         : __p_(__p), _V_hot_(false) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void reset() {_V_hot_ = false;}
 
     // generating functions
     template<class _URNG>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         result_type operator()(_URNG& __g)
         {return (*this)(__g, __p_);}
     template<class _URNG> result_type operator()(_URNG& __g, const param_type& __p);
 
     // property functions
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type mean() const {return __p_.mean();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type stddev() const {return __p_.stddev();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     param_type param() const {return __p_;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void param(const param_type& __p) {__p_ = __p;}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type min() const {return -numeric_limits<result_type>::infinity();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type max() const {return numeric_limits<result_type>::infinity();}
 
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator==(const normal_distribution& __x,
                         const normal_distribution& __y)
         {return __x.__p_ == __y.__p_ && __x._V_hot_ == __y._V_hot_ &&
                 (!__x._V_hot_ || __x._V_ == __y._V_);}
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator!=(const normal_distribution& __x,
                         const normal_distribution& __y)
         {return !(__x == __y);}
@@ -132,7 +132,7 @@ template<class _URNG>
 _RealType
 normal_distribution<_RealType>::operator()(_URNG& __g, const param_type& __p)
 {
-    static_assert(__libcpp_random_is_valid_urng<_URNG>::value, "");
+    static_assert(__LIBCUDACXX_random_is_valid_urng<_URNG>::value, "");
     result_type _Up;
     if (_V_hot_)
     {
@@ -151,7 +151,7 @@ normal_distribution<_RealType>::operator()(_URNG& __g, const param_type& __p)
             __v = _Uni(__g);
             __s = __u * __u + __v * __v;
         } while (__s > 1 || __s == 0);
-        result_type _Fp = _VSTD::sqrt(-2 * _VSTD::log(__s) / __s);
+        result_type _Fp = _CUDA_VSTD::sqrt(-2 * _CUDA_VSTD::log(__s) / __s);
         _V_ = __v * _Fp;
         _V_hot_ = true;
         _Up = __u * _Fp;
@@ -203,8 +203,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
     return __is;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___RANDOM_NORMAL_DISTRIBUTION_H
+#endif // _LIBCUDACXX___RANDOM_NORMAL_DISTRIBUTION_H

diff  --git a/libcxx/include/__random/piecewise_constant_distribution.h b/libcxx/include/__random/piecewise_constant_distribution.h
index 9c9e14b16d6e..3dbc47136bc4 100644
--- a/libcxx/include/__random/piecewise_constant_distribution.h
+++ b/libcxx/include/__random/piecewise_constant_distribution.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___RANDOM_PIECEWISE_CONSTANT_DISTRIBUTION_H
-#define _LIBCPP___RANDOM_PIECEWISE_CONSTANT_DISTRIBUTION_H
+#ifndef _LIBCUDACXX___RANDOM_PIECEWISE_CONSTANT_DISTRIBUTION_H
+#define _LIBCUDACXX___RANDOM_PIECEWISE_CONSTANT_DISTRIBUTION_H
 
 #include <__algorithm/upper_bound.h>
 #include <__config>
@@ -17,23 +17,23 @@
 #include <numeric>
 #include <vector>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template<class _RealType = double>
-class _LIBCPP_TEMPLATE_VIS piecewise_constant_distribution
+class _LIBCUDACXX_TEMPLATE_VIS piecewise_constant_distribution
 {
 public:
     // types
     typedef _RealType result_type;
 
-    class _LIBCPP_TEMPLATE_VIS param_type
+    class _LIBCUDACXX_TEMPLATE_VIS param_type
     {
         vector<result_type> __b_;
         vector<result_type> __densities_;
@@ -45,25 +45,25 @@ class _LIBCPP_TEMPLATE_VIS piecewise_constant_distribution
         template<class _InputIteratorB, class _InputIteratorW>
             param_type(_InputIteratorB __f_b, _InputIteratorB __l_b,
                        _InputIteratorW __f_w);
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
         template<class _UnaryOperation>
             param_type(initializer_list<result_type> __bl, _UnaryOperation __fw);
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
         template<class _UnaryOperation>
             param_type(size_t __nw, result_type __xmin, result_type __xmax,
                        _UnaryOperation __fw);
         param_type(param_type const&) = default;
         param_type & operator=(const param_type& __rhs);
 
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         vector<result_type> intervals() const {return __b_;}
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         vector<result_type> densities() const {return __densities_;}
 
-        friend _LIBCPP_INLINE_VISIBILITY
+        friend _LIBCUDACXX_INLINE_VISIBILITY
             bool operator==(const param_type& __x, const param_type& __y)
             {return __x.__densities_ == __y.__densities_ && __x.__b_ == __y.__b_;}
-        friend _LIBCPP_INLINE_VISIBILITY
+        friend _LIBCUDACXX_INLINE_VISIBILITY
             bool operator!=(const param_type& __x, const param_type& __y)
             {return !(__x == __y);}
 
@@ -90,64 +90,64 @@ class _LIBCPP_TEMPLATE_VIS piecewise_constant_distribution
 
 public:
     // constructor and reset functions
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     piecewise_constant_distribution() {}
     template<class _InputIteratorB, class _InputIteratorW>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         piecewise_constant_distribution(_InputIteratorB __f_b,
                                         _InputIteratorB __l_b,
                                         _InputIteratorW __f_w)
         : __p_(__f_b, __l_b, __f_w) {}
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
     template<class _UnaryOperation>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         piecewise_constant_distribution(initializer_list<result_type> __bl,
                                         _UnaryOperation __fw)
         : __p_(__bl, __fw) {}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
     template<class _UnaryOperation>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         piecewise_constant_distribution(size_t __nw, result_type __xmin,
                                         result_type __xmax, _UnaryOperation __fw)
         : __p_(__nw, __xmin, __xmax, __fw) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit piecewise_constant_distribution(const param_type& __p)
         : __p_(__p) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void reset() {}
 
     // generating functions
     template<class _URNG>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         result_type operator()(_URNG& __g)
         {return (*this)(__g, __p_);}
     template<class _URNG> result_type operator()(_URNG& __g, const param_type& __p);
 
     // property functions
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     vector<result_type> intervals() const {return __p_.intervals();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     vector<result_type> densities() const {return __p_.densities();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     param_type param() const {return __p_;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void param(const param_type& __p) {__p_ = __p;}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type min() const {return __p_.__b_.front();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type max() const {return __p_.__b_.back();}
 
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator==(const piecewise_constant_distribution& __x,
                         const piecewise_constant_distribution& __y)
         {return __x.__p_ == __y.__p_;}
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator!=(const piecewise_constant_distribution& __x,
                            const piecewise_constant_distribution& __y)
         {return !(__x == __y);}
@@ -187,14 +187,14 @@ void
 piecewise_constant_distribution<_RealType>::param_type::__init()
 {
     // __densities_ contains non-normalized areas
-    result_type __total_area = _VSTD::accumulate(__densities_.begin(),
+    result_type __total_area = _CUDA_VSTD::accumulate(__densities_.begin(),
                                                 __densities_.end(),
                                                 result_type());
     for (size_t __i = 0; __i < __densities_.size(); ++__i)
         __densities_[__i] /= __total_area;
     // __densities_ contains normalized areas
     __areas_.assign(__densities_.size(), result_type());
-    _VSTD::partial_sum(__densities_.begin(), __densities_.end() - 1,
+    _CUDA_VSTD::partial_sum(__densities_.begin(), __densities_.end() - 1,
                                                           __areas_.begin() + 1);
     // __areas_ contains partial sums of normalized areas: [0, __densities_ - 1]
     __densities_.back() = 1 - __areas_.back();  // correct round off error
@@ -235,7 +235,7 @@ piecewise_constant_distribution<_RealType>::param_type::param_type(
     }
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
 template<class _RealType>
 template<class _UnaryOperation>
@@ -260,7 +260,7 @@ piecewise_constant_distribution<_RealType>::param_type::param_type(
     }
 }
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
 template<class _RealType>
 template<class _UnaryOperation>
@@ -285,10 +285,10 @@ template<class _URNG>
 _RealType
 piecewise_constant_distribution<_RealType>::operator()(_URNG& __g, const param_type& __p)
 {
-    static_assert(__libcpp_random_is_valid_urng<_URNG>::value, "");
+    static_assert(__LIBCUDACXX_random_is_valid_urng<_URNG>::value, "");
     typedef uniform_real_distribution<result_type> _Gen;
     result_type __u = _Gen()(__g);
-    ptr
diff _t __k = _VSTD::upper_bound(__p.__areas_.begin(), __p.__areas_.end(),
+    ptr
diff _t __k = _CUDA_VSTD::upper_bound(__p.__areas_.begin(), __p.__areas_.end(),
                                       __u) - __p.__areas_.begin() - 1;
     return (__u - __p.__areas_[__k]) / __p.__densities_[__k] + __p.__b_[__k];
 }
@@ -351,8 +351,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
     return __is;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___RANDOM_PIECEWISE_CONSTANT_DISTRIBUTION_H
+#endif // _LIBCUDACXX___RANDOM_PIECEWISE_CONSTANT_DISTRIBUTION_H

diff  --git a/libcxx/include/__random/piecewise_linear_distribution.h b/libcxx/include/__random/piecewise_linear_distribution.h
index 05f00cef06ef..cd3ac2fdd5e3 100644
--- a/libcxx/include/__random/piecewise_linear_distribution.h
+++ b/libcxx/include/__random/piecewise_linear_distribution.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___RANDOM_PIECEWISE_LINEAR_DISTRIBUTION_H
-#define _LIBCPP___RANDOM_PIECEWISE_LINEAR_DISTRIBUTION_H
+#ifndef _LIBCUDACXX___RANDOM_PIECEWISE_LINEAR_DISTRIBUTION_H
+#define _LIBCUDACXX___RANDOM_PIECEWISE_LINEAR_DISTRIBUTION_H
 
 #include <__algorithm/upper_bound.h>
 #include <__config>
@@ -17,23 +17,23 @@
 #include <numeric>
 #include <vector>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template<class _RealType = double>
-class _LIBCPP_TEMPLATE_VIS piecewise_linear_distribution
+class _LIBCUDACXX_TEMPLATE_VIS piecewise_linear_distribution
 {
 public:
     // types
     typedef _RealType result_type;
 
-    class _LIBCPP_TEMPLATE_VIS param_type
+    class _LIBCUDACXX_TEMPLATE_VIS param_type
     {
         vector<result_type> __b_;
         vector<result_type> __densities_;
@@ -45,25 +45,25 @@ class _LIBCPP_TEMPLATE_VIS piecewise_linear_distribution
         template<class _InputIteratorB, class _InputIteratorW>
             param_type(_InputIteratorB __f_b, _InputIteratorB __l_b,
                        _InputIteratorW __f_w);
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
         template<class _UnaryOperation>
             param_type(initializer_list<result_type> __bl, _UnaryOperation __fw);
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
         template<class _UnaryOperation>
             param_type(size_t __nw, result_type __xmin, result_type __xmax,
                        _UnaryOperation __fw);
         param_type(param_type const&) = default;
         param_type & operator=(const param_type& __rhs);
 
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         vector<result_type> intervals() const {return __b_;}
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         vector<result_type> densities() const {return __densities_;}
 
-        friend _LIBCPP_INLINE_VISIBILITY
+        friend _LIBCUDACXX_INLINE_VISIBILITY
             bool operator==(const param_type& __x, const param_type& __y)
             {return __x.__densities_ == __y.__densities_ && __x.__b_ == __y.__b_;}
-        friend _LIBCPP_INLINE_VISIBILITY
+        friend _LIBCUDACXX_INLINE_VISIBILITY
             bool operator!=(const param_type& __x, const param_type& __y)
             {return !(__x == __y);}
 
@@ -90,64 +90,64 @@ class _LIBCPP_TEMPLATE_VIS piecewise_linear_distribution
 
 public:
     // constructor and reset functions
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     piecewise_linear_distribution() {}
     template<class _InputIteratorB, class _InputIteratorW>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         piecewise_linear_distribution(_InputIteratorB __f_b,
                                       _InputIteratorB __l_b,
                                       _InputIteratorW __f_w)
         : __p_(__f_b, __l_b, __f_w) {}
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
     template<class _UnaryOperation>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         piecewise_linear_distribution(initializer_list<result_type> __bl,
                                       _UnaryOperation __fw)
         : __p_(__bl, __fw) {}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
     template<class _UnaryOperation>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         piecewise_linear_distribution(size_t __nw, result_type __xmin,
                                       result_type __xmax, _UnaryOperation __fw)
         : __p_(__nw, __xmin, __xmax, __fw) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit piecewise_linear_distribution(const param_type& __p)
         : __p_(__p) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void reset() {}
 
     // generating functions
     template<class _URNG>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         result_type operator()(_URNG& __g)
         {return (*this)(__g, __p_);}
     template<class _URNG> result_type operator()(_URNG& __g, const param_type& __p);
 
     // property functions
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     vector<result_type> intervals() const {return __p_.intervals();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     vector<result_type> densities() const {return __p_.densities();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     param_type param() const {return __p_;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void param(const param_type& __p) {__p_ = __p;}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type min() const {return __p_.__b_.front();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type max() const {return __p_.__b_.back();}
 
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator==(const piecewise_linear_distribution& __x,
                         const piecewise_linear_distribution& __y)
         {return __x.__p_ == __y.__p_;}
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator!=(const piecewise_linear_distribution& __x,
                         const piecewise_linear_distribution& __y)
         {return !(__x == __y);}
@@ -239,7 +239,7 @@ piecewise_linear_distribution<_RealType>::param_type::param_type(
     }
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
 template<class _RealType>
 template<class _UnaryOperation>
@@ -264,7 +264,7 @@ piecewise_linear_distribution<_RealType>::param_type::param_type(
     }
 }
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
 template<class _RealType>
 template<class _UnaryOperation>
@@ -290,10 +290,10 @@ template<class _URNG>
 _RealType
 piecewise_linear_distribution<_RealType>::operator()(_URNG& __g, const param_type& __p)
 {
-    static_assert(__libcpp_random_is_valid_urng<_URNG>::value, "");
+    static_assert(__LIBCUDACXX_random_is_valid_urng<_URNG>::value, "");
     typedef uniform_real_distribution<result_type> _Gen;
     result_type __u = _Gen()(__g);
-    ptr
diff _t __k = _VSTD::upper_bound(__p.__areas_.begin(), __p.__areas_.end(),
+    ptr
diff _t __k = _CUDA_VSTD::upper_bound(__p.__areas_.begin(), __p.__areas_.end(),
                                       __u) - __p.__areas_.begin() - 1;
     __u -= __p.__areas_[__k];
     const result_type __dk = __p.__densities_[__k];
@@ -305,7 +305,7 @@ piecewise_linear_distribution<_RealType>::operator()(_URNG& __g, const param_typ
     const result_type __bk1 = __p.__b_[__k+1];
     const result_type __deltab = __bk1 - __bk;
     return (__bk * __dk1 - __bk1 * __dk +
-        _VSTD::sqrt(__deltab * (__deltab * __dk * __dk + 2 * __deltad * __u))) /
+        _CUDA_VSTD::sqrt(__deltab * (__deltab * __dk * __dk + 2 * __deltad * __u))) /
         __deltad;
 }
 
@@ -367,8 +367,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
     return __is;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___RANDOM_PIECEWISE_LINEAR_DISTRIBUTION_H
+#endif // _LIBCUDACXX___RANDOM_PIECEWISE_LINEAR_DISTRIBUTION_H

diff  --git a/libcxx/include/__random/poisson_distribution.h b/libcxx/include/__random/poisson_distribution.h
index ef55b1be4844..f1d9364e4146 100644
--- a/libcxx/include/__random/poisson_distribution.h
+++ b/libcxx/include/__random/poisson_distribution.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___RANDOM_POISSON_DISTRIBUTION_H
-#define _LIBCPP___RANDOM_POISSON_DISTRIBUTION_H
+#ifndef _LIBCUDACXX___RANDOM_POISSON_DISTRIBUTION_H
+#define _LIBCUDACXX___RANDOM_POISSON_DISTRIBUTION_H
 
 #include <__config>
 #include <__random/clamp_to_integral.h>
@@ -19,24 +19,24 @@
 #include <iosfwd>
 #include <limits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template<class _IntType = int>
-class _LIBCPP_TEMPLATE_VIS poisson_distribution
+class _LIBCUDACXX_TEMPLATE_VIS poisson_distribution
 {
-    static_assert(__libcpp_random_is_valid_inttype<_IntType>::value, "IntType must be a supported integer type");
+    static_assert(__LIBCUDACXX_random_is_valid_inttype<_IntType>::value, "IntType must be a supported integer type");
 public:
     // types
     typedef _IntType result_type;
 
-    class _LIBCPP_TEMPLATE_VIS param_type
+    class _LIBCUDACXX_TEMPLATE_VIS param_type
     {
         double __mean_;
         double __s_;
@@ -54,13 +54,13 @@ class _LIBCPP_TEMPLATE_VIS poisson_distribution
 
         explicit param_type(double __mean = 1.0);
 
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         double mean() const {return __mean_;}
 
-        friend _LIBCPP_INLINE_VISIBILITY
+        friend _LIBCUDACXX_INLINE_VISIBILITY
             bool operator==(const param_type& __x, const param_type& __y)
             {return __x.__mean_ == __y.__mean_;}
-        friend _LIBCPP_INLINE_VISIBILITY
+        friend _LIBCUDACXX_INLINE_VISIBILITY
             bool operator!=(const param_type& __x, const param_type& __y)
             {return !(__x == __y);}
 
@@ -72,48 +72,48 @@ class _LIBCPP_TEMPLATE_VIS poisson_distribution
 
 public:
     // constructors and reset functions
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     poisson_distribution() : poisson_distribution(1.0) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit poisson_distribution(double __mean)
         : __p_(__mean) {}
 #else
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit poisson_distribution(double __mean = 1.0)
         : __p_(__mean) {}
 #endif
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit poisson_distribution(const param_type& __p) : __p_(__p) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void reset() {}
 
     // generating functions
     template<class _URNG>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         result_type operator()(_URNG& __g)
         {return (*this)(__g, __p_);}
     template<class _URNG> result_type operator()(_URNG& __g, const param_type& __p);
 
     // property functions
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     double mean() const {return __p_.mean();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     param_type param() const {return __p_;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void param(const param_type& __p) {__p_ = __p;}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type min() const {return 0;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type max() const {return numeric_limits<result_type>::max();}
 
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator==(const poisson_distribution& __x,
                         const poisson_distribution& __y)
         {return __x.__p_ == __y.__p_;}
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator!=(const poisson_distribution& __x,
                         const poisson_distribution& __y)
         {return !(__x == __y);}
@@ -130,7 +130,7 @@ poisson_distribution<_IntType>::param_type::param_type(double __mean)
     {
         __s_ = 0;
         __d_ = 0;
-        __l_ = _VSTD::exp(-__mean_);
+        __l_ = _CUDA_VSTD::exp(-__mean_);
         __omega_ = 0;
         __c3_ = 0;
         __c2_ = 0;
@@ -140,9 +140,9 @@ poisson_distribution<_IntType>::param_type::param_type(double __mean)
     }
     else
     {
-        __s_ = _VSTD::sqrt(__mean_);
+        __s_ = _CUDA_VSTD::sqrt(__mean_);
         __d_ = 6 * __mean_ * __mean_;
-        __l_ = _VSTD::trunc(__mean_ - 1.1484);
+        __l_ = _CUDA_VSTD::trunc(__mean_ - 1.1484);
         __omega_ = .3989423 / __s_;
         double __b1_ = .4166667E-1 / __mean_;
         double __b2_ = .3 * __b1_ * __b1_;
@@ -159,7 +159,7 @@ template<class _URNG>
 _IntType
 poisson_distribution<_IntType>::operator()(_URNG& __urng, const param_type& __pr)
 {
-    static_assert(__libcpp_random_is_valid_urng<_URNG>::value, "");
+    static_assert(__LIBCUDACXX_random_is_valid_urng<_URNG>::value, "");
     double __tx;
     uniform_real_distribution<double> __urd;
     if (__pr.__mean_ < 10)
@@ -175,13 +175,13 @@ poisson_distribution<_IntType>::operator()(_URNG& __urng, const param_type& __pr
         double __u;
         if (__g > 0)
         {
-            __tx = _VSTD::trunc(__g);
+            __tx = _CUDA_VSTD::trunc(__g);
             if (__tx >= __pr.__l_)
-                return _VSTD::__clamp_to_integral<result_type>(__tx);
+                return _CUDA_VSTD::__clamp_to_integral<result_type>(__tx);
             __difmuk = __pr.__mean_ - __tx;
             __u = __urd(__urng);
             if (__pr.__d_ * __u >= __difmuk * __difmuk * __difmuk)
-                return _VSTD::__clamp_to_integral<result_type>(__tx);
+                return _CUDA_VSTD::__clamp_to_integral<result_type>(__tx);
         }
         exponential_distribution<double> __edist;
         for (bool __using_exp_dist = false; true; __using_exp_dist = true)
@@ -197,7 +197,7 @@ poisson_distribution<_IntType>::operator()(_URNG& __urng, const param_type& __pr
                     __u += __u - 1;
                     __t = 1.8 + (__u < 0 ? -__e : __e);
                 } while (__t <= -.6744);
-                __tx = _VSTD::trunc(__pr.__mean_ + __pr.__s_ * __t);
+                __tx = _CUDA_VSTD::trunc(__pr.__mean_ + __pr.__s_ * __t);
                 __difmuk = __pr.__mean_ - __tx;
                 __using_exp_dist = true;
             }
@@ -208,20 +208,20 @@ poisson_distribution<_IntType>::operator()(_URNG& __urng, const param_type& __pr
                 const double __fac[] = {1, 1, 2, 6, 24, 120, 720, 5040,
                                              40320, 362880};
                 __px = -__pr.__mean_;
-                __py = _VSTD::pow(__pr.__mean_, (double)__tx) / __fac[static_cast<int>(__tx)];
+                __py = _CUDA_VSTD::pow(__pr.__mean_, (double)__tx) / __fac[static_cast<int>(__tx)];
             }
             else
             {
                 double __del = .8333333E-1 / __tx;
                 __del -= 4.8 * __del * __del * __del;
                 double __v = __difmuk / __tx;
-                if (_VSTD::abs(__v) > 0.25)
-                    __px = __tx * _VSTD::log(1 + __v) - __difmuk - __del;
+                if (_CUDA_VSTD::abs(__v) > 0.25)
+                    __px = __tx * _CUDA_VSTD::log(1 + __v) - __difmuk - __del;
                 else
                     __px = __tx * __v * __v * (((((((.1250060 * __v + -.1384794) *
                            __v + .1421878) * __v + -.1661269) * __v + .2000118) *
                            __v + -.2500068) * __v + .3333333) * __v + -.5) - __del;
-                __py = .3989423 / _VSTD::sqrt(__tx);
+                __py = .3989423 / _CUDA_VSTD::sqrt(__tx);
             }
             double __r = (0.5 - __difmuk) / __pr.__s_;
             double __r2 = __r * __r;
@@ -230,18 +230,18 @@ poisson_distribution<_IntType>::operator()(_URNG& __urng, const param_type& __pr
                                         __r2 + __pr.__c1_) * __r2 + __pr.__c0_);
             if (__using_exp_dist)
             {
-                if (__pr.__c_ * _VSTD::abs(__u) <= __py * _VSTD::exp(__px + __e) -
-                                                   __fy * _VSTD::exp(__fx + __e))
+                if (__pr.__c_ * _CUDA_VSTD::abs(__u) <= __py * _CUDA_VSTD::exp(__px + __e) -
+                                                   __fy * _CUDA_VSTD::exp(__fx + __e))
                     break;
             }
             else
             {
-                if (__fy - __u * __fy <= __py * _VSTD::exp(__px - __fx))
+                if (__fy - __u * __fy <= __py * _CUDA_VSTD::exp(__px - __fx))
                     break;
             }
         }
     }
-    return _VSTD::__clamp_to_integral<result_type>(__tx);
+    return _CUDA_VSTD::__clamp_to_integral<result_type>(__tx);
 }
 
 template <class _CharT, class _Traits, class _IntType>
@@ -273,8 +273,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
     return __is;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___RANDOM_POISSON_DISTRIBUTION_H
+#endif // _LIBCUDACXX___RANDOM_POISSON_DISTRIBUTION_H

diff  --git a/libcxx/include/__random/random_device.h b/libcxx/include/__random/random_device.h
index e82b437a3b54..e7df59998ae5 100644
--- a/libcxx/include/__random/random_device.h
+++ b/libcxx/include/__random/random_device.h
@@ -6,32 +6,32 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___RANDOM_RANDOM_DEVICE_H
-#define _LIBCPP___RANDOM_RANDOM_DEVICE_H
+#ifndef _LIBCUDACXX___RANDOM_RANDOM_DEVICE_H
+#define _LIBCUDACXX___RANDOM_RANDOM_DEVICE_H
 
 #include <__config>
 #include <string>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if !defined(_LIBCPP_HAS_NO_RANDOM_DEVICE)
+#if !defined(_LIBCUDACXX_HAS_NO_RANDOM_DEVICE)
 
-class _LIBCPP_TYPE_VIS random_device
+class _LIBCUDACXX_TYPE_VIS random_device
 {
-#ifdef _LIBCPP_USING_DEV_RANDOM
+#ifdef _LIBCUDACXX_USING_DEV_RANDOM
     int __f_;
-#elif !defined(_LIBCPP_ABI_NO_RANDOM_DEVICE_COMPATIBILITY_LAYOUT)
-    _LIBCPP_DIAGNOSTIC_PUSH
-    _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wunused-private-field")
+#elif !defined(_LIBCUDACXX_ABI_NO_RANDOM_DEVICE_COMPATIBILITY_LAYOUT)
+    _LIBCUDACXX_DIAGNOSTIC_PUSH
+    _LIBCUDACXX_CLANG_DIAGNOSTIC_IGNORED("-Wunused-private-field")
 
-    // Apple platforms used to use the `_LIBCPP_USING_DEV_RANDOM` code path, and now
+    // Apple platforms used to use the `_LIBCUDACXX_USING_DEV_RANDOM` code path, and now
     // use `arc4random()` as of this comment. In order to avoid breaking the ABI, we
     // retain the same layout as before.
 #   if defined(__APPLE__)
@@ -40,7 +40,7 @@ class _LIBCPP_TYPE_VIS random_device
 
     // ... vendors can add workarounds here if they switch to a 
diff erent representation ...
 
-    _LIBCPP_DIAGNOSTIC_POP
+    _LIBCUDACXX_DIAGNOSTIC_POP
 #endif
 
 public:
@@ -48,16 +48,16 @@ class _LIBCPP_TYPE_VIS random_device
     typedef unsigned result_type;
 
     // generator characteristics
-    static _LIBCPP_CONSTEXPR const result_type _Min = 0;
-    static _LIBCPP_CONSTEXPR const result_type _Max = 0xFFFFFFFFu;
+    static _LIBCUDACXX_CONSTEXPR const result_type _Min = 0;
+    static _LIBCUDACXX_CONSTEXPR const result_type _Max = 0xFFFFFFFFu;
 
-    _LIBCPP_INLINE_VISIBILITY
-    static _LIBCPP_CONSTEXPR result_type min() { return _Min;}
-    _LIBCPP_INLINE_VISIBILITY
-    static _LIBCPP_CONSTEXPR result_type max() { return _Max;}
+    _LIBCUDACXX_INLINE_VISIBILITY
+    static _LIBCUDACXX_CONSTEXPR result_type min() { return _Min;}
+    _LIBCUDACXX_INLINE_VISIBILITY
+    static _LIBCUDACXX_CONSTEXPR result_type max() { return _Max;}
 
     // constructors
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
     random_device() : random_device("/dev/urandom") {}
     explicit random_device(const string& __token);
 #else
@@ -75,10 +75,10 @@ class _LIBCPP_TYPE_VIS random_device
     void operator=(const random_device&) = delete;
 };
 
-#endif // !_LIBCPP_HAS_NO_RANDOM_DEVICE
+#endif // !_LIBCUDACXX_HAS_NO_RANDOM_DEVICE
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___RANDOM_RANDOM_DEVICE_H
+#endif // _LIBCUDACXX___RANDOM_RANDOM_DEVICE_H

diff  --git a/libcxx/include/__random/ranlux.h b/libcxx/include/__random/ranlux.h
index e44cece39dfc..9aa1a0e5ca99 100644
--- a/libcxx/include/__random/ranlux.h
+++ b/libcxx/include/__random/ranlux.h
@@ -6,19 +6,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___RANDOM_RANLUX_H
-#define _LIBCPP___RANDOM_RANLUX_H
+#ifndef _LIBCUDACXX___RANDOM_RANLUX_H
+#define _LIBCUDACXX___RANDOM_RANLUX_H
 
 #include <__config>
 #include <__random/discard_block_engine.h>
 #include <__random/subtract_with_carry_engine.h>
 #include <cstdint>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 typedef subtract_with_carry_engine<uint_fast32_t, 24, 10, 24> ranlux24_base;
 typedef subtract_with_carry_engine<uint_fast64_t, 48,  5, 12> ranlux48_base;
@@ -26,6 +26,6 @@ typedef subtract_with_carry_engine<uint_fast64_t, 48,  5, 12> ranlux48_base;
 typedef discard_block_engine<ranlux24_base, 223, 23> ranlux24;
 typedef discard_block_engine<ranlux48_base, 389, 11> ranlux48;
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___RANDOM_RANLUX_H
+#endif // _LIBCUDACXX___RANDOM_RANLUX_H

diff  --git a/libcxx/include/__random/seed_seq.h b/libcxx/include/__random/seed_seq.h
index 330537fa0023..b448cac230ae 100644
--- a/libcxx/include/__random/seed_seq.h
+++ b/libcxx/include/__random/seed_seq.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___RANDOM_SEED_SEQ_H
-#define _LIBCPP___RANDOM_SEED_SEQ_H
+#ifndef _LIBCUDACXX___RANDOM_SEED_SEQ_H
+#define _LIBCUDACXX___RANDOM_SEED_SEQ_H
 
 #include <__algorithm/copy.h>
 #include <__algorithm/fill.h>
@@ -16,34 +16,34 @@
 #include <initializer_list>
 #include <vector>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-class _LIBCPP_TEMPLATE_VIS seed_seq
+class _LIBCUDACXX_TEMPLATE_VIS seed_seq
 {
 public:
     // types
     typedef uint32_t result_type;
 
     // constructors
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     seed_seq() _NOEXCEPT {}
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
     template<class _Tp, __enable_if_t<is_integral<_Tp>::value>* = nullptr>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     seed_seq(initializer_list<_Tp> __il) {
         __init(__il.begin(), __il.end());
     }
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
     template<class _InputIterator>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     seed_seq(_InputIterator __first, _InputIterator __last) {
         static_assert(is_integral<typename iterator_traits<_InputIterator>::value_type>::value,
             "Mandates: iterator_traits<InputIterator>::value_type is an integer type");
@@ -55,17 +55,17 @@ class _LIBCPP_TEMPLATE_VIS seed_seq
         void generate(_RandomAccessIterator __first, _RandomAccessIterator __last);
 
     // property functions
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t size() const _NOEXCEPT {return __v_.size();}
     template<class _OutputIterator>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         void param(_OutputIterator __dest) const
-            {_VSTD::copy(__v_.begin(), __v_.end(), __dest);}
+            {_CUDA_VSTD::copy(__v_.begin(), __v_.end(), __dest);}
 
     seed_seq(const seed_seq&) = delete;
     void operator=(const seed_seq&) = delete;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     static result_type _Tp(result_type __x) {return __x ^ (__x >> 27);}
 
 private:
@@ -89,7 +89,7 @@ seed_seq::generate(_RandomAccessIterator __first, _RandomAccessIterator __last)
 {
     if (__first != __last)
     {
-        _VSTD::fill(__first, __last, 0x8b8b8b8b);
+        _CUDA_VSTD::fill(__first, __last, 0x8b8b8b8b);
         const size_t __n = static_cast<size_t>(__last - __first);
         const size_t __s = __v_.size();
         const size_t __t = (__n >= 623) ? 11
@@ -99,7 +99,7 @@ seed_seq::generate(_RandomAccessIterator __first, _RandomAccessIterator __last)
                          : (__n - 1) / 2;
         const size_t __p = (__n - __t) / 2;
         const size_t __q = __p + __t;
-        const size_t __m = _VSTD::max(__s + 1, __n);
+        const size_t __m = _CUDA_VSTD::max(__s + 1, __n);
         // __k = 0;
         {
             result_type __r = 1664525 * _Tp(__first[0] ^ __first[__p]
@@ -170,8 +170,8 @@ seed_seq::generate(_RandomAccessIterator __first, _RandomAccessIterator __last)
     }
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___RANDOM_SEED_SEQ_H
+#endif // _LIBCUDACXX___RANDOM_SEED_SEQ_H

diff  --git a/libcxx/include/__random/shuffle_order_engine.h b/libcxx/include/__random/shuffle_order_engine.h
index c2f76f609ae5..76e83fdfbf5f 100644
--- a/libcxx/include/__random/shuffle_order_engine.h
+++ b/libcxx/include/__random/shuffle_order_engine.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___RANDOM_SHUFFLE_ORDER_ENGINE_H
-#define _LIBCPP___RANDOM_SHUFFLE_ORDER_ENGINE_H
+#ifndef _LIBCUDACXX___RANDOM_SHUFFLE_ORDER_ENGINE_H
+#define _LIBCUDACXX___RANDOM_SHUFFLE_ORDER_ENGINE_H
 
 #include <__algorithm/equal.h>
 #include <__config>
@@ -17,41 +17,41 @@
 #include <iosfwd>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <uint64_t _Xp, uint64_t _Yp>
 struct __ugcd
 {
-    static _LIBCPP_CONSTEXPR const uint64_t value = __ugcd<_Yp, _Xp % _Yp>::value;
+    static _LIBCUDACXX_CONSTEXPR const uint64_t value = __ugcd<_Yp, _Xp % _Yp>::value;
 };
 
 template <uint64_t _Xp>
 struct __ugcd<_Xp, 0>
 {
-    static _LIBCPP_CONSTEXPR const uint64_t value = _Xp;
+    static _LIBCUDACXX_CONSTEXPR const uint64_t value = _Xp;
 };
 
 template <uint64_t _Np, uint64_t _Dp>
 class __uratio
 {
     static_assert(_Dp != 0, "__uratio divide by 0");
-    static _LIBCPP_CONSTEXPR const uint64_t __gcd = __ugcd<_Np, _Dp>::value;
+    static _LIBCUDACXX_CONSTEXPR const uint64_t __gcd = __ugcd<_Np, _Dp>::value;
 public:
-    static _LIBCPP_CONSTEXPR const uint64_t num = _Np / __gcd;
-    static _LIBCPP_CONSTEXPR const uint64_t den = _Dp / __gcd;
+    static _LIBCUDACXX_CONSTEXPR const uint64_t num = _Np / __gcd;
+    static _LIBCUDACXX_CONSTEXPR const uint64_t den = _Dp / __gcd;
 
     typedef __uratio<num, den> type;
 };
 
 template<class _Engine, size_t __k>
-class _LIBCPP_TEMPLATE_VIS shuffle_order_engine
+class _LIBCUDACXX_TEMPLATE_VIS shuffle_order_engine
 {
     static_assert(0 < __k, "shuffle_order_engine invalid parameters");
 public:
@@ -65,48 +65,48 @@ class _LIBCPP_TEMPLATE_VIS shuffle_order_engine
 
 public:
     // engine characteristics
-    static _LIBCPP_CONSTEXPR const size_t table_size = __k;
+    static _LIBCUDACXX_CONSTEXPR const size_t table_size = __k;
 
-#ifdef _LIBCPP_CXX03_LANG
+#ifdef _LIBCUDACXX_CXX03_LANG
     static const result_type _Min = _Engine::_Min;
     static const result_type _Max = _Engine::_Max;
 #else
-    static _LIBCPP_CONSTEXPR const result_type _Min = _Engine::min();
-    static _LIBCPP_CONSTEXPR const result_type _Max = _Engine::max();
+    static _LIBCUDACXX_CONSTEXPR const result_type _Min = _Engine::min();
+    static _LIBCUDACXX_CONSTEXPR const result_type _Max = _Engine::max();
 #endif
     static_assert(_Min < _Max, "shuffle_order_engine invalid parameters");
-    _LIBCPP_INLINE_VISIBILITY
-    static _LIBCPP_CONSTEXPR result_type min() { return _Min; }
-    _LIBCPP_INLINE_VISIBILITY
-    static _LIBCPP_CONSTEXPR result_type max() { return _Max; }
+    _LIBCUDACXX_INLINE_VISIBILITY
+    static _LIBCUDACXX_CONSTEXPR result_type min() { return _Min; }
+    _LIBCUDACXX_INLINE_VISIBILITY
+    static _LIBCUDACXX_CONSTEXPR result_type max() { return _Max; }
 
-    static _LIBCPP_CONSTEXPR const unsigned long long _Rp = _Max - _Min + 1ull;
+    static _LIBCUDACXX_CONSTEXPR const unsigned long long _Rp = _Max - _Min + 1ull;
 
     // constructors and seeding functions
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     shuffle_order_engine() {__init();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit shuffle_order_engine(const _Engine& __e)
         : __e_(__e) {__init();}
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit shuffle_order_engine(_Engine&& __e)
-        : __e_(_VSTD::move(__e)) {__init();}
-#endif // _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+        : __e_(_CUDA_VSTD::move(__e)) {__init();}
+#endif // _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit shuffle_order_engine(result_type __sd) : __e_(__sd) {__init();}
     template<class _Sseq>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         explicit shuffle_order_engine(_Sseq& __q,
         typename enable_if<__is_seed_sequence<_Sseq, shuffle_order_engine>::value &&
                            !is_convertible<_Sseq, _Engine>::value>::type* = 0)
          : __e_(__q) {__init();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void seed() {__e_.seed(); __init();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void seed(result_type __sd) {__e_.seed(__sd); __init();}
     template<class _Sseq>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         typename enable_if
         <
             __is_seed_sequence<_Sseq, shuffle_order_engine>::value,
@@ -115,13 +115,13 @@ class _LIBCPP_TEMPLATE_VIS shuffle_order_engine
         seed(_Sseq& __q) {__e_.seed(__q); __init();}
 
     // generating functions
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type operator()() {return __eval(integral_constant<bool, _Rp != 0>());}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void discard(unsigned long long __z) {for (; __z; --__z) operator()();}
 
     // property functions
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const _Engine& base() const _NOEXCEPT {return __e_;}
 
 private:
@@ -153,7 +153,7 @@ class _LIBCPP_TEMPLATE_VIS shuffle_order_engine
     operator>>(basic_istream<_CharT, _Traits>& __is,
                shuffle_order_engine<_Eng, _Kp>& __x);
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __init()
     {
         for (size_t __i = 0; __i < __k; ++__i)
@@ -161,18 +161,18 @@ class _LIBCPP_TEMPLATE_VIS shuffle_order_engine
         _Y_ = __e_();
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type __eval(false_type) {return __eval2(integral_constant<bool, __k & 1>());}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type __eval(true_type) {return __eval(__uratio<__k, _Rp>());}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type __eval2(false_type) {return __eval(__uratio<__k/2, 0x8000000000000000ull>());}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type __eval2(true_type) {return __evalf<__k, 0>();}
 
     template <uint64_t _Np, uint64_t _Dp>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         typename enable_if
         <
             (__uratio<_Np, _Dp>::num > 0xFFFFFFFFFFFFFFFFull / (_Max - _Min)),
@@ -182,7 +182,7 @@ class _LIBCPP_TEMPLATE_VIS shuffle_order_engine
             {return __evalf<__uratio<_Np, _Dp>::num, __uratio<_Np, _Dp>::den>();}
 
     template <uint64_t _Np, uint64_t _Dp>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         typename enable_if
         <
             __uratio<_Np, _Dp>::num <= 0xFFFFFFFFFFFFFFFFull / (_Max - _Min),
@@ -198,7 +198,7 @@ class _LIBCPP_TEMPLATE_VIS shuffle_order_engine
         }
 
     template <uint64_t __n, uint64_t __d>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         result_type __evalf()
         {
             const double _Fp = __d == 0 ?
@@ -212,7 +212,7 @@ class _LIBCPP_TEMPLATE_VIS shuffle_order_engine
 };
 
 template<class _Engine, size_t __k>
-    _LIBCPP_CONSTEXPR const size_t shuffle_order_engine<_Engine, __k>::table_size;
+    _LIBCUDACXX_CONSTEXPR const size_t shuffle_order_engine<_Engine, __k>::table_size;
 
 template<class _Eng, size_t _Kp>
 bool
@@ -220,12 +220,12 @@ operator==(
     const shuffle_order_engine<_Eng, _Kp>& __x,
     const shuffle_order_engine<_Eng, _Kp>& __y)
 {
-    return __x._Y_ == __y._Y_ && _VSTD::equal(__x._V_, __x._V_ + _Kp, __y._V_) &&
+    return __x._Y_ == __y._Y_ && _CUDA_VSTD::equal(__x._V_, __x._V_ + _Kp, __y._V_) &&
            __x.__e_ == __y.__e_;
 }
 
 template<class _Eng, size_t _Kp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator!=(
     const shuffle_order_engine<_Eng, _Kp>& __x,
@@ -276,8 +276,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
     return __is;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___RANDOM_SHUFFLE_ORDER_ENGINE_H
+#endif // _LIBCUDACXX___RANDOM_SHUFFLE_ORDER_ENGINE_H

diff  --git a/libcxx/include/__random/student_t_distribution.h b/libcxx/include/__random/student_t_distribution.h
index 9e95f97cefab..307ddfe4a1ae 100644
--- a/libcxx/include/__random/student_t_distribution.h
+++ b/libcxx/include/__random/student_t_distribution.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___RANDOM_STUDENT_T_DISTRIBUTION_H
-#define _LIBCPP___RANDOM_STUDENT_T_DISTRIBUTION_H
+#ifndef _LIBCUDACXX___RANDOM_STUDENT_T_DISTRIBUTION_H
+#define _LIBCUDACXX___RANDOM_STUDENT_T_DISTRIBUTION_H
 
 #include <__config>
 #include <__random/gamma_distribution.h>
@@ -17,38 +17,38 @@
 #include <iosfwd>
 #include <limits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template<class _RealType = double>
-class _LIBCPP_TEMPLATE_VIS student_t_distribution
+class _LIBCUDACXX_TEMPLATE_VIS student_t_distribution
 {
 public:
     // types
     typedef _RealType result_type;
 
-    class _LIBCPP_TEMPLATE_VIS param_type
+    class _LIBCUDACXX_TEMPLATE_VIS param_type
     {
         result_type __n_;
     public:
         typedef student_t_distribution distribution_type;
 
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         explicit param_type(result_type __n = 1) : __n_(__n) {}
 
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         result_type n() const {return __n_;}
 
-        friend _LIBCPP_INLINE_VISIBILITY
+        friend _LIBCUDACXX_INLINE_VISIBILITY
             bool operator==(const param_type& __x, const param_type& __y)
             {return __x.__n_ == __y.__n_;}
-        friend _LIBCPP_INLINE_VISIBILITY
+        friend _LIBCUDACXX_INLINE_VISIBILITY
             bool operator!=(const param_type& __x, const param_type& __y)
             {return !(__x == __y);}
     };
@@ -59,49 +59,49 @@ class _LIBCPP_TEMPLATE_VIS student_t_distribution
 
 public:
     // constructor and reset functions
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     student_t_distribution() : student_t_distribution(1) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit student_t_distribution(result_type __n)
         : __p_(param_type(__n)) {}
 #else
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit student_t_distribution(result_type __n = 1)
         : __p_(param_type(__n)) {}
 #endif
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit student_t_distribution(const param_type& __p)
         : __p_(__p) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void reset() {__nd_.reset();}
 
     // generating functions
     template<class _URNG>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         result_type operator()(_URNG& __g)
         {return (*this)(__g, __p_);}
     template<class _URNG> result_type operator()(_URNG& __g, const param_type& __p);
 
     // property functions
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type n() const {return __p_.n();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     param_type param() const {return __p_;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void param(const param_type& __p) {__p_ = __p;}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type min() const {return -numeric_limits<result_type>::infinity();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type max() const {return numeric_limits<result_type>::infinity();}
 
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator==(const student_t_distribution& __x,
                         const student_t_distribution& __y)
         {return __x.__p_ == __y.__p_;}
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator!=(const student_t_distribution& __x,
                         const student_t_distribution& __y)
         {return !(__x == __y);}
@@ -112,9 +112,9 @@ template<class _URNG>
 _RealType
 student_t_distribution<_RealType>::operator()(_URNG& __g, const param_type& __p)
 {
-    static_assert(__libcpp_random_is_valid_urng<_URNG>::value, "");
+    static_assert(__LIBCUDACXX_random_is_valid_urng<_URNG>::value, "");
     gamma_distribution<result_type> __gd(__p.n() * .5, 2);
-    return __nd_(__g) * _VSTD::sqrt(__p.n()/__gd(__g));
+    return __nd_(__g) * _CUDA_VSTD::sqrt(__p.n()/__gd(__g));
 }
 
 template <class _CharT, class _Traits, class _RT>
@@ -148,8 +148,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
     return __is;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___RANDOM_STUDENT_T_DISTRIBUTION_H
+#endif // _LIBCUDACXX___RANDOM_STUDENT_T_DISTRIBUTION_H

diff  --git a/libcxx/include/__random/subtract_with_carry_engine.h b/libcxx/include/__random/subtract_with_carry_engine.h
index fdbe2d2e9be3..6e8d2cd31e35 100644
--- a/libcxx/include/__random/subtract_with_carry_engine.h
+++ b/libcxx/include/__random/subtract_with_carry_engine.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___RANDOM_SUBTRACT_WITH_CARRY_ENGINE_H
-#define _LIBCPP___RANDOM_SUBTRACT_WITH_CARRY_ENGINE_H
+#ifndef _LIBCUDACXX___RANDOM_SUBTRACT_WITH_CARRY_ENGINE_H
+#define _LIBCUDACXX___RANDOM_SUBTRACT_WITH_CARRY_ENGINE_H
 
 #include <__algorithm/equal.h>
 #include <__algorithm/min.h>
@@ -20,17 +20,17 @@
 #include <limits>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template<class _UIntType, size_t __w, size_t __s, size_t __r>
-class _LIBCPP_TEMPLATE_VIS subtract_with_carry_engine;
+class _LIBCUDACXX_TEMPLATE_VIS subtract_with_carry_engine;
 
 template<class _UInt, size_t _Wp, size_t _Sp, size_t _Rp>
 bool
@@ -39,7 +39,7 @@ operator==(
     const subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __y);
 
 template<class _UInt, size_t _Wp, size_t _Sp, size_t _Rp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator!=(
     const subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __x,
@@ -58,7 +58,7 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
            subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __x);
 
 template<class _UIntType, size_t __w, size_t __s, size_t __r>
-class _LIBCPP_TEMPLATE_VIS subtract_with_carry_engine
+class _LIBCUDACXX_TEMPLATE_VIS subtract_with_carry_engine
 {
 public:
     // types
@@ -69,49 +69,49 @@ class _LIBCPP_TEMPLATE_VIS subtract_with_carry_engine
     result_type  __c_;
     size_t      __i_;
 
-    static _LIBCPP_CONSTEXPR const result_type _Dt = numeric_limits<result_type>::digits;
+    static _LIBCUDACXX_CONSTEXPR const result_type _Dt = numeric_limits<result_type>::digits;
     static_assert(  0 <  __w, "subtract_with_carry_engine invalid parameters");
     static_assert(__w <= _Dt, "subtract_with_carry_engine invalid parameters");
     static_assert(  0 <  __s, "subtract_with_carry_engine invalid parameters");
     static_assert(__s <  __r, "subtract_with_carry_engine invalid parameters");
 public:
-    static _LIBCPP_CONSTEXPR const result_type _Min = 0;
-    static _LIBCPP_CONSTEXPR const result_type _Max = __w == _Dt ? result_type(~0) :
+    static _LIBCUDACXX_CONSTEXPR const result_type _Min = 0;
+    static _LIBCUDACXX_CONSTEXPR const result_type _Max = __w == _Dt ? result_type(~0) :
                                                       (result_type(1) << __w) - result_type(1);
     static_assert(_Min < _Max, "subtract_with_carry_engine invalid parameters");
 
     // engine characteristics
-    static _LIBCPP_CONSTEXPR const size_t word_size = __w;
-    static _LIBCPP_CONSTEXPR const size_t short_lag = __s;
-    static _LIBCPP_CONSTEXPR const size_t long_lag = __r;
-    _LIBCPP_INLINE_VISIBILITY
-    static _LIBCPP_CONSTEXPR result_type min() { return _Min; }
-    _LIBCPP_INLINE_VISIBILITY
-    static _LIBCPP_CONSTEXPR result_type max() { return _Max; }
-    static _LIBCPP_CONSTEXPR const result_type default_seed = 19780503u;
+    static _LIBCUDACXX_CONSTEXPR const size_t word_size = __w;
+    static _LIBCUDACXX_CONSTEXPR const size_t short_lag = __s;
+    static _LIBCUDACXX_CONSTEXPR const size_t long_lag = __r;
+    _LIBCUDACXX_INLINE_VISIBILITY
+    static _LIBCUDACXX_CONSTEXPR result_type min() { return _Min; }
+    _LIBCUDACXX_INLINE_VISIBILITY
+    static _LIBCUDACXX_CONSTEXPR result_type max() { return _Max; }
+    static _LIBCUDACXX_CONSTEXPR const result_type default_seed = 19780503u;
 
     // constructors and seeding functions
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     subtract_with_carry_engine() : subtract_with_carry_engine(default_seed) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit subtract_with_carry_engine(result_type __sd) { seed(__sd); }
 #else
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit subtract_with_carry_engine(result_type __sd = default_seed) {
       seed(__sd);
     }
 #endif
     template<class _Sseq>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         explicit subtract_with_carry_engine(_Sseq& __q,
         typename enable_if<__is_seed_sequence<_Sseq, subtract_with_carry_engine>::value>::type* = 0)
         {seed(__q);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void seed(result_type __sd = default_seed)
         {seed(__sd, integral_constant<unsigned, 1 + (__w - 1) / 32>());}
     template<class _Sseq>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         typename enable_if
         <
             __is_seed_sequence<_Sseq, subtract_with_carry_engine>::value,
@@ -122,7 +122,7 @@ class _LIBCPP_TEMPLATE_VIS subtract_with_carry_engine
 
     // generating functions
     result_type operator()();
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void discard(unsigned long long __z) {for (; __z; --__z) operator()();}
 
     template<class _UInt, size_t _Wp, size_t _Sp, size_t _Rp>
@@ -164,16 +164,16 @@ class _LIBCPP_TEMPLATE_VIS subtract_with_carry_engine
 };
 
 template<class _UIntType, size_t __w, size_t __s, size_t __r>
-    _LIBCPP_CONSTEXPR const size_t subtract_with_carry_engine<_UIntType, __w, __s, __r>::word_size;
+    _LIBCUDACXX_CONSTEXPR const size_t subtract_with_carry_engine<_UIntType, __w, __s, __r>::word_size;
 
 template<class _UIntType, size_t __w, size_t __s, size_t __r>
-    _LIBCPP_CONSTEXPR const size_t subtract_with_carry_engine<_UIntType, __w, __s, __r>::short_lag;
+    _LIBCUDACXX_CONSTEXPR const size_t subtract_with_carry_engine<_UIntType, __w, __s, __r>::short_lag;
 
 template<class _UIntType, size_t __w, size_t __s, size_t __r>
-    _LIBCPP_CONSTEXPR const size_t subtract_with_carry_engine<_UIntType, __w, __s, __r>::long_lag;
+    _LIBCUDACXX_CONSTEXPR const size_t subtract_with_carry_engine<_UIntType, __w, __s, __r>::long_lag;
 
 template<class _UIntType, size_t __w, size_t __s, size_t __r>
-    _LIBCPP_CONSTEXPR const typename subtract_with_carry_engine<_UIntType, __w, __s, __r>::result_type
+    _LIBCUDACXX_CONSTEXPR const typename subtract_with_carry_engine<_UIntType, __w, __s, __r>::result_type
     subtract_with_carry_engine<_UIntType, __w, __s, __r>::default_seed;
 
 template<class _UIntType, size_t __w, size_t __s, size_t __r>
@@ -259,42 +259,42 @@ operator==(
     if (__x.__c_ != __y.__c_)
         return false;
     if (__x.__i_ == __y.__i_)
-        return _VSTD::equal(__x.__x_, __x.__x_ + _Rp, __y.__x_);
+        return _CUDA_VSTD::equal(__x.__x_, __x.__x_ + _Rp, __y.__x_);
     if (__x.__i_ == 0 || __y.__i_ == 0)
     {
-        size_t __j = _VSTD::min(_Rp - __x.__i_, _Rp - __y.__i_);
-        if (!_VSTD::equal(__x.__x_ + __x.__i_, __x.__x_ + __x.__i_ + __j,
+        size_t __j = _CUDA_VSTD::min(_Rp - __x.__i_, _Rp - __y.__i_);
+        if (!_CUDA_VSTD::equal(__x.__x_ + __x.__i_, __x.__x_ + __x.__i_ + __j,
                          __y.__x_ + __y.__i_))
             return false;
         if (__x.__i_ == 0)
-            return _VSTD::equal(__x.__x_ + __j, __x.__x_ + _Rp, __y.__x_);
-        return _VSTD::equal(__x.__x_, __x.__x_ + (_Rp - __j), __y.__x_ + __j);
+            return _CUDA_VSTD::equal(__x.__x_ + __j, __x.__x_ + _Rp, __y.__x_);
+        return _CUDA_VSTD::equal(__x.__x_, __x.__x_ + (_Rp - __j), __y.__x_ + __j);
     }
     if (__x.__i_ < __y.__i_)
     {
         size_t __j = _Rp - __y.__i_;
-        if (!_VSTD::equal(__x.__x_ + __x.__i_, __x.__x_ + (__x.__i_ + __j),
+        if (!_CUDA_VSTD::equal(__x.__x_ + __x.__i_, __x.__x_ + (__x.__i_ + __j),
                          __y.__x_ + __y.__i_))
             return false;
-        if (!_VSTD::equal(__x.__x_ + (__x.__i_ + __j), __x.__x_ + _Rp,
+        if (!_CUDA_VSTD::equal(__x.__x_ + (__x.__i_ + __j), __x.__x_ + _Rp,
                          __y.__x_))
             return false;
-        return _VSTD::equal(__x.__x_, __x.__x_ + __x.__i_,
+        return _CUDA_VSTD::equal(__x.__x_, __x.__x_ + __x.__i_,
                            __y.__x_ + (_Rp - (__x.__i_ + __j)));
     }
     size_t __j = _Rp - __x.__i_;
-    if (!_VSTD::equal(__y.__x_ + __y.__i_, __y.__x_ + (__y.__i_ + __j),
+    if (!_CUDA_VSTD::equal(__y.__x_ + __y.__i_, __y.__x_ + (__y.__i_ + __j),
                      __x.__x_ + __x.__i_))
         return false;
-    if (!_VSTD::equal(__y.__x_ + (__y.__i_ + __j), __y.__x_ + _Rp,
+    if (!_CUDA_VSTD::equal(__y.__x_ + (__y.__i_ + __j), __y.__x_ + _Rp,
                      __x.__x_))
         return false;
-    return _VSTD::equal(__y.__x_, __y.__x_ + __y.__i_,
+    return _CUDA_VSTD::equal(__y.__x_, __y.__x_ + __y.__i_,
                        __x.__x_ + (_Rp - (__y.__i_ + __j)));
 }
 
 template<class _UInt, size_t _Wp, size_t _Sp, size_t _Rp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator!=(
     const subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __x,
@@ -345,8 +345,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
     return __is;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___RANDOM_SUBTRACT_WITH_CARRY_ENGINE_H
+#endif // _LIBCUDACXX___RANDOM_SUBTRACT_WITH_CARRY_ENGINE_H

diff  --git a/libcxx/include/__random/uniform_int_distribution.h b/libcxx/include/__random/uniform_int_distribution.h
index 46b627f45da9..e91d8c940922 100644
--- a/libcxx/include/__random/uniform_int_distribution.h
+++ b/libcxx/include/__random/uniform_int_distribution.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___RANDOM_UNIFORM_INT_DISTRIBUTION_H
-#define _LIBCPP___RANDOM_UNIFORM_INT_DISTRIBUTION_H
+#ifndef _LIBCUDACXX___RANDOM_UNIFORM_INT_DISTRIBUTION_H
+#define _LIBCUDACXX___RANDOM_UNIFORM_INT_DISTRIBUTION_H
 
 #include <__bits>
 #include <__config>
@@ -20,14 +20,14 @@
 #include <limits>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template<class _Engine, class _UIntType>
 class __independent_bits_engine
@@ -55,16 +55,16 @@ class __independent_bits_engine
     _Engine_result_type __mask0_;
     _Engine_result_type __mask1_;
 
-#ifdef _LIBCPP_CXX03_LANG
+#ifdef _LIBCUDACXX_CXX03_LANG
     static const _Working_result_type _Rp = _Engine::_Max - _Engine::_Min
                                           + _Working_result_type(1);
 #else
-    static _LIBCPP_CONSTEXPR const _Working_result_type _Rp = _Engine::max() - _Engine::min()
+    static _LIBCUDACXX_CONSTEXPR const _Working_result_type _Rp = _Engine::max() - _Engine::min()
                                                       + _Working_result_type(1);
 #endif
-    static _LIBCPP_CONSTEXPR const size_t __m = __log2<_Working_result_type, _Rp>::value;
-    static _LIBCPP_CONSTEXPR const size_t _WDt = numeric_limits<_Working_result_type>::digits;
-    static _LIBCPP_CONSTEXPR const size_t _EDt = numeric_limits<_Engine_result_type>::digits;
+    static _LIBCUDACXX_CONSTEXPR const size_t __m = __log2<_Working_result_type, _Rp>::value;
+    static _LIBCUDACXX_CONSTEXPR const size_t _WDt = numeric_limits<_Working_result_type>::digits;
+    static _LIBCUDACXX_CONSTEXPR const size_t _EDt = numeric_limits<_Engine_result_type>::digits;
 
 public:
     // constructors and seeding functions
@@ -159,7 +159,7 @@ __independent_bits_engine<_Engine, _UIntType>::__eval(true_type)
 template<class _IntType = int>
 class uniform_int_distribution
 {
-    static_assert(__libcpp_random_is_valid_inttype<_IntType>::value, "IntType must be a supported integer type");
+    static_assert(__LIBCUDACXX_random_is_valid_inttype<_IntType>::value, "IntType must be a supported integer type");
 public:
     // types
     typedef _IntType result_type;
@@ -189,7 +189,7 @@ class uniform_int_distribution
 
 public:
     // constructors and reset functions
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
     uniform_int_distribution() : uniform_int_distribution(0) {}
     explicit uniform_int_distribution(
         result_type __a, result_type __b = numeric_limits<result_type>::max())
@@ -230,9 +230,9 @@ template<class _IntType>
 template<class _URNG>
 typename uniform_int_distribution<_IntType>::result_type
 uniform_int_distribution<_IntType>::operator()(_URNG& __g, const param_type& __p)
-_LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
+_LIBCUDACXX_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
 {
-    static_assert(__libcpp_random_is_valid_urng<_URNG>::value, "");
+    static_assert(__LIBCUDACXX_random_is_valid_urng<_URNG>::value, "");
     typedef typename conditional<sizeof(result_type) <= sizeof(uint32_t), uint32_t,
                                  typename make_unsigned<result_type>::type>::type _UIntType;
     const _UIntType _Rp = _UIntType(__p.b()) - _UIntType(__p.a()) + _UIntType(1);
@@ -286,8 +286,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
     return __is;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___RANDOM_UNIFORM_INT_DISTRIBUTION_H
+#endif // _LIBCUDACXX___RANDOM_UNIFORM_INT_DISTRIBUTION_H

diff  --git a/libcxx/include/__random/uniform_random_bit_generator.h b/libcxx/include/__random/uniform_random_bit_generator.h
index 84a30b0ebe16..4084055095ba 100644
--- a/libcxx/include/__random/uniform_random_bit_generator.h
+++ b/libcxx/include/__random/uniform_random_bit_generator.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___RANDOM_UNIFORM_RANDOM_BIT_GENERATOR_H
-#define _LIBCPP___RANDOM_UNIFORM_RANDOM_BIT_GENERATOR_H
+#ifndef _LIBCUDACXX___RANDOM_UNIFORM_RANDOM_BIT_GENERATOR_H
+#define _LIBCUDACXX___RANDOM_UNIFORM_RANDOM_BIT_GENERATOR_H
 
 #include <__concepts/arithmetic.h>
 #include <__concepts/invocable.h>
@@ -15,16 +15,16 @@
 #include <__config>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 // [rand.req.urng]
 template<class _Gen>
@@ -36,10 +36,10 @@ concept uniform_random_bit_generator =
     requires bool_constant<(_Gen::min() < _Gen::max())>::value;
   };
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___RANDOM_UNIFORM_RANDOM_BIT_GENERATOR_H
+#endif // _LIBCUDACXX___RANDOM_UNIFORM_RANDOM_BIT_GENERATOR_H

diff  --git a/libcxx/include/__random/uniform_real_distribution.h b/libcxx/include/__random/uniform_real_distribution.h
index 7d2ecda732fe..f3416371d446 100644
--- a/libcxx/include/__random/uniform_real_distribution.h
+++ b/libcxx/include/__random/uniform_real_distribution.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___RANDOM_UNIFORM_REAL_DISTRIBUTION_H
-#define _LIBCPP___RANDOM_UNIFORM_REAL_DISTRIBUTION_H
+#ifndef _LIBCUDACXX___RANDOM_UNIFORM_REAL_DISTRIBUTION_H
+#define _LIBCUDACXX___RANDOM_UNIFORM_REAL_DISTRIBUTION_H
 
 #include <__config>
 #include <__random/generate_canonical.h>
@@ -16,43 +16,43 @@
 #include <limits>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template<class _RealType = double>
-class _LIBCPP_TEMPLATE_VIS uniform_real_distribution
+class _LIBCUDACXX_TEMPLATE_VIS uniform_real_distribution
 {
 public:
     // types
     typedef _RealType result_type;
 
-    class _LIBCPP_TEMPLATE_VIS param_type
+    class _LIBCUDACXX_TEMPLATE_VIS param_type
     {
         result_type __a_;
         result_type __b_;
     public:
         typedef uniform_real_distribution distribution_type;
 
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         explicit param_type(result_type __a = 0,
                             result_type __b = 1)
             : __a_(__a), __b_(__b) {}
 
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         result_type a() const {return __a_;}
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         result_type b() const {return __b_;}
 
-        friend _LIBCPP_INLINE_VISIBILITY
+        friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator==(const param_type& __x, const param_type& __y)
             {return __x.__a_ == __y.__a_ && __x.__b_ == __y.__b_;}
-        friend _LIBCPP_INLINE_VISIBILITY
+        friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator!=(const param_type& __x, const param_type& __y)
             {return !(__x == __y);}
     };
@@ -62,49 +62,49 @@ class _LIBCPP_TEMPLATE_VIS uniform_real_distribution
 
 public:
     // constructors and reset functions
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     uniform_real_distribution() : uniform_real_distribution(0) {}
     explicit uniform_real_distribution(result_type __a, result_type __b = 1)
         : __p_(param_type(__a, __b)) {}
 #else
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit uniform_real_distribution(result_type __a = 0, result_type __b = 1)
         : __p_(param_type(__a, __b)) {}
 #endif
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit uniform_real_distribution(const param_type& __p) : __p_(__p) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void reset() {}
 
     // generating functions
     template<class _URNG>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         result_type operator()(_URNG& __g)
         {return (*this)(__g, __p_);}
-    template<class _URNG> _LIBCPP_INLINE_VISIBILITY result_type operator()(_URNG& __g, const param_type& __p);
+    template<class _URNG> _LIBCUDACXX_INLINE_VISIBILITY result_type operator()(_URNG& __g, const param_type& __p);
 
     // property functions
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type a() const {return __p_.a();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type b() const {return __p_.b();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     param_type param() const {return __p_;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void param(const param_type& __p) {__p_ = __p;}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type min() const {return a();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type max() const {return b();}
 
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator==(const uniform_real_distribution& __x,
                         const uniform_real_distribution& __y)
         {return __x.__p_ == __y.__p_;}
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator!=(const uniform_real_distribution& __x,
                         const uniform_real_distribution& __y)
         {return !(__x == __y);}
@@ -116,9 +116,9 @@ inline
 typename uniform_real_distribution<_RealType>::result_type
 uniform_real_distribution<_RealType>::operator()(_URNG& __g, const param_type& __p)
 {
-    static_assert(__libcpp_random_is_valid_urng<_URNG>::value, "");
+    static_assert(__LIBCUDACXX_random_is_valid_urng<_URNG>::value, "");
     return (__p.b() - __p.a())
-        * _VSTD::generate_canonical<_RealType, numeric_limits<_RealType>::digits>(__g)
+        * _CUDA_VSTD::generate_canonical<_RealType, numeric_limits<_RealType>::digits>(__g)
         + __p.a();
 }
 
@@ -155,8 +155,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
     return __is;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___RANDOM_UNIFORM_REAL_DISTRIBUTION_H
+#endif // _LIBCUDACXX___RANDOM_UNIFORM_REAL_DISTRIBUTION_H

diff  --git a/libcxx/include/__random/weibull_distribution.h b/libcxx/include/__random/weibull_distribution.h
index 85bae65096cb..89c5add99516 100644
--- a/libcxx/include/__random/weibull_distribution.h
+++ b/libcxx/include/__random/weibull_distribution.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___RANDOM_WEIBULL_DISTRIBUTION_H
-#define _LIBCPP___RANDOM_WEIBULL_DISTRIBUTION_H
+#ifndef _LIBCUDACXX___RANDOM_WEIBULL_DISTRIBUTION_H
+#define _LIBCUDACXX___RANDOM_WEIBULL_DISTRIBUTION_H
 
 #include <__config>
 #include <__random/exponential_distribution.h>
@@ -15,42 +15,42 @@
 #include <iosfwd>
 #include <limits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template<class _RealType = double>
-class _LIBCPP_TEMPLATE_VIS weibull_distribution
+class _LIBCUDACXX_TEMPLATE_VIS weibull_distribution
 {
 public:
     // types
     typedef _RealType result_type;
 
-    class _LIBCPP_TEMPLATE_VIS param_type
+    class _LIBCUDACXX_TEMPLATE_VIS param_type
     {
         result_type __a_;
         result_type __b_;
     public:
         typedef weibull_distribution distribution_type;
 
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         explicit param_type(result_type __a = 1, result_type __b = 1)
             : __a_(__a), __b_(__b) {}
 
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         result_type a() const {return __a_;}
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         result_type b() const {return __b_;}
 
-        friend _LIBCPP_INLINE_VISIBILITY
+        friend _LIBCUDACXX_INLINE_VISIBILITY
             bool operator==(const param_type& __x, const param_type& __y)
             {return __x.__a_ == __y.__a_ && __x.__b_ == __y.__b_;}
-        friend _LIBCPP_INLINE_VISIBILITY
+        friend _LIBCUDACXX_INLINE_VISIBILITY
             bool operator!=(const param_type& __x, const param_type& __y)
             {return !(__x == __y);}
     };
@@ -60,55 +60,55 @@ class _LIBCPP_TEMPLATE_VIS weibull_distribution
 
 public:
     // constructor and reset functions
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     weibull_distribution() : weibull_distribution(1) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit weibull_distribution(result_type __a, result_type __b = 1)
         : __p_(param_type(__a, __b)) {}
 #else
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit weibull_distribution(result_type __a = 1, result_type __b = 1)
         : __p_(param_type(__a, __b)) {}
 #endif
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit weibull_distribution(const param_type& __p)
         : __p_(__p) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void reset() {}
 
     // generating functions
     template<class _URNG>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         result_type operator()(_URNG& __g)
         {return (*this)(__g, __p_);}
     template<class _URNG>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         result_type operator()(_URNG& __g, const param_type& __p)
         {return __p.b() *
-            _VSTD::pow(exponential_distribution<result_type>()(__g), 1/__p.a());}
+            _CUDA_VSTD::pow(exponential_distribution<result_type>()(__g), 1/__p.a());}
 
     // property functions
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type a() const {return __p_.a();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type b() const {return __p_.b();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     param_type param() const {return __p_;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void param(const param_type& __p) {__p_ = __p;}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type min() const {return 0;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     result_type max() const {return numeric_limits<result_type>::infinity();}
 
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator==(const weibull_distribution& __x,
                         const weibull_distribution& __y)
         {return __x.__p_ == __y.__p_;}
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator!=(const weibull_distribution& __x,
                         const weibull_distribution& __y)
         {return !(__x == __y);}
@@ -148,8 +148,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
     return __is;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___RANDOM_WEIBULL_DISTRIBUTION_H
+#endif // _LIBCUDACXX___RANDOM_WEIBULL_DISTRIBUTION_H

diff  --git a/libcxx/include/__ranges/access.h b/libcxx/include/__ranges/access.h
index 0f1cca033a23..af1613af4a50 100644
--- a/libcxx/include/__ranges/access.h
+++ b/libcxx/include/__ranges/access.h
@@ -6,8 +6,8 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-#ifndef _LIBCPP___RANGES_ACCESS_H
-#define _LIBCPP___RANGES_ACCESS_H
+#ifndef _LIBCUDACXX___RANGES_ACCESS_H
+#define _LIBCUDACXX___RANGES_ACCESS_H
 
 #include <__concepts/class_or_enum.h>
 #include <__config>
@@ -17,13 +17,13 @@
 #include <__utility/auto_cast.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 namespace ranges {
   template <class _Tp>
@@ -40,7 +40,7 @@ namespace __begin {
     __can_borrow<_Tp> &&
     __workaround_52970<_Tp> &&
     requires(_Tp&& __t) {
-      { _LIBCPP_AUTO_CAST(__t.begin()) } -> input_or_output_iterator;
+      { _LIBCUDACXX_AUTO_CAST(__t.begin()) } -> input_or_output_iterator;
     };
 
   void begin(auto&) = delete;
@@ -52,19 +52,19 @@ namespace __begin {
     __can_borrow<_Tp> &&
     __class_or_enum<remove_cvref_t<_Tp>> &&
     requires(_Tp && __t) {
-      { _LIBCPP_AUTO_CAST(begin(__t)) } -> input_or_output_iterator;
+      { _LIBCUDACXX_AUTO_CAST(begin(__t)) } -> input_or_output_iterator;
     };
 
   struct __fn {
     template <class _Tp>
-    [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp (&__t)[]) const noexcept
+    [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp (&__t)[]) const noexcept
       requires (sizeof(_Tp) >= 0)  // Disallow incomplete element types.
     {
       return __t + 0;
     }
 
     template <class _Tp, size_t _Np>
-    [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp (&__t)[_Np]) const noexcept
+    [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp (&__t)[_Np]) const noexcept
       requires (sizeof(_Tp) >= 0)  // Disallow incomplete element types.
     {
       return __t + 0;
@@ -72,18 +72,18 @@ namespace __begin {
 
     template <class _Tp>
       requires __member_begin<_Tp>
-    [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const
-      noexcept(noexcept(_LIBCPP_AUTO_CAST(__t.begin())))
+    [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const
+      noexcept(noexcept(_LIBCUDACXX_AUTO_CAST(__t.begin())))
     {
-      return _LIBCPP_AUTO_CAST(__t.begin());
+      return _LIBCUDACXX_AUTO_CAST(__t.begin());
     }
 
     template <class _Tp>
       requires __unqualified_begin<_Tp>
-    [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const
-      noexcept(noexcept(_LIBCPP_AUTO_CAST(begin(__t))))
+    [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const
+      noexcept(noexcept(_LIBCUDACXX_AUTO_CAST(begin(__t))))
     {
-      return _LIBCPP_AUTO_CAST(begin(__t));
+      return _LIBCUDACXX_AUTO_CAST(begin(__t));
     }
 
     void operator()(auto&&) const = delete;
@@ -112,7 +112,7 @@ namespace __end {
     __workaround_52970<_Tp> &&
     requires(_Tp&& __t) {
       typename iterator_t<_Tp>;
-      { _LIBCPP_AUTO_CAST(__t.end()) } -> sentinel_for<iterator_t<_Tp>>;
+      { _LIBCUDACXX_AUTO_CAST(__t.end()) } -> sentinel_for<iterator_t<_Tp>>;
     };
 
   void end(auto&) = delete;
@@ -125,12 +125,12 @@ namespace __end {
     __class_or_enum<remove_cvref_t<_Tp>> &&
     requires(_Tp && __t) {
       typename iterator_t<_Tp>;
-      { _LIBCPP_AUTO_CAST(end(__t)) } -> sentinel_for<iterator_t<_Tp>>;
+      { _LIBCUDACXX_AUTO_CAST(end(__t)) } -> sentinel_for<iterator_t<_Tp>>;
     };
 
   struct __fn {
     template <class _Tp, size_t _Np>
-    [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp (&__t)[_Np]) const noexcept
+    [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp (&__t)[_Np]) const noexcept
       requires (sizeof(_Tp) >= 0)  // Disallow incomplete element types.
     {
       return __t + _Np;
@@ -138,18 +138,18 @@ namespace __end {
 
     template <class _Tp>
       requires __member_end<_Tp>
-    [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const
-      noexcept(noexcept(_LIBCPP_AUTO_CAST(__t.end())))
+    [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const
+      noexcept(noexcept(_LIBCUDACXX_AUTO_CAST(__t.end())))
     {
-      return _LIBCPP_AUTO_CAST(__t.end());
+      return _LIBCUDACXX_AUTO_CAST(__t.end());
     }
 
     template <class _Tp>
       requires __unqualified_end<_Tp>
-    [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const
-      noexcept(noexcept(_LIBCPP_AUTO_CAST(end(__t))))
+    [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const
+      noexcept(noexcept(_LIBCUDACXX_AUTO_CAST(end(__t))))
     {
-      return _LIBCPP_AUTO_CAST(end(__t));
+      return _LIBCUDACXX_AUTO_CAST(end(__t));
     }
 
     void operator()(auto&&) const = delete;
@@ -168,7 +168,7 @@ namespace __cbegin {
   struct __fn {
     template <class _Tp>
       requires is_lvalue_reference_v<_Tp&&>
-    [[nodiscard]] _LIBCPP_HIDE_FROM_ABI
+    [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI
     constexpr auto operator()(_Tp&& __t) const
       noexcept(noexcept(ranges::begin(static_cast<const remove_reference_t<_Tp>&>(__t))))
       -> decltype(      ranges::begin(static_cast<const remove_reference_t<_Tp>&>(__t)))
@@ -176,7 +176,7 @@ namespace __cbegin {
 
     template <class _Tp>
       requires is_rvalue_reference_v<_Tp&&>
-    [[nodiscard]] _LIBCPP_HIDE_FROM_ABI
+    [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI
     constexpr auto operator()(_Tp&& __t) const
       noexcept(noexcept(ranges::begin(static_cast<const _Tp&&>(__t))))
       -> decltype(      ranges::begin(static_cast<const _Tp&&>(__t)))
@@ -196,7 +196,7 @@ namespace __cend {
   struct __fn {
     template <class _Tp>
       requires is_lvalue_reference_v<_Tp&&>
-    [[nodiscard]] _LIBCPP_HIDE_FROM_ABI
+    [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI
     constexpr auto operator()(_Tp&& __t) const
       noexcept(noexcept(ranges::end(static_cast<const remove_reference_t<_Tp>&>(__t))))
       -> decltype(      ranges::end(static_cast<const remove_reference_t<_Tp>&>(__t)))
@@ -204,7 +204,7 @@ namespace __cend {
 
     template <class _Tp>
       requires is_rvalue_reference_v<_Tp&&>
-    [[nodiscard]] _LIBCPP_HIDE_FROM_ABI
+    [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI
     constexpr auto operator()(_Tp&& __t) const
       noexcept(noexcept(ranges::end(static_cast<const _Tp&&>(__t))))
       -> decltype(      ranges::end(static_cast<const _Tp&&>(__t)))
@@ -217,8 +217,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___RANGES_ACCESS_H
+#endif // _LIBCUDACXX___RANGES_ACCESS_H

diff  --git a/libcxx/include/__ranges/all.h b/libcxx/include/__ranges/all.h
index 181477419c85..687b78d5bb61 100644
--- a/libcxx/include/__ranges/all.h
+++ b/libcxx/include/__ranges/all.h
@@ -6,8 +6,8 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-#ifndef _LIBCPP___RANGES_ALL_H
-#define _LIBCPP___RANGES_ALL_H
+#ifndef _LIBCUDACXX___RANGES_ALL_H
+#define _LIBCUDACXX___RANGES_ALL_H
 
 #include <__config>
 #include <__iterator/concepts.h>
@@ -22,13 +22,13 @@
 #include <__utility/forward.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
 namespace ranges::views {
 
@@ -36,18 +36,18 @@ namespace __all {
   struct __fn : __range_adaptor_closure<__fn> {
     template<class _Tp>
       requires ranges::view<decay_t<_Tp>>
-    [[nodiscard]] _LIBCPP_HIDE_FROM_ABI
+    [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI
     constexpr auto operator()(_Tp&& __t) const
-      noexcept(noexcept(_LIBCPP_AUTO_CAST(std::forward<_Tp>(__t))))
-      -> decltype(_LIBCPP_AUTO_CAST(std::forward<_Tp>(__t)))
+      noexcept(noexcept(_LIBCUDACXX_AUTO_CAST(std::forward<_Tp>(__t))))
+      -> decltype(_LIBCUDACXX_AUTO_CAST(std::forward<_Tp>(__t)))
     {
-      return _LIBCPP_AUTO_CAST(std::forward<_Tp>(__t));
+      return _LIBCUDACXX_AUTO_CAST(std::forward<_Tp>(__t));
     }
 
     template<class _Tp>
       requires (!ranges::view<decay_t<_Tp>>) &&
                requires (_Tp&& __t) { ranges::ref_view{std::forward<_Tp>(__t)}; }
-    [[nodiscard]] _LIBCPP_HIDE_FROM_ABI
+    [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI
     constexpr auto operator()(_Tp&& __t) const
       noexcept(noexcept(ranges::ref_view{std::forward<_Tp>(__t)}))
     {
@@ -58,7 +58,7 @@ namespace __all {
       requires (!ranges::view<decay_t<_Tp>> &&
                 !requires (_Tp&& __t) { ranges::ref_view{std::forward<_Tp>(__t)}; } &&
                  requires (_Tp&& __t) { ranges::owning_view{std::forward<_Tp>(__t)}; })
-    [[nodiscard]] _LIBCPP_HIDE_FROM_ABI
+    [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI
     constexpr auto operator()(_Tp&& __t) const
       noexcept(noexcept(ranges::owning_view{std::forward<_Tp>(__t)}))
     {
@@ -76,8 +76,8 @@ using all_t = decltype(views::all(declval<_Range>()));
 
 } // namespace ranges::views
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___RANGES_ALL_H
+#endif // _LIBCUDACXX___RANGES_ALL_H

diff  --git a/libcxx/include/__ranges/common_view.h b/libcxx/include/__ranges/common_view.h
index 61b9b61f26aa..091a2719fc27 100644
--- a/libcxx/include/__ranges/common_view.h
+++ b/libcxx/include/__ranges/common_view.h
@@ -6,8 +6,8 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-#ifndef _LIBCPP___RANGES_COMMON_VIEW_H
-#define _LIBCPP___RANGES_COMMON_VIEW_H
+#ifndef _LIBCUDACXX___RANGES_COMMON_VIEW_H
+#define _LIBCUDACXX___RANGES_COMMON_VIEW_H
 
 #include <__config>
 #include <__iterator/common_iterator.h>
@@ -24,13 +24,13 @@
 #include <concepts>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
 namespace ranges {
 
@@ -40,19 +40,19 @@ class common_view : public view_interface<common_view<_View>> {
   _View __base_ = _View();
 
 public:
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   common_view() requires default_initializable<_View> = default;
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr explicit common_view(_View __v) : __base_(std::move(__v)) { }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr _View base() const& requires copy_constructible<_View> { return __base_; }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr _View base() && { return std::move(__base_); }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto begin() {
     if constexpr (random_access_range<_View> && sized_range<_View>)
       return ranges::begin(__base_);
@@ -60,7 +60,7 @@ class common_view : public view_interface<common_view<_View>> {
       return common_iterator<iterator_t<_View>, sentinel_t<_View>>(ranges::begin(__base_));
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto begin() const requires range<const _View> {
     if constexpr (random_access_range<const _View> && sized_range<const _View>)
       return ranges::begin(__base_);
@@ -68,7 +68,7 @@ class common_view : public view_interface<common_view<_View>> {
       return common_iterator<iterator_t<const _View>, sentinel_t<const _View>>(ranges::begin(__base_));
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto end() {
     if constexpr (random_access_range<_View> && sized_range<_View>)
       return ranges::begin(__base_) + ranges::size(__base_);
@@ -76,7 +76,7 @@ class common_view : public view_interface<common_view<_View>> {
       return common_iterator<iterator_t<_View>, sentinel_t<_View>>(ranges::end(__base_));
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto end() const requires range<const _View> {
     if constexpr (random_access_range<const _View> && sized_range<const _View>)
       return ranges::begin(__base_) + ranges::size(__base_);
@@ -84,12 +84,12 @@ class common_view : public view_interface<common_view<_View>> {
       return common_iterator<iterator_t<const _View>, sentinel_t<const _View>>(ranges::end(__base_));
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto size() requires sized_range<_View> {
     return ranges::size(__base_);
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto size() const requires sized_range<const _View> {
     return ranges::size(__base_);
   }
@@ -107,14 +107,14 @@ namespace __common {
   struct __fn : __range_adaptor_closure<__fn> {
     template<class _Range>
       requires common_range<_Range>
-    [[nodiscard]] _LIBCPP_HIDE_FROM_ABI
+    [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI
     constexpr auto operator()(_Range&& __range) const
       noexcept(noexcept(views::all(std::forward<_Range>(__range))))
       -> decltype(      views::all(std::forward<_Range>(__range)))
       { return          views::all(std::forward<_Range>(__range)); }
 
     template<class _Range>
-    [[nodiscard]] _LIBCPP_HIDE_FROM_ABI
+    [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI
     constexpr auto operator()(_Range&& __range) const
       noexcept(noexcept(common_view{std::forward<_Range>(__range)}))
       -> decltype(      common_view{std::forward<_Range>(__range)})
@@ -128,8 +128,8 @@ inline namespace __cpo {
 } // namespace views
 } // namespace ranges
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___RANGES_COMMON_VIEW_H
+#endif // _LIBCUDACXX___RANGES_COMMON_VIEW_H

diff  --git a/libcxx/include/__ranges/concepts.h b/libcxx/include/__ranges/concepts.h
index 87df1d18baf8..47c25c699d3c 100644
--- a/libcxx/include/__ranges/concepts.h
+++ b/libcxx/include/__ranges/concepts.h
@@ -6,8 +6,8 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-#ifndef _LIBCPP___RANGES_CONCEPTS_H
-#define _LIBCPP___RANGES_CONCEPTS_H
+#ifndef _LIBCUDACXX___RANGES_CONCEPTS_H
+#define _LIBCUDACXX___RANGES_CONCEPTS_H
 
 #include <__concepts/constructible.h>
 #include <__concepts/movable.h>
@@ -26,13 +26,13 @@
 #include <initializer_list>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 namespace ranges {
 
@@ -135,8 +135,8 @@ namespace ranges {
 
 } // namespace ranges
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___RANGES_CONCEPTS_H
+#endif // _LIBCUDACXX___RANGES_CONCEPTS_H

diff  --git a/libcxx/include/__ranges/copyable_box.h b/libcxx/include/__ranges/copyable_box.h
index 6012497db5e8..851752bd2c84 100644
--- a/libcxx/include/__ranges/copyable_box.h
+++ b/libcxx/include/__ranges/copyable_box.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___RANGES_COPYABLE_BOX_H
-#define _LIBCPP___RANGES_COPYABLE_BOX_H
+#ifndef _LIBCUDACXX___RANGES_COPYABLE_BOX_H
+#define _LIBCUDACXX___RANGES_COPYABLE_BOX_H
 
 #include <__config>
 #include <__memory/addressof.h>
@@ -18,13 +18,13 @@
 #include <optional>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
 // __copyable_box allows turning a type that is copy-constructible (but maybe not copy-assignable) into
 // a type that is both copy-constructible and copy-assignable. It does that by introducing an empty state
@@ -41,27 +41,27 @@ namespace ranges {
   // Primary template - uses std::optional and introduces an empty state in case assignment fails.
   template<__copy_constructible_object _Tp>
   class __copyable_box {
-    _LIBCPP_NO_UNIQUE_ADDRESS optional<_Tp> __val_;
+    _LIBCUDACXX_NO_UNIQUE_ADDRESS optional<_Tp> __val_;
 
   public:
     template<class ..._Args>
       requires is_constructible_v<_Tp, _Args...>
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr explicit __copyable_box(in_place_t, _Args&& ...__args)
       noexcept(is_nothrow_constructible_v<_Tp, _Args...>)
       : __val_(in_place, std::forward<_Args>(__args)...)
     { }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr __copyable_box() noexcept(is_nothrow_default_constructible_v<_Tp>)
       requires default_initializable<_Tp>
       : __val_(in_place)
     { }
 
-    _LIBCPP_HIDE_FROM_ABI __copyable_box(__copyable_box const&) = default;
-    _LIBCPP_HIDE_FROM_ABI __copyable_box(__copyable_box&&) = default;
+    _LIBCUDACXX_HIDE_FROM_ABI __copyable_box(__copyable_box const&) = default;
+    _LIBCUDACXX_HIDE_FROM_ABI __copyable_box(__copyable_box&&) = default;
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr __copyable_box& operator=(__copyable_box const& __other)
       noexcept(is_nothrow_copy_constructible_v<_Tp>)
     {
@@ -72,10 +72,10 @@ namespace ranges {
       return *this;
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     __copyable_box& operator=(__copyable_box&&) requires movable<_Tp> = default;
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr __copyable_box& operator=(__copyable_box&& __other)
       noexcept(is_nothrow_move_constructible_v<_Tp>)
     {
@@ -86,13 +86,13 @@ namespace ranges {
       return *this;
     }
 
-    _LIBCPP_HIDE_FROM_ABI constexpr _Tp const& operator*() const noexcept { return *__val_; }
-    _LIBCPP_HIDE_FROM_ABI constexpr _Tp& operator*() noexcept { return *__val_; }
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr _Tp const& operator*() const noexcept { return *__val_; }
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr _Tp& operator*() noexcept { return *__val_; }
 
-    _LIBCPP_HIDE_FROM_ABI constexpr const _Tp *operator->() const noexcept { return __val_.operator->(); }
-    _LIBCPP_HIDE_FROM_ABI constexpr _Tp *operator->() noexcept { return __val_.operator->(); }
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr const _Tp *operator->() const noexcept { return __val_.operator->(); }
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr _Tp *operator->() noexcept { return __val_.operator->(); }
 
-    _LIBCPP_HIDE_FROM_ABI constexpr bool __has_value() const noexcept { return __val_.has_value(); }
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr bool __has_value() const noexcept { return __val_.has_value(); }
   };
 
   // This partial specialization implements an optimization for when we know we don't need to store
@@ -116,32 +116,32 @@ namespace ranges {
   template<__copy_constructible_object _Tp>
     requires __doesnt_need_empty_state_for_copy<_Tp> && __doesnt_need_empty_state_for_move<_Tp>
   class __copyable_box<_Tp> {
-    _LIBCPP_NO_UNIQUE_ADDRESS _Tp __val_;
+    _LIBCUDACXX_NO_UNIQUE_ADDRESS _Tp __val_;
 
   public:
     template<class ..._Args>
       requires is_constructible_v<_Tp, _Args...>
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr explicit __copyable_box(in_place_t, _Args&& ...__args)
       noexcept(is_nothrow_constructible_v<_Tp, _Args...>)
       : __val_(std::forward<_Args>(__args)...)
     { }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr __copyable_box() noexcept(is_nothrow_default_constructible_v<_Tp>)
       requires default_initializable<_Tp>
       : __val_()
     { }
 
-    _LIBCPP_HIDE_FROM_ABI __copyable_box(__copyable_box const&) = default;
-    _LIBCPP_HIDE_FROM_ABI __copyable_box(__copyable_box&&) = default;
+    _LIBCUDACXX_HIDE_FROM_ABI __copyable_box(__copyable_box const&) = default;
+    _LIBCUDACXX_HIDE_FROM_ABI __copyable_box(__copyable_box&&) = default;
 
     // Implementation of assignment operators in case we perform optimization (1)
-    _LIBCPP_HIDE_FROM_ABI __copyable_box& operator=(__copyable_box const&) requires copyable<_Tp> = default;
-    _LIBCPP_HIDE_FROM_ABI __copyable_box& operator=(__copyable_box&&) requires movable<_Tp> = default;
+    _LIBCUDACXX_HIDE_FROM_ABI __copyable_box& operator=(__copyable_box const&) requires copyable<_Tp> = default;
+    _LIBCUDACXX_HIDE_FROM_ABI __copyable_box& operator=(__copyable_box&&) requires movable<_Tp> = default;
 
     // Implementation of assignment operators in case we perform optimization (2)
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr __copyable_box& operator=(__copyable_box const& __other) noexcept {
       static_assert(is_nothrow_copy_constructible_v<_Tp>);
       if (this != std::addressof(__other)) {
@@ -151,7 +151,7 @@ namespace ranges {
       return *this;
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr __copyable_box& operator=(__copyable_box&& __other) noexcept {
       static_assert(is_nothrow_move_constructible_v<_Tp>);
       if (this != std::addressof(__other)) {
@@ -161,18 +161,18 @@ namespace ranges {
       return *this;
     }
 
-    _LIBCPP_HIDE_FROM_ABI constexpr _Tp const& operator*() const noexcept { return __val_; }
-    _LIBCPP_HIDE_FROM_ABI constexpr _Tp& operator*() noexcept { return __val_; }
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr _Tp const& operator*() const noexcept { return __val_; }
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr _Tp& operator*() noexcept { return __val_; }
 
-    _LIBCPP_HIDE_FROM_ABI constexpr const _Tp *operator->() const noexcept { return std::addressof(__val_); }
-    _LIBCPP_HIDE_FROM_ABI constexpr _Tp *operator->() noexcept { return std::addressof(__val_); }
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr const _Tp *operator->() const noexcept { return std::addressof(__val_); }
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr _Tp *operator->() noexcept { return std::addressof(__val_); }
 
-    _LIBCPP_HIDE_FROM_ABI constexpr bool __has_value() const noexcept { return true; }
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr bool __has_value() const noexcept { return true; }
   };
 } // namespace ranges
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___RANGES_COPYABLE_BOX_H
+#endif // _LIBCUDACXX___RANGES_COPYABLE_BOX_H

diff  --git a/libcxx/include/__ranges/counted.h b/libcxx/include/__ranges/counted.h
index f45f1e890085..374c171dd5f3 100644
--- a/libcxx/include/__ranges/counted.h
+++ b/libcxx/include/__ranges/counted.h
@@ -6,8 +6,8 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-#ifndef _LIBCPP___RANGES_COUNTED_H
-#define _LIBCPP___RANGES_COUNTED_H
+#ifndef _LIBCUDACXX___RANGES_COUNTED_H
+#define _LIBCUDACXX___RANGES_COUNTED_H
 
 #include <__concepts/convertible_to.h>
 #include <__config>
@@ -23,13 +23,13 @@
 #include <span>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
 namespace ranges::views {
 
@@ -37,21 +37,21 @@ namespace __counted {
 
   struct __fn {
     template<contiguous_iterator _It>
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     static constexpr auto __go(_It __it, iter_
diff erence_t<_It> __count)
       noexcept(noexcept(span(std::to_address(__it), static_cast<size_t>(__count))))
       // Deliberately omit return-type SFINAE, because to_address is not SFINAE-friendly
       { return          span(std::to_address(__it), static_cast<size_t>(__count)); }
 
     template<random_access_iterator _It>
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     static constexpr auto __go(_It __it, iter_
diff erence_t<_It> __count)
       noexcept(noexcept(subrange(__it, __it + __count)))
       -> decltype(      subrange(__it, __it + __count))
       { return          subrange(__it, __it + __count); }
 
     template<class _It>
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     static constexpr auto __go(_It __it, iter_
diff erence_t<_It> __count)
       noexcept(noexcept(subrange(counted_iterator(std::move(__it), __count), default_sentinel)))
       -> decltype(      subrange(counted_iterator(std::move(__it), __count), default_sentinel))
@@ -59,7 +59,7 @@ namespace __counted {
 
     template<class _It, convertible_to<iter_
diff erence_t<_It>> _Diff>
       requires input_or_output_iterator<decay_t<_It>>
-    [[nodiscard]] _LIBCPP_HIDE_FROM_ABI
+    [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI
     constexpr auto operator()(_It&& __it, _Diff&& __count) const
       noexcept(noexcept(__go(std::forward<_It>(__it), std::forward<_Diff>(__count))))
       -> decltype(      __go(std::forward<_It>(__it), std::forward<_Diff>(__count)))
@@ -74,8 +74,8 @@ inline namespace __cpo {
 
 } // namespace ranges::views
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___RANGES_COUNTED_H
+#endif // _LIBCUDACXX___RANGES_COUNTED_H

diff  --git a/libcxx/include/__ranges/dangling.h b/libcxx/include/__ranges/dangling.h
index 525b5ff0aabe..f3309a98dc84 100644
--- a/libcxx/include/__ranges/dangling.h
+++ b/libcxx/include/__ranges/dangling.h
@@ -7,26 +7,26 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___RANGES_DANGLING_H
-#define _LIBCPP___RANGES_DANGLING_H
+#ifndef _LIBCUDACXX___RANGES_DANGLING_H
+#define _LIBCUDACXX___RANGES_DANGLING_H
 
 #include <__config>
 #include <__ranges/access.h>
 #include <__ranges/concepts.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 namespace ranges {
 struct dangling {
   dangling() = default;
-  _LIBCPP_HIDE_FROM_ABI constexpr dangling(auto&&...) noexcept {}
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr dangling(auto&&...) noexcept {}
 };
 
 template <range _Rp>
@@ -35,8 +35,8 @@ using borrowed_iterator_t = _If<borrowed_range<_Rp>, iterator_t<_Rp>, dangling>;
 // borrowed_subrange_t defined in <__ranges/subrange.h>
 } // namespace ranges
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___RANGES_DANGLING_H
+#endif // _LIBCUDACXX___RANGES_DANGLING_H

diff  --git a/libcxx/include/__ranges/data.h b/libcxx/include/__ranges/data.h
index 35d1af1e648f..ce2d02508884 100644
--- a/libcxx/include/__ranges/data.h
+++ b/libcxx/include/__ranges/data.h
@@ -6,8 +6,8 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-#ifndef _LIBCPP___RANGES_DATA_H
-#define _LIBCPP___RANGES_DATA_H
+#ifndef _LIBCUDACXX___RANGES_DATA_H
+#define _LIBCUDACXX___RANGES_DATA_H
 
 #include <__concepts/class_or_enum.h>
 #include <__config>
@@ -18,13 +18,13 @@
 #include <__utility/auto_cast.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 // [range.prim.data]
 
@@ -38,7 +38,7 @@ namespace __data {
     __can_borrow<_Tp> &&
     __workaround_52970<_Tp> &&
     requires(_Tp&& __t) {
-      { _LIBCPP_AUTO_CAST(__t.data()) } -> __ptr_to_object;
+      { _LIBCUDACXX_AUTO_CAST(__t.data()) } -> __ptr_to_object;
     };
 
   template <class _Tp>
@@ -51,14 +51,14 @@ namespace __data {
 
   struct __fn {
     template <__member_data _Tp>
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr auto operator()(_Tp&& __t) const
         noexcept(noexcept(__t.data())) {
       return __t.data();
     }
 
     template<__ranges_begin_invocable _Tp>
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr auto operator()(_Tp&& __t) const
         noexcept(noexcept(std::to_address(ranges::begin(__t)))) {
       return std::to_address(ranges::begin(__t));
@@ -78,7 +78,7 @@ namespace __cdata {
   struct __fn {
     template <class _Tp>
       requires is_lvalue_reference_v<_Tp&&>
-    [[nodiscard]] _LIBCPP_HIDE_FROM_ABI
+    [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI
     constexpr auto operator()(_Tp&& __t) const
       noexcept(noexcept(ranges::data(static_cast<const remove_reference_t<_Tp>&>(__t))))
       -> decltype(      ranges::data(static_cast<const remove_reference_t<_Tp>&>(__t)))
@@ -86,7 +86,7 @@ namespace __cdata {
 
     template <class _Tp>
       requires is_rvalue_reference_v<_Tp&&>
-    [[nodiscard]] _LIBCPP_HIDE_FROM_ABI
+    [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI
     constexpr auto operator()(_Tp&& __t) const
       noexcept(noexcept(ranges::data(static_cast<const _Tp&&>(__t))))
       -> decltype(      ranges::data(static_cast<const _Tp&&>(__t)))
@@ -99,8 +99,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___RANGES_DATA_H
+#endif // _LIBCUDACXX___RANGES_DATA_H

diff  --git a/libcxx/include/__ranges/drop_view.h b/libcxx/include/__ranges/drop_view.h
index b2a8ee581475..7e80f388a9e9 100644
--- a/libcxx/include/__ranges/drop_view.h
+++ b/libcxx/include/__ranges/drop_view.h
@@ -6,8 +6,8 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-#ifndef _LIBCPP___RANGES_DROP_VIEW_H
-#define _LIBCPP___RANGES_DROP_VIEW_H
+#ifndef _LIBCUDACXX___RANGES_DROP_VIEW_H
+#define _LIBCUDACXX___RANGES_DROP_VIEW_H
 
 #include <__algorithm/min.h>
 #include <__assert>
@@ -36,16 +36,16 @@
 #include <concepts>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
 namespace ranges {
   template<view _View>
@@ -59,25 +59,25 @@ namespace ranges {
     // one can't call begin() on it more than once.
     static constexpr bool _UseCache = forward_range<_View> && !(random_access_range<_View> && sized_range<_View>);
     using _Cache = _If<_UseCache, __non_propagating_cache<iterator_t<_View>>, __empty_cache>;
-    _LIBCPP_NO_UNIQUE_ADDRESS _Cache __cached_begin_ = _Cache();
+    _LIBCUDACXX_NO_UNIQUE_ADDRESS _Cache __cached_begin_ = _Cache();
     range_
diff erence_t<_View> __count_ = 0;
     _View __base_ = _View();
 
 public:
     drop_view() requires default_initializable<_View> = default;
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr drop_view(_View __base, range_
diff erence_t<_View> __count)
       : __count_(__count)
       , __base_(std::move(__base))
     {
-      _LIBCPP_ASSERT(__count_ >= 0, "count must be greater than or equal to zero.");
+      _LIBCUDACXX_ASSERT(__count_ >= 0, "count must be greater than or equal to zero.");
     }
 
-    _LIBCPP_HIDE_FROM_ABI constexpr _View base() const& requires copy_constructible<_View> { return __base_; }
-    _LIBCPP_HIDE_FROM_ABI constexpr _View base() && { return std::move(__base_); }
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr _View base() const& requires copy_constructible<_View> { return __base_; }
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr _View base() && { return std::move(__base_); }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr auto begin()
       requires (!(__simple_view<_View> &&
                   random_access_range<const _View> && sized_range<const _View>))
@@ -92,36 +92,36 @@ namespace ranges {
       return __tmp;
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr auto begin() const
       requires random_access_range<const _View> && sized_range<const _View>
     {
       return ranges::next(ranges::begin(__base_), __count_, ranges::end(__base_));
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr auto end()
       requires (!__simple_view<_View>)
     { return ranges::end(__base_); }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr auto end() const
       requires range<const _View>
     { return ranges::end(__base_); }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     static constexpr auto __size(auto& __self) {
       const auto __s = ranges::size(__self.__base_);
       const auto __c = static_cast<decltype(__s)>(__self.__count_);
       return __s < __c ? 0 : __s - __c;
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr auto size()
       requires sized_range<_View>
     { return __size(*this); }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr auto size() const
       requires sized_range<const _View>
     { return __size(*this); }
@@ -195,11 +195,11 @@ struct __fn {
   // [range.drop.overview]: the `empty_view` case.
   template <class _Range, convertible_to<range_
diff erence_t<_Range>> _Np>
     requires __is_empty_view<remove_cvref_t<_Range>>
-  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI
+  [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto operator()(_Range&& __range, _Np&&) const
-    noexcept(noexcept(_LIBCPP_AUTO_CAST(std::forward<_Range>(__range))))
-    -> decltype(      _LIBCPP_AUTO_CAST(std::forward<_Range>(__range)))
-    { return          _LIBCPP_AUTO_CAST(std::forward<_Range>(__range)); }
+    noexcept(noexcept(_LIBCUDACXX_AUTO_CAST(std::forward<_Range>(__range))))
+    -> decltype(      _LIBCUDACXX_AUTO_CAST(std::forward<_Range>(__range)))
+    { return          _LIBCUDACXX_AUTO_CAST(std::forward<_Range>(__range)); }
 
   // [range.drop.overview]: the `span | basic_string_view | iota_view | subrange (StoreSize == false)` case.
   template <class _Range,
@@ -210,7 +210,7 @@ struct __fn {
               random_access_range<_RawRange> &&
               sized_range<_RawRange> &&
               __is_passthrough_specialization<_RawRange>)
-  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI
+  [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto operator()(_Range&& __rng, _Np&& __n) const
     noexcept(noexcept(__passthrough_type_t<_RawRange>(
                               ranges::begin(__rng) + std::min<_Dist>(ranges::distance(__rng), std::forward<_Np>(__n)),
@@ -235,7 +235,7 @@ struct __fn {
               random_access_range<_RawRange> &&
               sized_range<_RawRange> &&
               __is_subrange_specialization_with_store_size<_RawRange>)
-  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI
+  [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto operator()(_Range&& __rng, _Np&& __n) const
     noexcept(noexcept(_RawRange(
                               ranges::begin(__rng) + std::min<_Dist>(ranges::distance(__rng), std::forward<_Np>(__n)),
@@ -274,7 +274,7 @@ struct __fn {
                 sized_range<_RawRange> &&
                 random_access_range<_RawRange>)
              ))
-  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI
+  [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto operator()(_Range&& __range, _Np&& __n) const
     noexcept(noexcept(drop_view(std::forward<_Range>(__range), std::forward<_Np>(__n))))
     -> decltype(      drop_view(std::forward<_Range>(__range), std::forward<_Np>(__n)))
@@ -282,7 +282,7 @@ struct __fn {
 
   template <class _Np>
     requires constructible_from<decay_t<_Np>, _Np>
-  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI
+  [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto operator()(_Np&& __n) const
     noexcept(is_nothrow_constructible_v<decay_t<_Np>, _Np>)
   { return __range_adaptor_closure_t(std::__bind_back(*this, std::forward<_Np>(__n))); }
@@ -297,10 +297,10 @@ inline namespace __cpo {
 
 } // namespace ranges
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___RANGES_DROP_VIEW_H
+#endif // _LIBCUDACXX___RANGES_DROP_VIEW_H

diff  --git a/libcxx/include/__ranges/empty.h b/libcxx/include/__ranges/empty.h
index 46c97ca7e329..42308cb8cb86 100644
--- a/libcxx/include/__ranges/empty.h
+++ b/libcxx/include/__ranges/empty.h
@@ -6,8 +6,8 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-#ifndef _LIBCPP___RANGES_EMPTY_H
-#define _LIBCPP___RANGES_EMPTY_H
+#ifndef _LIBCUDACXX___RANGES_EMPTY_H
+#define _LIBCUDACXX___RANGES_EMPTY_H
 
 #include <__concepts/class_or_enum.h>
 #include <__config>
@@ -16,13 +16,13 @@
 #include <__ranges/size.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
 // [range.prim.empty]
 
@@ -51,19 +51,19 @@ namespace __empty {
 
   struct __fn {
     template <__member_empty _Tp>
-    [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(_Tp&& __t) const
+    [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator()(_Tp&& __t) const
         noexcept(noexcept(bool(__t.empty()))) {
       return bool(__t.empty());
     }
 
     template <__can_invoke_size _Tp>
-    [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(_Tp&& __t) const
+    [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator()(_Tp&& __t) const
         noexcept(noexcept(ranges::size(__t))) {
       return ranges::size(__t) == 0;
     }
 
     template<__can_compare_begin_end _Tp>
-    [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(_Tp&& __t) const
+    [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator()(_Tp&& __t) const
         noexcept(noexcept(bool(ranges::begin(__t) == ranges::end(__t)))) {
       return ranges::begin(__t) == ranges::end(__t);
     }
@@ -75,8 +75,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___RANGES_EMPTY_H
+#endif // _LIBCUDACXX___RANGES_EMPTY_H

diff  --git a/libcxx/include/__ranges/empty_view.h b/libcxx/include/__ranges/empty_view.h
index 3299fe825ddf..428b360955f2 100644
--- a/libcxx/include/__ranges/empty_view.h
+++ b/libcxx/include/__ranges/empty_view.h
@@ -6,32 +6,32 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-#ifndef _LIBCPP___RANGES_EMPTY_VIEW_H
-#define _LIBCPP___RANGES_EMPTY_VIEW_H
+#ifndef _LIBCUDACXX___RANGES_EMPTY_VIEW_H
+#define _LIBCUDACXX___RANGES_EMPTY_VIEW_H
 
 #include <__config>
 #include <__ranges/enable_borrowed_range.h>
 #include <__ranges/view_interface.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
 namespace ranges {
   template<class _Tp>
     requires is_object_v<_Tp>
   class empty_view : public view_interface<empty_view<_Tp>> {
   public:
-    _LIBCPP_HIDE_FROM_ABI static constexpr _Tp* begin() noexcept { return nullptr; }
-    _LIBCPP_HIDE_FROM_ABI static constexpr _Tp* end() noexcept { return nullptr; }
-    _LIBCPP_HIDE_FROM_ABI static constexpr _Tp* data() noexcept { return nullptr; }
-    _LIBCPP_HIDE_FROM_ABI static constexpr size_t size() noexcept { return 0; }
-    _LIBCPP_HIDE_FROM_ABI static constexpr bool empty() noexcept { return true; }
+    _LIBCUDACXX_HIDE_FROM_ABI static constexpr _Tp* begin() noexcept { return nullptr; }
+    _LIBCUDACXX_HIDE_FROM_ABI static constexpr _Tp* end() noexcept { return nullptr; }
+    _LIBCUDACXX_HIDE_FROM_ABI static constexpr _Tp* data() noexcept { return nullptr; }
+    _LIBCUDACXX_HIDE_FROM_ABI static constexpr size_t size() noexcept { return 0; }
+    _LIBCUDACXX_HIDE_FROM_ABI static constexpr bool empty() noexcept { return true; }
   };
 
   template<class _Tp>
@@ -45,8 +45,8 @@ namespace ranges {
   } // namespace views
 } // namespace ranges
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___RANGES_EMPTY_VIEW_H
+#endif // _LIBCUDACXX___RANGES_EMPTY_VIEW_H

diff  --git a/libcxx/include/__ranges/enable_borrowed_range.h b/libcxx/include/__ranges/enable_borrowed_range.h
index 833d266403ca..617e7eff7df8 100644
--- a/libcxx/include/__ranges/enable_borrowed_range.h
+++ b/libcxx/include/__ranges/enable_borrowed_range.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___RANGES_ENABLE_BORROWED_RANGE_H
-#define _LIBCPP___RANGES_ENABLE_BORROWED_RANGE_H
+#ifndef _LIBCUDACXX___RANGES_ENABLE_BORROWED_RANGE_H
+#define _LIBCUDACXX___RANGES_ENABLE_BORROWED_RANGE_H
 
 // These customization variables are used in <span> and <string_view>. The
 // separate header is used to avoid including the entire <ranges> header in
@@ -16,13 +16,13 @@
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 namespace ranges {
 
@@ -33,8 +33,8 @@ inline constexpr bool enable_borrowed_range = false;
 
 } // namespace ranges
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___RANGES_ENABLE_BORROWED_RANGE_H
+#endif // _LIBCUDACXX___RANGES_ENABLE_BORROWED_RANGE_H

diff  --git a/libcxx/include/__ranges/enable_view.h b/libcxx/include/__ranges/enable_view.h
index a1e5721404cd..d6cd359901d6 100644
--- a/libcxx/include/__ranges/enable_view.h
+++ b/libcxx/include/__ranges/enable_view.h
@@ -7,20 +7,20 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___RANGES_ENABLE_VIEW_H
-#define _LIBCPP___RANGES_ENABLE_VIEW_H
+#ifndef _LIBCUDACXX___RANGES_ENABLE_VIEW_H
+#define _LIBCUDACXX___RANGES_ENABLE_VIEW_H
 
 #include <__config>
 #include <concepts>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 namespace ranges {
 
@@ -40,8 +40,8 @@ inline constexpr bool enable_view = derived_from<_Tp, view_base> ||
 
 } // namespace ranges
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___RANGES_ENABLE_VIEW_H
+#endif // _LIBCUDACXX___RANGES_ENABLE_VIEW_H

diff  --git a/libcxx/include/__ranges/filter_view.h b/libcxx/include/__ranges/filter_view.h
index b040ea57b779..11c5f5691f1a 100644
--- a/libcxx/include/__ranges/filter_view.h
+++ b/libcxx/include/__ranges/filter_view.h
@@ -6,8 +6,8 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-#ifndef _LIBCPP___RANGES_FILTER_VIEW_H
-#define _LIBCPP___RANGES_FILTER_VIEW_H
+#ifndef _LIBCUDACXX___RANGES_FILTER_VIEW_H
+#define _LIBCUDACXX___RANGES_FILTER_VIEW_H
 
 #include <__algorithm/ranges_find_if.h>
 #include <__config>
@@ -33,51 +33,51 @@
 #include <concepts>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
 namespace ranges {
   template<input_range _View, indirect_unary_predicate<iterator_t<_View>> _Pred>
     requires view<_View> && is_object_v<_Pred>
   class filter_view : public view_interface<filter_view<_View, _Pred>> {
-    _LIBCPP_NO_UNIQUE_ADDRESS _View __base_ = _View();
-    _LIBCPP_NO_UNIQUE_ADDRESS __copyable_box<_Pred> __pred_;
+    _LIBCUDACXX_NO_UNIQUE_ADDRESS _View __base_ = _View();
+    _LIBCUDACXX_NO_UNIQUE_ADDRESS __copyable_box<_Pred> __pred_;
 
     // We cache the result of begin() to allow providing an amortized O(1) begin() whenever
     // the underlying range is at least a forward_range.
     static constexpr bool _UseCache = forward_range<_View>;
     using _Cache = _If<_UseCache, __non_propagating_cache<iterator_t<_View>>, __empty_cache>;
-    _LIBCPP_NO_UNIQUE_ADDRESS _Cache __cached_begin_ = _Cache();
+    _LIBCUDACXX_NO_UNIQUE_ADDRESS _Cache __cached_begin_ = _Cache();
 
     class __iterator;
     class __sentinel;
 
   public:
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     filter_view() requires default_initializable<_View> && default_initializable<_Pred> = default;
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr filter_view(_View __base, _Pred __pred)
       : __base_(std::move(__base)), __pred_(in_place, std::move(__pred))
     { }
 
     template<class _Vp = _View>
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr _View base() const& requires copy_constructible<_Vp> { return __base_; }
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr _View base() && { return std::move(__base_); }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr _Pred const& pred() const { return *__pred_; }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr __iterator begin() {
-      _LIBCPP_ASSERT(__pred_.__has_value(), "Trying to call begin() on a filter_view that does not have a valid predicate.");
+      _LIBCUDACXX_ASSERT(__pred_.__has_value(), "Trying to call begin() on a filter_view that does not have a valid predicate.");
       if constexpr (_UseCache) {
         if (!__cached_begin_.__has_value()) {
           __cached_begin_.__emplace(ranges::find_if(__base_, std::ref(*__pred_)));
@@ -88,7 +88,7 @@ namespace ranges {
       }
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr auto end() {
       if constexpr (common_range<_View>)
         return __iterator{*this, ranges::end(__base_)};
@@ -117,8 +117,8 @@ namespace ranges {
     requires view<_View> && is_object_v<_Pred>
   class filter_view<_View, _Pred>::__iterator : public __filter_iterator_category<_View> {
   public:
-    _LIBCPP_NO_UNIQUE_ADDRESS iterator_t<_View> __current_ = iterator_t<_View>();
-    _LIBCPP_NO_UNIQUE_ADDRESS filter_view* __parent_ = nullptr;
+    _LIBCUDACXX_NO_UNIQUE_ADDRESS iterator_t<_View> __current_ = iterator_t<_View>();
+    _LIBCUDACXX_NO_UNIQUE_ADDRESS filter_view* __parent_ = nullptr;
 
     using iterator_concept =
       _If<bidirectional_range<_View>, bidirectional_iterator_tag,
@@ -129,72 +129,72 @@ namespace ranges {
     using value_type = range_value_t<_View>;
     using 
diff erence_type = range_
diff erence_t<_View>;
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     __iterator() requires default_initializable<iterator_t<_View>> = default;
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr __iterator(filter_view& __parent, iterator_t<_View> __current)
       : __current_(std::move(__current)), __parent_(std::addressof(__parent))
     { }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr iterator_t<_View> const& base() const& noexcept { return __current_; }
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr iterator_t<_View> base() && { return std::move(__current_); }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr range_reference_t<_View> operator*() const { return *__current_; }
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr iterator_t<_View> operator->() const
       requires __has_arrow<iterator_t<_View>> && copyable<iterator_t<_View>>
     {
       return __current_;
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr __iterator& operator++() {
       __current_ = ranges::find_if(std::move(++__current_), ranges::end(__parent_->__base_),
                                    std::ref(*__parent_->__pred_));
       return *this;
     }
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr void operator++(int) { ++*this; }
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr __iterator operator++(int) requires forward_range<_View> {
       auto __tmp = *this;
       ++*this;
       return __tmp;
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr __iterator& operator--() requires bidirectional_range<_View> {
       do {
         --__current_;
       } while (!std::invoke(*__parent_->__pred_, *__current_));
       return *this;
     }
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr __iterator operator--(int) requires bidirectional_range<_View> {
       auto tmp = *this;
       --*this;
       return tmp;
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     friend constexpr bool operator==(__iterator const& __x, __iterator const& __y)
       requires equality_comparable<iterator_t<_View>>
     {
       return __x.__current_ == __y.__current_;
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     friend constexpr range_rvalue_reference_t<_View> iter_move(__iterator const& __it)
       noexcept(noexcept(ranges::iter_move(__it.__current_)))
     {
       return ranges::iter_move(__it.__current_);
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     friend constexpr void iter_swap(__iterator const& __x, __iterator const& __y)
       noexcept(noexcept(ranges::iter_swap(__x.__current_, __y.__current_)))
       requires indirectly_swappable<iterator_t<_View>>
@@ -209,18 +209,18 @@ namespace ranges {
   public:
     sentinel_t<_View> __end_ = sentinel_t<_View>();
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     __sentinel() = default;
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr explicit __sentinel(filter_view& __parent)
       : __end_(ranges::end(__parent.__base_))
     { }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr sentinel_t<_View> base() const { return __end_; }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     friend constexpr bool operator==(__iterator const& __x, __sentinel const& __y) {
       return __x.__current_ == __y.__end_;
     }
@@ -230,7 +230,7 @@ namespace views {
 namespace __filter {
   struct __fn {
     template<class _Range, class _Pred>
-    [[nodiscard]] _LIBCPP_HIDE_FROM_ABI
+    [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI
     constexpr auto operator()(_Range&& __range, _Pred&& __pred) const
       noexcept(noexcept(filter_view(std::forward<_Range>(__range), std::forward<_Pred>(__pred))))
       -> decltype(      filter_view(std::forward<_Range>(__range), std::forward<_Pred>(__pred)))
@@ -238,7 +238,7 @@ namespace __filter {
 
     template<class _Pred>
       requires constructible_from<decay_t<_Pred>, _Pred>
-    [[nodiscard]] _LIBCPP_HIDE_FROM_ABI
+    [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI
     constexpr auto operator()(_Pred&& __pred) const
       noexcept(is_nothrow_constructible_v<decay_t<_Pred>, _Pred>)
     { return __range_adaptor_closure_t(std::__bind_back(*this, std::forward<_Pred>(__pred))); }
@@ -252,8 +252,8 @@ inline namespace __cpo {
 
 } // namespace ranges
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___RANGES_FILTER_VIEW_H
+#endif // _LIBCUDACXX___RANGES_FILTER_VIEW_H

diff  --git a/libcxx/include/__ranges/iota_view.h b/libcxx/include/__ranges/iota_view.h
index e1f03bafa03a..7580307bd022 100644
--- a/libcxx/include/__ranges/iota_view.h
+++ b/libcxx/include/__ranges/iota_view.h
@@ -6,8 +6,8 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-#ifndef _LIBCPP___RANGES_IOTA_VIEW_H
-#define _LIBCPP___RANGES_IOTA_VIEW_H
+#ifndef _LIBCUDACXX___RANGES_IOTA_VIEW_H
+#define _LIBCUDACXX___RANGES_IOTA_VIEW_H
 
 #include <__assert>
 #include <__compare/three_way_comparable.h>
@@ -33,13 +33,13 @@
 #include <__utility/move.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
 namespace ranges {
   template<class _Int>
@@ -107,47 +107,47 @@ namespace ranges {
 
       _Start __value_ = _Start();
 
-      _LIBCPP_HIDE_FROM_ABI
+      _LIBCUDACXX_HIDE_FROM_ABI
       __iterator() requires default_initializable<_Start> = default;
 
-      _LIBCPP_HIDE_FROM_ABI
+      _LIBCUDACXX_HIDE_FROM_ABI
       constexpr explicit __iterator(_Start __value) : __value_(std::move(__value)) {}
 
-      _LIBCPP_HIDE_FROM_ABI
+      _LIBCUDACXX_HIDE_FROM_ABI
       constexpr _Start operator*() const noexcept(is_nothrow_copy_constructible_v<_Start>) {
         return __value_;
       }
 
-      _LIBCPP_HIDE_FROM_ABI
+      _LIBCUDACXX_HIDE_FROM_ABI
       constexpr __iterator& operator++() {
         ++__value_;
         return *this;
       }
 
-      _LIBCPP_HIDE_FROM_ABI
+      _LIBCUDACXX_HIDE_FROM_ABI
       constexpr void operator++(int) { ++*this; }
 
-      _LIBCPP_HIDE_FROM_ABI
+      _LIBCUDACXX_HIDE_FROM_ABI
       constexpr __iterator operator++(int) requires incrementable<_Start> {
         auto __tmp = *this;
         ++*this;
         return __tmp;
       }
 
-      _LIBCPP_HIDE_FROM_ABI
+      _LIBCUDACXX_HIDE_FROM_ABI
       constexpr __iterator& operator--() requires __decrementable<_Start> {
         --__value_;
         return *this;
       }
 
-      _LIBCPP_HIDE_FROM_ABI
+      _LIBCUDACXX_HIDE_FROM_ABI
       constexpr __iterator  operator--(int) requires __decrementable<_Start> {
         auto __tmp = *this;
         --*this;
         return __tmp;
       }
 
-      _LIBCPP_HIDE_FROM_ABI
+      _LIBCUDACXX_HIDE_FROM_ABI
       constexpr __iterator& operator+=(
diff erence_type __n)
         requires __advanceable<_Start>
       {
@@ -163,7 +163,7 @@ namespace ranges {
         return *this;
       }
 
-      _LIBCPP_HIDE_FROM_ABI
+      _LIBCUDACXX_HIDE_FROM_ABI
       constexpr __iterator& operator-=(
diff erence_type __n)
         requires __advanceable<_Start>
       {
@@ -179,42 +179,42 @@ namespace ranges {
         return *this;
       }
 
-      _LIBCPP_HIDE_FROM_ABI
+      _LIBCUDACXX_HIDE_FROM_ABI
       constexpr _Start operator[](
diff erence_type __n) const
         requires __advanceable<_Start>
       {
         return _Start(__value_ + __n);
       }
 
-      _LIBCPP_HIDE_FROM_ABI
+      _LIBCUDACXX_HIDE_FROM_ABI
       friend constexpr bool operator==(const __iterator& __x, const __iterator& __y)
         requires equality_comparable<_Start>
       {
         return __x.__value_ == __y.__value_;
       }
 
-      _LIBCPP_HIDE_FROM_ABI
+      _LIBCUDACXX_HIDE_FROM_ABI
       friend constexpr bool operator<(const __iterator& __x, const __iterator& __y)
         requires totally_ordered<_Start>
       {
         return __x.__value_ < __y.__value_;
       }
 
-      _LIBCPP_HIDE_FROM_ABI
+      _LIBCUDACXX_HIDE_FROM_ABI
       friend constexpr bool operator>(const __iterator& __x, const __iterator& __y)
         requires totally_ordered<_Start>
       {
         return __y < __x;
       }
 
-      _LIBCPP_HIDE_FROM_ABI
+      _LIBCUDACXX_HIDE_FROM_ABI
       friend constexpr bool operator<=(const __iterator& __x, const __iterator& __y)
         requires totally_ordered<_Start>
       {
         return !(__y < __x);
       }
 
-      _LIBCPP_HIDE_FROM_ABI
+      _LIBCUDACXX_HIDE_FROM_ABI
       friend constexpr bool operator>=(const __iterator& __x, const __iterator& __y)
         requires totally_ordered<_Start>
       {
@@ -227,7 +227,7 @@ namespace ranges {
         return __x.__value_ <=> __y.__value_;
       }
 
-      _LIBCPP_HIDE_FROM_ABI
+      _LIBCUDACXX_HIDE_FROM_ABI
       friend constexpr __iterator operator+(__iterator __i, 
diff erence_type __n)
         requires __advanceable<_Start>
       {
@@ -235,14 +235,14 @@ namespace ranges {
         return __i;
       }
 
-      _LIBCPP_HIDE_FROM_ABI
+      _LIBCUDACXX_HIDE_FROM_ABI
       friend constexpr __iterator operator+(
diff erence_type __n, __iterator __i)
         requires __advanceable<_Start>
       {
         return __i + __n;
       }
 
-      _LIBCPP_HIDE_FROM_ABI
+      _LIBCUDACXX_HIDE_FROM_ABI
       friend constexpr __iterator operator-(__iterator __i, 
diff erence_type __n)
         requires __advanceable<_Start>
       {
@@ -250,7 +250,7 @@ namespace ranges {
         return __i;
       }
 
-      _LIBCPP_HIDE_FROM_ABI
+      _LIBCUDACXX_HIDE_FROM_ABI
       friend constexpr 
diff erence_type operator-(const __iterator& __x, const __iterator& __y)
         requires __advanceable<_Start>
       {
@@ -274,23 +274,23 @@ namespace ranges {
       _BoundSentinel __bound_sentinel_ = _BoundSentinel();
 
     public:
-      _LIBCPP_HIDE_FROM_ABI
+      _LIBCUDACXX_HIDE_FROM_ABI
       __sentinel() = default;
       constexpr explicit __sentinel(_BoundSentinel __bound_sentinel) : __bound_sentinel_(std::move(__bound_sentinel)) {}
 
-      _LIBCPP_HIDE_FROM_ABI
+      _LIBCUDACXX_HIDE_FROM_ABI
       friend constexpr bool operator==(const __iterator& __x, const __sentinel& __y) {
         return __x.__value_ == __y.__bound_sentinel_;
       }
 
-      _LIBCPP_HIDE_FROM_ABI
+      _LIBCUDACXX_HIDE_FROM_ABI
       friend constexpr iter_
diff erence_t<_Start> operator-(const __iterator& __x, const __sentinel& __y)
         requires sized_sentinel_for<_BoundSentinel, _Start>
       {
         return __x.__value_ - __y.__bound_sentinel_;
       }
 
-      _LIBCPP_HIDE_FROM_ABI
+      _LIBCUDACXX_HIDE_FROM_ABI
       friend constexpr iter_
diff erence_t<_Start> operator-(const __sentinel& __x, const __iterator& __y)
         requires sized_sentinel_for<_BoundSentinel, _Start>
       {
@@ -302,41 +302,41 @@ namespace ranges {
     _BoundSentinel __bound_sentinel_ = _BoundSentinel();
 
   public:
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     iota_view() requires default_initializable<_Start> = default;
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr explicit iota_view(_Start __value) : __value_(std::move(__value)) { }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr iota_view(type_identity_t<_Start> __value, type_identity_t<_BoundSentinel> __bound_sentinel)
         : __value_(std::move(__value)), __bound_sentinel_(std::move(__bound_sentinel)) {
       // Validate the precondition if possible.
       if constexpr (totally_ordered_with<_Start, _BoundSentinel>) {
-        _LIBCPP_ASSERT(ranges::less_equal()(__value_, __bound_sentinel_),
+        _LIBCUDACXX_ASSERT(ranges::less_equal()(__value_, __bound_sentinel_),
                        "Precondition violated: value is greater than bound.");
       }
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr iota_view(__iterator __first, __iterator __last)
       requires same_as<_Start, _BoundSentinel>
     : iota_view(std::move(__first.__value_), std::move(__last.__value_)) {}
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr iota_view(__iterator __first, _BoundSentinel __last)
       requires same_as<_BoundSentinel, unreachable_sentinel_t>
     : iota_view(std::move(__first.__value_), std::move(__last)) {}
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr iota_view(__iterator __first, __sentinel __last)
       requires(!same_as<_Start, _BoundSentinel> && !same_as<_Start, unreachable_sentinel_t>)
     : iota_view(std::move(__first.__value_), std::move(__last.__bound_sentinel_)) {}
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr __iterator begin() const { return __iterator{__value_}; }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr auto end() const {
       if constexpr (same_as<_BoundSentinel, unreachable_sentinel_t>)
         return unreachable_sentinel;
@@ -344,14 +344,14 @@ namespace ranges {
         return __sentinel{__bound_sentinel_};
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr __iterator end() const
       requires same_as<_Start, _BoundSentinel>
     {
       return __iterator{__bound_sentinel_};
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr auto size() const
       requires(same_as<_Start, _BoundSentinel> && __advanceable<_Start>) ||
               (integral<_Start> && integral<_BoundSentinel>) || sized_sentinel_for<_BoundSentinel, _Start>
@@ -381,14 +381,14 @@ namespace ranges {
  namespace __iota {
   struct __fn {
     template<class _Start>
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr auto operator()(_Start&& __start) const
       noexcept(noexcept(ranges::iota_view(std::forward<_Start>(__start))))
       -> decltype(      ranges::iota_view(std::forward<_Start>(__start)))
       { return          ranges::iota_view(std::forward<_Start>(__start)); }
 
     template <class _Start, class _BoundSentinel>
-    _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Start&& __start, _BoundSentinel&& __bound_sentinel) const
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Start&& __start, _BoundSentinel&& __bound_sentinel) const
       noexcept(noexcept(ranges::iota_view(std::forward<_Start>(__start), std::forward<_BoundSentinel>(__bound_sentinel))))
       -> decltype(      ranges::iota_view(std::forward<_Start>(__start), std::forward<_BoundSentinel>(__bound_sentinel)))
       { return          ranges::iota_view(std::forward<_Start>(__start), std::forward<_BoundSentinel>(__bound_sentinel)); }
@@ -401,8 +401,8 @@ inline namespace __cpo {
 } // namespace views
 } // namespace ranges
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___RANGES_IOTA_VIEW_H
+#endif // _LIBCUDACXX___RANGES_IOTA_VIEW_H

diff  --git a/libcxx/include/__ranges/join_view.h b/libcxx/include/__ranges/join_view.h
index b6fcce95aeda..28f5cc03f9a8 100644
--- a/libcxx/include/__ranges/join_view.h
+++ b/libcxx/include/__ranges/join_view.h
@@ -6,8 +6,8 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-#ifndef _LIBCPP___RANGES_JOIN_VIEW_H
-#define _LIBCPP___RANGES_JOIN_VIEW_H
+#ifndef _LIBCUDACXX___RANGES_JOIN_VIEW_H
+#define _LIBCUDACXX___RANGES_JOIN_VIEW_H
 
 #include <__concepts/constructible.h>
 #include <__concepts/convertible_to.h>
@@ -29,13 +29,13 @@
 #include <optional>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
 namespace ranges {
   template<class>
@@ -73,24 +73,24 @@ namespace ranges {
 
     static constexpr bool _UseCache = !is_reference_v<_InnerRange>;
     using _Cache = _If<_UseCache, __non_propagating_cache<remove_cvref_t<_InnerRange>>, __empty_cache>;
-    _LIBCPP_NO_UNIQUE_ADDRESS _Cache __cache_;
-    _LIBCPP_NO_UNIQUE_ADDRESS _View __base_ = _View();
+    _LIBCUDACXX_NO_UNIQUE_ADDRESS _Cache __cache_;
+    _LIBCUDACXX_NO_UNIQUE_ADDRESS _View __base_ = _View();
 
   public:
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     join_view() requires default_initializable<_View> = default;
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr explicit join_view(_View __base)
       : __base_(std::move(__base)) {}
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr _View base() const& requires copy_constructible<_View> { return __base_; }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr _View base() && { return std::move(__base_); }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr auto begin() {
       constexpr bool __use_const = __simple_view<_View> &&
                                    is_reference_v<range_reference_t<_View>>;
@@ -98,7 +98,7 @@ namespace ranges {
     }
 
     template<class _V2 = _View>
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr auto begin() const
       requires input_range<const _V2> &&
                is_reference_v<range_reference_t<const _V2>>
@@ -106,7 +106,7 @@ namespace ranges {
       return __iterator<true>{*this, ranges::begin(__base_)};
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr auto end() {
       if constexpr (forward_range<_View> &&
                     is_reference_v<_InnerRange> &&
@@ -119,7 +119,7 @@ namespace ranges {
     }
 
     template<class _V2 = _View>
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr auto end() const
       requires input_range<const _V2> &&
                is_reference_v<range_reference_t<const _V2>>
@@ -148,21 +148,21 @@ namespace ranges {
     sentinel_t<_Base> __end_ = sentinel_t<_Base>();
 
   public:
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     __sentinel() = default;
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr explicit __sentinel(_Parent& __parent)
       : __end_(ranges::end(__parent.__base_)) {}
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr __sentinel(__sentinel<!_Const> __s)
       requires _Const && convertible_to<sentinel_t<_View>, sentinel_t<_Base>>
       : __end_(std::move(__s.__end_)) {}
 
     template<bool _OtherConst>
       requires sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>>
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     friend constexpr bool operator==(const __iterator<_OtherConst>& __x, const __sentinel& __y) {
       return __x.__outer_ == __y.__end_;
     }
@@ -190,7 +190,7 @@ namespace ranges {
     optional<_Inner> __inner_;
     _Parent *__parent_ = nullptr;
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr void __satisfy() {
       for (; __outer_ != ranges::end(__parent_->__base_); ++__outer_) {
         auto&& __inner = [&]() -> auto&& {
@@ -225,17 +225,17 @@ namespace ranges {
     using 
diff erence_type = common_type_t<
       range_
diff erence_t<_Base>, range_
diff erence_t<range_reference_t<_Base>>>;
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     __iterator() requires default_initializable<_Outer> = default;
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr __iterator(_Parent& __parent, _Outer __outer)
       : __outer_(std::move(__outer))
       , __parent_(std::addressof(__parent)) {
       __satisfy();
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr __iterator(__iterator<!_Const> __i)
       requires _Const &&
                convertible_to<iterator_t<_View>, _Outer> &&
@@ -244,19 +244,19 @@ namespace ranges {
       , __inner_(std::move(__i.__inner_))
       , __parent_(__i.__parent_) {}
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr decltype(auto) operator*() const {
       return **__inner_;
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr _Inner operator->() const
       requires __has_arrow<_Inner> && copyable<_Inner>
     {
       return *__inner_;
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr __iterator& operator++() {
       auto&& __inner = [&]() -> auto&& {
         if constexpr (__ref_is_glvalue)
@@ -271,12 +271,12 @@ namespace ranges {
       return *this;
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr void operator++(int) {
       ++*this;
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr __iterator operator++(int)
       requires __ref_is_glvalue &&
                forward_range<_Base> &&
@@ -287,7 +287,7 @@ namespace ranges {
       return __tmp;
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr __iterator& operator--()
       requires __ref_is_glvalue &&
                bidirectional_range<_Base> &&
@@ -306,7 +306,7 @@ namespace ranges {
       return *this;
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr __iterator operator--(int)
       requires __ref_is_glvalue &&
                bidirectional_range<_Base> &&
@@ -318,7 +318,7 @@ namespace ranges {
       return __tmp;
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     friend constexpr bool operator==(const __iterator& __x, const __iterator& __y)
       requires __ref_is_glvalue &&
                equality_comparable<iterator_t<_Base>> &&
@@ -327,14 +327,14 @@ namespace ranges {
       return __x.__outer_ == __y.__outer_ && __x.__inner_ == __y.__inner_;
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     friend constexpr decltype(auto) iter_move(const __iterator& __i)
       noexcept(noexcept(ranges::iter_move(*__i.__inner_)))
     {
       return ranges::iter_move(*__i.__inner_);
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     friend constexpr void iter_swap(const __iterator& __x, const __iterator& __y)
       noexcept(noexcept(ranges::iter_swap(*__x.__inner_, *__y.__inner_)))
       requires indirectly_swappable<_Inner>
@@ -350,7 +350,7 @@ namespace views {
 namespace __join_view {
 struct __fn : __range_adaptor_closure<__fn> {
   template<class _Range>
-  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI
+  [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto operator()(_Range&& __range) const
     noexcept(noexcept(join_view<all_t<_Range&&>>(std::forward<_Range>(__range))))
     -> decltype(      join_view<all_t<_Range&&>>(std::forward<_Range>(__range)))
@@ -363,8 +363,8 @@ inline namespace __cpo {
 } // namespace views
 } // namespace ranges
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___RANGES_JOIN_VIEW_H
+#endif // _LIBCUDACXX___RANGES_JOIN_VIEW_H

diff  --git a/libcxx/include/__ranges/lazy_split_view.h b/libcxx/include/__ranges/lazy_split_view.h
index e559a76ef7b7..d0b3d17c82f0 100644
--- a/libcxx/include/__ranges/lazy_split_view.h
+++ b/libcxx/include/__ranges/lazy_split_view.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___RANGES_LAZY_SPLIT_VIEW_H
-#define _LIBCPP___RANGES_LAZY_SPLIT_VIEW_H
+#ifndef _LIBCUDACXX___RANGES_LAZY_SPLIT_VIEW_H
+#define _LIBCUDACXX___RANGES_LAZY_SPLIT_VIEW_H
 
 #include <__algorithm/in_in_result.h>
 #include <__algorithm/ranges_find.h>
@@ -39,13 +39,13 @@
 #include <__utility/move.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
 namespace ranges {
 
@@ -63,38 +63,38 @@ template <input_range _View, forward_range _Pattern>
            (forward_range<_View> || __tiny_range<_Pattern>)
 class lazy_split_view : public view_interface<lazy_split_view<_View, _Pattern>> {
 
-  _LIBCPP_NO_UNIQUE_ADDRESS _View __base_ = _View();
-  _LIBCPP_NO_UNIQUE_ADDRESS _Pattern __pattern_ = _Pattern();
+  _LIBCUDACXX_NO_UNIQUE_ADDRESS _View __base_ = _View();
+  _LIBCUDACXX_NO_UNIQUE_ADDRESS _Pattern __pattern_ = _Pattern();
 
   using _MaybeCurrent = _If<!forward_range<_View>, __non_propagating_cache<iterator_t<_View>>, __empty_cache>;
-  _LIBCPP_NO_UNIQUE_ADDRESS _MaybeCurrent __current_ = _MaybeCurrent();
+  _LIBCUDACXX_NO_UNIQUE_ADDRESS _MaybeCurrent __current_ = _MaybeCurrent();
 
   template <bool> struct __outer_iterator;
   template <bool> struct __inner_iterator;
 
 public:
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   lazy_split_view()
     requires default_initializable<_View> && default_initializable<_Pattern> = default;
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr lazy_split_view(_View __base, _Pattern __pattern)
     : __base_(std::move(__base)), __pattern_(std::move(__pattern)) {}
 
   template <input_range _Range>
     requires constructible_from<_View, views::all_t<_Range>> &&
              constructible_from<_Pattern, single_view<range_value_t<_Range>>>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr lazy_split_view(_Range&& __r, range_value_t<_Range> __e)
     : __base_(views::all(std::forward<_Range>(__r)))
     , __pattern_(views::single(std::move(__e))) {}
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr _View base() const& requires copy_constructible<_View> { return __base_; }
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr _View base() && { return std::move(__base_); }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto begin() {
     if constexpr (forward_range<_View>) {
       return __outer_iterator<__simple_view<_View> && __simple_view<_Pattern>>{*this, ranges::begin(__base_)};
@@ -104,17 +104,17 @@ class lazy_split_view : public view_interface<lazy_split_view<_View, _Pattern>>
     }
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto begin() const requires forward_range<_View> && forward_range<const _View> {
     return __outer_iterator<true>{*this, ranges::begin(__base_)};
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto end() requires forward_range<_View> && common_range<_View> {
     return __outer_iterator<__simple_view<_View> && __simple_view<_Pattern>>{*this, ranges::end(__base_)};
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto end() const {
     if constexpr (forward_range<_View> && forward_range<const _View> && common_range<const _View>) {
       return __outer_iterator<true>{*this, ranges::end(__base_)};
@@ -145,10 +145,10 @@ class lazy_split_view : public view_interface<lazy_split_view<_View, _Pattern>>
 
     _Parent* __parent_ = nullptr;
     using _MaybeCurrent = _If<forward_range<_View>, iterator_t<_Base>, __empty_cache>;
-    _LIBCPP_NO_UNIQUE_ADDRESS _MaybeCurrent __current_ = _MaybeCurrent();
+    _LIBCUDACXX_NO_UNIQUE_ADDRESS _MaybeCurrent __current_ = _MaybeCurrent();
     bool __trailing_empty_ = false;
 
-    [[nodiscard]] _LIBCPP_HIDE_FROM_ABI
+    [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI
     constexpr auto& __current() noexcept {
       if constexpr (forward_range<_View>) {
         return __current_;
@@ -157,7 +157,7 @@ class lazy_split_view : public view_interface<lazy_split_view<_View, _Pattern>>
       }
     }
 
-    [[nodiscard]] _LIBCPP_HIDE_FROM_ABI
+    [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI
     constexpr const auto& __current() const noexcept {
       if constexpr (forward_range<_View>) {
         return __current_;
@@ -168,7 +168,7 @@ class lazy_split_view : public view_interface<lazy_split_view<_View, _Pattern>>
 
     // Workaround for the GCC issue that doesn't allow calling `__parent_->__base_` from friend functions (because
     // `__base_` is private).
-    [[nodiscard]] _LIBCPP_HIDE_FROM_ABI
+    [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI
     constexpr auto& __parent_base() const noexcept {
       return __parent_->__base_;
     }
@@ -183,40 +183,40 @@ class lazy_split_view : public view_interface<lazy_split_view<_View, _Pattern>>
       __outer_iterator __i_ = __outer_iterator();
 
     public:
-      _LIBCPP_HIDE_FROM_ABI
+      _LIBCUDACXX_HIDE_FROM_ABI
       value_type() = default;
-      _LIBCPP_HIDE_FROM_ABI
+      _LIBCUDACXX_HIDE_FROM_ABI
       constexpr explicit value_type(__outer_iterator __i)
         : __i_(std::move(__i)) {}
 
-      _LIBCPP_HIDE_FROM_ABI
+      _LIBCUDACXX_HIDE_FROM_ABI
       constexpr __inner_iterator<_Const> begin() const { return __inner_iterator<_Const>{__i_}; }
-      _LIBCPP_HIDE_FROM_ABI
+      _LIBCUDACXX_HIDE_FROM_ABI
       constexpr default_sentinel_t end() const noexcept { return default_sentinel; }
     };
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     __outer_iterator() = default;
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr explicit __outer_iterator(_Parent& __parent)
       requires (!forward_range<_Base>)
       : __parent_(std::addressof(__parent)) {}
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr __outer_iterator(_Parent& __parent, iterator_t<_Base> __current)
       requires forward_range<_Base>
       : __parent_(std::addressof(__parent)), __current_(std::move(__current)) {}
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr __outer_iterator(__outer_iterator<!_Const> __i)
       requires _Const && convertible_to<iterator_t<_View>, iterator_t<_Base>>
       : __parent_(__i.__parent_), __current_(std::move(__i.__current_)) {}
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr value_type operator*() const { return value_type{*this}; }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr __outer_iterator& operator++() {
       const auto __end = ranges::end(__parent_->__base_);
       if (__current() == __end) {
@@ -256,7 +256,7 @@ class lazy_split_view : public view_interface<lazy_split_view<_View, _Pattern>>
       return *this;
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr decltype(auto) operator++(int) {
       if constexpr (forward_range<_Base>) {
         auto __tmp = *this;
@@ -268,15 +268,15 @@ class lazy_split_view : public view_interface<lazy_split_view<_View, _Pattern>>
       }
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     friend constexpr bool operator==(const __outer_iterator& __x, const __outer_iterator& __y)
       requires forward_range<_Base> {
       return __x.__current_ == __y.__current_ && __x.__trailing_empty_ == __y.__trailing_empty_;
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     friend constexpr bool operator==(const __outer_iterator& __x, default_sentinel_t) {
-      _LIBCPP_ASSERT(__x.__parent_, "Cannot call comparison on a default-constructed iterator.");
+      _LIBCUDACXX_ASSERT(__x.__parent_, "Cannot call comparison on a default-constructed iterator.");
       return __x.__current() == ranges::end(__x.__parent_base()) && !__x.__trailing_empty_;
     }
   };
@@ -305,9 +305,9 @@ class lazy_split_view : public view_interface<lazy_split_view<_View, _Pattern>>
     // Note: these private functions are necessary because GCC doesn't allow calls to private members of `__i_` from
     // free functions that are friends of `inner-iterator`.
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr bool __is_done() const {
-      _LIBCPP_ASSERT(__i_.__parent_, "Cannot call comparison on a default-constructed iterator.");
+      _LIBCUDACXX_ASSERT(__i_.__parent_, "Cannot call comparison on a default-constructed iterator.");
 
       auto [__pcur, __pend] = ranges::subrange{__i_.__parent_->__pattern_};
       auto __end = ranges::end(__i_.__parent_->__base_);
@@ -339,12 +339,12 @@ class lazy_split_view : public view_interface<lazy_split_view<_View, _Pattern>>
       }
     }
 
-    [[nodiscard]] _LIBCPP_HIDE_FROM_ABI
+    [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI
     constexpr auto& __outer_current() noexcept {
       return __i_.__current();
     }
 
-    [[nodiscard]] _LIBCPP_HIDE_FROM_ABI
+    [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI
     constexpr const auto& __outer_current() const noexcept {
       return __i_.__current();
     }
@@ -355,23 +355,23 @@ class lazy_split_view : public view_interface<lazy_split_view<_View, _Pattern>>
     using value_type = range_value_t<_Base>;
     using 
diff erence_type = range_
diff erence_t<_Base>;
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     __inner_iterator() = default;
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr explicit __inner_iterator(__outer_iterator<_Const> __i)
       : __i_(std::move(__i)) {}
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr const iterator_t<_Base>& base() const& noexcept { return __i_.__current(); }
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr iterator_t<_Base> base() &&
       requires forward_range<_View> { return std::move(__i_.__current()); }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr decltype(auto) operator*() const { return *__i_.__current(); }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr __inner_iterator& operator++() {
       __incremented_ = true;
 
@@ -385,7 +385,7 @@ class lazy_split_view : public view_interface<lazy_split_view<_View, _Pattern>>
       return *this;
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr decltype(auto) operator++(int) {
       if constexpr (forward_range<_Base>) {
         auto __tmp = *this;
@@ -397,24 +397,24 @@ class lazy_split_view : public view_interface<lazy_split_view<_View, _Pattern>>
       }
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     friend constexpr bool operator==(const __inner_iterator& __x, const __inner_iterator& __y)
       requires forward_range<_Base> {
       return __x.__outer_current() == __y.__outer_current();
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     friend constexpr bool operator==(const __inner_iterator& __x, default_sentinel_t) {
       return __x.__is_done();
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     friend constexpr decltype(auto) iter_move(const __inner_iterator& __i)
         noexcept(noexcept(ranges::iter_move(__i.__outer_current()))) {
       return ranges::iter_move(__i.__outer_current());
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     friend constexpr void iter_swap(const __inner_iterator& __x, const __inner_iterator& __y)
         noexcept(noexcept(ranges::iter_swap(__x.__outer_current(), __y.__outer_current())))
         requires indirectly_swappable<iterator_t<_Base>> {
@@ -435,7 +435,7 @@ namespace views {
 namespace __lazy_split_view {
 struct __fn : __range_adaptor_closure<__fn> {
   template <class _Range, class _Pattern>
-  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI
+  [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto operator()(_Range&& __range, _Pattern&& __pattern) const
     noexcept(noexcept(lazy_split_view(std::forward<_Range>(__range), std::forward<_Pattern>(__pattern))))
     -> decltype(      lazy_split_view(std::forward<_Range>(__range), std::forward<_Pattern>(__pattern)))
@@ -443,7 +443,7 @@ struct __fn : __range_adaptor_closure<__fn> {
 
   template <class _Pattern>
     requires constructible_from<decay_t<_Pattern>, _Pattern>
-  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI
+  [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto operator()(_Pattern&& __pattern) const
       noexcept(is_nothrow_constructible_v<decay_t<_Pattern>, _Pattern>) {
     return __range_adaptor_closure_t(std::__bind_back(*this, std::forward<_Pattern>(__pattern)));
@@ -458,8 +458,8 @@ inline namespace __cpo {
 
 } // namespace ranges
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___RANGES_LAZY_SPLIT_VIEW_H
+#endif // _LIBCUDACXX___RANGES_LAZY_SPLIT_VIEW_H

diff  --git a/libcxx/include/__ranges/non_propagating_cache.h b/libcxx/include/__ranges/non_propagating_cache.h
index 7255705256d7..50528cadad90 100644
--- a/libcxx/include/__ranges/non_propagating_cache.h
+++ b/libcxx/include/__ranges/non_propagating_cache.h
@@ -6,8 +6,8 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-#ifndef _LIBCPP___RANGES_NON_PROPAGATING_CACHE_H
-#define _LIBCPP___RANGES_NON_PROPAGATING_CACHE_H
+#ifndef _LIBCUDACXX___RANGES_NON_PROPAGATING_CACHE_H
+#define _LIBCUDACXX___RANGES_NON_PROPAGATING_CACHE_H
 
 #include <__config>
 #include <__iterator/concepts.h>        // indirectly_readable
@@ -18,13 +18,13 @@
 #include <optional>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
 namespace ranges {
   // __non_propagating_cache is a helper type that allows storing an optional value in it,
@@ -37,7 +37,7 @@ namespace ranges {
   // may refer to internal details of the source view.
   template<class _Tp>
     requires is_object_v<_Tp>
-  class _LIBCPP_TEMPLATE_VIS __non_propagating_cache {
+  class _LIBCUDACXX_TEMPLATE_VIS __non_propagating_cache {
     struct __from_tag { };
     struct __forward_tag { };
 
@@ -54,21 +54,21 @@ namespace ranges {
     optional<__wrapper> __value_ = nullopt;
 
   public:
-    _LIBCPP_HIDE_FROM_ABI __non_propagating_cache() = default;
+    _LIBCUDACXX_HIDE_FROM_ABI __non_propagating_cache() = default;
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr __non_propagating_cache(__non_propagating_cache const&) noexcept
       : __value_(nullopt)
     { }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr __non_propagating_cache(__non_propagating_cache&& __other) noexcept
       : __value_(nullopt)
     {
       __other.__value_.reset();
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr __non_propagating_cache& operator=(__non_propagating_cache const& __other) noexcept {
       if (this != std::addressof(__other)) {
         __value_.reset();
@@ -76,29 +76,29 @@ namespace ranges {
       return *this;
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr __non_propagating_cache& operator=(__non_propagating_cache&& __other) noexcept {
       __value_.reset();
       __other.__value_.reset();
       return *this;
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr _Tp& operator*() { return __value_->__t_; }
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr _Tp const& operator*() const { return __value_->__t_; }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr bool __has_value() const { return __value_.has_value(); }
 
     template<class _Fn>
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr _Tp& __emplace_from(_Fn const& __f) {
       return __value_.emplace(__from_tag{}, __f).__t_;
     }
 
     template<class ..._Args>
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr _Tp& __emplace(_Args&& ...__args) {
       return __value_.emplace(__forward_tag{}, std::forward<_Args>(__args)...).__t_;
     }
@@ -107,8 +107,8 @@ namespace ranges {
   struct __empty_cache { };
 } // namespace ranges
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___RANGES_NON_PROPAGATING_CACHE_H
+#endif // _LIBCUDACXX___RANGES_NON_PROPAGATING_CACHE_H

diff  --git a/libcxx/include/__ranges/owning_view.h b/libcxx/include/__ranges/owning_view.h
index ac1ef08fecc2..97a67c436fa9 100644
--- a/libcxx/include/__ranges/owning_view.h
+++ b/libcxx/include/__ranges/owning_view.h
@@ -6,8 +6,8 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-#ifndef _LIBCPP___RANGES_OWNING_VIEW_H
-#define _LIBCPP___RANGES_OWNING_VIEW_H
+#ifndef _LIBCUDACXX___RANGES_OWNING_VIEW_H
+#define _LIBCUDACXX___RANGES_OWNING_VIEW_H
 
 #include <__concepts/constructible.h>
 #include <__concepts/movable.h>
@@ -22,13 +22,13 @@
 #include <__utility/move.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
 namespace ranges {
   template<range _Rp>
@@ -38,34 +38,34 @@ namespace ranges {
 
 public:
     owning_view() requires default_initializable<_Rp> = default;
-    _LIBCPP_HIDE_FROM_ABI constexpr owning_view(_Rp&& __r) : __r_(std::move(__r)) {}
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr owning_view(_Rp&& __r) : __r_(std::move(__r)) {}
 
     owning_view(owning_view&&) = default;
     owning_view& operator=(owning_view&&) = default;
 
-    _LIBCPP_HIDE_FROM_ABI constexpr _Rp& base() & noexcept { return __r_; }
-    _LIBCPP_HIDE_FROM_ABI constexpr const _Rp& base() const& noexcept { return __r_; }
-    _LIBCPP_HIDE_FROM_ABI constexpr _Rp&& base() && noexcept { return std::move(__r_); }
-    _LIBCPP_HIDE_FROM_ABI constexpr const _Rp&& base() const&& noexcept { return std::move(__r_); }
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr _Rp& base() & noexcept { return __r_; }
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr const _Rp& base() const& noexcept { return __r_; }
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr _Rp&& base() && noexcept { return std::move(__r_); }
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr const _Rp&& base() const&& noexcept { return std::move(__r_); }
 
-    _LIBCPP_HIDE_FROM_ABI constexpr iterator_t<_Rp> begin() { return ranges::begin(__r_); }
-    _LIBCPP_HIDE_FROM_ABI constexpr sentinel_t<_Rp> end() { return ranges::end(__r_); }
-    _LIBCPP_HIDE_FROM_ABI constexpr auto begin() const requires range<const _Rp> { return ranges::begin(__r_); }
-    _LIBCPP_HIDE_FROM_ABI constexpr auto end() const requires range<const _Rp> { return ranges::end(__r_); }
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr iterator_t<_Rp> begin() { return ranges::begin(__r_); }
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr sentinel_t<_Rp> end() { return ranges::end(__r_); }
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr auto begin() const requires range<const _Rp> { return ranges::begin(__r_); }
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr auto end() const requires range<const _Rp> { return ranges::end(__r_); }
 
-    _LIBCPP_HIDE_FROM_ABI constexpr bool empty() requires requires { ranges::empty(__r_); }
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr bool empty() requires requires { ranges::empty(__r_); }
       { return ranges::empty(__r_); }
-    _LIBCPP_HIDE_FROM_ABI constexpr bool empty() const requires requires { ranges::empty(__r_); }
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr bool empty() const requires requires { ranges::empty(__r_); }
       { return ranges::empty(__r_); }
 
-    _LIBCPP_HIDE_FROM_ABI constexpr auto size() requires sized_range<_Rp>
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr auto size() requires sized_range<_Rp>
       { return ranges::size(__r_); }
-    _LIBCPP_HIDE_FROM_ABI constexpr auto size() const requires sized_range<const _Rp>
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr auto size() const requires sized_range<const _Rp>
       { return ranges::size(__r_); }
 
-    _LIBCPP_HIDE_FROM_ABI constexpr auto data() requires contiguous_range<_Rp>
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr auto data() requires contiguous_range<_Rp>
       { return ranges::data(__r_); }
-    _LIBCPP_HIDE_FROM_ABI constexpr auto data() const requires contiguous_range<const _Rp>
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr auto data() const requires contiguous_range<const _Rp>
       { return ranges::data(__r_); }
   };
 
@@ -74,8 +74,8 @@ namespace ranges {
 
 } // namespace ranges
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___RANGES_OWNING_VIEW_H
+#endif // _LIBCUDACXX___RANGES_OWNING_VIEW_H

diff  --git a/libcxx/include/__ranges/range_adaptor.h b/libcxx/include/__ranges/range_adaptor.h
index b65233b56359..c80cc49d8b2b 100644
--- a/libcxx/include/__ranges/range_adaptor.h
+++ b/libcxx/include/__ranges/range_adaptor.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___RANGES_RANGE_ADAPTOR_H
-#define _LIBCPP___RANGES_RANGE_ADAPTOR_H
+#ifndef _LIBCUDACXX___RANGES_RANGE_ADAPTOR_H
+#define _LIBCUDACXX___RANGES_RANGE_ADAPTOR_H
 
 #include <__config>
 #include <__functional/compose.h>
@@ -19,13 +19,13 @@
 #include <concepts>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
 // CRTP base that one can derive from in order to be considered a range adaptor closure
 // by the library. When deriving from this class, a pipe operator will be provided to
@@ -50,7 +50,7 @@ struct __range_adaptor_closure {
     template <ranges::viewable_range _View, _RangeAdaptorClosure _Closure>
         requires same_as<_Tp, remove_cvref_t<_Closure>> &&
                  invocable<_Closure, _View>
-    [[nodiscard]] _LIBCPP_HIDE_FROM_ABI
+    [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI
     friend constexpr decltype(auto) operator|(_View&& __view, _Closure&& __closure)
         noexcept(is_nothrow_invocable_v<_Closure, _View>)
     { return std::invoke(std::forward<_Closure>(__closure), std::forward<_View>(__view)); }
@@ -59,15 +59,15 @@ struct __range_adaptor_closure {
         requires same_as<_Tp, remove_cvref_t<_Closure>> &&
                  constructible_from<decay_t<_Closure>, _Closure> &&
                  constructible_from<decay_t<_OtherClosure>, _OtherClosure>
-    [[nodiscard]] _LIBCPP_HIDE_FROM_ABI
+    [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI
     friend constexpr auto operator|(_Closure&& __c1, _OtherClosure&& __c2)
         noexcept(is_nothrow_constructible_v<decay_t<_Closure>, _Closure> &&
                  is_nothrow_constructible_v<decay_t<_OtherClosure>, _OtherClosure>)
     { return __range_adaptor_closure_t(std::__compose(std::forward<_OtherClosure>(__c2), std::forward<_Closure>(__c1))); }
 };
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___RANGES_RANGE_ADAPTOR_H
+#endif // _LIBCUDACXX___RANGES_RANGE_ADAPTOR_H

diff  --git a/libcxx/include/__ranges/rbegin.h b/libcxx/include/__ranges/rbegin.h
index 9291359fdf3b..8cdf8877aa12 100644
--- a/libcxx/include/__ranges/rbegin.h
+++ b/libcxx/include/__ranges/rbegin.h
@@ -6,8 +6,8 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-#ifndef _LIBCPP___RANGES_RBEGIN_H
-#define _LIBCPP___RANGES_RBEGIN_H
+#ifndef _LIBCUDACXX___RANGES_RBEGIN_H
+#define _LIBCUDACXX___RANGES_RBEGIN_H
 
 #include <__concepts/class_or_enum.h>
 #include <__concepts/same_as.h>
@@ -19,13 +19,13 @@
 #include <__utility/auto_cast.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
 // [ranges.access.rbegin]
 
@@ -36,7 +36,7 @@ concept __member_rbegin =
   __can_borrow<_Tp> &&
   __workaround_52970<_Tp> &&
   requires(_Tp&& __t) {
-    { _LIBCPP_AUTO_CAST(__t.rbegin()) } -> input_or_output_iterator;
+    { _LIBCUDACXX_AUTO_CAST(__t.rbegin()) } -> input_or_output_iterator;
   };
 
 void rbegin(auto&) = delete;
@@ -48,7 +48,7 @@ concept __unqualified_rbegin =
   __can_borrow<_Tp> &&
   __class_or_enum<remove_cvref_t<_Tp>> &&
   requires(_Tp&& __t) {
-    { _LIBCPP_AUTO_CAST(rbegin(__t)) } -> input_or_output_iterator;
+    { _LIBCUDACXX_AUTO_CAST(rbegin(__t)) } -> input_or_output_iterator;
   };
 
 template <class _Tp>
@@ -64,23 +64,23 @@ concept __can_reverse =
 struct __fn {
   template <class _Tp>
     requires __member_rbegin<_Tp>
-  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const
-    noexcept(noexcept(_LIBCPP_AUTO_CAST(__t.rbegin())))
+  [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const
+    noexcept(noexcept(_LIBCUDACXX_AUTO_CAST(__t.rbegin())))
   {
-    return _LIBCPP_AUTO_CAST(__t.rbegin());
+    return _LIBCUDACXX_AUTO_CAST(__t.rbegin());
   }
 
   template <class _Tp>
     requires __unqualified_rbegin<_Tp>
-  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const
-    noexcept(noexcept(_LIBCPP_AUTO_CAST(rbegin(__t))))
+  [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const
+    noexcept(noexcept(_LIBCUDACXX_AUTO_CAST(rbegin(__t))))
   {
-    return _LIBCPP_AUTO_CAST(rbegin(__t));
+    return _LIBCUDACXX_AUTO_CAST(rbegin(__t));
   }
 
   template <class _Tp>
     requires __can_reverse<_Tp>
-  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const
+  [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const
     noexcept(noexcept(ranges::end(__t)))
   {
     return std::make_reverse_iterator(ranges::end(__t));
@@ -102,7 +102,7 @@ namespace __crbegin {
 struct __fn {
   template <class _Tp>
     requires is_lvalue_reference_v<_Tp&&>
-  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI
+  [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto operator()(_Tp&& __t) const
     noexcept(noexcept(ranges::rbegin(static_cast<const remove_reference_t<_Tp>&>(__t))))
     -> decltype(      ranges::rbegin(static_cast<const remove_reference_t<_Tp>&>(__t)))
@@ -110,7 +110,7 @@ struct __fn {
 
   template <class _Tp>
     requires is_rvalue_reference_v<_Tp&&>
-  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI
+  [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto operator()(_Tp&& __t) const
     noexcept(noexcept(ranges::rbegin(static_cast<const _Tp&&>(__t))))
     -> decltype(      ranges::rbegin(static_cast<const _Tp&&>(__t)))
@@ -123,8 +123,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___RANGES_RBEGIN_H
+#endif // _LIBCUDACXX___RANGES_RBEGIN_H

diff  --git a/libcxx/include/__ranges/ref_view.h b/libcxx/include/__ranges/ref_view.h
index e69c715fb9e4..0d1190167389 100644
--- a/libcxx/include/__ranges/ref_view.h
+++ b/libcxx/include/__ranges/ref_view.h
@@ -6,8 +6,8 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-#ifndef _LIBCPP___RANGES_REF_VIEW_H
-#define _LIBCPP___RANGES_REF_VIEW_H
+#ifndef _LIBCUDACXX___RANGES_REF_VIEW_H
+#define _LIBCUDACXX___RANGES_REF_VIEW_H
 
 #include <__config>
 #include <__iterator/concepts.h>
@@ -25,13 +25,13 @@
 #include <concepts>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
 namespace ranges {
   template<range _Range>
@@ -46,27 +46,27 @@ namespace ranges {
     template<class _Tp>
       requires __
diff erent_from<_Tp, ref_view> &&
         convertible_to<_Tp, _Range&> && requires { __fun(declval<_Tp>()); }
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr ref_view(_Tp&& __t)
       : __range_(std::addressof(static_cast<_Range&>(std::forward<_Tp>(__t))))
     {}
 
-    _LIBCPP_HIDE_FROM_ABI constexpr _Range& base() const { return *__range_; }
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr _Range& base() const { return *__range_; }
 
-    _LIBCPP_HIDE_FROM_ABI constexpr iterator_t<_Range> begin() const { return ranges::begin(*__range_); }
-    _LIBCPP_HIDE_FROM_ABI constexpr sentinel_t<_Range> end() const { return ranges::end(*__range_); }
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr iterator_t<_Range> begin() const { return ranges::begin(*__range_); }
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr sentinel_t<_Range> end() const { return ranges::end(*__range_); }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr bool empty() const
       requires requires { ranges::empty(*__range_); }
     { return ranges::empty(*__range_); }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr auto size() const
       requires sized_range<_Range>
     { return ranges::size(*__range_); }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr auto data() const
       requires contiguous_range<_Range>
     { return ranges::data(*__range_); }
@@ -79,8 +79,8 @@ namespace ranges {
   inline constexpr bool enable_borrowed_range<ref_view<_Tp>> = true;
 } // namespace ranges
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___RANGES_REF_VIEW_H
+#endif // _LIBCUDACXX___RANGES_REF_VIEW_H

diff  --git a/libcxx/include/__ranges/rend.h b/libcxx/include/__ranges/rend.h
index e507b2587277..cb898f8da5ee 100644
--- a/libcxx/include/__ranges/rend.h
+++ b/libcxx/include/__ranges/rend.h
@@ -6,8 +6,8 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-#ifndef _LIBCPP___RANGES_REND_H
-#define _LIBCPP___RANGES_REND_H
+#ifndef _LIBCUDACXX___RANGES_REND_H
+#define _LIBCUDACXX___RANGES_REND_H
 
 #include <__concepts/class_or_enum.h>
 #include <__concepts/same_as.h>
@@ -20,13 +20,13 @@
 #include <__utility/auto_cast.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
 // [range.access.rend]
 
@@ -38,7 +38,7 @@ concept __member_rend =
   __workaround_52970<_Tp> &&
   requires(_Tp&& __t) {
     ranges::rbegin(__t);
-    { _LIBCPP_AUTO_CAST(__t.rend()) } -> sentinel_for<decltype(ranges::rbegin(__t))>;
+    { _LIBCUDACXX_AUTO_CAST(__t.rend()) } -> sentinel_for<decltype(ranges::rbegin(__t))>;
   };
 
 void rend(auto&) = delete;
@@ -51,7 +51,7 @@ concept __unqualified_rend =
   __class_or_enum<remove_cvref_t<_Tp>> &&
   requires(_Tp&& __t) {
     ranges::rbegin(__t);
-    { _LIBCPP_AUTO_CAST(rend(__t)) } -> sentinel_for<decltype(ranges::rbegin(__t))>;
+    { _LIBCUDACXX_AUTO_CAST(rend(__t)) } -> sentinel_for<decltype(ranges::rbegin(__t))>;
   };
 
 template <class _Tp>
@@ -68,23 +68,23 @@ class __fn {
 public:
   template <class _Tp>
     requires __member_rend<_Tp>
-  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const
-    noexcept(noexcept(_LIBCPP_AUTO_CAST(__t.rend())))
+  [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const
+    noexcept(noexcept(_LIBCUDACXX_AUTO_CAST(__t.rend())))
   {
-    return _LIBCPP_AUTO_CAST(__t.rend());
+    return _LIBCUDACXX_AUTO_CAST(__t.rend());
   }
 
   template <class _Tp>
     requires __unqualified_rend<_Tp>
-  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const
-    noexcept(noexcept(_LIBCPP_AUTO_CAST(rend(__t))))
+  [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const
+    noexcept(noexcept(_LIBCUDACXX_AUTO_CAST(rend(__t))))
   {
-    return _LIBCPP_AUTO_CAST(rend(__t));
+    return _LIBCUDACXX_AUTO_CAST(rend(__t));
   }
 
   template <class _Tp>
     requires __can_reverse<_Tp>
-  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const
+  [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const
     noexcept(noexcept(ranges::begin(__t)))
   {
     return std::make_reverse_iterator(ranges::begin(__t));
@@ -106,7 +106,7 @@ namespace __crend {
 struct __fn {
   template <class _Tp>
     requires is_lvalue_reference_v<_Tp&&>
-  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI
+  [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto operator()(_Tp&& __t) const
     noexcept(noexcept(ranges::rend(static_cast<const remove_reference_t<_Tp>&>(__t))))
     -> decltype(      ranges::rend(static_cast<const remove_reference_t<_Tp>&>(__t)))
@@ -114,7 +114,7 @@ struct __fn {
 
   template <class _Tp>
     requires is_rvalue_reference_v<_Tp&&>
-  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI
+  [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto operator()(_Tp&& __t) const
     noexcept(noexcept(ranges::rend(static_cast<const _Tp&&>(__t))))
     -> decltype(      ranges::rend(static_cast<const _Tp&&>(__t)))
@@ -127,8 +127,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___RANGES_REND_H
+#endif // _LIBCUDACXX___RANGES_REND_H

diff  --git a/libcxx/include/__ranges/reverse_view.h b/libcxx/include/__ranges/reverse_view.h
index b1df8fbc337b..d340b966bd88 100644
--- a/libcxx/include/__ranges/reverse_view.h
+++ b/libcxx/include/__ranges/reverse_view.h
@@ -6,8 +6,8 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-#ifndef _LIBCPP___RANGES_REVERSE_VIEW_H
-#define _LIBCPP___RANGES_REVERSE_VIEW_H
+#ifndef _LIBCUDACXX___RANGES_REVERSE_VIEW_H
+#define _LIBCUDACXX___RANGES_REVERSE_VIEW_H
 
 #include <__concepts/constructible.h>
 #include <__config>
@@ -27,13 +27,13 @@
 #include <__utility/move.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
 namespace ranges {
   template<view _View>
@@ -43,23 +43,23 @@ namespace ranges {
     // amortized O(1) begin() method.
     static constexpr bool _UseCache = !random_access_range<_View> && !common_range<_View>;
     using _Cache = _If<_UseCache, __non_propagating_cache<reverse_iterator<iterator_t<_View>>>, __empty_cache>;
-    _LIBCPP_NO_UNIQUE_ADDRESS _Cache __cached_begin_ = _Cache();
-    _LIBCPP_NO_UNIQUE_ADDRESS _View __base_ = _View();
+    _LIBCUDACXX_NO_UNIQUE_ADDRESS _Cache __cached_begin_ = _Cache();
+    _LIBCUDACXX_NO_UNIQUE_ADDRESS _View __base_ = _View();
 
   public:
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     reverse_view() requires default_initializable<_View> = default;
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr explicit reverse_view(_View __view) : __base_(std::move(__view)) {}
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr _View base() const& requires copy_constructible<_View> { return __base_; }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr _View base() && { return std::move(__base_); }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr reverse_iterator<iterator_t<_View>> begin() {
       if constexpr (_UseCache)
         if (__cached_begin_.__has_value())
@@ -71,32 +71,32 @@ namespace ranges {
       return __tmp;
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr reverse_iterator<iterator_t<_View>> begin() requires common_range<_View> {
       return std::make_reverse_iterator(ranges::end(__base_));
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr auto begin() const requires common_range<const _View> {
       return std::make_reverse_iterator(ranges::end(__base_));
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr reverse_iterator<iterator_t<_View>> end() {
       return std::make_reverse_iterator(ranges::begin(__base_));
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr auto end() const requires common_range<const _View> {
       return std::make_reverse_iterator(ranges::begin(__base_));
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr auto size() requires sized_range<_View> {
       return ranges::size(__base_);
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr auto size() const requires sized_range<const _View> {
       return ranges::size(__base_);
     }
@@ -141,7 +141,7 @@ namespace ranges {
     struct __fn : __range_adaptor_closure<__fn> {
       template<class _Range>
         requires __is_reverse_view<remove_cvref_t<_Range>>
-      [[nodiscard]] _LIBCPP_HIDE_FROM_ABI
+      [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI
       constexpr auto operator()(_Range&& __range) const
         noexcept(noexcept(std::forward<_Range>(__range).base()))
         -> decltype(      std::forward<_Range>(__range).base())
@@ -150,7 +150,7 @@ namespace ranges {
       template<class _Range,
                class _UnwrappedSubrange = typename __unwrapped_reverse_subrange<remove_cvref_t<_Range>>::type>
         requires __is_sized_reverse_subrange<remove_cvref_t<_Range>>
-      [[nodiscard]] _LIBCPP_HIDE_FROM_ABI
+      [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI
       constexpr auto operator()(_Range&& __range) const
         noexcept(noexcept(_UnwrappedSubrange(__range.end().base(), __range.begin().base(), __range.size())))
         -> decltype(      _UnwrappedSubrange(__range.end().base(), __range.begin().base(), __range.size()))
@@ -159,7 +159,7 @@ namespace ranges {
       template<class _Range,
                class _UnwrappedSubrange = typename __unwrapped_reverse_subrange<remove_cvref_t<_Range>>::type>
         requires __is_unsized_reverse_subrange<remove_cvref_t<_Range>>
-      [[nodiscard]] _LIBCPP_HIDE_FROM_ABI
+      [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI
       constexpr auto operator()(_Range&& __range) const
         noexcept(noexcept(_UnwrappedSubrange(__range.end().base(), __range.begin().base())))
         -> decltype(      _UnwrappedSubrange(__range.end().base(), __range.begin().base()))
@@ -169,7 +169,7 @@ namespace ranges {
         requires (!__is_reverse_view<remove_cvref_t<_Range>> &&
                   !__is_sized_reverse_subrange<remove_cvref_t<_Range>> &&
                   !__is_unsized_reverse_subrange<remove_cvref_t<_Range>>)
-      [[nodiscard]] _LIBCPP_HIDE_FROM_ABI
+      [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI
       constexpr auto operator()(_Range&& __range) const
         noexcept(noexcept(reverse_view{std::forward<_Range>(__range)}))
         -> decltype(      reverse_view{std::forward<_Range>(__range)})
@@ -183,8 +183,8 @@ namespace ranges {
   } // namespace views
 } // namespace ranges
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___RANGES_REVERSE_VIEW_H
+#endif // _LIBCUDACXX___RANGES_REVERSE_VIEW_H

diff  --git a/libcxx/include/__ranges/single_view.h b/libcxx/include/__ranges/single_view.h
index 98ebe5f3839f..83db236d500f 100644
--- a/libcxx/include/__ranges/single_view.h
+++ b/libcxx/include/__ranges/single_view.h
@@ -6,8 +6,8 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-#ifndef _LIBCPP___RANGES_SINGLE_VIEW_H
-#define _LIBCPP___RANGES_SINGLE_VIEW_H
+#ifndef _LIBCUDACXX___RANGES_SINGLE_VIEW_H
+#define _LIBCUDACXX___RANGES_SINGLE_VIEW_H
 
 #include <__config>
 #include <__ranges/copyable_box.h>
@@ -19,13 +19,13 @@
 #include <concepts>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
 namespace ranges {
   template<copy_constructible _Tp>
@@ -34,40 +34,40 @@ namespace ranges {
     __copyable_box<_Tp> __value_;
 
   public:
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     single_view() requires default_initializable<_Tp> = default;
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr explicit single_view(const _Tp& __t) : __value_(in_place, __t) {}
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr explicit single_view(_Tp&& __t) : __value_(in_place, std::move(__t)) {}
 
     template<class... _Args>
       requires constructible_from<_Tp, _Args...>
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr explicit single_view(in_place_t, _Args&&... __args)
       : __value_{in_place, std::forward<_Args>(__args)...} {}
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr _Tp* begin() noexcept { return data(); }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr const _Tp* begin() const noexcept { return data(); }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr _Tp* end() noexcept { return data() + 1; }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr const _Tp* end() const noexcept { return data() + 1; }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     static constexpr size_t size() noexcept { return 1; }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr _Tp* data() noexcept { return __value_.operator->(); }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr const _Tp* data() const noexcept { return __value_.operator->(); }
   };
 
@@ -79,7 +79,7 @@ namespace __single_view {
 
 struct __fn : __range_adaptor_closure<__fn> {
   template<class _Range>
-  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI
+  [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto operator()(_Range&& __range) const
     noexcept(noexcept(single_view<decay_t<_Range&&>>(std::forward<_Range>(__range))))
     -> decltype(      single_view<decay_t<_Range&&>>(std::forward<_Range>(__range)))
@@ -94,8 +94,8 @@ inline namespace __cpo {
 } // namespace views
 } // namespace ranges
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___RANGES_SINGLE_VIEW_H
+#endif // _LIBCUDACXX___RANGES_SINGLE_VIEW_H

diff  --git a/libcxx/include/__ranges/size.h b/libcxx/include/__ranges/size.h
index 0e6d295651a3..5da133b4d4f5 100644
--- a/libcxx/include/__ranges/size.h
+++ b/libcxx/include/__ranges/size.h
@@ -6,8 +6,8 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-#ifndef _LIBCPP___RANGES_SIZE_H
-#define _LIBCPP___RANGES_SIZE_H
+#ifndef _LIBCUDACXX___RANGES_SIZE_H
+#define _LIBCUDACXX___RANGES_SIZE_H
 
 #include <__concepts/class_or_enum.h>
 #include <__config>
@@ -19,13 +19,13 @@
 #include <cstddef>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 namespace ranges {
   template<class>
@@ -47,7 +47,7 @@ concept __member_size =
   __size_enabled<_Tp> &&
   __workaround_52970<_Tp> &&
   requires(_Tp&& __t) {
-    { _LIBCPP_AUTO_CAST(__t.size()) } -> __integer_like;
+    { _LIBCUDACXX_AUTO_CAST(__t.size()) } -> __integer_like;
   };
 
 template <class _Tp>
@@ -56,7 +56,7 @@ concept __unqualified_size =
   !__member_size<_Tp> &&
   __class_or_enum<remove_cvref_t<_Tp>> &&
   requires(_Tp&& __t) {
-    { _LIBCPP_AUTO_CAST(size(__t)) } -> __integer_like;
+    { _LIBCUDACXX_AUTO_CAST(size(__t)) } -> __integer_like;
   };
 
 template <class _Tp>
@@ -73,33 +73,33 @@ struct __fn {
 
   // `[range.prim.size]`: the array case (for rvalues).
   template <class _Tp, size_t _Sz>
-  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr size_t operator()(_Tp (&&)[_Sz]) const noexcept {
+  [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI constexpr size_t operator()(_Tp (&&)[_Sz]) const noexcept {
     return _Sz;
   }
 
   // `[range.prim.size]`: the array case (for lvalues).
   template <class _Tp, size_t _Sz>
-  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr size_t operator()(_Tp (&)[_Sz]) const noexcept {
+  [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI constexpr size_t operator()(_Tp (&)[_Sz]) const noexcept {
     return _Sz;
   }
 
   // `[range.prim.size]`: `auto(t.size())` is a valid expression.
   template <__member_size _Tp>
-  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr __integer_like auto operator()(_Tp&& __t) const
-      noexcept(noexcept(_LIBCPP_AUTO_CAST(__t.size()))) {
-    return _LIBCPP_AUTO_CAST(__t.size());
+  [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI constexpr __integer_like auto operator()(_Tp&& __t) const
+      noexcept(noexcept(_LIBCUDACXX_AUTO_CAST(__t.size()))) {
+    return _LIBCUDACXX_AUTO_CAST(__t.size());
   }
 
   // `[range.prim.size]`: `auto(size(t))` is a valid expression.
   template <__unqualified_size _Tp>
-  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr __integer_like auto operator()(_Tp&& __t) const
-      noexcept(noexcept(_LIBCPP_AUTO_CAST(size(__t)))) {
-    return _LIBCPP_AUTO_CAST(size(__t));
+  [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI constexpr __integer_like auto operator()(_Tp&& __t) const
+      noexcept(noexcept(_LIBCUDACXX_AUTO_CAST(size(__t)))) {
+    return _LIBCUDACXX_AUTO_CAST(size(__t));
   }
 
   // [range.prim.size]: the `to-unsigned-like` case.
   template <__
diff erence _Tp>
-  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const
+  [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const
     noexcept(noexcept(std::__to_unsigned_like(ranges::end(__t) - ranges::begin(__t))))
     -> decltype(      std::__to_unsigned_like(ranges::end(__t) - ranges::begin(__t)))
     { return          std::__to_unsigned_like(ranges::end(__t) - ranges::begin(__t));
@@ -120,7 +120,7 @@ namespace __ssize {
 struct __fn {
   template<class _Tp>
     requires requires (_Tp&& __t) { ranges::size(__t); }
-  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr integral auto operator()(_Tp&& __t) const
+  [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI constexpr integral auto operator()(_Tp&& __t) const
     noexcept(noexcept(ranges::size(__t))) {
     using _Signed = make_signed_t<decltype(ranges::size(__t))>;
     if constexpr (sizeof(ptr
diff _t) > sizeof(_Signed))
@@ -136,8 +136,8 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___RANGES_SIZE_H
+#endif // _LIBCUDACXX___RANGES_SIZE_H

diff  --git a/libcxx/include/__ranges/subrange.h b/libcxx/include/__ranges/subrange.h
index 7e42da6ce7f9..fcb4cc77f26f 100644
--- a/libcxx/include/__ranges/subrange.h
+++ b/libcxx/include/__ranges/subrange.h
@@ -6,8 +6,8 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-#ifndef _LIBCPP___RANGES_SUBRANGE_H
-#define _LIBCPP___RANGES_SUBRANGE_H
+#ifndef _LIBCUDACXX___RANGES_SUBRANGE_H
+#define _LIBCUDACXX___RANGES_SUBRANGE_H
 
 #include <__assert>
 #include <__concepts/constructible.h>
@@ -30,13 +30,13 @@
 #include <__utility/move.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
 namespace ranges {
   template<class _From, class _To>
@@ -67,14 +67,14 @@ namespace ranges {
     __convertible_to_non_slicing<_Iter, tuple_element_t<0, _Pair>> &&
     convertible_to<_Sent, tuple_element_t<1, _Pair>>;
 
-  enum class _LIBCPP_ENUM_VIS subrange_kind : bool { unsized, sized };
+  enum class _LIBCUDACXX_ENUM_VIS subrange_kind : bool { unsized, sized };
 
   template<input_or_output_iterator _Iter, sentinel_for<_Iter> _Sent = _Iter,
            subrange_kind _Kind = sized_sentinel_for<_Sent, _Iter>
              ? subrange_kind::sized
              : subrange_kind::unsized>
     requires (_Kind == subrange_kind::sized || !sized_sentinel_for<_Sent, _Iter>)
-  class _LIBCPP_TEMPLATE_VIS subrange
+  class _LIBCUDACXX_TEMPLATE_VIS subrange
     : public view_interface<subrange<_Iter, _Sent, _Kind>>
   {
   public:
@@ -85,28 +85,28 @@ namespace ranges {
     static constexpr bool _MustProvideSizeAtConstruction = !_StoreSize; // just to improve compiler diagnostics
     struct _Empty { constexpr _Empty(auto) noexcept { } };
     using _Size = conditional_t<_StoreSize, make_unsigned_t<iter_
diff erence_t<_Iter>>, _Empty>;
-    _LIBCPP_NO_UNIQUE_ADDRESS _Iter __begin_ = _Iter();
-    _LIBCPP_NO_UNIQUE_ADDRESS _Sent __end_ = _Sent();
-    _LIBCPP_NO_UNIQUE_ADDRESS _Size __size_ = 0;
+    _LIBCUDACXX_NO_UNIQUE_ADDRESS _Iter __begin_ = _Iter();
+    _LIBCUDACXX_NO_UNIQUE_ADDRESS _Sent __end_ = _Sent();
+    _LIBCUDACXX_NO_UNIQUE_ADDRESS _Size __size_ = 0;
 
   public:
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     subrange() requires default_initializable<_Iter> = default;
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr subrange(__convertible_to_non_slicing<_Iter> auto __iter, _Sent __sent)
       requires _MustProvideSizeAtConstruction
       : __begin_(std::move(__iter)), __end_(std::move(__sent))
     { }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr subrange(__convertible_to_non_slicing<_Iter> auto __iter, _Sent __sent,
                        make_unsigned_t<iter_
diff erence_t<_Iter>> __n)
       requires (_Kind == subrange_kind::sized)
       : __begin_(std::move(__iter)), __end_(std::move(__sent)), __size_(__n)
     {
       if constexpr (sized_sentinel_for<_Sent, _Iter>)
-        _LIBCPP_ASSERT((__end_ - __begin_) == static_cast<iter_
diff erence_t<_Iter>>(__n),
+        _LIBCUDACXX_ASSERT((__end_ - __begin_) == static_cast<iter_
diff erence_t<_Iter>>(__n),
           "std::ranges::subrange was passed an invalid size hint");
     }
 
@@ -114,7 +114,7 @@ namespace ranges {
       requires borrowed_range<_Range> &&
                __convertible_to_non_slicing<iterator_t<_Range>, _Iter> &&
                convertible_to<sentinel_t<_Range>, _Sent>
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr subrange(_Range&& __range)
       requires (!_StoreSize)
       : subrange(ranges::begin(__range), ranges::end(__range))
@@ -124,7 +124,7 @@ namespace ranges {
       requires borrowed_range<_Range> &&
                __convertible_to_non_slicing<iterator_t<_Range>, _Iter> &&
                convertible_to<sentinel_t<_Range>, _Sent>
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr subrange(_Range&& __range)
       requires _StoreSize && sized_range<_Range>
       : subrange(__range, ranges::size(__range))
@@ -133,7 +133,7 @@ namespace ranges {
     template<borrowed_range _Range>
       requires __convertible_to_non_slicing<iterator_t<_Range>, _Iter> &&
                convertible_to<sentinel_t<_Range>, _Sent>
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr subrange(_Range&& __range, make_unsigned_t<iter_
diff erence_t<_Iter>> __n)
       requires (_Kind == subrange_kind::sized)
       : subrange(ranges::begin(__range), ranges::end(__range), __n)
@@ -141,30 +141,30 @@ namespace ranges {
 
     template<__
diff erent_from<subrange> _Pair>
       requires __pair_like_convertible_from<_Pair, const _Iter&, const _Sent&>
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr operator _Pair() const {
       return _Pair(__begin_, __end_);
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr _Iter begin() const requires copyable<_Iter> {
       return __begin_;
     }
 
-    [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Iter begin() requires (!copyable<_Iter>) {
+    [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI constexpr _Iter begin() requires (!copyable<_Iter>) {
       return std::move(__begin_);
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr _Sent end() const {
       return __end_;
     }
 
-    [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool empty() const {
+    [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI constexpr bool empty() const {
       return __begin_ == __end_;
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr make_unsigned_t<iter_
diff erence_t<_Iter>> size() const
       requires (_Kind == subrange_kind::sized)
     {
@@ -174,7 +174,7 @@ namespace ranges {
         return std::__to_unsigned_like(__end_ - __begin_);
     }
 
-    [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr subrange next(iter_
diff erence_t<_Iter> __n = 1) const&
+    [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI constexpr subrange next(iter_
diff erence_t<_Iter> __n = 1) const&
       requires forward_iterator<_Iter>
     {
       auto __tmp = *this;
@@ -182,12 +182,12 @@ namespace ranges {
       return __tmp;
     }
 
-    [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr subrange next(iter_
diff erence_t<_Iter> __n = 1) && {
+    [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI constexpr subrange next(iter_
diff erence_t<_Iter> __n = 1) && {
       advance(__n);
       return std::move(*this);
     }
 
-    [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr subrange prev(iter_
diff erence_t<_Iter> __n = 1) const
+    [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI constexpr subrange prev(iter_
diff erence_t<_Iter> __n = 1) const
       requires bidirectional_iterator<_Iter>
     {
       auto __tmp = *this;
@@ -195,7 +195,7 @@ namespace ranges {
       return __tmp;
     }
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     constexpr subrange& advance(iter_
diff erence_t<_Iter> __n) {
       if constexpr (bidirectional_iterator<_Iter>) {
         if (__n < 0) {
@@ -231,7 +231,7 @@ namespace ranges {
 
   template<size_t _Index, class _Iter, class _Sent, subrange_kind _Kind>
     requires ((_Index == 0 && copyable<_Iter>) || _Index == 1)
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto get(const subrange<_Iter, _Sent, _Kind>& __subrange) {
     if constexpr (_Index == 0)
       return __subrange.begin();
@@ -241,7 +241,7 @@ namespace ranges {
 
   template<size_t _Index, class _Iter, class _Sent, subrange_kind _Kind>
     requires (_Index < 2)
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto get(subrange<_Iter, _Sent, _Kind>&& __subrange) {
     if constexpr (_Index == 0)
       return __subrange.begin();
@@ -285,8 +285,8 @@ struct tuple_element<1, const ranges::subrange<_Ip, _Sp, _Kp>> {
   using type = _Sp;
 };
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___RANGES_SUBRANGE_H
+#endif // _LIBCUDACXX___RANGES_SUBRANGE_H

diff  --git a/libcxx/include/__ranges/take_view.h b/libcxx/include/__ranges/take_view.h
index 11d5c9fc36bc..f74d28e315a2 100644
--- a/libcxx/include/__ranges/take_view.h
+++ b/libcxx/include/__ranges/take_view.h
@@ -6,8 +6,8 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-#ifndef _LIBCPP___RANGES_TAKE_VIEW_H
-#define _LIBCPP___RANGES_TAKE_VIEW_H
+#ifndef _LIBCUDACXX___RANGES_TAKE_VIEW_H
+#define _LIBCUDACXX___RANGES_TAKE_VIEW_H
 
 #include <__algorithm/min.h>
 #include <__algorithm/ranges_min.h>
@@ -36,41 +36,41 @@
 #include <concepts>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
 namespace ranges {
 
 template<view _View>
 class take_view : public view_interface<take_view<_View>> {
-  _LIBCPP_NO_UNIQUE_ADDRESS _View __base_ = _View();
+  _LIBCUDACXX_NO_UNIQUE_ADDRESS _View __base_ = _View();
   range_
diff erence_t<_View> __count_ = 0;
 
   template<bool> class __sentinel;
 
 public:
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   take_view() requires default_initializable<_View> = default;
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr take_view(_View __base, range_
diff erence_t<_View> __count)
     : __base_(std::move(__base)), __count_(__count) {}
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr _View base() const& requires copy_constructible<_View> { return __base_; }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr _View base() && { return std::move(__base_); }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto begin() requires (!__simple_view<_View>) {
     if constexpr (sized_range<_View>) {
       if constexpr (random_access_range<_View>) {
@@ -85,7 +85,7 @@ class take_view : public view_interface<take_view<_View>> {
     }
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto begin() const requires range<const _View> {
     if constexpr (sized_range<const _View>) {
       if constexpr (random_access_range<const _View>) {
@@ -100,7 +100,7 @@ class take_view : public view_interface<take_view<_View>> {
     }
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto end() requires (!__simple_view<_View>) {
     if constexpr (sized_range<_View>) {
       if constexpr (random_access_range<_View>) {
@@ -113,7 +113,7 @@ class take_view : public view_interface<take_view<_View>> {
     }
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto end() const requires range<const _View> {
     if constexpr (sized_range<const _View>) {
       if constexpr (random_access_range<const _View>) {
@@ -126,13 +126,13 @@ class take_view : public view_interface<take_view<_View>> {
     }
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto size() requires sized_range<_View> {
     auto __n = ranges::size(__base_);
     return ranges::min(__n, static_cast<decltype(__n)>(__count_));
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto size() const requires sized_range<const _View> {
     auto __n = ranges::size(__base_);
     return ranges::min(__n, static_cast<decltype(__n)>(__count_));
@@ -145,34 +145,34 @@ class take_view<_View>::__sentinel {
   using _Base = __maybe_const<_Const, _View>;
   template<bool _OtherConst>
   using _Iter = counted_iterator<iterator_t<__maybe_const<_OtherConst, _View>>>;
-  _LIBCPP_NO_UNIQUE_ADDRESS sentinel_t<_Base> __end_ = sentinel_t<_Base>();
+  _LIBCUDACXX_NO_UNIQUE_ADDRESS sentinel_t<_Base> __end_ = sentinel_t<_Base>();
 
   template<bool>
   friend class take_view<_View>::__sentinel;
 
 public:
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   __sentinel() = default;
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr explicit __sentinel(sentinel_t<_Base> __end) : __end_(std::move(__end)) {}
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr __sentinel(__sentinel<!_Const> __s)
     requires _Const && convertible_to<sentinel_t<_View>, sentinel_t<_Base>>
     : __end_(std::move(__s.__end_)) {}
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr sentinel_t<_Base> base() const { return __end_; }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr bool operator==(const _Iter<_Const>& __lhs, const __sentinel& __rhs) {
     return __lhs.count() == 0 || __lhs.base() == __rhs.__end_;
   }
 
   template<bool _OtherConst = !_Const>
     requires sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr bool operator==(const _Iter<_Const>& __lhs, const __sentinel& __rhs) {
     return __lhs.count() == 0 || __lhs.base() == __rhs.__end_;
   }
@@ -236,11 +236,11 @@ struct __fn {
   // [range.take.overview]: the `empty_view` case.
   template <class _Range, convertible_to<range_
diff erence_t<_Range>> _Np>
     requires __is_empty_view<remove_cvref_t<_Range>>
-  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI
+  [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto operator()(_Range&& __range, _Np&&) const
-    noexcept(noexcept(_LIBCPP_AUTO_CAST(std::forward<_Range>(__range))))
-    -> decltype(      _LIBCPP_AUTO_CAST(std::forward<_Range>(__range)))
-    { return          _LIBCPP_AUTO_CAST(std::forward<_Range>(__range)); }
+    noexcept(noexcept(_LIBCUDACXX_AUTO_CAST(std::forward<_Range>(__range))))
+    -> decltype(      _LIBCUDACXX_AUTO_CAST(std::forward<_Range>(__range)))
+    { return          _LIBCUDACXX_AUTO_CAST(std::forward<_Range>(__range)); }
 
   // [range.take.overview]: the `span | basic_string_view | subrange` case.
   template <class _Range,
@@ -251,7 +251,7 @@ struct __fn {
               random_access_range<_RawRange> &&
               sized_range<_RawRange> &&
               __is_passthrough_specialization<_RawRange>)
-  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI
+  [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto operator()(_Range&& __rng, _Np&& __n) const
     noexcept(noexcept(__passthrough_type_t<_RawRange>(
                               ranges::begin(__rng),
@@ -276,7 +276,7 @@ struct __fn {
               random_access_range<_RawRange> &&
               sized_range<_RawRange> &&
               __is_iota_specialization<_RawRange>)
-  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI
+  [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto operator()(_Range&& __rng, _Np&& __n) const
     noexcept(noexcept(ranges::iota_view(
                               *ranges::begin(__rng),
@@ -305,7 +305,7 @@ struct __fn {
                 sized_range<_RawRange> &&
                 random_access_range<_RawRange>)
              ))
-  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI
+  [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto operator()(_Range&& __range, _Np&& __n) const
     noexcept(noexcept(take_view(std::forward<_Range>(__range), std::forward<_Np>(__n))))
     -> decltype(      take_view(std::forward<_Range>(__range), std::forward<_Np>(__n)))
@@ -313,7 +313,7 @@ struct __fn {
 
   template <class _Np>
     requires constructible_from<decay_t<_Np>, _Np>
-  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI
+  [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto operator()(_Np&& __n) const
     noexcept(is_nothrow_constructible_v<decay_t<_Np>, _Np>)
   { return __range_adaptor_closure_t(std::__bind_back(*this, std::forward<_Np>(__n))); }
@@ -328,10 +328,10 @@ inline namespace __cpo {
 
 } // namespace ranges
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___RANGES_TAKE_VIEW_H
+#endif // _LIBCUDACXX___RANGES_TAKE_VIEW_H

diff  --git a/libcxx/include/__ranges/transform_view.h b/libcxx/include/__ranges/transform_view.h
index c5a7128c366b..231c3655c48a 100644
--- a/libcxx/include/__ranges/transform_view.h
+++ b/libcxx/include/__ranges/transform_view.h
@@ -6,8 +6,8 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-#ifndef _LIBCPP___RANGES_TRANSFORM_VIEW_H
-#define _LIBCPP___RANGES_TRANSFORM_VIEW_H
+#ifndef _LIBCUDACXX___RANGES_TRANSFORM_VIEW_H
+#define _LIBCUDACXX___RANGES_TRANSFORM_VIEW_H
 
 #include <__compare/three_way_comparable.h>
 #include <__concepts/constructible.h>
@@ -35,13 +35,13 @@
 #include <__utility/move.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
 namespace ranges {
 
@@ -61,28 +61,28 @@ class transform_view : public view_interface<transform_view<_View, _Fn>> {
   template<bool> class __iterator;
   template<bool> class __sentinel;
 
-  _LIBCPP_NO_UNIQUE_ADDRESS __copyable_box<_Fn> __func_;
-  _LIBCPP_NO_UNIQUE_ADDRESS _View __base_ = _View();
+  _LIBCUDACXX_NO_UNIQUE_ADDRESS __copyable_box<_Fn> __func_;
+  _LIBCUDACXX_NO_UNIQUE_ADDRESS _View __base_ = _View();
 
 public:
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   transform_view()
     requires default_initializable<_View> && default_initializable<_Fn> = default;
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr transform_view(_View __base, _Fn __func)
     : __func_(std::in_place, std::move(__func)), __base_(std::move(__base)) {}
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr _View base() const& requires copy_constructible<_View> { return __base_; }
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr _View base() && { return std::move(__base_); }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr __iterator<false> begin() {
     return __iterator<false>{*this, ranges::begin(__base_)};
   }
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr __iterator<true> begin() const
     requires range<const _View> &&
              __regular_invocable_with_range_ref<const _Fn&, const _View>
@@ -90,24 +90,24 @@ class transform_view : public view_interface<transform_view<_View, _Fn>> {
     return __iterator<true>(*this, ranges::begin(__base_));
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr __sentinel<false> end() {
     return __sentinel<false>(ranges::end(__base_));
   }
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr __iterator<false> end()
     requires common_range<_View>
   {
     return __iterator<false>(*this, ranges::end(__base_));
   }
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr __sentinel<true> end() const
     requires range<const _View> &&
              __regular_invocable_with_range_ref<const _Fn&, const _View>
   {
     return __sentinel<true>(ranges::end(__base_));
   }
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr __iterator<true> end() const
     requires common_range<const _View> &&
              __regular_invocable_with_range_ref<const _Fn&, const _View>
@@ -115,9 +115,9 @@ class transform_view : public view_interface<transform_view<_View, _Fn>> {
     return __iterator<true>(*this, ranges::end(__base_));
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto size() requires sized_range<_View> { return ranges::size(__base_); }
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto size() const requires sized_range<const _View> { return ranges::size(__base_); }
 };
 
@@ -178,48 +178,48 @@ class transform_view<_View, _Fn>::__iterator
   using value_type = remove_cvref_t<invoke_result_t<_Fn&, range_reference_t<_Base>>>;
   using 
diff erence_type = range_
diff erence_t<_Base>;
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   __iterator() requires default_initializable<iterator_t<_Base>> = default;
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr __iterator(_Parent& __parent, iterator_t<_Base> __current)
     : __parent_(std::addressof(__parent)), __current_(std::move(__current)) {}
 
   // Note: `__i` should always be `__iterator<false>`, but directly using
   // `__iterator<false>` is ill-formed when `_Const` is false
   // (see http://wg21.link/class.copy.ctor#5).
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr __iterator(__iterator<!_Const> __i)
     requires _Const && convertible_to<iterator_t<_View>, iterator_t<_Base>>
     : __parent_(__i.__parent_), __current_(std::move(__i.__current_)) {}
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr const iterator_t<_Base>& base() const& noexcept {
     return __current_;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr iterator_t<_Base> base() && {
     return std::move(__current_);
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr decltype(auto) operator*() const
     noexcept(noexcept(std::invoke(*__parent_->__func_, *__current_)))
   {
     return std::invoke(*__parent_->__func_, *__current_);
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr __iterator& operator++() {
     ++__current_;
     return *this;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr void operator++(int) { ++__current_; }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr __iterator operator++(int)
     requires forward_range<_Base>
   {
@@ -228,7 +228,7 @@ class transform_view<_View, _Fn>::__iterator
     return __tmp;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr __iterator& operator--()
     requires bidirectional_range<_Base>
   {
@@ -236,7 +236,7 @@ class transform_view<_View, _Fn>::__iterator
     return *this;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr __iterator operator--(int)
     requires bidirectional_range<_Base>
   {
@@ -245,7 +245,7 @@ class transform_view<_View, _Fn>::__iterator
     return __tmp;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr __iterator& operator+=(
diff erence_type __n)
     requires random_access_range<_Base>
   {
@@ -253,7 +253,7 @@ class transform_view<_View, _Fn>::__iterator
     return *this;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr __iterator& operator-=(
diff erence_type __n)
     requires random_access_range<_Base>
   {
@@ -261,7 +261,7 @@ class transform_view<_View, _Fn>::__iterator
     return *this;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr decltype(auto) operator[](
diff erence_type __n) const
     noexcept(noexcept(std::invoke(*__parent_->__func_, __current_[__n])))
     requires random_access_range<_Base>
@@ -269,77 +269,77 @@ class transform_view<_View, _Fn>::__iterator
     return std::invoke(*__parent_->__func_, __current_[__n]);
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr bool operator==(const __iterator& __x, const __iterator& __y)
     requires equality_comparable<iterator_t<_Base>>
   {
     return __x.__current_ == __y.__current_;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr bool operator<(const __iterator& __x, const __iterator& __y)
     requires random_access_range<_Base>
   {
     return __x.__current_ < __y.__current_;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr bool operator>(const __iterator& __x, const __iterator& __y)
     requires random_access_range<_Base>
   {
     return __x.__current_ > __y.__current_;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr bool operator<=(const __iterator& __x, const __iterator& __y)
     requires random_access_range<_Base>
   {
     return __x.__current_ <= __y.__current_;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr bool operator>=(const __iterator& __x, const __iterator& __y)
     requires random_access_range<_Base>
   {
     return __x.__current_ >= __y.__current_;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr auto operator<=>(const __iterator& __x, const __iterator& __y)
     requires random_access_range<_Base> && three_way_comparable<iterator_t<_Base>>
   {
     return __x.__current_ <=> __y.__current_;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr __iterator operator+(__iterator __i, 
diff erence_type __n)
     requires random_access_range<_Base>
   {
     return __iterator{*__i.__parent_, __i.__current_ + __n};
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr __iterator operator+(
diff erence_type __n, __iterator __i)
     requires random_access_range<_Base>
   {
     return __iterator{*__i.__parent_, __i.__current_ + __n};
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr __iterator operator-(__iterator __i, 
diff erence_type __n)
     requires random_access_range<_Base>
   {
     return __iterator{*__i.__parent_, __i.__current_ - __n};
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr 
diff erence_type operator-(const __iterator& __x, const __iterator& __y)
     requires sized_sentinel_for<iterator_t<_Base>, iterator_t<_Base>>
   {
     return __x.__current_ - __y.__current_;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr decltype(auto) iter_move(const __iterator& __i)
     noexcept(noexcept(*__i))
   {
@@ -366,33 +366,33 @@ class transform_view<_View, _Fn>::__sentinel {
   friend class transform_view<_View, _Fn>::__sentinel;
 
 public:
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   __sentinel() = default;
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr explicit __sentinel(sentinel_t<_Base> __end) : __end_(__end) {}
 
   // Note: `__i` should always be `__sentinel<false>`, but directly using
   // `__sentinel<false>` is ill-formed when `_Const` is false
   // (see http://wg21.link/class.copy.ctor#5).
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr __sentinel(__sentinel<!_Const> __i)
     requires _Const && convertible_to<sentinel_t<_View>, sentinel_t<_Base>>
     : __end_(std::move(__i.__end_)) {}
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr sentinel_t<_Base> base() const { return __end_; }
 
   template<bool _OtherConst>
     requires sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr bool operator==(const __iterator<_OtherConst>& __x, const __sentinel& __y) {
     return __x.__current_ == __y.__end_;
   }
 
   template<bool _OtherConst>
     requires sized_sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr range_
diff erence_t<__maybe_const<_OtherConst, _View>>
   operator-(const __iterator<_OtherConst>& __x, const __sentinel& __y) {
     return __x.__current_ - __y.__end_;
@@ -400,7 +400,7 @@ class transform_view<_View, _Fn>::__sentinel {
 
   template<bool _OtherConst>
     requires sized_sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr range_
diff erence_t<__maybe_const<_OtherConst, _View>>
   operator-(const __sentinel& __x, const __iterator<_OtherConst>& __y) {
     return __x.__end_ - __y.__current_;
@@ -411,7 +411,7 @@ namespace views {
 namespace __transform {
   struct __fn {
     template<class _Range, class _Fn>
-    [[nodiscard]] _LIBCPP_HIDE_FROM_ABI
+    [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI
     constexpr auto operator()(_Range&& __range, _Fn&& __f) const
       noexcept(noexcept(transform_view(std::forward<_Range>(__range), std::forward<_Fn>(__f))))
       -> decltype(      transform_view(std::forward<_Range>(__range), std::forward<_Fn>(__f)))
@@ -419,7 +419,7 @@ namespace __transform {
 
     template<class _Fn>
       requires constructible_from<decay_t<_Fn>, _Fn>
-    [[nodiscard]] _LIBCPP_HIDE_FROM_ABI
+    [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI
     constexpr auto operator()(_Fn&& __f) const
       noexcept(is_nothrow_constructible_v<decay_t<_Fn>, _Fn>)
     { return __range_adaptor_closure_t(std::__bind_back(*this, std::forward<_Fn>(__f))); }
@@ -433,8 +433,8 @@ inline namespace __cpo {
 
 } // namespace ranges
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___RANGES_TRANSFORM_VIEW_H
+#endif // _LIBCUDACXX___RANGES_TRANSFORM_VIEW_H

diff  --git a/libcxx/include/__ranges/view_interface.h b/libcxx/include/__ranges/view_interface.h
index 4b36e02f7d6b..f52b67f5c530 100644
--- a/libcxx/include/__ranges/view_interface.h
+++ b/libcxx/include/__ranges/view_interface.h
@@ -6,8 +6,8 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-#ifndef _LIBCPP___RANGES_VIEW_INTERFACE_H
-#define _LIBCPP___RANGES_VIEW_INTERFACE_H
+#ifndef _LIBCUDACXX___RANGES_VIEW_INTERFACE_H
+#define _LIBCUDACXX___RANGES_VIEW_INTERFACE_H
 
 #include <__assert>
 #include <__concepts/derived_from.h>
@@ -22,26 +22,26 @@
 #include <__ranges/empty.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
 namespace ranges {
 
 template<class _Derived>
   requires is_class_v<_Derived> && same_as<_Derived, remove_cv_t<_Derived>>
 class view_interface {
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr _Derived& __derived() noexcept {
     static_assert(sizeof(_Derived) && derived_from<_Derived, view_interface> && view<_Derived>);
     return static_cast<_Derived&>(*this);
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr _Derived const& __derived() const noexcept {
     static_assert(sizeof(_Derived) && derived_from<_Derived, view_interface> && view<_Derived>);
     return static_cast<_Derived const&>(*this);
@@ -49,21 +49,21 @@ class view_interface {
 
 public:
   template<class _D2 = _Derived>
-  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool empty()
+  [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI constexpr bool empty()
     requires forward_range<_D2>
   {
     return ranges::begin(__derived()) == ranges::end(__derived());
   }
 
   template<class _D2 = _Derived>
-  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool empty() const
+  [[nodiscard]] _LIBCUDACXX_HIDE_FROM_ABI constexpr bool empty() const
     requires forward_range<const _D2>
   {
     return ranges::begin(__derived()) == ranges::end(__derived());
   }
 
   template<class _D2 = _Derived>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr explicit operator bool()
     requires requires (_D2& __t) { ranges::empty(__t); }
   {
@@ -71,7 +71,7 @@ class view_interface {
   }
 
   template<class _D2 = _Derived>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr explicit operator bool() const
     requires requires (const _D2& __t) { ranges::empty(__t); }
   {
@@ -79,7 +79,7 @@ class view_interface {
   }
 
   template<class _D2 = _Derived>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto data()
     requires contiguous_iterator<iterator_t<_D2>>
   {
@@ -87,7 +87,7 @@ class view_interface {
   }
 
   template<class _D2 = _Derived>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto data() const
     requires range<const _D2> && contiguous_iterator<iterator_t<const _D2>>
   {
@@ -95,7 +95,7 @@ class view_interface {
   }
 
   template<class _D2 = _Derived>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto size()
     requires forward_range<_D2> && sized_sentinel_for<sentinel_t<_D2>, iterator_t<_D2>>
   {
@@ -103,7 +103,7 @@ class view_interface {
   }
 
   template<class _D2 = _Derived>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto size() const
     requires forward_range<const _D2> && sized_sentinel_for<sentinel_t<const _D2>, iterator_t<const _D2>>
   {
@@ -111,54 +111,54 @@ class view_interface {
   }
 
   template<class _D2 = _Derived>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr decltype(auto) front()
     requires forward_range<_D2>
   {
-    _LIBCPP_ASSERT(!empty(),
+    _LIBCUDACXX_ASSERT(!empty(),
         "Precondition `!empty()` not satisfied. `.front()` called on an empty view.");
     return *ranges::begin(__derived());
   }
 
   template<class _D2 = _Derived>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr decltype(auto) front() const
     requires forward_range<const _D2>
   {
-    _LIBCPP_ASSERT(!empty(),
+    _LIBCUDACXX_ASSERT(!empty(),
         "Precondition `!empty()` not satisfied. `.front()` called on an empty view.");
     return *ranges::begin(__derived());
   }
 
   template<class _D2 = _Derived>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr decltype(auto) back()
     requires bidirectional_range<_D2> && common_range<_D2>
   {
-    _LIBCPP_ASSERT(!empty(),
+    _LIBCUDACXX_ASSERT(!empty(),
         "Precondition `!empty()` not satisfied. `.back()` called on an empty view.");
     return *ranges::prev(ranges::end(__derived()));
   }
 
   template<class _D2 = _Derived>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr decltype(auto) back() const
     requires bidirectional_range<const _D2> && common_range<const _D2>
   {
-    _LIBCPP_ASSERT(!empty(),
+    _LIBCUDACXX_ASSERT(!empty(),
         "Precondition `!empty()` not satisfied. `.back()` called on an empty view.");
     return *ranges::prev(ranges::end(__derived()));
   }
 
   template<random_access_range _RARange = _Derived>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr decltype(auto) operator[](range_
diff erence_t<_RARange> __index)
   {
     return ranges::begin(__derived())[__index];
   }
 
   template<random_access_range _RARange = const _Derived>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr decltype(auto) operator[](range_
diff erence_t<_RARange> __index) const
   {
     return ranges::begin(__derived())[__index];
@@ -167,8 +167,8 @@ class view_interface {
 
 } // namespace ranges
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___RANGES_VIEW_INTERFACE_H
+#endif // _LIBCUDACXX___RANGES_VIEW_INTERFACE_H

diff  --git a/libcxx/include/__ranges/views.h b/libcxx/include/__ranges/views.h
index 8cc5ba3d2aca..1b1596a512c5 100644
--- a/libcxx/include/__ranges/views.h
+++ b/libcxx/include/__ranges/views.h
@@ -7,18 +7,18 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___RANGES_VIEWS
-#define _LIBCPP___RANGES_VIEWS
+#ifndef _LIBCUDACXX___RANGES_VIEWS
+#define _LIBCUDACXX___RANGES_VIEWS
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
 namespace ranges {
 
@@ -28,8 +28,8 @@ namespace views { }
 
 namespace views = ranges::views;
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___RANGES_VIEWS
+#endif // _LIBCUDACXX___RANGES_VIEWS

diff  --git a/libcxx/include/__ranges/zip_view.h b/libcxx/include/__ranges/zip_view.h
index a8035bc79e12..e03381913e5f 100644
--- a/libcxx/include/__ranges/zip_view.h
+++ b/libcxx/include/__ranges/zip_view.h
@@ -6,8 +6,8 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-#ifndef _LIBCPP___RANGES_ZIP_VIEW_H
-#define _LIBCPP___RANGES_ZIP_VIEW_H
+#ifndef _LIBCUDACXX___RANGES_ZIP_VIEW_H
+#define _LIBCUDACXX___RANGES_ZIP_VIEW_H
 
 #include <__config>
 
@@ -35,16 +35,16 @@
 #include <tuple>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 20 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCUDACXX_STD_VER > 20 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
 namespace ranges {
 
@@ -64,7 +64,7 @@ template <class... _Types>
 using __tuple_or_pair = decltype(__tuple_or_pair_test<_Types...>());
 
 template <class _Fun, class _Tuple>
-_LIBCPP_HIDE_FROM_ABI constexpr auto __tuple_transform(_Fun&& __f, _Tuple&& __tuple) {
+_LIBCUDACXX_HIDE_FROM_ABI constexpr auto __tuple_transform(_Fun&& __f, _Tuple&& __tuple) {
   return std::apply(
       [&]<class... _Types>(_Types&&... __elements) {
         return __tuple_or_pair<invoke_result_t<_Fun&, _Types>...>(
@@ -74,14 +74,14 @@ _LIBCPP_HIDE_FROM_ABI constexpr auto __tuple_transform(_Fun&& __f, _Tuple&& __tu
 }
 
 template <class _Fun, class _Tuple>
-_LIBCPP_HIDE_FROM_ABI constexpr void __tuple_for_each(_Fun&& __f, _Tuple&& __tuple) {
+_LIBCUDACXX_HIDE_FROM_ABI constexpr void __tuple_for_each(_Fun&& __f, _Tuple&& __tuple) {
   std::apply(
       [&]<class... _Types>(_Types&&... __elements) { (std::invoke(__f, std::forward<_Types>(__elements)), ...); },
       std::forward<_Tuple>(__tuple));
 }
 
 template <class _Fun, class _Tuple1, class _Tuple2, size_t... _Indices>
-_LIBCPP_HIDE_FROM_ABI constexpr __tuple_or_pair<
+_LIBCUDACXX_HIDE_FROM_ABI constexpr __tuple_or_pair<
     invoke_result_t<_Fun&, typename tuple_element<_Indices, remove_cvref_t<_Tuple1>>::type,
                     typename tuple_element<_Indices, remove_cvref_t<_Tuple2>>::type>...>
 __tuple_zip_transform(_Fun&& __f, _Tuple1&& __tuple1, _Tuple2&& __tuple2, index_sequence<_Indices...>) {
@@ -90,13 +90,13 @@ __tuple_zip_transform(_Fun&& __f, _Tuple1&& __tuple1, _Tuple2&& __tuple2, index_
 }
 
 template <class _Fun, class _Tuple1, class _Tuple2>
-_LIBCPP_HIDE_FROM_ABI constexpr auto __tuple_zip_transform(_Fun&& __f, _Tuple1&& __tuple1, _Tuple2&& __tuple2) {
+_LIBCUDACXX_HIDE_FROM_ABI constexpr auto __tuple_zip_transform(_Fun&& __f, _Tuple1&& __tuple1, _Tuple2&& __tuple2) {
   return ranges::__tuple_zip_transform(__f, std::forward<_Tuple1>(__tuple1), std::forward<_Tuple2>(__tuple2),
                                        std::make_index_sequence<tuple_size<remove_cvref_t<_Tuple1>>::value>());
 }
 
 template <class _Fun, class _Tuple1, class _Tuple2, size_t... _Indices>
-_LIBCPP_HIDE_FROM_ABI constexpr void __tuple_zip_for_each(_Fun&& __f, _Tuple1&& __tuple1, _Tuple2&& __tuple2,
+_LIBCUDACXX_HIDE_FROM_ABI constexpr void __tuple_zip_for_each(_Fun&& __f, _Tuple1&& __tuple1, _Tuple2&& __tuple2,
                                                           index_sequence<_Indices...>) {
   (std::invoke(__f, std::get<_Indices>(std::forward<_Tuple1>(__tuple1)),
                std::get<_Indices>(std::forward<_Tuple2>(__tuple2))),
@@ -104,13 +104,13 @@ _LIBCPP_HIDE_FROM_ABI constexpr void __tuple_zip_for_each(_Fun&& __f, _Tuple1&&
 }
 
 template <class _Fun, class _Tuple1, class _Tuple2>
-_LIBCPP_HIDE_FROM_ABI constexpr auto __tuple_zip_for_each(_Fun&& __f, _Tuple1&& __tuple1, _Tuple2&& __tuple2) {
+_LIBCUDACXX_HIDE_FROM_ABI constexpr auto __tuple_zip_for_each(_Fun&& __f, _Tuple1&& __tuple1, _Tuple2&& __tuple2) {
   return ranges::__tuple_zip_for_each(__f, std::forward<_Tuple1>(__tuple1), std::forward<_Tuple2>(__tuple2),
                                       std::make_index_sequence<tuple_size<remove_cvref_t<_Tuple1>>::value>());
 }
 
 template <class _Tuple1, class _Tuple2>
-_LIBCPP_HIDE_FROM_ABI constexpr bool __tuple_any_equals(const _Tuple1& __tuple1, const _Tuple2& __tuple2) {
+_LIBCUDACXX_HIDE_FROM_ABI constexpr bool __tuple_any_equals(const _Tuple1& __tuple1, const _Tuple2& __tuple2) {
   const auto __equals = ranges::__tuple_zip_transform(std::equal_to<>(), __tuple1, __tuple2);
   return std::apply([](auto... __bools) { return (__bools || ...); }, __equals);
 }
@@ -118,7 +118,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool __tuple_any_equals(const _Tuple1& __tuple1,
 // abs in cstdlib is not constexpr
 // TODO : remove __abs once P0533R9 is implemented.
 template <class _Tp>
-_LIBCPP_HIDE_FROM_ABI constexpr _Tp __abs(_Tp __t) {
+_LIBCUDACXX_HIDE_FROM_ABI constexpr _Tp __abs(_Tp __t) {
   return __t < 0 ? -__t : __t;
 }
 
@@ -126,7 +126,7 @@ template <input_range... _Views>
   requires(view<_Views> && ...) && (sizeof...(_Views) > 0)
 class zip_view : public view_interface<zip_view<_Views...>> {
 
-  _LIBCPP_NO_UNIQUE_ADDRESS tuple<_Views...> __views_;
+  _LIBCUDACXX_NO_UNIQUE_ADDRESS tuple<_Views...> __views_;
 
   template <bool>
   class __iterator;
@@ -135,25 +135,25 @@ class zip_view : public view_interface<zip_view<_Views...>> {
   class __sentinel;
 
 public:
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   zip_view() = default;
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr explicit zip_view(_Views... __views) : __views_(std::move(__views)...) {}
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto begin()
     requires(!(__simple_view<_Views> && ...)) {
     return __iterator<false>(ranges::__tuple_transform(ranges::begin, __views_));
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto begin() const
     requires(range<const _Views> && ...) {
     return __iterator<true>(ranges::__tuple_transform(ranges::begin, __views_));
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto end()
     requires(!(__simple_view<_Views> && ...)) {
     if constexpr (!__zip_is_common<_Views...>) {
@@ -165,7 +165,7 @@ class zip_view : public view_interface<zip_view<_Views...>> {
     }
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto end() const
     requires(range<const _Views> && ...) {
     if constexpr (!__zip_is_common<const _Views...>) {
@@ -177,7 +177,7 @@ class zip_view : public view_interface<zip_view<_Views...>> {
     }
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto size()
     requires(sized_range<_Views> && ...) {
     return std::apply(
@@ -188,7 +188,7 @@ class zip_view : public view_interface<zip_view<_Views...>> {
         ranges::__tuple_transform(ranges::size, __views_));
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto size() const
     requires(sized_range<const _Views> && ...) {
     return std::apply(
@@ -241,7 +241,7 @@ class zip_view<_Views...>::__iterator : public __zip_view_iterator_category_base
 
   __tuple_or_pair<iterator_t<__maybe_const<_Const, _Views>>...> __current_;
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr explicit __iterator(__tuple_or_pair<iterator_t<__maybe_const<_Const, _Views>>...> __current)
       : __current_(std::move(__current)) {}
 
@@ -258,29 +258,29 @@ class zip_view<_Views...>::__iterator : public __zip_view_iterator_category_base
   using value_type = __tuple_or_pair<range_value_t<__maybe_const<_Const, _Views>>...>;
   using 
diff erence_type = common_type_t<range_
diff erence_t<__maybe_const<_Const, _Views>>...>;
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   __iterator() = default;
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr __iterator(__iterator<!_Const> __i)
     requires _Const && (convertible_to<iterator_t<_Views>, iterator_t<__maybe_const<_Const, _Views>>> && ...)
   : __current_(std::move(__i.__current_)) {}
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto operator*() const {
     return ranges::__tuple_transform([](auto& __i) -> decltype(auto) { return *__i; }, __current_);
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr __iterator& operator++() {
     ranges::__tuple_for_each([](auto& __i) { ++__i; }, __current_);
     return *this;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr void operator++(int) { ++*this; }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr __iterator operator++(int)
     requires __zip_all_forward<_Const, _Views...> {
     auto __tmp = *this;
@@ -288,14 +288,14 @@ class zip_view<_Views...>::__iterator : public __zip_view_iterator_category_base
     return __tmp;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr __iterator& operator--()
     requires __zip_all_bidirectional<_Const, _Views...> {
     ranges::__tuple_for_each([](auto& __i) { --__i; }, __current_);
     return *this;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr __iterator operator--(int)
     requires __zip_all_bidirectional<_Const, _Views...> {
     auto __tmp = *this;
@@ -303,28 +303,28 @@ class zip_view<_Views...>::__iterator : public __zip_view_iterator_category_base
     return __tmp;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr __iterator& operator+=(
diff erence_type __x)
     requires __zip_all_random_access<_Const, _Views...> {
     ranges::__tuple_for_each([&]<class _Iter>(_Iter& __i) { __i += iter_
diff erence_t<_Iter>(__x); }, __current_);
     return *this;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr __iterator& operator-=(
diff erence_type __x)
     requires __zip_all_random_access<_Const, _Views...> {
     ranges::__tuple_for_each([&]<class _Iter>(_Iter& __i) { __i -= iter_
diff erence_t<_Iter>(__x); }, __current_);
     return *this;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto operator[](
diff erence_type __n) const
     requires __zip_all_random_access<_Const, _Views...> {
     return ranges::__tuple_transform(
         [&]<class _Iter>(_Iter& __i) -> decltype(auto) { return __i[iter_
diff erence_t<_Iter>(__n)]; }, __current_);
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr bool operator==(const __iterator& __x, const __iterator& __y)
     requires(equality_comparable<iterator_t<__maybe_const<_Const, _Views>>> && ...) {
     if constexpr (__zip_all_bidirectional<_Const, _Views...>) {
@@ -334,38 +334,38 @@ class zip_view<_Views...>::__iterator : public __zip_view_iterator_category_base
     }
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr bool operator<(const __iterator& __x, const __iterator& __y)
     requires __zip_all_random_access<_Const, _Views...> {
     return __x.__current_ < __y.__current_;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr bool operator>(const __iterator& __x, const __iterator& __y)
     requires __zip_all_random_access<_Const, _Views...> {
     return __y < __x;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr bool operator<=(const __iterator& __x, const __iterator& __y)
     requires __zip_all_random_access<_Const, _Views...> {
     return !(__y < __x);
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr bool operator>=(const __iterator& __x, const __iterator& __y)
     requires __zip_all_random_access<_Const, _Views...> {
     return !(__x < __y);
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr auto operator<=>(const __iterator& __x, const __iterator& __y)
     requires __zip_all_random_access<_Const, _Views...> &&
              (three_way_comparable<iterator_t<__maybe_const<_Const, _Views>>> && ...) {
     return __x.__current_ <=> __y.__current_;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr __iterator operator+(const __iterator& __i, 
diff erence_type __n)
     requires __zip_all_random_access<_Const, _Views...> {
     auto __r = __i;
@@ -373,13 +373,13 @@ class zip_view<_Views...>::__iterator : public __zip_view_iterator_category_base
     return __r;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr __iterator operator+(
diff erence_type __n, const __iterator& __i)
     requires __zip_all_random_access<_Const, _Views...> {
     return __i + __n;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr __iterator operator-(const __iterator& __i, 
diff erence_type __n)
     requires __zip_all_random_access<_Const, _Views...> {
     auto __r = __i;
@@ -387,7 +387,7 @@ class zip_view<_Views...>::__iterator : public __zip_view_iterator_category_base
     return __r;
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr 
diff erence_type operator-(const __iterator& __x, const __iterator& __y)
     requires(sized_sentinel_for<iterator_t<__maybe_const<_Const, _Views>>, iterator_t<__maybe_const<_Const, _Views>>> &&
              ...) {
@@ -400,14 +400,14 @@ class zip_view<_Views...>::__iterator : public __zip_view_iterator_category_base
         __
diff s);
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr auto iter_move(const __iterator& __i) noexcept(
       (noexcept(ranges::iter_move(declval<const iterator_t<__maybe_const<_Const, _Views>>&>())) && ...) &&
       (is_nothrow_move_constructible_v<range_rvalue_reference_t<__maybe_const<_Const, _Views>>> && ...)) {
     return ranges::__tuple_transform(ranges::iter_move, __i.__current_);
   }
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   friend constexpr void iter_swap(const __iterator& __l, const __iterator& __r) noexcept(
       (noexcept(ranges::iter_swap(declval<const iterator_t<__maybe_const<_Const, _Views>>&>(),
                                   declval<const iterator_t<__maybe_const<_Const, _Views>>&>())) &&
@@ -424,23 +424,23 @@ class zip_view<_Views...>::__sentinel {
 
   __tuple_or_pair<sentinel_t<__maybe_const<_Const, _Views>>...> __end_;
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr explicit __sentinel(__tuple_or_pair<sentinel_t<__maybe_const<_Const, _Views>>...> __end) : __end_(__end) {}
 
   friend class zip_view<_Views...>;
 
   // hidden friend cannot access private member of iterator because they are friends of friends
   template <bool _OtherConst>
-  _LIBCPP_HIDE_FROM_ABI static constexpr decltype(auto)
+  _LIBCUDACXX_HIDE_FROM_ABI static constexpr decltype(auto)
   __iter_current(zip_view<_Views...>::__iterator<_OtherConst> const& __it) {
     return (__it.__current_);
   }
 
 public:
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   __sentinel() = default;
 
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr __sentinel(__sentinel<!_Const> __i)
     requires _Const && (convertible_to<sentinel_t<_Views>, sentinel_t<__maybe_const<_Const, _Views>>> && ...)
   : __end_(std::move(__i.__end_)) {}
@@ -448,7 +448,7 @@ class zip_view<_Views...>::__sentinel {
   template <bool _OtherConst>
     requires(sentinel_for<sentinel_t<__maybe_const<_Const, _Views>>, iterator_t<__maybe_const<_OtherConst, _Views>>> &&
              ...)
-  _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(const __iterator<_OtherConst>& __x, const __sentinel& __y) {
+  _LIBCUDACXX_HIDE_FROM_ABI friend constexpr bool operator==(const __iterator<_OtherConst>& __x, const __sentinel& __y) {
     return ranges::__tuple_any_equals(__iter_current(__x), __y.__end_);
   }
 
@@ -456,7 +456,7 @@ class zip_view<_Views...>::__sentinel {
     requires(
         sized_sentinel_for<sentinel_t<__maybe_const<_Const, _Views>>, iterator_t<__maybe_const<_OtherConst, _Views>>> &&
         ...)
-  _LIBCPP_HIDE_FROM_ABI friend constexpr common_type_t<range_
diff erence_t<__maybe_const<_OtherConst, _Views>>...>
+  _LIBCUDACXX_HIDE_FROM_ABI friend constexpr common_type_t<range_
diff erence_t<__maybe_const<_OtherConst, _Views>>...>
   operator-(const __iterator<_OtherConst>& __x, const __sentinel& __y) {
     const auto __
diff s = ranges::__tuple_zip_transform(minus<>(), __iter_current(__x), __y.__end_);
     return std::apply(
@@ -472,7 +472,7 @@ class zip_view<_Views...>::__sentinel {
     requires(
         sized_sentinel_for<sentinel_t<__maybe_const<_Const, _Views>>, iterator_t<__maybe_const<_OtherConst, _Views>>> &&
         ...)
-  _LIBCPP_HIDE_FROM_ABI friend constexpr common_type_t<range_
diff erence_t<__maybe_const<_OtherConst, _Views>>...>
+  _LIBCUDACXX_HIDE_FROM_ABI friend constexpr common_type_t<range_
diff erence_t<__maybe_const<_OtherConst, _Views>>...>
   operator-(const __sentinel& __y, const __iterator<_OtherConst>& __x) {
     return -(__x - __y);
   }
@@ -485,10 +485,10 @@ namespace views {
 namespace __zip {
 
 struct __fn {
-  _LIBCPP_HIDE_FROM_ABI constexpr auto operator()() const noexcept { return empty_view<tuple<>>{}; }
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()() const noexcept { return empty_view<tuple<>>{}; }
 
   template <class... _Ranges>
-  _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Ranges&&... __rs) const
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Ranges&&... __rs) const
       noexcept(noexcept(zip_view<all_t<_Ranges&&>...>(std::forward<_Ranges>(__rs)...)))
           -> decltype(zip_view<all_t<_Ranges&&>...>(std::forward<_Ranges>(__rs)...)) {
     return zip_view<all_t<_Ranges>...>(std::forward<_Ranges>(__rs)...);
@@ -502,10 +502,10 @@ inline namespace __cpo {
 } // namespace views
 } // namespace ranges
 
-#endif // _LIBCPP_STD_VER > 20 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCUDACXX_STD_VER > 20 && !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___RANGES_ZIP_VIEW_H
+#endif // _LIBCUDACXX___RANGES_ZIP_VIEW_H

diff  --git a/libcxx/include/__split_buffer b/libcxx/include/__split_buffer
index 4d40732a75cf..f961f4d1207c 100644
--- a/libcxx/include/__split_buffer
+++ b/libcxx/include/__split_buffer
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___SPLIT_BUFFER
-#define _LIBCPP___SPLIT_BUFFER
+#ifndef _LIBCUDACXX___SPLIT_BUFFER
+#define _LIBCUDACXX___SPLIT_BUFFER
 
 #include <__algorithm/max.h>
 #include <__algorithm/move.h>
@@ -24,15 +24,15 @@
 #include <memory>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Tp, class _Allocator = allocator<_Tp> >
 struct __split_buffer
@@ -62,107 +62,107 @@ public:
     typedef typename add_lvalue_reference<allocator_type>::type __alloc_ref;
     typedef typename add_lvalue_reference<allocator_type>::type __alloc_const_ref;
 
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY __alloc_rr&           __alloc() _NOEXCEPT         {return __end_cap_.second();}
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY const __alloc_rr&     __alloc() const _NOEXCEPT   {return __end_cap_.second();}
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY pointer&              __end_cap() _NOEXCEPT       {return __end_cap_.first();}
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY const pointer&        __end_cap() const _NOEXCEPT {return __end_cap_.first();}
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY __alloc_rr&           __alloc() _NOEXCEPT         {return __end_cap_.second();}
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY const __alloc_rr&     __alloc() const _NOEXCEPT   {return __end_cap_.second();}
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY pointer&              __end_cap() _NOEXCEPT       {return __end_cap_.first();}
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY const pointer&        __end_cap() const _NOEXCEPT {return __end_cap_.first();}
 
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY
     __split_buffer()
         _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value);
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY
     explicit __split_buffer(__alloc_rr& __a);
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY
     explicit __split_buffer(const __alloc_rr& __a);
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 __split_buffer(size_type __cap, size_type __start, __alloc_rr& __a);
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 ~__split_buffer();
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 __split_buffer(size_type __cap, size_type __start, __alloc_rr& __a);
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 ~__split_buffer();
 
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 __split_buffer(__split_buffer&& __c)
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 __split_buffer(__split_buffer&& __c)
         _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value);
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 __split_buffer(__split_buffer&& __c, const __alloc_rr& __a);
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 __split_buffer& operator=(__split_buffer&& __c)
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 __split_buffer(__split_buffer&& __c, const __alloc_rr& __a);
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 __split_buffer& operator=(__split_buffer&& __c)
         _NOEXCEPT_((__alloc_traits::propagate_on_container_move_assignment::value &&
                 is_nothrow_move_assignable<allocator_type>::value) ||
                !__alloc_traits::propagate_on_container_move_assignment::value);
 
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY       iterator begin() _NOEXCEPT       {return __begin_;}
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY const_iterator begin() const _NOEXCEPT {return __begin_;}
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY       iterator end() _NOEXCEPT         {return __end_;}
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY const_iterator end() const _NOEXCEPT   {return __end_;}
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY       iterator begin() _NOEXCEPT       {return __begin_;}
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY const_iterator begin() const _NOEXCEPT {return __begin_;}
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY       iterator end() _NOEXCEPT         {return __end_;}
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY const_iterator end() const _NOEXCEPT   {return __end_;}
 
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY
     void clear() _NOEXCEPT
         {__destruct_at_end(__begin_);}
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY size_type size() const {return static_cast<size_type>(__end_ - __begin_);}
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY bool empty()     const {return __end_ == __begin_;}
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY size_type capacity() const {return static_cast<size_type>(__end_cap() - __first_);}
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY size_type __front_spare() const {return static_cast<size_type>(__begin_ - __first_);}
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY size_type __back_spare() const {return static_cast<size_type>(__end_cap() - __end_);}
-
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY       reference front()       {return *__begin_;}
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY const_reference front() const {return *__begin_;}
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY       reference back()        {return *(__end_ - 1);}
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY const_reference back() const  {return *(__end_ - 1);}
-
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 void reserve(size_type __n);
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 void shrink_to_fit() _NOEXCEPT;
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 void push_front(const_reference __x);
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY void push_back(const_reference __x);
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 void push_front(value_type&& __x);
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 void push_back(value_type&& __x);
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY size_type size() const {return static_cast<size_type>(__end_ - __begin_);}
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY bool empty()     const {return __end_ == __begin_;}
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY size_type capacity() const {return static_cast<size_type>(__end_cap() - __first_);}
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY size_type __front_spare() const {return static_cast<size_type>(__begin_ - __first_);}
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY size_type __back_spare() const {return static_cast<size_type>(__end_cap() - __end_);}
+
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY       reference front()       {return *__begin_;}
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY const_reference front() const {return *__begin_;}
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY       reference back()        {return *(__end_ - 1);}
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY const_reference back() const  {return *(__end_ - 1);}
+
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 void reserve(size_type __n);
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 void shrink_to_fit() _NOEXCEPT;
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 void push_front(const_reference __x);
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY void push_back(const_reference __x);
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 void push_front(value_type&& __x);
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 void push_back(value_type&& __x);
     template <class... _Args>
-        _LIBCPP_CONSTEXPR_AFTER_CXX17 void emplace_back(_Args&&... __args);
+        _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 void emplace_back(_Args&&... __args);
 
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY void pop_front() {__destruct_at_begin(__begin_+1);}
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY void pop_back() {__destruct_at_end(__end_-1);}
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY void pop_front() {__destruct_at_begin(__begin_+1);}
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY void pop_back() {__destruct_at_end(__end_-1);}
 
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 void __construct_at_end(size_type __n);
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 void __construct_at_end(size_type __n, const_reference __x);
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 void __construct_at_end(size_type __n);
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 void __construct_at_end(size_type __n, const_reference __x);
     template <class _InputIter>
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 __enable_if_t<__is_exactly_cpp17_input_iterator<_InputIter>::value>
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 __enable_if_t<__is_exactly_cpp17_input_iterator<_InputIter>::value>
         __construct_at_end(_InputIter __first, _InputIter __last);
     template <class _ForwardIterator>
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 __enable_if_t<__is_cpp17_forward_iterator<_ForwardIterator>::value>
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 __enable_if_t<__is_cpp17_forward_iterator<_ForwardIterator>::value>
         __construct_at_end(_ForwardIterator __first, _ForwardIterator __last);
 
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY void __destruct_at_begin(pointer __new_begin)
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY void __destruct_at_begin(pointer __new_begin)
         {__destruct_at_begin(__new_begin, is_trivially_destructible<value_type>());}
-        _LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY
         void __destruct_at_begin(pointer __new_begin, false_type);
-        _LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY
         void __destruct_at_begin(pointer __new_begin, true_type);
 
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY
     void __destruct_at_end(pointer __new_last) _NOEXCEPT
         {__destruct_at_end(__new_last, false_type());}
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY
         void __destruct_at_end(pointer __new_last, false_type) _NOEXCEPT;
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY
         void __destruct_at_end(pointer __new_last, true_type) _NOEXCEPT;
 
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 void swap(__split_buffer& __x)
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 void swap(__split_buffer& __x)
         _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value||
                    __is_nothrow_swappable<__alloc_rr>::value);
 
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 bool __invariants() const;
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 bool __invariants() const;
 
 private:
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY
     void __move_assign_alloc(__split_buffer& __c, true_type)
         _NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
         {
-            __alloc() = _VSTD::move(__c.__alloc());
+            __alloc() = _CUDA_VSTD::move(__c.__alloc());
         }
 
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY
     void __move_assign_alloc(__split_buffer&, false_type) _NOEXCEPT
         {}
 
     struct _ConstructTransaction {
-      _LIBCPP_CONSTEXPR_AFTER_CXX17 explicit _ConstructTransaction(pointer* __p, size_type __n) _NOEXCEPT
+      _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 explicit _ConstructTransaction(pointer* __p, size_type __n) _NOEXCEPT
       : __pos_(*__p), __end_(*__p + __n), __dest_(__p) {
       }
-      _LIBCPP_CONSTEXPR_AFTER_CXX17 ~_ConstructTransaction() {
+      _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 ~_ConstructTransaction() {
         *__dest_ = __pos_;
       }
       pointer __pos_;
@@ -173,7 +173,7 @@ private:
 };
 
 template <class _Tp, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 bool
 __split_buffer<_Tp, _Allocator>::__invariants() const
 {
@@ -204,13 +204,13 @@ __split_buffer<_Tp, _Allocator>::__invariants() const
 //  Precondition:  size() + __n <= capacity()
 //  Postcondition:  size() == size() + __n
 template <class _Tp, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void
 __split_buffer<_Tp, _Allocator>::__construct_at_end(size_type __n)
 {
     _ConstructTransaction __tx(&this->__end_, __n);
     for (; __tx.__pos_ != __tx.__end_; ++__tx.__pos_) {
-        __alloc_traits::construct(this->__alloc(), _VSTD::__to_address(__tx.__pos_));
+        __alloc_traits::construct(this->__alloc(), _CUDA_VSTD::__to_address(__tx.__pos_));
     }
 }
 
@@ -221,20 +221,20 @@ __split_buffer<_Tp, _Allocator>::__construct_at_end(size_type __n)
 //  Postcondition:  size() == old size() + __n
 //  Postcondition:  [i] == __x for all i in [size() - __n, __n)
 template <class _Tp, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void
 __split_buffer<_Tp, _Allocator>::__construct_at_end(size_type __n, const_reference __x)
 {
     _ConstructTransaction __tx(&this->__end_, __n);
     for (; __tx.__pos_ != __tx.__end_; ++__tx.__pos_) {
         __alloc_traits::construct(this->__alloc(),
-            _VSTD::__to_address(__tx.__pos_), __x);
+            _CUDA_VSTD::__to_address(__tx.__pos_), __x);
     }
 }
 
 template <class _Tp, class _Allocator>
 template <class _InputIter>
-_LIBCPP_CONSTEXPR_AFTER_CXX17 __enable_if_t<__is_exactly_cpp17_input_iterator<_InputIter>::value>
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17 __enable_if_t<__is_exactly_cpp17_input_iterator<_InputIter>::value>
 __split_buffer<_Tp, _Allocator>::__construct_at_end(_InputIter __first, _InputIter __last)
 {
     __alloc_rr& __a = this->__alloc();
@@ -243,42 +243,42 @@ __split_buffer<_Tp, _Allocator>::__construct_at_end(_InputIter __first, _InputIt
         if (__end_ == __end_cap())
         {
             size_type __old_cap = __end_cap() - __first_;
-            size_type __new_cap = _VSTD::max<size_type>(2 * __old_cap, 8);
+            size_type __new_cap = _CUDA_VSTD::max<size_type>(2 * __old_cap, 8);
             __split_buffer __buf(__new_cap, 0, __a);
             for (pointer __p = __begin_; __p != __end_; ++__p, (void) ++__buf.__end_)
                 __alloc_traits::construct(__buf.__alloc(),
-                        _VSTD::__to_address(__buf.__end_), _VSTD::move(*__p));
+                        _CUDA_VSTD::__to_address(__buf.__end_), _CUDA_VSTD::move(*__p));
             swap(__buf);
         }
-        __alloc_traits::construct(__a, _VSTD::__to_address(this->__end_), *__first);
+        __alloc_traits::construct(__a, _CUDA_VSTD::__to_address(this->__end_), *__first);
         ++this->__end_;
     }
 }
 
 template <class _Tp, class _Allocator>
 template <class _ForwardIterator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17 __enable_if_t<__is_cpp17_forward_iterator<_ForwardIterator>::value>
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17 __enable_if_t<__is_cpp17_forward_iterator<_ForwardIterator>::value>
 __split_buffer<_Tp, _Allocator>::__construct_at_end(_ForwardIterator __first, _ForwardIterator __last)
 {
-    _ConstructTransaction __tx(&this->__end_, _VSTD::distance(__first, __last));
+    _ConstructTransaction __tx(&this->__end_, _CUDA_VSTD::distance(__first, __last));
     for (; __tx.__pos_ != __tx.__end_; ++__tx.__pos_, (void) ++__first) {
         __alloc_traits::construct(this->__alloc(),
-            _VSTD::__to_address(__tx.__pos_), *__first);
+            _CUDA_VSTD::__to_address(__tx.__pos_), *__first);
     }
 }
 
 template <class _Tp, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 inline
 void
 __split_buffer<_Tp, _Allocator>::__destruct_at_begin(pointer __new_begin, false_type)
 {
     while (__begin_ != __new_begin)
-        __alloc_traits::destroy(__alloc(), _VSTD::__to_address(__begin_++));
+        __alloc_traits::destroy(__alloc(), _CUDA_VSTD::__to_address(__begin_++));
 }
 
 template <class _Tp, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 inline
 void
 __split_buffer<_Tp, _Allocator>::__destruct_at_begin(pointer __new_begin, true_type)
@@ -287,18 +287,18 @@ __split_buffer<_Tp, _Allocator>::__destruct_at_begin(pointer __new_begin, true_t
 }
 
 template <class _Tp, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
-inline _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 __split_buffer<_Tp, _Allocator>::__destruct_at_end(pointer __new_last, false_type) _NOEXCEPT
 {
     while (__new_last != __end_)
-        __alloc_traits::destroy(__alloc(), _VSTD::__to_address(--__end_));
+        __alloc_traits::destroy(__alloc(), _CUDA_VSTD::__to_address(--__end_));
 }
 
 template <class _Tp, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
-inline _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 __split_buffer<_Tp, _Allocator>::__destruct_at_end(pointer __new_last, true_type) _NOEXCEPT
 {
@@ -306,7 +306,7 @@ __split_buffer<_Tp, _Allocator>::__destruct_at_end(pointer __new_last, true_type
 }
 
 template <class _Tp, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 __split_buffer<_Tp, _Allocator>::__split_buffer(size_type __cap, size_type __start, __alloc_rr& __a)
     : __end_cap_(nullptr, __a)
 {
@@ -322,7 +322,7 @@ __split_buffer<_Tp, _Allocator>::__split_buffer(size_type __cap, size_type __sta
 }
 
 template <class _Tp, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 inline
 __split_buffer<_Tp, _Allocator>::__split_buffer()
     _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
@@ -331,7 +331,7 @@ __split_buffer<_Tp, _Allocator>::__split_buffer()
 }
 
 template <class _Tp, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 inline
 __split_buffer<_Tp, _Allocator>::__split_buffer(__alloc_rr& __a)
     : __first_(nullptr), __begin_(nullptr), __end_(nullptr), __end_cap_(nullptr, __a)
@@ -339,7 +339,7 @@ __split_buffer<_Tp, _Allocator>::__split_buffer(__alloc_rr& __a)
 }
 
 template <class _Tp, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 inline
 __split_buffer<_Tp, _Allocator>::__split_buffer(const __alloc_rr& __a)
     : __first_(nullptr), __begin_(nullptr), __end_(nullptr), __end_cap_(nullptr, __a)
@@ -347,7 +347,7 @@ __split_buffer<_Tp, _Allocator>::__split_buffer(const __alloc_rr& __a)
 }
 
 template <class _Tp, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 __split_buffer<_Tp, _Allocator>::~__split_buffer()
 {
     clear();
@@ -356,13 +356,13 @@ __split_buffer<_Tp, _Allocator>::~__split_buffer()
 }
 
 template <class _Tp, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 __split_buffer<_Tp, _Allocator>::__split_buffer(__split_buffer&& __c)
     _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)
-    : __first_(_VSTD::move(__c.__first_)),
-      __begin_(_VSTD::move(__c.__begin_)),
-      __end_(_VSTD::move(__c.__end_)),
-      __end_cap_(_VSTD::move(__c.__end_cap_))
+    : __first_(_CUDA_VSTD::move(__c.__first_)),
+      __begin_(_CUDA_VSTD::move(__c.__begin_)),
+      __end_(_CUDA_VSTD::move(__c.__end_)),
+      __end_cap_(_CUDA_VSTD::move(__c.__end_cap_))
 {
     __c.__first_ = nullptr;
     __c.__begin_ = nullptr;
@@ -371,7 +371,7 @@ __split_buffer<_Tp, _Allocator>::__split_buffer(__split_buffer&& __c)
 }
 
 template <class _Tp, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 __split_buffer<_Tp, _Allocator>::__split_buffer(__split_buffer&& __c, const __alloc_rr& __a)
     : __end_cap_(nullptr, __a)
 {
@@ -398,7 +398,7 @@ __split_buffer<_Tp, _Allocator>::__split_buffer(__split_buffer&& __c, const __al
 }
 
 template <class _Tp, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 __split_buffer<_Tp, _Allocator>&
 __split_buffer<_Tp, _Allocator>::operator=(__split_buffer&& __c)
     _NOEXCEPT_((__alloc_traits::propagate_on_container_move_assignment::value &&
@@ -419,21 +419,21 @@ __split_buffer<_Tp, _Allocator>::operator=(__split_buffer&& __c)
 }
 
 template <class _Tp, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void
 __split_buffer<_Tp, _Allocator>::swap(__split_buffer& __x)
         _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value||
                    __is_nothrow_swappable<__alloc_rr>::value)
 {
-    _VSTD::swap(__first_, __x.__first_);
-    _VSTD::swap(__begin_, __x.__begin_);
-    _VSTD::swap(__end_, __x.__end_);
-    _VSTD::swap(__end_cap(), __x.__end_cap());
-    _VSTD::__swap_allocator(__alloc(), __x.__alloc());
+    _CUDA_VSTD::swap(__first_, __x.__first_);
+    _CUDA_VSTD::swap(__begin_, __x.__begin_);
+    _CUDA_VSTD::swap(__end_, __x.__end_);
+    _CUDA_VSTD::swap(__end_cap(), __x.__end_cap());
+    _CUDA_VSTD::__swap_allocator(__alloc(), __x.__alloc());
 }
 
 template <class _Tp, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void
 __split_buffer<_Tp, _Allocator>::reserve(size_type __n)
 {
@@ -442,43 +442,43 @@ __split_buffer<_Tp, _Allocator>::reserve(size_type __n)
         __split_buffer<value_type, __alloc_rr&> __t(__n, 0, __alloc());
         __t.__construct_at_end(move_iterator<pointer>(__begin_),
                                move_iterator<pointer>(__end_));
-        _VSTD::swap(__first_, __t.__first_);
-        _VSTD::swap(__begin_, __t.__begin_);
-        _VSTD::swap(__end_, __t.__end_);
-        _VSTD::swap(__end_cap(), __t.__end_cap());
+        _CUDA_VSTD::swap(__first_, __t.__first_);
+        _CUDA_VSTD::swap(__begin_, __t.__begin_);
+        _CUDA_VSTD::swap(__end_, __t.__end_);
+        _CUDA_VSTD::swap(__end_cap(), __t.__end_cap());
     }
 }
 
 template <class _Tp, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void
 __split_buffer<_Tp, _Allocator>::shrink_to_fit() _NOEXCEPT
 {
     if (capacity() > size())
     {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         try
         {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
             __split_buffer<value_type, __alloc_rr&> __t(size(), 0, __alloc());
             __t.__construct_at_end(move_iterator<pointer>(__begin_),
                                    move_iterator<pointer>(__end_));
             __t.__end_ = __t.__begin_ + (__end_ - __begin_);
-            _VSTD::swap(__first_, __t.__first_);
-            _VSTD::swap(__begin_, __t.__begin_);
-            _VSTD::swap(__end_, __t.__end_);
-            _VSTD::swap(__end_cap(), __t.__end_cap());
-#ifndef _LIBCPP_NO_EXCEPTIONS
+            _CUDA_VSTD::swap(__first_, __t.__first_);
+            _CUDA_VSTD::swap(__begin_, __t.__begin_);
+            _CUDA_VSTD::swap(__end_, __t.__end_);
+            _CUDA_VSTD::swap(__end_cap(), __t.__end_cap());
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         }
         catch (...)
         {
         }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
     }
 }
 
 template <class _Tp, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void
 __split_buffer<_Tp, _Allocator>::push_front(const_reference __x)
 {
@@ -488,7 +488,7 @@ __split_buffer<_Tp, _Allocator>::push_front(const_reference __x)
         {
             
diff erence_type __d = __end_cap() - __end_;
             __d = (__d + 1) / 2;
-            __begin_ = _VSTD::move_backward(__begin_, __end_, __end_ + __d);
+            __begin_ = _CUDA_VSTD::move_backward(__begin_, __end_, __end_ + __d);
             __end_ += __d;
         }
         else
@@ -497,18 +497,18 @@ __split_buffer<_Tp, _Allocator>::push_front(const_reference __x)
             __split_buffer<value_type, __alloc_rr&> __t(__c, (__c + 3) / 4, __alloc());
             __t.__construct_at_end(move_iterator<pointer>(__begin_),
                                    move_iterator<pointer>(__end_));
-            _VSTD::swap(__first_, __t.__first_);
-            _VSTD::swap(__begin_, __t.__begin_);
-            _VSTD::swap(__end_, __t.__end_);
-            _VSTD::swap(__end_cap(), __t.__end_cap());
+            _CUDA_VSTD::swap(__first_, __t.__first_);
+            _CUDA_VSTD::swap(__begin_, __t.__begin_);
+            _CUDA_VSTD::swap(__end_, __t.__end_);
+            _CUDA_VSTD::swap(__end_cap(), __t.__end_cap());
         }
     }
-    __alloc_traits::construct(__alloc(), _VSTD::__to_address(__begin_-1), __x);
+    __alloc_traits::construct(__alloc(), _CUDA_VSTD::__to_address(__begin_-1), __x);
     --__begin_;
 }
 
 template <class _Tp, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void
 __split_buffer<_Tp, _Allocator>::push_front(value_type&& __x)
 {
@@ -518,7 +518,7 @@ __split_buffer<_Tp, _Allocator>::push_front(value_type&& __x)
         {
             
diff erence_type __d = __end_cap() - __end_;
             __d = (__d + 1) / 2;
-            __begin_ = _VSTD::move_backward(__begin_, __end_, __end_ + __d);
+            __begin_ = _CUDA_VSTD::move_backward(__begin_, __end_, __end_ + __d);
             __end_ += __d;
         }
         else
@@ -527,20 +527,20 @@ __split_buffer<_Tp, _Allocator>::push_front(value_type&& __x)
             __split_buffer<value_type, __alloc_rr&> __t(__c, (__c + 3) / 4, __alloc());
             __t.__construct_at_end(move_iterator<pointer>(__begin_),
                                    move_iterator<pointer>(__end_));
-            _VSTD::swap(__first_, __t.__first_);
-            _VSTD::swap(__begin_, __t.__begin_);
-            _VSTD::swap(__end_, __t.__end_);
-            _VSTD::swap(__end_cap(), __t.__end_cap());
+            _CUDA_VSTD::swap(__first_, __t.__first_);
+            _CUDA_VSTD::swap(__begin_, __t.__begin_);
+            _CUDA_VSTD::swap(__end_, __t.__end_);
+            _CUDA_VSTD::swap(__end_cap(), __t.__end_cap());
         }
     }
-    __alloc_traits::construct(__alloc(), _VSTD::__to_address(__begin_-1),
-            _VSTD::move(__x));
+    __alloc_traits::construct(__alloc(), _CUDA_VSTD::__to_address(__begin_-1),
+            _CUDA_VSTD::move(__x));
     --__begin_;
 }
 
 template <class _Tp, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
-inline _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 __split_buffer<_Tp, _Allocator>::push_back(const_reference __x)
 {
@@ -550,7 +550,7 @@ __split_buffer<_Tp, _Allocator>::push_back(const_reference __x)
         {
             
diff erence_type __d = __begin_ - __first_;
             __d = (__d + 1) / 2;
-            __end_ = _VSTD::move(__begin_, __end_, __begin_ - __d);
+            __end_ = _CUDA_VSTD::move(__begin_, __end_, __begin_ - __d);
             __begin_ -= __d;
         }
         else
@@ -559,18 +559,18 @@ __split_buffer<_Tp, _Allocator>::push_back(const_reference __x)
             __split_buffer<value_type, __alloc_rr&> __t(__c, __c / 4, __alloc());
             __t.__construct_at_end(move_iterator<pointer>(__begin_),
                                    move_iterator<pointer>(__end_));
-            _VSTD::swap(__first_, __t.__first_);
-            _VSTD::swap(__begin_, __t.__begin_);
-            _VSTD::swap(__end_, __t.__end_);
-            _VSTD::swap(__end_cap(), __t.__end_cap());
+            _CUDA_VSTD::swap(__first_, __t.__first_);
+            _CUDA_VSTD::swap(__begin_, __t.__begin_);
+            _CUDA_VSTD::swap(__end_, __t.__end_);
+            _CUDA_VSTD::swap(__end_cap(), __t.__end_cap());
         }
     }
-    __alloc_traits::construct(__alloc(), _VSTD::__to_address(__end_), __x);
+    __alloc_traits::construct(__alloc(), _CUDA_VSTD::__to_address(__end_), __x);
     ++__end_;
 }
 
 template <class _Tp, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void
 __split_buffer<_Tp, _Allocator>::push_back(value_type&& __x)
 {
@@ -580,7 +580,7 @@ __split_buffer<_Tp, _Allocator>::push_back(value_type&& __x)
         {
             
diff erence_type __d = __begin_ - __first_;
             __d = (__d + 1) / 2;
-            __end_ = _VSTD::move(__begin_, __end_, __begin_ - __d);
+            __end_ = _CUDA_VSTD::move(__begin_, __end_, __begin_ - __d);
             __begin_ -= __d;
         }
         else
@@ -589,20 +589,20 @@ __split_buffer<_Tp, _Allocator>::push_back(value_type&& __x)
             __split_buffer<value_type, __alloc_rr&> __t(__c, __c / 4, __alloc());
             __t.__construct_at_end(move_iterator<pointer>(__begin_),
                                    move_iterator<pointer>(__end_));
-            _VSTD::swap(__first_, __t.__first_);
-            _VSTD::swap(__begin_, __t.__begin_);
-            _VSTD::swap(__end_, __t.__end_);
-            _VSTD::swap(__end_cap(), __t.__end_cap());
+            _CUDA_VSTD::swap(__first_, __t.__first_);
+            _CUDA_VSTD::swap(__begin_, __t.__begin_);
+            _CUDA_VSTD::swap(__end_, __t.__end_);
+            _CUDA_VSTD::swap(__end_cap(), __t.__end_cap());
         }
     }
-    __alloc_traits::construct(__alloc(), _VSTD::__to_address(__end_),
-            _VSTD::move(__x));
+    __alloc_traits::construct(__alloc(), _CUDA_VSTD::__to_address(__end_),
+            _CUDA_VSTD::move(__x));
     ++__end_;
 }
 
 template <class _Tp, class _Allocator>
 template <class... _Args>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void
 __split_buffer<_Tp, _Allocator>::emplace_back(_Args&&... __args)
 {
@@ -612,7 +612,7 @@ __split_buffer<_Tp, _Allocator>::emplace_back(_Args&&... __args)
         {
             
diff erence_type __d = __begin_ - __first_;
             __d = (__d + 1) / 2;
-            __end_ = _VSTD::move(__begin_, __end_, __begin_ - __d);
+            __end_ = _CUDA_VSTD::move(__begin_, __end_, __begin_ - __d);
             __begin_ -= __d;
         }
         else
@@ -621,20 +621,20 @@ __split_buffer<_Tp, _Allocator>::emplace_back(_Args&&... __args)
             __split_buffer<value_type, __alloc_rr&> __t(__c, __c / 4, __alloc());
             __t.__construct_at_end(move_iterator<pointer>(__begin_),
                                    move_iterator<pointer>(__end_));
-            _VSTD::swap(__first_, __t.__first_);
-            _VSTD::swap(__begin_, __t.__begin_);
-            _VSTD::swap(__end_, __t.__end_);
-            _VSTD::swap(__end_cap(), __t.__end_cap());
+            _CUDA_VSTD::swap(__first_, __t.__first_);
+            _CUDA_VSTD::swap(__begin_, __t.__begin_);
+            _CUDA_VSTD::swap(__end_, __t.__end_);
+            _CUDA_VSTD::swap(__end_cap(), __t.__end_cap());
         }
     }
-    __alloc_traits::construct(__alloc(), _VSTD::__to_address(__end_),
-                              _VSTD::forward<_Args>(__args)...);
+    __alloc_traits::construct(__alloc(), _CUDA_VSTD::__to_address(__end_),
+                              _CUDA_VSTD::forward<_Args>(__args)...);
     ++__end_;
 }
 
 template <class _Tp, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
-inline _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 swap(__split_buffer<_Tp, _Allocator>& __x, __split_buffer<_Tp, _Allocator>& __y)
         _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
@@ -642,8 +642,8 @@ swap(__split_buffer<_Tp, _Allocator>& __x, __split_buffer<_Tp, _Allocator>& __y)
     __x.swap(__y);
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___SPLIT_BUFFER
+#endif // _LIBCUDACXX___SPLIT_BUFFER

diff  --git a/libcxx/include/__std_stream b/libcxx/include/__std_stream
index e419e8c03af0..84a77d31f292 100644
--- a/libcxx/include/__std_stream
+++ b/libcxx/include/__std_stream
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___STD_STREAM
-#define _LIBCPP___STD_STREAM
+#ifndef _LIBCUDACXX___STD_STREAM
+#define _LIBCUDACXX___STD_STREAM
 
 #include <__config>
 #include <__locale>
@@ -16,22 +16,22 @@
 #include <istream>
 #include <ostream>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 static const int __limit = 8;
 
 // __stdinbuf
 
 template <class _CharT>
-class _LIBCPP_HIDDEN __stdinbuf
+class _LIBCUDACXX_HIDDEN __stdinbuf
     : public basic_streambuf<_CharT, char_traits<_CharT> >
 {
 public:
@@ -116,7 +116,7 @@ __stdinbuf<_CharT>::__getchar(bool __consume)
         return __result;
     }
     char __extbuf[__limit];
-    int __nread = _VSTD::max(1, __encoding_);
+    int __nread = _CUDA_VSTD::max(1, __encoding_);
     for (int __i = 0; __i < __nread; ++__i)
     {
         int __c = getc(__file_);
@@ -139,7 +139,7 @@ __stdinbuf<_CharT>::__getchar(bool __consume)
                                    &__1buf, &__1buf + 1, __inxt);
             switch (__r)
             {
-            case _VSTD::codecvt_base::ok:
+            case _CUDA_VSTD::codecvt_base::ok:
                 break;
             case codecvt_base::partial:
                 *__st_ = __sv_st;
@@ -155,11 +155,11 @@ __stdinbuf<_CharT>::__getchar(bool __consume)
                 break;
             case codecvt_base::error:
                 return traits_type::eof();
-            case _VSTD::codecvt_base::noconv:
+            case _CUDA_VSTD::codecvt_base::noconv:
                 __1buf = static_cast<char_type>(__extbuf[0]);
                 break;
             }
-        } while (__r == _VSTD::codecvt_base::partial);
+        } while (__r == _CUDA_VSTD::codecvt_base::partial);
     }
     if (!__consume)
     {
@@ -197,9 +197,9 @@ __stdinbuf<_CharT>::pbackfail(int_type __c)
         switch (__cv_->out(*__st_, &__ci, &__ci + 1, __inxt,
                                   __extbuf, __extbuf + sizeof(__extbuf), __enxt))
         {
-        case _VSTD::codecvt_base::ok:
+        case _CUDA_VSTD::codecvt_base::ok:
             break;
-        case _VSTD::codecvt_base::noconv:
+        case _CUDA_VSTD::codecvt_base::noconv:
             __extbuf[0] = static_cast<char>(__last_consumed_);
             __enxt = __extbuf + 1;
             break;
@@ -219,7 +219,7 @@ __stdinbuf<_CharT>::pbackfail(int_type __c)
 // __stdoutbuf
 
 template <class _CharT>
-class _LIBCPP_HIDDEN __stdoutbuf
+class _LIBCUDACXX_HIDDEN __stdoutbuf
     : public basic_streambuf<_CharT, char_traits<_CharT> >
 {
 public:
@@ -354,8 +354,8 @@ __stdoutbuf<_CharT>::imbue(const locale& __loc)
     __always_noconv_ = __cv_->always_noconv();
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___STD_STREAM
+#endif // _LIBCUDACXX___STD_STREAM

diff  --git a/libcxx/include/__string/char_traits.h b/libcxx/include/__string/char_traits.h
index 18ad67b28e16..ace45fa66378 100644
--- a/libcxx/include/__string/char_traits.h
+++ b/libcxx/include/__string/char_traits.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___STRING_CHAR_TRAITS_H
-#define _LIBCPP___STRING_CHAR_TRAITS_H
+#ifndef _LIBCUDACXX___STRING_CHAR_TRAITS_H
+#define _LIBCUDACXX___STRING_CHAR_TRAITS_H
 
 #include <__algorithm/copy_n.h>
 #include <__algorithm/fill_n.h>
@@ -23,21 +23,21 @@
 #include <iosfwd>
 #include <type_traits>
 
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 #   include <cwchar> // for wmemcpy
 #endif
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _CharT>
-struct _LIBCPP_TEMPLATE_VIS char_traits
+struct _LIBCUDACXX_TEMPLATE_VIS char_traits
 {
     typedef _CharT    char_type;
     typedef int       int_type;
@@ -45,42 +45,42 @@ struct _LIBCPP_TEMPLATE_VIS char_traits
     typedef streampos pos_type;
     typedef mbstate_t state_type;
 
-    static inline void _LIBCPP_CONSTEXPR_AFTER_CXX14
+    static inline void _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
         assign(char_type& __c1, const char_type& __c2) _NOEXCEPT {__c1 = __c2;}
-    static inline _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
+    static inline _LIBCUDACXX_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
         {return __c1 == __c2;}
-    static inline _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
+    static inline _LIBCUDACXX_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
         {return __c1 < __c2;}
 
-    static _LIBCPP_CONSTEXPR_AFTER_CXX14
+    static _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     int compare(const char_type* __s1, const char_type* __s2, size_t __n);
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     size_t length(const char_type* __s);
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     const char_type* find(const char_type* __s, size_t __n, const char_type& __a);
-    static _LIBCPP_CONSTEXPR_AFTER_CXX17
+    static _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     char_type*       move(char_type* __s1, const char_type* __s2, size_t __n);
-    _LIBCPP_INLINE_VISIBILITY
-    static _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY
+    static _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     char_type*       copy(char_type* __s1, const char_type* __s2, size_t __n);
-    _LIBCPP_INLINE_VISIBILITY
-    static _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY
+    static _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     char_type*       assign(char_type* __s, size_t __n, char_type __a);
 
-    static inline _LIBCPP_CONSTEXPR int_type  not_eof(int_type __c) _NOEXCEPT
+    static inline _LIBCUDACXX_CONSTEXPR int_type  not_eof(int_type __c) _NOEXCEPT
         {return eq_int_type(__c, eof()) ? ~eof() : __c;}
-    static inline _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
+    static inline _LIBCUDACXX_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
         {return char_type(__c);}
-    static inline _LIBCPP_CONSTEXPR int_type  to_int_type(char_type __c) _NOEXCEPT
+    static inline _LIBCUDACXX_CONSTEXPR int_type  to_int_type(char_type __c) _NOEXCEPT
         {return int_type(__c);}
-    static inline _LIBCPP_CONSTEXPR bool      eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
+    static inline _LIBCUDACXX_CONSTEXPR bool      eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
         {return __c1 == __c2;}
-    static inline _LIBCPP_CONSTEXPR int_type  eof() _NOEXCEPT
+    static inline _LIBCUDACXX_CONSTEXPR int_type  eof() _NOEXCEPT
         {return int_type(EOF);}
 };
 
 template <class _CharT>
-_LIBCPP_CONSTEXPR_AFTER_CXX14 int
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX14 int
 char_traits<_CharT>::compare(const char_type* __s1, const char_type* __s2, size_t __n)
 {
     for (; __n; --__n, ++__s1, ++__s2)
@@ -95,7 +95,7 @@ char_traits<_CharT>::compare(const char_type* __s1, const char_type* __s2, size_
 
 template <class _CharT>
 inline
-_LIBCPP_CONSTEXPR_AFTER_CXX14 size_t
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX14 size_t
 char_traits<_CharT>::length(const char_type* __s)
 {
     size_t __len = 0;
@@ -106,7 +106,7 @@ char_traits<_CharT>::length(const char_type* __s)
 
 template <class _CharT>
 inline
-_LIBCPP_CONSTEXPR_AFTER_CXX14 const _CharT*
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX14 const _CharT*
 char_traits<_CharT>::find(const char_type* __s, size_t __n, const char_type& __a)
 {
     for (; __n; --__n)
@@ -119,7 +119,7 @@ char_traits<_CharT>::find(const char_type* __s, size_t __n, const char_type& __a
 }
 
 template <class _CharT>
-_LIBCPP_CONSTEXPR_AFTER_CXX17 _CharT*
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _CharT*
 char_traits<_CharT>::move(char_type* __s1, const char_type* __s2, size_t __n)
 {
     if (__n == 0) return __s1;
@@ -140,12 +140,12 @@ char_traits<_CharT>::move(char_type* __s1, const char_type* __s2, size_t __n)
 }
 
 template <class _CharT>
-inline _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 _CharT*
 char_traits<_CharT>::copy(char_type* __s1, const char_type* __s2, size_t __n)
 {
-    if (!__libcpp_is_constant_evaluated()) {
-        _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
+    if (!__LIBCUDACXX_is_constant_evaluated()) {
+        _LIBCUDACXX_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
     }
     char_type* __r = __s1;
     for (; __n; --__n, ++__s1, ++__s2)
@@ -154,7 +154,7 @@ char_traits<_CharT>::copy(char_type* __s1, const char_type* __s2, size_t __n)
 }
 
 template <class _CharT>
-inline _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 _CharT*
 char_traits<_CharT>::assign(char_type* __s, size_t __n, char_type __a)
 {
@@ -165,11 +165,11 @@ char_traits<_CharT>::assign(char_type* __s, size_t __n, char_type __a)
 }
 
 template <class _CharT>
-static inline _LIBCPP_CONSTEXPR_AFTER_CXX17
+static inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 _CharT* __char_traits_move(_CharT* __dest, const _CharT* __source, size_t __n) _NOEXCEPT
 {
-#ifdef _LIBCPP_COMPILER_GCC
-  if (__libcpp_is_constant_evaluated()) {
+#ifdef _LIBCUDACXX_COMPILER_GCC
+  if (__LIBCUDACXX_is_constant_evaluated()) {
     if (__n == 0)
       return __dest;
     _CharT* __allocation = new _CharT[__n];
@@ -186,7 +186,7 @@ _CharT* __char_traits_move(_CharT* __dest, const _CharT* __source, size_t __n) _
 // char_traits<char>
 
 template <>
-struct _LIBCPP_TEMPLATE_VIS char_traits<char>
+struct _LIBCUDACXX_TEMPLATE_VIS char_traits<char>
 {
     typedef char      char_type;
     typedef int       int_type;
@@ -194,21 +194,21 @@ struct _LIBCPP_TEMPLATE_VIS char_traits<char>
     typedef streampos pos_type;
     typedef mbstate_t state_type;
 
-    static inline _LIBCPP_CONSTEXPR_AFTER_CXX14
+    static inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT {__c1 = __c2;}
-    static inline _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
+    static inline _LIBCUDACXX_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
             {return __c1 == __c2;}
-    static inline _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
+    static inline _LIBCUDACXX_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
         {return (unsigned char)__c1 < (unsigned char)__c2;}
 
-    static _LIBCPP_CONSTEXPR_AFTER_CXX14
+    static _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     int compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT;
 
-    static inline size_t _LIBCPP_CONSTEXPR_AFTER_CXX14 length(const char_type* __s)  _NOEXCEPT {
+    static inline size_t _LIBCUDACXX_CONSTEXPR_AFTER_CXX14 length(const char_type* __s)  _NOEXCEPT {
       // GCC currently does not support __builtin_strlen during constant evaluation.
       // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70816
-#ifdef _LIBCPP_COMPILER_GCC
-      if (__libcpp_is_constant_evaluated()) {
+#ifdef _LIBCUDACXX_COMPILER_GCC
+      if (__LIBCUDACXX_is_constant_evaluated()) {
         size_t __i = 0;
         for (; __s[__i] != char_type('\0'); ++__i)
             ;
@@ -218,41 +218,41 @@ struct _LIBCPP_TEMPLATE_VIS char_traits<char>
       return __builtin_strlen(__s);
     }
 
-    static _LIBCPP_CONSTEXPR_AFTER_CXX14
+    static _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     const char_type* find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT;
 
-    static inline _LIBCPP_CONSTEXPR_AFTER_CXX17
+    static inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     char_type* move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT {
         return std::__char_traits_move(__s1, __s2, __n);
     }
 
-    static inline _LIBCPP_CONSTEXPR_AFTER_CXX17
+    static inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT {
-        if (!__libcpp_is_constant_evaluated())
-            _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
+        if (!__LIBCUDACXX_is_constant_evaluated())
+            _LIBCUDACXX_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
         std::copy_n(__s2, __n, __s1);
         return __s1;
     }
 
-    static inline _LIBCPP_CONSTEXPR_AFTER_CXX17
+    static inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     char_type* assign(char_type* __s, size_t __n, char_type __a) _NOEXCEPT {
         std::fill_n(__s, __n, __a);
         return __s;
     }
 
-    static inline _LIBCPP_CONSTEXPR int_type  not_eof(int_type __c) _NOEXCEPT
+    static inline _LIBCUDACXX_CONSTEXPR int_type  not_eof(int_type __c) _NOEXCEPT
         {return eq_int_type(__c, eof()) ? ~eof() : __c;}
-    static inline _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
+    static inline _LIBCUDACXX_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
         {return char_type(__c);}
-    static inline _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
+    static inline _LIBCUDACXX_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
         {return int_type((unsigned char)__c);}
-    static inline _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
+    static inline _LIBCUDACXX_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
         {return __c1 == __c2;}
-    static inline _LIBCPP_CONSTEXPR int_type  eof() _NOEXCEPT
+    static inline _LIBCUDACXX_CONSTEXPR int_type  eof() _NOEXCEPT
         {return int_type(EOF);}
 };
 
-inline _LIBCPP_CONSTEXPR_AFTER_CXX14
+inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 int
 char_traits<char>::compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT
 {
@@ -260,8 +260,8 @@ char_traits<char>::compare(const char_type* __s1, const char_type* __s2, size_t
         return 0;
 #if __has_feature(cxx_constexpr_string_builtins)
     return __builtin_memcmp(__s1, __s2, __n);
-#elif _LIBCPP_STD_VER <= 14
-    return _VSTD::memcmp(__s1, __s2, __n);
+#elif _LIBCUDACXX_STD_VER <= 14
+    return _CUDA_VSTD::memcmp(__s1, __s2, __n);
 #else
     for (; __n; --__n, ++__s1, ++__s2)
     {
@@ -274,7 +274,7 @@ char_traits<char>::compare(const char_type* __s1, const char_type* __s2, size_t
 #endif
 }
 
-inline _LIBCPP_CONSTEXPR_AFTER_CXX14
+inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 const char*
 char_traits<char>::find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT
 {
@@ -282,8 +282,8 @@ char_traits<char>::find(const char_type* __s, size_t __n, const char_type& __a)
         return nullptr;
 #if __has_feature(cxx_constexpr_string_builtins)
     return __builtin_char_memchr(__s, to_int_type(__a), __n);
-#elif _LIBCPP_STD_VER <= 14
-    return (const char_type*) _VSTD::memchr(__s, to_int_type(__a), __n);
+#elif _LIBCUDACXX_STD_VER <= 14
+    return (const char_type*) _CUDA_VSTD::memchr(__s, to_int_type(__a), __n);
 #else
     for (; __n; --__n)
     {
@@ -298,9 +298,9 @@ char_traits<char>::find(const char_type* __s, size_t __n, const char_type& __a)
 
 // char_traits<wchar_t>
 
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 template <>
-struct _LIBCPP_TEMPLATE_VIS char_traits<wchar_t>
+struct _LIBCUDACXX_TEMPLATE_VIS char_traits<wchar_t>
 {
     typedef wchar_t   char_type;
     typedef wint_t    int_type;
@@ -308,52 +308,52 @@ struct _LIBCPP_TEMPLATE_VIS char_traits<wchar_t>
     typedef streampos pos_type;
     typedef mbstate_t state_type;
 
-    static inline _LIBCPP_CONSTEXPR_AFTER_CXX14
+    static inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT {__c1 = __c2;}
-    static inline _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
+    static inline _LIBCUDACXX_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
         {return __c1 == __c2;}
-    static inline _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
+    static inline _LIBCUDACXX_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
         {return __c1 < __c2;}
 
-    static _LIBCPP_CONSTEXPR_AFTER_CXX14
+    static _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     int compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT;
-    static _LIBCPP_CONSTEXPR_AFTER_CXX14
+    static _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     size_t length(const char_type* __s) _NOEXCEPT;
-    static _LIBCPP_CONSTEXPR_AFTER_CXX14
+    static _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     const char_type* find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT;
 
-    static inline _LIBCPP_CONSTEXPR_AFTER_CXX17
+    static inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     char_type* move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT {
         return std::__char_traits_move(__s1, __s2, __n);
     }
 
-    static inline _LIBCPP_CONSTEXPR_AFTER_CXX17
+    static inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT {
-        if (!__libcpp_is_constant_evaluated())
-            _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
+        if (!__LIBCUDACXX_is_constant_evaluated())
+            _LIBCUDACXX_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
         std::copy_n(__s2, __n, __s1);
         return __s1;
     }
 
-    static inline _LIBCPP_CONSTEXPR_AFTER_CXX17
+    static inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     char_type* assign(char_type* __s, size_t __n, char_type __a) _NOEXCEPT {
         std::fill_n(__s, __n, __a);
         return __s;
     }
 
-    static inline _LIBCPP_CONSTEXPR int_type  not_eof(int_type __c) _NOEXCEPT
+    static inline _LIBCUDACXX_CONSTEXPR int_type  not_eof(int_type __c) _NOEXCEPT
         {return eq_int_type(__c, eof()) ? ~eof() : __c;}
-    static inline _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
+    static inline _LIBCUDACXX_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
         {return char_type(__c);}
-    static inline _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
+    static inline _LIBCUDACXX_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
         {return int_type(__c);}
-    static inline _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
+    static inline _LIBCUDACXX_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
         {return __c1 == __c2;}
-    static inline _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT
+    static inline _LIBCUDACXX_CONSTEXPR int_type eof() _NOEXCEPT
         {return int_type(WEOF);}
 };
 
-inline _LIBCPP_CONSTEXPR_AFTER_CXX14
+inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 int
 char_traits<wchar_t>::compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT
 {
@@ -361,8 +361,8 @@ char_traits<wchar_t>::compare(const char_type* __s1, const char_type* __s2, size
         return 0;
 #if __has_feature(cxx_constexpr_string_builtins)
     return __builtin_wmemcmp(__s1, __s2, __n);
-#elif _LIBCPP_STD_VER <= 14
-    return _VSTD::wmemcmp(__s1, __s2, __n);
+#elif _LIBCUDACXX_STD_VER <= 14
+    return _CUDA_VSTD::wmemcmp(__s1, __s2, __n);
 #else
     for (; __n; --__n, ++__s1, ++__s2)
     {
@@ -375,14 +375,14 @@ char_traits<wchar_t>::compare(const char_type* __s1, const char_type* __s2, size
 #endif
 }
 
-inline _LIBCPP_CONSTEXPR_AFTER_CXX14
+inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 size_t
 char_traits<wchar_t>::length(const char_type* __s) _NOEXCEPT
 {
 #if __has_feature(cxx_constexpr_string_builtins)
     return __builtin_wcslen(__s);
-#elif _LIBCPP_STD_VER <= 14
-    return _VSTD::wcslen(__s);
+#elif _LIBCUDACXX_STD_VER <= 14
+    return _CUDA_VSTD::wcslen(__s);
 #else
     size_t __len = 0;
     for (; !eq(*__s, char_type(0)); ++__s)
@@ -391,7 +391,7 @@ char_traits<wchar_t>::length(const char_type* __s) _NOEXCEPT
 #endif
 }
 
-inline _LIBCPP_CONSTEXPR_AFTER_CXX14
+inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 const wchar_t*
 char_traits<wchar_t>::find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT
 {
@@ -399,8 +399,8 @@ char_traits<wchar_t>::find(const char_type* __s, size_t __n, const char_type& __
         return nullptr;
 #if __has_feature(cxx_constexpr_string_builtins)
     return __builtin_wmemchr(__s, __a, __n);
-#elif _LIBCPP_STD_VER <= 14
-    return _VSTD::wmemchr(__s, __a, __n);
+#elif _LIBCUDACXX_STD_VER <= 14
+    return _CUDA_VSTD::wmemchr(__s, __a, __n);
 #else
     for (; __n; --__n)
     {
@@ -411,12 +411,12 @@ char_traits<wchar_t>::find(const char_type* __s, size_t __n, const char_type& __
     return nullptr;
 #endif
 }
-#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#endif // _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 
-#ifndef _LIBCPP_HAS_NO_CHAR8_T
+#ifndef _LIBCUDACXX_HAS_NO_CHAR8_T
 
 template <>
-struct _LIBCPP_TEMPLATE_VIS char_traits<char8_t>
+struct _LIBCUDACXX_TEMPLATE_VIS char_traits<char8_t>
 {
     typedef char8_t        char_type;
     typedef unsigned int   int_type;
@@ -437,23 +437,23 @@ struct _LIBCPP_TEMPLATE_VIS char_traits<char8_t>
     static constexpr
     size_t           length(const char_type* __s) _NOEXCEPT;
 
-    _LIBCPP_INLINE_VISIBILITY static constexpr
+    _LIBCUDACXX_INLINE_VISIBILITY static constexpr
     const char_type* find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT;
 
-    static _LIBCPP_CONSTEXPR_AFTER_CXX17
+    static _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     char_type*       move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT {
         return std::__char_traits_move(__s1, __s2, __n);
     }
 
-    static _LIBCPP_CONSTEXPR_AFTER_CXX17
+    static _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     char_type*       copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT {
-        if (!__libcpp_is_constant_evaluated())
-            _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
+        if (!__LIBCUDACXX_is_constant_evaluated())
+            _LIBCUDACXX_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
         std::copy_n(__s2, __n, __s1);
         return __s1;
     }
 
-    static _LIBCPP_CONSTEXPR_AFTER_CXX17
+    static _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     char_type*       assign(char_type* __s, size_t __n, char_type __a) _NOEXCEPT {
         std::fill_n(__s, __n, __a);
         return __s;
@@ -514,10 +514,10 @@ char_traits<char8_t>::find(const char_type* __s, size_t __n, const char_type& __
     return nullptr;
 }
 
-#endif // _LIBCPP_HAS_NO_CHAR8_T
+#endif // _LIBCUDACXX_HAS_NO_CHAR8_T
 
 template <>
-struct _LIBCPP_TEMPLATE_VIS char_traits<char16_t>
+struct _LIBCUDACXX_TEMPLATE_VIS char_traits<char16_t>
 {
     typedef char16_t       char_type;
     typedef uint_least16_t int_type;
@@ -525,52 +525,52 @@ struct _LIBCPP_TEMPLATE_VIS char_traits<char16_t>
     typedef u16streampos   pos_type;
     typedef mbstate_t      state_type;
 
-    static inline _LIBCPP_CONSTEXPR_AFTER_CXX14
+    static inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT {__c1 = __c2;}
-    static inline _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
+    static inline _LIBCUDACXX_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
         {return __c1 == __c2;}
-    static inline _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
+    static inline _LIBCUDACXX_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
         {return __c1 < __c2;}
 
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     int              compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT;
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     size_t           length(const char_type* __s) _NOEXCEPT;
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     const char_type* find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT;
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     static char_type*       move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT {
         return std::__char_traits_move(__s1, __s2, __n);
     }
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     static char_type*       copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT {
-        if (!__libcpp_is_constant_evaluated())
-            _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
+        if (!__LIBCUDACXX_is_constant_evaluated())
+            _LIBCUDACXX_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
         std::copy_n(__s2, __n, __s1);
         return __s1;
     }
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     static char_type*       assign(char_type* __s, size_t __n, char_type __a) _NOEXCEPT {
         std::fill_n(__s, __n, __a);
         return __s;
     }
 
-    static inline _LIBCPP_CONSTEXPR int_type  not_eof(int_type __c) _NOEXCEPT
+    static inline _LIBCUDACXX_CONSTEXPR int_type  not_eof(int_type __c) _NOEXCEPT
         {return eq_int_type(__c, eof()) ? ~eof() : __c;}
-    static inline _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
+    static inline _LIBCUDACXX_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
         {return char_type(__c);}
-    static inline _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
+    static inline _LIBCUDACXX_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
         {return int_type(__c);}
-    static inline _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
+    static inline _LIBCUDACXX_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
         {return __c1 == __c2;}
-    static inline _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT
+    static inline _LIBCUDACXX_CONSTEXPR int_type eof() _NOEXCEPT
         {return int_type(0xFFFF);}
 };
 
-inline _LIBCPP_CONSTEXPR_AFTER_CXX14
+inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 int
 char_traits<char16_t>::compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT
 {
@@ -584,7 +584,7 @@ char_traits<char16_t>::compare(const char_type* __s1, const char_type* __s2, siz
     return 0;
 }
 
-inline _LIBCPP_CONSTEXPR_AFTER_CXX14
+inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 size_t
 char_traits<char16_t>::length(const char_type* __s) _NOEXCEPT
 {
@@ -594,7 +594,7 @@ char_traits<char16_t>::length(const char_type* __s) _NOEXCEPT
     return __len;
 }
 
-inline _LIBCPP_CONSTEXPR_AFTER_CXX14
+inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 const char16_t*
 char_traits<char16_t>::find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT
 {
@@ -608,7 +608,7 @@ char_traits<char16_t>::find(const char_type* __s, size_t __n, const char_type& _
 }
 
 template <>
-struct _LIBCPP_TEMPLATE_VIS char_traits<char32_t>
+struct _LIBCUDACXX_TEMPLATE_VIS char_traits<char32_t>
 {
     typedef char32_t       char_type;
     typedef uint_least32_t int_type;
@@ -616,50 +616,50 @@ struct _LIBCPP_TEMPLATE_VIS char_traits<char32_t>
     typedef u32streampos   pos_type;
     typedef mbstate_t      state_type;
 
-    static inline _LIBCPP_CONSTEXPR_AFTER_CXX14
+    static inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT {__c1 = __c2;}
-    static inline _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
+    static inline _LIBCUDACXX_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
         {return __c1 == __c2;}
-    static inline _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
+    static inline _LIBCUDACXX_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
         {return __c1 < __c2;}
 
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     int              compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT;
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     size_t           length(const char_type* __s) _NOEXCEPT;
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     const char_type* find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT;
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     static char_type*       move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT {
         return std::__char_traits_move(__s1, __s2, __n);
     }
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     static char_type*       copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT {
         std::copy_n(__s2, __n, __s1);
         return __s1;
     }
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     static char_type*       assign(char_type* __s, size_t __n, char_type __a) _NOEXCEPT {
         std::fill_n(__s, __n, __a);
         return __s;
     }
 
-    static inline _LIBCPP_CONSTEXPR int_type  not_eof(int_type __c) _NOEXCEPT
+    static inline _LIBCUDACXX_CONSTEXPR int_type  not_eof(int_type __c) _NOEXCEPT
         {return eq_int_type(__c, eof()) ? ~eof() : __c;}
-    static inline _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
+    static inline _LIBCUDACXX_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
         {return char_type(__c);}
-    static inline _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
+    static inline _LIBCUDACXX_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
         {return int_type(__c);}
-    static inline _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
+    static inline _LIBCUDACXX_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
         {return __c1 == __c2;}
-    static inline _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT
+    static inline _LIBCUDACXX_CONSTEXPR int_type eof() _NOEXCEPT
         {return int_type(0xFFFFFFFF);}
 };
 
-inline _LIBCPP_CONSTEXPR_AFTER_CXX14
+inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 int
 char_traits<char32_t>::compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT
 {
@@ -673,7 +673,7 @@ char_traits<char32_t>::compare(const char_type* __s1, const char_type* __s2, siz
     return 0;
 }
 
-inline _LIBCPP_CONSTEXPR_AFTER_CXX14
+inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 size_t
 char_traits<char32_t>::length(const char_type* __s) _NOEXCEPT
 {
@@ -683,7 +683,7 @@ char_traits<char32_t>::length(const char_type* __s) _NOEXCEPT
     return __len;
 }
 
-inline _LIBCPP_CONSTEXPR_AFTER_CXX14
+inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
 const char32_t*
 char_traits<char32_t>::find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT
 {
@@ -700,7 +700,7 @@ char_traits<char32_t>::find(const char_type* __s, size_t __n, const char_type& _
 
 // __str_find
 template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
-inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+inline _SizeT _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
 __str_find(const _CharT *__p, _SizeT __sz,
              _CharT __c, _SizeT __pos) _NOEXCEPT
 {
@@ -713,7 +713,7 @@ __str_find(const _CharT *__p, _SizeT __sz,
 }
 
 template <class _CharT, class _Traits>
-inline _LIBCPP_CONSTEXPR_AFTER_CXX11 const _CharT *
+inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 const _CharT *
 __search_substring(const _CharT *__first1, const _CharT *__last1,
                    const _CharT *__first2, const _CharT *__last2) _NOEXCEPT {
   // Take advantage of knowing source and pattern lengths.
@@ -752,7 +752,7 @@ __search_substring(const _CharT *__first1, const _CharT *__last1,
 }
 
 template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
-inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+inline _SizeT _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
 __str_find(const _CharT *__p, _SizeT __sz,
        const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
 {
@@ -774,7 +774,7 @@ __str_find(const _CharT *__p, _SizeT __sz,
 // __str_rfind
 
 template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
-inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+inline _SizeT _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
 __str_rfind(const _CharT *__p, _SizeT __sz,
               _CharT __c, _SizeT __pos) _NOEXCEPT
 {
@@ -793,11 +793,11 @@ __str_rfind(const _CharT *__p, _SizeT __sz,
 }
 
 template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
-inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+inline _SizeT _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
 __str_rfind(const _CharT *__p, _SizeT __sz,
         const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
 {
-    __pos = _VSTD::min(__pos, __sz);
+    __pos = _CUDA_VSTD::min(__pos, __sz);
     if (__n < __sz - __pos)
         __pos += __n;
     else
@@ -810,13 +810,13 @@ __str_rfind(const _CharT *__p, _SizeT __sz,
 
 // __str_find_first_of
 template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
-inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+inline _SizeT _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
 __str_find_first_of(const _CharT *__p, _SizeT __sz,
                 const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
 {
     if (__pos >= __sz || __n == 0)
         return __npos;
-    const _CharT* __r = _VSTD::__find_first_of_ce
+    const _CharT* __r = _CUDA_VSTD::__find_first_of_ce
         (__p + __pos, __p + __sz, __s, __s + __n, _Traits::eq );
     if (__r == __p + __sz)
         return __npos;
@@ -826,7 +826,7 @@ __str_find_first_of(const _CharT *__p, _SizeT __sz,
 
 // __str_find_last_of
 template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
-inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+inline _SizeT _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
 __str_find_last_of(const _CharT *__p, _SizeT __sz,
                const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
     {
@@ -849,7 +849,7 @@ __str_find_last_of(const _CharT *__p, _SizeT __sz,
 
 // __str_find_first_not_of
 template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
-inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+inline _SizeT _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
 __str_find_first_not_of(const _CharT *__p, _SizeT __sz,
                     const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
 {
@@ -865,7 +865,7 @@ __str_find_first_not_of(const _CharT *__p, _SizeT __sz,
 
 
 template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
-inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+inline _SizeT _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
 __str_find_first_not_of(const _CharT *__p, _SizeT __sz,
                           _CharT __c, _SizeT __pos) _NOEXCEPT
 {
@@ -882,7 +882,7 @@ __str_find_first_not_of(const _CharT *__p, _SizeT __sz,
 
 // __str_find_last_not_of
 template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
-inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+inline _SizeT _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
 __str_find_last_not_of(const _CharT *__p, _SizeT __sz,
                    const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
 {
@@ -898,7 +898,7 @@ __str_find_last_not_of(const _CharT *__p, _SizeT __sz,
 
 
 template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
-inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+inline _SizeT _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
 __str_find_last_not_of(const _CharT *__p, _SizeT __sz,
                          _CharT __c, _SizeT __pos) _NOEXCEPT
 {
@@ -913,15 +913,15 @@ __str_find_last_not_of(const _CharT *__p, _SizeT __sz,
 }
 
 template<class _Ptr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 size_t __do_string_hash(_Ptr __p, _Ptr __e)
 {
     typedef typename iterator_traits<_Ptr>::value_type value_type;
     return __murmur2_or_cityhash<size_t>()(__p, (__e-__p)*sizeof(value_type));
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___STRING_CHAR_TRAITS_H
+#endif // _LIBCUDACXX___STRING_CHAR_TRAITS_H

diff  --git a/libcxx/include/__string/extern_template_lists.h b/libcxx/include/__string/extern_template_lists.h
index edbda7cbd004..bc07039d54c6 100644
--- a/libcxx/include/__string/extern_template_lists.h
+++ b/libcxx/include/__string/extern_template_lists.h
@@ -6,18 +6,18 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___STRING_EXTERN_TEMPLATE_LISTS_H
-#define _LIBCPP___STRING_EXTERN_TEMPLATE_LISTS_H
+#ifndef _LIBCUDACXX___STRING_EXTERN_TEMPLATE_LISTS_H
+#define _LIBCUDACXX___STRING_EXTERN_TEMPLATE_LISTS_H
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
 // We maintain 2 ABI lists:
-// - _LIBCPP_STRING_V1_EXTERN_TEMPLATE_LIST
-// - _LIBCPP_STRING_UNSTABLE_EXTERN_TEMPLATE_LIST
+// - _LIBCUDACXX_STRING_V1_EXTERN_TEMPLATE_LIST
+// - _LIBCUDACXX_STRING_UNSTABLE_EXTERN_TEMPLATE_LIST
 // As the name implies, the ABI lists define the V1 (Stable) and unstable ABI.
 //
 // For unstable, we may explicitly remove function that are external in V1,
@@ -27,105 +27,105 @@
 // For stable, the ABI list should rarely change, except for adding new
 // functions supporting new c++ version / API changes. Typically entries
 // must never be removed from the stable list.
-#define _LIBCPP_STRING_V1_EXTERN_TEMPLATE_LIST(_Func, _CharType) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::replace(size_type, size_type, value_type const*, size_type)) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::rfind(value_type const*, size_type, size_type) const) \
-  _Func(_LIBCPP_FUNC_VIS void basic_string<_CharType>::__init(value_type const*, size_type, size_type)) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::basic_string(basic_string const&)) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::replace(size_type, size_type, value_type const*)) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::basic_string(basic_string const&, allocator<_CharType> const&)) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find_last_not_of(value_type const*, size_type, size_type) const) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::~basic_string()) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find_first_not_of(value_type const*, size_type, size_type) const) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::insert(size_type, size_type, value_type)) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::operator=(value_type)) \
-  _Func(_LIBCPP_FUNC_VIS void basic_string<_CharType>::__init(value_type const*, size_type)) \
-  _Func(_LIBCPP_FUNC_VIS const _CharType& basic_string<_CharType>::at(size_type) const) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::insert(size_type, value_type const*, size_type)) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find_first_of(value_type const*, size_type, size_type) const) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::replace(size_type, size_type, size_type, value_type)) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::assign(value_type const*, size_type)) \
-  _Func(_LIBCPP_FUNC_VIS void basic_string<_CharType>::reserve(size_type)) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::append(value_type const*, size_type)) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::assign(basic_string const&, size_type, size_type)) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::copy(value_type*, size_type, size_type) const) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::basic_string(basic_string const&, size_type, size_type, allocator<_CharType> const&)) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find(value_type, size_type) const) \
-  _Func(_LIBCPP_FUNC_VIS void basic_string<_CharType>::__init(size_type, value_type)) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::insert(size_type, value_type const*)) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find_last_of(value_type const*, size_type, size_type) const) \
-  _Func(_LIBCPP_FUNC_VIS void basic_string<_CharType>::__grow_by(size_type, size_type, size_type, size_type, size_type, size_type)) \
-  _Func(_LIBCPP_FUNC_VIS void basic_string<_CharType>::__grow_by_and_replace(size_type, size_type, size_type, size_type, size_type, size_type, value_type const*)) \
-  _Func(_LIBCPP_FUNC_VIS void basic_string<_CharType>::push_back(value_type)) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::append(size_type, value_type)) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::rfind(value_type, size_type) const) \
-  _Func(_LIBCPP_FUNC_VIS const basic_string<_CharType>::size_type basic_string<_CharType>::npos) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::assign(size_type, value_type)) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::erase(size_type, size_type)) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::append(basic_string const&, size_type, size_type)) \
-  _Func(_LIBCPP_FUNC_VIS int basic_string<_CharType>::compare(value_type const*) const) \
-  _Func(_LIBCPP_FUNC_VIS int basic_string<_CharType>::compare(size_type, size_type, value_type const*) const) \
-  _Func(_LIBCPP_FUNC_VIS _CharType& basic_string<_CharType>::at(size_type)) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::assign(value_type const*)) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find(value_type const*, size_type, size_type) const) \
-  _Func(_LIBCPP_FUNC_VIS int basic_string<_CharType>::compare(size_type, size_type, basic_string const&, size_type, size_type) const) \
-  _Func(_LIBCPP_FUNC_VIS int basic_string<_CharType>::compare(size_type, size_type, value_type const*, size_type) const) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::operator=(basic_string const&)) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::append(value_type const*)) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::replace(size_type, size_type, basic_string const&, size_type, size_type)) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::iterator basic_string<_CharType>::insert(basic_string::const_iterator, value_type)) \
-  _Func(_LIBCPP_FUNC_VIS void basic_string<_CharType>::resize(size_type, value_type)) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::insert(size_type, basic_string const&, size_type, size_type))
+#define _LIBCUDACXX_STRING_V1_EXTERN_TEMPLATE_LIST(_Func, _CharType) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::replace(size_type, size_type, value_type const*, size_type)) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::rfind(value_type const*, size_type, size_type) const) \
+  _Func(_LIBCUDACXX_FUNC_VIS void basic_string<_CharType>::__init(value_type const*, size_type, size_type)) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>::basic_string(basic_string const&)) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::replace(size_type, size_type, value_type const*)) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>::basic_string(basic_string const&, allocator<_CharType> const&)) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find_last_not_of(value_type const*, size_type, size_type) const) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>::~basic_string()) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find_first_not_of(value_type const*, size_type, size_type) const) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::insert(size_type, size_type, value_type)) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::operator=(value_type)) \
+  _Func(_LIBCUDACXX_FUNC_VIS void basic_string<_CharType>::__init(value_type const*, size_type)) \
+  _Func(_LIBCUDACXX_FUNC_VIS const _CharType& basic_string<_CharType>::at(size_type) const) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::insert(size_type, value_type const*, size_type)) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find_first_of(value_type const*, size_type, size_type) const) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::replace(size_type, size_type, size_type, value_type)) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::assign(value_type const*, size_type)) \
+  _Func(_LIBCUDACXX_FUNC_VIS void basic_string<_CharType>::reserve(size_type)) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::append(value_type const*, size_type)) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::assign(basic_string const&, size_type, size_type)) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::copy(value_type*, size_type, size_type) const) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>::basic_string(basic_string const&, size_type, size_type, allocator<_CharType> const&)) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find(value_type, size_type) const) \
+  _Func(_LIBCUDACXX_FUNC_VIS void basic_string<_CharType>::__init(size_type, value_type)) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::insert(size_type, value_type const*)) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find_last_of(value_type const*, size_type, size_type) const) \
+  _Func(_LIBCUDACXX_FUNC_VIS void basic_string<_CharType>::__grow_by(size_type, size_type, size_type, size_type, size_type, size_type)) \
+  _Func(_LIBCUDACXX_FUNC_VIS void basic_string<_CharType>::__grow_by_and_replace(size_type, size_type, size_type, size_type, size_type, size_type, value_type const*)) \
+  _Func(_LIBCUDACXX_FUNC_VIS void basic_string<_CharType>::push_back(value_type)) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::append(size_type, value_type)) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::rfind(value_type, size_type) const) \
+  _Func(_LIBCUDACXX_FUNC_VIS const basic_string<_CharType>::size_type basic_string<_CharType>::npos) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::assign(size_type, value_type)) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::erase(size_type, size_type)) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::append(basic_string const&, size_type, size_type)) \
+  _Func(_LIBCUDACXX_FUNC_VIS int basic_string<_CharType>::compare(value_type const*) const) \
+  _Func(_LIBCUDACXX_FUNC_VIS int basic_string<_CharType>::compare(size_type, size_type, value_type const*) const) \
+  _Func(_LIBCUDACXX_FUNC_VIS _CharType& basic_string<_CharType>::at(size_type)) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::assign(value_type const*)) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find(value_type const*, size_type, size_type) const) \
+  _Func(_LIBCUDACXX_FUNC_VIS int basic_string<_CharType>::compare(size_type, size_type, basic_string const&, size_type, size_type) const) \
+  _Func(_LIBCUDACXX_FUNC_VIS int basic_string<_CharType>::compare(size_type, size_type, value_type const*, size_type) const) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::operator=(basic_string const&)) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::append(value_type const*)) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::replace(size_type, size_type, basic_string const&, size_type, size_type)) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>::iterator basic_string<_CharType>::insert(basic_string::const_iterator, value_type)) \
+  _Func(_LIBCUDACXX_FUNC_VIS void basic_string<_CharType>::resize(size_type, value_type)) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::insert(size_type, basic_string const&, size_type, size_type))
 
-#define _LIBCPP_STRING_UNSTABLE_EXTERN_TEMPLATE_LIST(_Func, _CharType) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::replace(size_type, size_type, value_type const*, size_type)) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::rfind(value_type const*, size_type, size_type) const) \
-  _Func(_LIBCPP_FUNC_VIS void basic_string<_CharType>::__init(value_type const*, size_type, size_type)) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::replace(size_type, size_type, value_type const*)) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find_last_not_of(value_type const*, size_type, size_type) const) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::~basic_string()) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find_first_not_of(value_type const*, size_type, size_type) const) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::insert(size_type, size_type, value_type)) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::operator=(value_type)) \
-  _Func(_LIBCPP_FUNC_VIS void basic_string<_CharType>::__init(value_type const*, size_type)) \
-  _Func(_LIBCPP_FUNC_VIS void basic_string<_CharType>::__init_copy_ctor_external(value_type const*, size_type)) \
-  _Func(_LIBCPP_FUNC_VIS const _CharType& basic_string<_CharType>::at(size_type) const) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::insert(size_type, value_type const*, size_type)) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find_first_of(value_type const*, size_type, size_type) const) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::replace(size_type, size_type, size_type, value_type)) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::__assign_external(value_type const*, size_type)) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::__assign_external(value_type const*)) \
-  _Func(_LIBCPP_FUNC_VIS void basic_string<_CharType>::reserve(size_type)) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::append(value_type const*, size_type)) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::assign(basic_string const&, size_type, size_type)) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::copy(value_type*, size_type, size_type) const) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::basic_string(basic_string const&, size_type, size_type, allocator<_CharType> const&)) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find(value_type, size_type) const) \
-  _Func(_LIBCPP_FUNC_VIS void basic_string<_CharType>::__init(size_type, value_type)) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::insert(size_type, value_type const*)) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find_last_of(value_type const*, size_type, size_type) const) \
-  _Func(_LIBCPP_FUNC_VIS void basic_string<_CharType>::__grow_by(size_type, size_type, size_type, size_type, size_type, size_type)) \
-  _Func(_LIBCPP_FUNC_VIS void basic_string<_CharType>::__grow_by_and_replace(size_type, size_type, size_type, size_type, size_type, size_type, value_type const*)) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::__assign_no_alias<false>(value_type const*, size_type)) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::__assign_no_alias<true>(value_type const*, size_type)) \
-  _Func(_LIBCPP_FUNC_VIS void basic_string<_CharType>::push_back(value_type)) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::append(size_type, value_type)) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::rfind(value_type, size_type) const) \
-  _Func(_LIBCPP_FUNC_VIS const basic_string<_CharType>::size_type basic_string<_CharType>::npos) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::assign(size_type, value_type)) \
-  _Func(_LIBCPP_FUNC_VIS void basic_string<_CharType>::__erase_external_with_move(size_type, size_type)) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::append(basic_string const&, size_type, size_type)) \
-  _Func(_LIBCPP_FUNC_VIS int basic_string<_CharType>::compare(value_type const*) const) \
-  _Func(_LIBCPP_FUNC_VIS int basic_string<_CharType>::compare(size_type, size_type, value_type const*) const) \
-  _Func(_LIBCPP_FUNC_VIS _CharType& basic_string<_CharType>::at(size_type)) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find(value_type const*, size_type, size_type) const) \
-  _Func(_LIBCPP_FUNC_VIS int basic_string<_CharType>::compare(size_type, size_type, basic_string const&, size_type, size_type) const) \
-  _Func(_LIBCPP_FUNC_VIS int basic_string<_CharType>::compare(size_type, size_type, value_type const*, size_type) const) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::append(value_type const*)) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::replace(size_type, size_type, basic_string const&, size_type, size_type)) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::iterator basic_string<_CharType>::insert(basic_string::const_iterator, value_type)) \
-  _Func(_LIBCPP_FUNC_VIS void basic_string<_CharType>::resize(size_type, value_type)) \
-  _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::insert(size_type, basic_string const&, size_type, size_type))
+#define _LIBCUDACXX_STRING_UNSTABLE_EXTERN_TEMPLATE_LIST(_Func, _CharType) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::replace(size_type, size_type, value_type const*, size_type)) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::rfind(value_type const*, size_type, size_type) const) \
+  _Func(_LIBCUDACXX_FUNC_VIS void basic_string<_CharType>::__init(value_type const*, size_type, size_type)) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::replace(size_type, size_type, value_type const*)) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find_last_not_of(value_type const*, size_type, size_type) const) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>::~basic_string()) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find_first_not_of(value_type const*, size_type, size_type) const) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::insert(size_type, size_type, value_type)) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::operator=(value_type)) \
+  _Func(_LIBCUDACXX_FUNC_VIS void basic_string<_CharType>::__init(value_type const*, size_type)) \
+  _Func(_LIBCUDACXX_FUNC_VIS void basic_string<_CharType>::__init_copy_ctor_external(value_type const*, size_type)) \
+  _Func(_LIBCUDACXX_FUNC_VIS const _CharType& basic_string<_CharType>::at(size_type) const) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::insert(size_type, value_type const*, size_type)) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find_first_of(value_type const*, size_type, size_type) const) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::replace(size_type, size_type, size_type, value_type)) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::__assign_external(value_type const*, size_type)) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::__assign_external(value_type const*)) \
+  _Func(_LIBCUDACXX_FUNC_VIS void basic_string<_CharType>::reserve(size_type)) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::append(value_type const*, size_type)) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::assign(basic_string const&, size_type, size_type)) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::copy(value_type*, size_type, size_type) const) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>::basic_string(basic_string const&, size_type, size_type, allocator<_CharType> const&)) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find(value_type, size_type) const) \
+  _Func(_LIBCUDACXX_FUNC_VIS void basic_string<_CharType>::__init(size_type, value_type)) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::insert(size_type, value_type const*)) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find_last_of(value_type const*, size_type, size_type) const) \
+  _Func(_LIBCUDACXX_FUNC_VIS void basic_string<_CharType>::__grow_by(size_type, size_type, size_type, size_type, size_type, size_type)) \
+  _Func(_LIBCUDACXX_FUNC_VIS void basic_string<_CharType>::__grow_by_and_replace(size_type, size_type, size_type, size_type, size_type, size_type, value_type const*)) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::__assign_no_alias<false>(value_type const*, size_type)) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::__assign_no_alias<true>(value_type const*, size_type)) \
+  _Func(_LIBCUDACXX_FUNC_VIS void basic_string<_CharType>::push_back(value_type)) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::append(size_type, value_type)) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::rfind(value_type, size_type) const) \
+  _Func(_LIBCUDACXX_FUNC_VIS const basic_string<_CharType>::size_type basic_string<_CharType>::npos) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::assign(size_type, value_type)) \
+  _Func(_LIBCUDACXX_FUNC_VIS void basic_string<_CharType>::__erase_external_with_move(size_type, size_type)) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::append(basic_string const&, size_type, size_type)) \
+  _Func(_LIBCUDACXX_FUNC_VIS int basic_string<_CharType>::compare(value_type const*) const) \
+  _Func(_LIBCUDACXX_FUNC_VIS int basic_string<_CharType>::compare(size_type, size_type, value_type const*) const) \
+  _Func(_LIBCUDACXX_FUNC_VIS _CharType& basic_string<_CharType>::at(size_type)) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find(value_type const*, size_type, size_type) const) \
+  _Func(_LIBCUDACXX_FUNC_VIS int basic_string<_CharType>::compare(size_type, size_type, basic_string const&, size_type, size_type) const) \
+  _Func(_LIBCUDACXX_FUNC_VIS int basic_string<_CharType>::compare(size_type, size_type, value_type const*, size_type) const) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::append(value_type const*)) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::replace(size_type, size_type, basic_string const&, size_type, size_type)) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>::iterator basic_string<_CharType>::insert(basic_string::const_iterator, value_type)) \
+  _Func(_LIBCUDACXX_FUNC_VIS void basic_string<_CharType>::resize(size_type, value_type)) \
+  _Func(_LIBCUDACXX_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::insert(size_type, basic_string const&, size_type, size_type))
 
 
-#endif // _LIBCPP___STRING_EXTERN_TEMPLATE_LISTS_H
+#endif // _LIBCUDACXX___STRING_EXTERN_TEMPLATE_LISTS_H

diff  --git a/libcxx/include/__support/android/locale_bionic.h b/libcxx/include/__support/android/locale_bionic.h
index c41e26420fa5..7773b8df7c81 100644
--- a/libcxx/include/__support/android/locale_bionic.h
+++ b/libcxx/include/__support/android/locale_bionic.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_SUPPORT_ANDROID_LOCALE_BIONIC_H
-#define _LIBCPP_SUPPORT_ANDROID_LOCALE_BIONIC_H
+#ifndef _LIBCUDACXX_SUPPORT_ANDROID_LOCALE_BIONIC_H
+#define _LIBCUDACXX_SUPPORT_ANDROID_LOCALE_BIONIC_H
 
 #if defined(__BIONIC__)
 
@@ -46,17 +46,17 @@ extern "C" {
 extern "C" {
 #endif
 
-inline _LIBCPP_HIDE_FROM_ABI float
+inline _LIBCUDACXX_HIDE_FROM_ABI float
 strtof_l(const char* __nptr, char** __endptr, locale_t) {
   return ::strtof(__nptr, __endptr);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI double
+inline _LIBCUDACXX_HIDE_FROM_ABI double
 strtod_l(const char* __nptr, char** __endptr, locale_t) {
   return ::strtod(__nptr, __endptr);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI long
+inline _LIBCUDACXX_HIDE_FROM_ABI long
 strtol_l(const char* __nptr, char** __endptr, int __base, locale_t) {
   return ::strtol(__nptr, __endptr, __base);
 }
@@ -72,4 +72,4 @@ strtol_l(const char* __nptr, char** __endptr, int __base, locale_t) {
 #endif // defined(__ANDROID__)
 
 #endif // defined(__BIONIC__)
-#endif // _LIBCPP_SUPPORT_ANDROID_LOCALE_BIONIC_H
+#endif // _LIBCUDACXX_SUPPORT_ANDROID_LOCALE_BIONIC_H

diff  --git a/libcxx/include/__support/fuchsia/xlocale.h b/libcxx/include/__support/fuchsia/xlocale.h
index e8def81480ea..91318d55a714 100644
--- a/libcxx/include/__support/fuchsia/xlocale.h
+++ b/libcxx/include/__support/fuchsia/xlocale.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_SUPPORT_FUCHSIA_XLOCALE_H
-#define _LIBCPP_SUPPORT_FUCHSIA_XLOCALE_H
+#ifndef _LIBCUDACXX_SUPPORT_FUCHSIA_XLOCALE_H
+#define _LIBCUDACXX_SUPPORT_FUCHSIA_XLOCALE_H
 
 #if defined(__Fuchsia__)
 
@@ -19,4 +19,4 @@
 
 #endif // defined(__Fuchsia__)
 
-#endif // _LIBCPP_SUPPORT_FUCHSIA_XLOCALE_H
+#endif // _LIBCUDACXX_SUPPORT_FUCHSIA_XLOCALE_H

diff  --git a/libcxx/include/__support/ibm/gettod_zos.h b/libcxx/include/__support/ibm/gettod_zos.h
index 2b2d927bae5c..aaa5aef5d993 100644
--- a/libcxx/include/__support/ibm/gettod_zos.h
+++ b/libcxx/include/__support/ibm/gettod_zos.h
@@ -7,12 +7,12 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_SUPPORT_IBM_GETTOD_ZOS_H
-#define _LIBCPP_SUPPORT_IBM_GETTOD_ZOS_H
+#ifndef _LIBCUDACXX_SUPPORT_IBM_GETTOD_ZOS_H
+#define _LIBCUDACXX_SUPPORT_IBM_GETTOD_ZOS_H
 
 #include <time.h>
 
-inline _LIBCPP_HIDE_FROM_ABI int
+inline _LIBCUDACXX_HIDE_FROM_ABI int
 gettimeofdayMonotonic(struct timespec64* Output) {
 
   // The POSIX gettimeofday() function is not available on z/OS. Therefore,
@@ -51,4 +51,4 @@ gettimeofdayMonotonic(struct timespec64* Output) {
   return 0;
 }
 
-#endif // _LIBCPP_SUPPORT_IBM_GETTOD_ZOS_H
+#endif // _LIBCUDACXX_SUPPORT_IBM_GETTOD_ZOS_H

diff  --git a/libcxx/include/__support/ibm/locale_mgmt_zos.h b/libcxx/include/__support/ibm/locale_mgmt_zos.h
index 90ad2c2c8612..3c069b07d436 100644
--- a/libcxx/include/__support/ibm/locale_mgmt_zos.h
+++ b/libcxx/include/__support/ibm/locale_mgmt_zos.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_SUPPORT_IBM_LOCALE_MGMT_ZOS_H
-#define _LIBCPP_SUPPORT_IBM_LOCALE_MGMT_ZOS_H
+#ifndef _LIBCUDACXX_SUPPORT_IBM_LOCALE_MGMT_ZOS_H
+#define _LIBCUDACXX_SUPPORT_IBM_LOCALE_MGMT_ZOS_H
 
 #if defined(__MVS__)
 #include <locale.h>
@@ -50,4 +50,4 @@ locale_t uselocale(locale_t newloc);
 }
 #endif
 #endif // defined(__MVS__)
-#endif // _LIBCPP_SUPPORT_IBM_LOCALE_MGMT_ZOS_H
+#endif // _LIBCUDACXX_SUPPORT_IBM_LOCALE_MGMT_ZOS_H

diff  --git a/libcxx/include/__support/ibm/nanosleep.h b/libcxx/include/__support/ibm/nanosleep.h
index 9c6b976c0003..c104a04bd0c0 100644
--- a/libcxx/include/__support/ibm/nanosleep.h
+++ b/libcxx/include/__support/ibm/nanosleep.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_SUPPORT_IBM_NANOSLEEP_H
-#define _LIBCPP_SUPPORT_IBM_NANOSLEEP_H
+#ifndef _LIBCUDACXX_SUPPORT_IBM_NANOSLEEP_H
+#define _LIBCUDACXX_SUPPORT_IBM_NANOSLEEP_H
 
 #include <unistd.h>
 
@@ -52,4 +52,4 @@ inline int nanosleep(const struct timespec* __req, struct timespec* __rem) {
   return 0;
 }
 
-#endif // _LIBCPP_SUPPORT_IBM_NANOSLEEP_H
+#endif // _LIBCUDACXX_SUPPORT_IBM_NANOSLEEP_H

diff  --git a/libcxx/include/__support/ibm/xlocale.h b/libcxx/include/__support/ibm/xlocale.h
index 5a09212c6a92..b3f66aa9649c 100644
--- a/libcxx/include/__support/ibm/xlocale.h
+++ b/libcxx/include/__support/ibm/xlocale.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_SUPPORT_IBM_XLOCALE_H
-#define _LIBCPP_SUPPORT_IBM_XLOCALE_H
+#ifndef _LIBCUDACXX_SUPPORT_IBM_XLOCALE_H
+#define _LIBCUDACXX_SUPPORT_IBM_XLOCALE_H
 
 #if defined(__MVS__)
 #include <__support/ibm/locale_mgmt_zos.h>
@@ -55,49 +55,49 @@ struct __setAndRestore {
 
 // The following are not POSIX routines.  These are quick-and-dirty hacks
 // to make things pretend to work
-inline _LIBCPP_HIDE_FROM_ABI long long
+inline _LIBCUDACXX_HIDE_FROM_ABI long long
 strtoll_l(const char *__nptr, char **__endptr, int __base, locale_t locale) {
   __setAndRestore __newloc(locale);
   return ::strtoll(__nptr, __endptr, __base);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI long
+inline _LIBCUDACXX_HIDE_FROM_ABI long
 strtol_l(const char *__nptr, char **__endptr, int __base, locale_t locale) {
   __setAndRestore __newloc(locale);
   return ::strtol(__nptr, __endptr, __base);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI double
+inline _LIBCUDACXX_HIDE_FROM_ABI double
 strtod_l(const char *__nptr, char **__endptr, locale_t locale) {
   __setAndRestore __newloc(locale);
   return ::strtod(__nptr, __endptr);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI float
+inline _LIBCUDACXX_HIDE_FROM_ABI float
 strtof_l(const char *__nptr, char **__endptr, locale_t locale) {
   __setAndRestore __newloc(locale);
   return ::strtof(__nptr, __endptr);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI long double
+inline _LIBCUDACXX_HIDE_FROM_ABI long double
 strtold_l(const char *__nptr, char **__endptr, locale_t locale) {
   __setAndRestore __newloc(locale);
   return ::strtold(__nptr, __endptr);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
+inline _LIBCUDACXX_HIDE_FROM_ABI unsigned long long
 strtoull_l(const char *__nptr, char **__endptr, int __base, locale_t locale) {
   __setAndRestore __newloc(locale);
   return ::strtoull(__nptr, __endptr, __base);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI unsigned long
+inline _LIBCUDACXX_HIDE_FROM_ABI unsigned long
 strtoul_l(const char *__nptr, char **__endptr, int __base, locale_t locale) {
   __setAndRestore __newloc(locale);
   return ::strtoul(__nptr, __endptr, __base);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI int
+inline _LIBCUDACXX_HIDE_FROM_ABI int
 vasprintf(char **strp, const char *fmt, va_list ap) {
   const size_t buff_size = 256;
   if ((*strp = (char *)malloc(buff_size)) == NULL) {
@@ -106,7 +106,7 @@ vasprintf(char **strp, const char *fmt, va_list ap) {
 
   va_list ap_copy;
   // va_copy may not be provided by the C library in C++ 03 mode.
-#if defined(_LIBCPP_CXX03_LANG) && __has_builtin(__builtin_va_copy)
+#if defined(_LIBCUDACXX_CXX03_LANG) && __has_builtin(__builtin_va_copy)
   __builtin_va_copy(ap_copy, ap);
 #else
   va_copy(ap_copy, ap);
@@ -126,4 +126,4 @@ vasprintf(char **strp, const char *fmt, va_list ap) {
 #ifdef __cplusplus
 }
 #endif
-#endif // _LIBCPP_SUPPORT_IBM_XLOCALE_H
+#endif // _LIBCUDACXX_SUPPORT_IBM_XLOCALE_H

diff  --git a/libcxx/include/__support/musl/xlocale.h b/libcxx/include/__support/musl/xlocale.h
index f564c87885ac..84b657c9e5f1 100644
--- a/libcxx/include/__support/musl/xlocale.h
+++ b/libcxx/include/__support/musl/xlocale.h
@@ -14,8 +14,8 @@
 // in Musl.
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_SUPPORT_MUSL_XLOCALE_H
-#define _LIBCPP_SUPPORT_MUSL_XLOCALE_H
+#ifndef _LIBCUDACXX_SUPPORT_MUSL_XLOCALE_H
+#define _LIBCUDACXX_SUPPORT_MUSL_XLOCALE_H
 
 #include <cstdlib>
 #include <cwchar>
@@ -24,27 +24,27 @@
 extern "C" {
 #endif
 
-inline _LIBCPP_HIDE_FROM_ABI long long
+inline _LIBCUDACXX_HIDE_FROM_ABI long long
 strtoll_l(const char *__nptr, char **__endptr, int __base, locale_t) {
   return ::strtoll(__nptr, __endptr, __base);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
+inline _LIBCUDACXX_HIDE_FROM_ABI unsigned long long
 strtoull_l(const char *__nptr, char **__endptr, int __base, locale_t) {
   return ::strtoull(__nptr, __endptr, __base);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI long long
+inline _LIBCUDACXX_HIDE_FROM_ABI long long
 wcstoll_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
   return ::wcstoll(__nptr, __endptr, __base);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI long long
+inline _LIBCUDACXX_HIDE_FROM_ABI long long
 wcstoull_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
   return ::wcstoull(__nptr, __endptr, __base);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI long double
+inline _LIBCUDACXX_HIDE_FROM_ABI long double
 wcstold_l(const wchar_t *__nptr, wchar_t **__endptr, locale_t) {
   return ::wcstold(__nptr, __endptr);
 }
@@ -53,4 +53,4 @@ wcstold_l(const wchar_t *__nptr, wchar_t **__endptr, locale_t) {
 }
 #endif
 
-#endif // _LIBCPP_SUPPORT_MUSL_XLOCALE_H
+#endif // _LIBCUDACXX_SUPPORT_MUSL_XLOCALE_H

diff  --git a/libcxx/include/__support/newlib/xlocale.h b/libcxx/include/__support/newlib/xlocale.h
index b75f9263a4c4..aada809e679f 100644
--- a/libcxx/include/__support/newlib/xlocale.h
+++ b/libcxx/include/__support/newlib/xlocale.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_SUPPORT_NEWLIB_XLOCALE_H
-#define _LIBCPP_SUPPORT_NEWLIB_XLOCALE_H
+#ifndef _LIBCUDACXX_SUPPORT_NEWLIB_XLOCALE_H
+#define _LIBCUDACXX_SUPPORT_NEWLIB_XLOCALE_H
 
 #if defined(_NEWLIB_VERSION)
 

diff  --git a/libcxx/include/__support/openbsd/xlocale.h b/libcxx/include/__support/openbsd/xlocale.h
index 2be8dc7a0085..f4d0d1d0abd9 100644
--- a/libcxx/include/__support/openbsd/xlocale.h
+++ b/libcxx/include/__support/openbsd/xlocale.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_SUPPORT_OPENBSD_XLOCALE_H
-#define _LIBCPP_SUPPORT_OPENBSD_XLOCALE_H
+#ifndef _LIBCUDACXX_SUPPORT_OPENBSD_XLOCALE_H
+#define _LIBCUDACXX_SUPPORT_OPENBSD_XLOCALE_H
 
 #include <__support/xlocale/__strtonum_fallback.h>
 #include <clocale>
@@ -21,12 +21,12 @@ extern "C" {
 #endif
 
 
-inline _LIBCPP_HIDE_FROM_ABI long
+inline _LIBCUDACXX_HIDE_FROM_ABI long
 strtol_l(const char *__nptr, char **__endptr, int __base, locale_t) {
   return ::strtol(__nptr, __endptr, __base);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI unsigned long
+inline _LIBCUDACXX_HIDE_FROM_ABI unsigned long
 strtoul_l(const char *__nptr, char **__endptr, int __base, locale_t) {
   return ::strtoul(__nptr, __endptr, __base);
 }

diff  --git a/libcxx/include/__support/solaris/xlocale.h b/libcxx/include/__support/solaris/xlocale.h
index 999102a81167..57e15af49ce2 100644
--- a/libcxx/include/__support/solaris/xlocale.h
+++ b/libcxx/include/__support/solaris/xlocale.h
@@ -32,37 +32,37 @@ struct lconv *localeconv(void);
 struct lconv *localeconv_l(locale_t __l);
 
 // FIXME: These are quick-and-dirty hacks to make things pretend to work
-inline _LIBCPP_HIDE_FROM_ABI long long
+inline _LIBCUDACXX_HIDE_FROM_ABI long long
 strtoll_l(const char *__nptr, char **__endptr, int __base, locale_t __loc) {
   return ::strtoll(__nptr, __endptr, __base);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI long
+inline _LIBCUDACXX_HIDE_FROM_ABI long
 strtol_l(const char *__nptr, char **__endptr, int __base, locale_t __loc) {
   return ::strtol(__nptr, __endptr, __base);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
+inline _LIBCUDACXX_HIDE_FROM_ABI unsigned long long
 strtoull_l(const char *__nptr, char **__endptr, int __base, locale_t __loc) 
   return ::strtoull(__nptr, __endptr, __base);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI unsigned long
+inline _LIBCUDACXX_HIDE_FROM_ABI unsigned long
 strtoul_l(const char *__nptr, char **__endptr, int __base, locale_t __loc) {
   return ::strtoul(__nptr, __endptr, __base);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI float
+inline _LIBCUDACXX_HIDE_FROM_ABI float
 strtof_l(const char *__nptr, char **__endptr, locale_t __loc) {
   return ::strtof(__nptr, __endptr);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI double
+inline _LIBCUDACXX_HIDE_FROM_ABI double
 strtod_l(const char *__nptr, char **__endptr, locale_t __loc) {
   return ::strtod(__nptr, __endptr);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI long double
+inline _LIBCUDACXX_HIDE_FROM_ABI long double
 strtold_l(const char *__nptr, char **__endptr, locale_t __loc) {
   return ::strtold(__nptr, __endptr);
 }

diff  --git a/libcxx/include/__support/win32/limits_msvc_win32.h b/libcxx/include/__support/win32/limits_msvc_win32.h
index 87e4e7db668f..7cdbd85c569c 100644
--- a/libcxx/include/__support/win32/limits_msvc_win32.h
+++ b/libcxx/include/__support/win32/limits_msvc_win32.h
@@ -7,10 +7,10 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_SUPPORT_WIN32_LIMITS_MSVC_WIN32_H
-#define _LIBCPP_SUPPORT_WIN32_LIMITS_MSVC_WIN32_H
+#ifndef _LIBCUDACXX_SUPPORT_WIN32_LIMITS_MSVC_WIN32_H
+#define _LIBCUDACXX_SUPPORT_WIN32_LIMITS_MSVC_WIN32_H
 
-#if !defined(_LIBCPP_MSVCRT)
+#if !defined(_LIBCUDACXX_MSVCRT)
 #error "This header complements the Microsoft C Runtime library, and should not be included otherwise."
 #endif
 #if defined(__clang__)
@@ -68,4 +68,4 @@
 #define __builtin_nanl(__dummmy) _LNan._Long_double
 #define __builtin_nansl(__dummy) _LSnan._Long_double
 
-#endif // _LIBCPP_SUPPORT_WIN32_LIMITS_MSVC_WIN32_H
+#endif // _LIBCUDACXX_SUPPORT_WIN32_LIMITS_MSVC_WIN32_H

diff  --git a/libcxx/include/__support/win32/locale_win32.h b/libcxx/include/__support/win32/locale_win32.h
index 8127f286b6f3..6c10d6947f62 100644
--- a/libcxx/include/__support/win32/locale_win32.h
+++ b/libcxx/include/__support/win32/locale_win32.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_SUPPORT_WIN32_LOCALE_WIN32_H
-#define _LIBCPP_SUPPORT_WIN32_LOCALE_WIN32_H
+#ifndef _LIBCUDACXX_SUPPORT_WIN32_LOCALE_WIN32_H
+#define _LIBCUDACXX_SUPPORT_WIN32_LOCALE_WIN32_H
 
 #include <__config>
 #include <cstddef>
@@ -216,20 +216,20 @@ decltype(MB_CUR_MAX) MB_CUR_MAX_L( locale_t __l );
 #define strtoll_l _strtoi64_l
 #define strtoull_l _strtoui64_l
 #define strtod_l _strtod_l
-#if defined(_LIBCPP_MSVCRT)
+#if defined(_LIBCUDACXX_MSVCRT)
 #define strtof_l _strtof_l
 #define strtold_l _strtold_l
 #else
-_LIBCPP_FUNC_VIS float strtof_l(const char*, char**, locale_t);
-_LIBCPP_FUNC_VIS long double strtold_l(const char*, char**, locale_t);
+_LIBCUDACXX_FUNC_VIS float strtof_l(const char*, char**, locale_t);
+_LIBCUDACXX_FUNC_VIS long double strtold_l(const char*, char**, locale_t);
 #endif
-inline _LIBCPP_HIDE_FROM_ABI int
+inline _LIBCUDACXX_HIDE_FROM_ABI int
 islower_l(int __c, _locale_t __loc)
 {
  return _islower_l((int)__c, __loc);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI int
+inline _LIBCUDACXX_HIDE_FROM_ABI int
 isupper_l(int __c, _locale_t __loc)
 {
  return _isupper_l((int)__c, __loc);
@@ -255,7 +255,7 @@ isupper_l(int __c, _locale_t __loc)
 #define towupper_l _towupper_l
 #define towlower_l _towlower_l
 #if defined(__MINGW32__) && __MSVCRT_VERSION__ < 0x0800
-_LIBCPP_FUNC_VIS size_t strftime_l(char *ret, size_t n, const char *format,
+_LIBCUDACXX_FUNC_VIS size_t strftime_l(char *ret, size_t n, const char *format,
                                    const struct tm *tm, locale_t loc);
 #else
 #define strftime_l _strftime_l
@@ -264,9 +264,9 @@ _LIBCPP_FUNC_VIS size_t strftime_l(char *ret, size_t n, const char *format,
 #define sprintf_l( __s, __l, __f, ... ) _sprintf_l( __s, __f, __l, __VA_ARGS__ )
 #define vsprintf_l( __s, __l, __f, ... ) _vsprintf_l( __s, __f, __l, __VA_ARGS__ )
 #define vsnprintf_l( __s, __n, __l, __f, ... ) _vsnprintf_l( __s, __n, __f, __l, __VA_ARGS__ )
-_LIBCPP_FUNC_VIS int snprintf_l(char *__ret, size_t __n, locale_t __loc, const char *__format, ...);
-_LIBCPP_FUNC_VIS int asprintf_l( char **__ret, locale_t __loc, const char *__format, ... );
-_LIBCPP_FUNC_VIS int vasprintf_l( char **__ret, locale_t __loc, const char *__format, va_list __ap );
+_LIBCUDACXX_FUNC_VIS int snprintf_l(char *__ret, size_t __n, locale_t __loc, const char *__format, ...);
+_LIBCUDACXX_FUNC_VIS int asprintf_l( char **__ret, locale_t __loc, const char *__format, ... );
+_LIBCUDACXX_FUNC_VIS int vasprintf_l( char **__ret, locale_t __loc, const char *__format, va_list __ap );
 
 // not-so-pressing FIXME: use locale to determine blank characters
 inline int isblank_l( int __c, locale_t /*loc*/ )
@@ -278,4 +278,4 @@ inline int iswblank_l( wint_t __c, locale_t /*loc*/ )
     return ( __c == L' ' || __c == L'\t' );
 }
 
-#endif // _LIBCPP_SUPPORT_WIN32_LOCALE_WIN32_H
+#endif // _LIBCUDACXX_SUPPORT_WIN32_LOCALE_WIN32_H

diff  --git a/libcxx/include/__support/xlocale/__nop_locale_mgmt.h b/libcxx/include/__support/xlocale/__nop_locale_mgmt.h
index 3d26183fafed..c70b93dfa71f 100644
--- a/libcxx/include/__support/xlocale/__nop_locale_mgmt.h
+++ b/libcxx/include/__support/xlocale/__nop_locale_mgmt.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_SUPPORT_XLOCALE_NOP_LOCALE_MGMT_H
-#define _LIBCPP_SUPPORT_XLOCALE_NOP_LOCALE_MGMT_H
+#ifndef _LIBCUDACXX_SUPPORT_XLOCALE_NOP_LOCALE_MGMT_H
+#define _LIBCUDACXX_SUPPORT_XLOCALE_NOP_LOCALE_MGMT_H
 
 #ifdef __cplusplus
 extern "C" {
@@ -17,21 +17,21 @@ extern "C" {
 // Patch over lack of extended locale support
 typedef void *locale_t;
 
-inline _LIBCPP_HIDE_FROM_ABI locale_t
+inline _LIBCUDACXX_HIDE_FROM_ABI locale_t
 duplocale(locale_t) {
   return NULL;
 }
 
-inline _LIBCPP_HIDE_FROM_ABI void
+inline _LIBCUDACXX_HIDE_FROM_ABI void
 freelocale(locale_t) {
 }
 
-inline _LIBCPP_HIDE_FROM_ABI locale_t
+inline _LIBCUDACXX_HIDE_FROM_ABI locale_t
 newlocale(int, const char *, locale_t) {
   return NULL;
 }
 
-inline _LIBCPP_HIDE_FROM_ABI locale_t
+inline _LIBCUDACXX_HIDE_FROM_ABI locale_t
 uselocale(locale_t) {
   return NULL;
 }
@@ -53,4 +53,4 @@ uselocale(locale_t) {
 } // extern "C"
 #endif
 
-#endif // _LIBCPP_SUPPORT_XLOCALE_NOP_LOCALE_MGMT_H
+#endif // _LIBCUDACXX_SUPPORT_XLOCALE_NOP_LOCALE_MGMT_H

diff  --git a/libcxx/include/__support/xlocale/__posix_l_fallback.h b/libcxx/include/__support/xlocale/__posix_l_fallback.h
index 294149eb8ff9..bea428344916 100644
--- a/libcxx/include/__support/xlocale/__posix_l_fallback.h
+++ b/libcxx/include/__support/xlocale/__posix_l_fallback.h
@@ -12,147 +12,147 @@
 // Android's bionic and Newlib).
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_SUPPORT_XLOCALE_POSIX_L_FALLBACK_H
-#define _LIBCPP_SUPPORT_XLOCALE_POSIX_L_FALLBACK_H
+#ifndef _LIBCUDACXX_SUPPORT_XLOCALE_POSIX_L_FALLBACK_H
+#define _LIBCUDACXX_SUPPORT_XLOCALE_POSIX_L_FALLBACK_H
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-inline _LIBCPP_HIDE_FROM_ABI int isalnum_l(int __c, locale_t) {
+inline _LIBCUDACXX_HIDE_FROM_ABI int isalnum_l(int __c, locale_t) {
   return ::isalnum(__c);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI int isalpha_l(int __c, locale_t) {
+inline _LIBCUDACXX_HIDE_FROM_ABI int isalpha_l(int __c, locale_t) {
   return ::isalpha(__c);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI int isblank_l(int __c, locale_t) {
+inline _LIBCUDACXX_HIDE_FROM_ABI int isblank_l(int __c, locale_t) {
   return ::isblank(__c);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI int iscntrl_l(int __c, locale_t) {
+inline _LIBCUDACXX_HIDE_FROM_ABI int iscntrl_l(int __c, locale_t) {
   return ::iscntrl(__c);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI int isdigit_l(int __c, locale_t) {
+inline _LIBCUDACXX_HIDE_FROM_ABI int isdigit_l(int __c, locale_t) {
   return ::isdigit(__c);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI int isgraph_l(int __c, locale_t) {
+inline _LIBCUDACXX_HIDE_FROM_ABI int isgraph_l(int __c, locale_t) {
   return ::isgraph(__c);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI int islower_l(int __c, locale_t) {
+inline _LIBCUDACXX_HIDE_FROM_ABI int islower_l(int __c, locale_t) {
   return ::islower(__c);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI int isprint_l(int __c, locale_t) {
+inline _LIBCUDACXX_HIDE_FROM_ABI int isprint_l(int __c, locale_t) {
   return ::isprint(__c);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI int ispunct_l(int __c, locale_t) {
+inline _LIBCUDACXX_HIDE_FROM_ABI int ispunct_l(int __c, locale_t) {
   return ::ispunct(__c);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI int isspace_l(int __c, locale_t) {
+inline _LIBCUDACXX_HIDE_FROM_ABI int isspace_l(int __c, locale_t) {
   return ::isspace(__c);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI int isupper_l(int __c, locale_t) {
+inline _LIBCUDACXX_HIDE_FROM_ABI int isupper_l(int __c, locale_t) {
   return ::isupper(__c);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI int isxdigit_l(int __c, locale_t) {
+inline _LIBCUDACXX_HIDE_FROM_ABI int isxdigit_l(int __c, locale_t) {
   return ::isxdigit(__c);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI int iswalnum_l(wint_t __c, locale_t) {
+inline _LIBCUDACXX_HIDE_FROM_ABI int iswalnum_l(wint_t __c, locale_t) {
   return ::iswalnum(__c);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI int iswalpha_l(wint_t __c, locale_t) {
+inline _LIBCUDACXX_HIDE_FROM_ABI int iswalpha_l(wint_t __c, locale_t) {
   return ::iswalpha(__c);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI int iswblank_l(wint_t __c, locale_t) {
+inline _LIBCUDACXX_HIDE_FROM_ABI int iswblank_l(wint_t __c, locale_t) {
   return ::iswblank(__c);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI int iswcntrl_l(wint_t __c, locale_t) {
+inline _LIBCUDACXX_HIDE_FROM_ABI int iswcntrl_l(wint_t __c, locale_t) {
   return ::iswcntrl(__c);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI int iswdigit_l(wint_t __c, locale_t) {
+inline _LIBCUDACXX_HIDE_FROM_ABI int iswdigit_l(wint_t __c, locale_t) {
   return ::iswdigit(__c);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI int iswgraph_l(wint_t __c, locale_t) {
+inline _LIBCUDACXX_HIDE_FROM_ABI int iswgraph_l(wint_t __c, locale_t) {
   return ::iswgraph(__c);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI int iswlower_l(wint_t __c, locale_t) {
+inline _LIBCUDACXX_HIDE_FROM_ABI int iswlower_l(wint_t __c, locale_t) {
   return ::iswlower(__c);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI int iswprint_l(wint_t __c, locale_t) {
+inline _LIBCUDACXX_HIDE_FROM_ABI int iswprint_l(wint_t __c, locale_t) {
   return ::iswprint(__c);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI int iswpunct_l(wint_t __c, locale_t) {
+inline _LIBCUDACXX_HIDE_FROM_ABI int iswpunct_l(wint_t __c, locale_t) {
   return ::iswpunct(__c);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI int iswspace_l(wint_t __c, locale_t) {
+inline _LIBCUDACXX_HIDE_FROM_ABI int iswspace_l(wint_t __c, locale_t) {
   return ::iswspace(__c);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI int iswupper_l(wint_t __c, locale_t) {
+inline _LIBCUDACXX_HIDE_FROM_ABI int iswupper_l(wint_t __c, locale_t) {
   return ::iswupper(__c);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI int iswxdigit_l(wint_t __c, locale_t) {
+inline _LIBCUDACXX_HIDE_FROM_ABI int iswxdigit_l(wint_t __c, locale_t) {
   return ::iswxdigit(__c);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI int toupper_l(int __c, locale_t) {
+inline _LIBCUDACXX_HIDE_FROM_ABI int toupper_l(int __c, locale_t) {
   return ::toupper(__c);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI int tolower_l(int __c, locale_t) {
+inline _LIBCUDACXX_HIDE_FROM_ABI int tolower_l(int __c, locale_t) {
   return ::tolower(__c);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI wint_t towupper_l(wint_t __c, locale_t) {
+inline _LIBCUDACXX_HIDE_FROM_ABI wint_t towupper_l(wint_t __c, locale_t) {
   return ::towupper(__c);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI wint_t towlower_l(wint_t __c, locale_t) {
+inline _LIBCUDACXX_HIDE_FROM_ABI wint_t towlower_l(wint_t __c, locale_t) {
   return ::towlower(__c);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI int
+inline _LIBCUDACXX_HIDE_FROM_ABI int
 strcoll_l(const char *__s1, const char *__s2, locale_t) {
   return ::strcoll(__s1, __s2);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI size_t
+inline _LIBCUDACXX_HIDE_FROM_ABI size_t
 strxfrm_l(char *__dest, const char *__src, size_t __n, locale_t) {
   return ::strxfrm(__dest, __src, __n);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI size_t
+inline _LIBCUDACXX_HIDE_FROM_ABI size_t
 strftime_l(char *__s, size_t __max, const char *__format, const struct tm *__tm,
            locale_t) {
   return ::strftime(__s, __max, __format, __tm);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI int
+inline _LIBCUDACXX_HIDE_FROM_ABI int
 wcscoll_l(const wchar_t *__ws1, const wchar_t *__ws2, locale_t) {
   return ::wcscoll(__ws1, __ws2);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI size_t
+inline _LIBCUDACXX_HIDE_FROM_ABI size_t
 wcsxfrm_l(wchar_t *__dest, const wchar_t *__src, size_t __n, locale_t) {
   return ::wcsxfrm(__dest, __src, __n);
 }
@@ -161,4 +161,4 @@ wcsxfrm_l(wchar_t *__dest, const wchar_t *__src, size_t __n, locale_t) {
 }
 #endif
 
-#endif // _LIBCPP_SUPPORT_XLOCALE_POSIX_L_FALLBACK_H
+#endif // _LIBCUDACXX_SUPPORT_XLOCALE_POSIX_L_FALLBACK_H

diff  --git a/libcxx/include/__support/xlocale/__strtonum_fallback.h b/libcxx/include/__support/xlocale/__strtonum_fallback.h
index 19780909b2c5..66f55b7293a0 100644
--- a/libcxx/include/__support/xlocale/__strtonum_fallback.h
+++ b/libcxx/include/__support/xlocale/__strtonum_fallback.h
@@ -12,49 +12,49 @@
 // convert strings to some numeric type.
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_SUPPORT_XLOCALE_STRTONUM_FALLBACK_H
-#define _LIBCPP_SUPPORT_XLOCALE_STRTONUM_FALLBACK_H
+#ifndef _LIBCUDACXX_SUPPORT_XLOCALE_STRTONUM_FALLBACK_H
+#define _LIBCUDACXX_SUPPORT_XLOCALE_STRTONUM_FALLBACK_H
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-inline _LIBCPP_HIDE_FROM_ABI float
+inline _LIBCUDACXX_HIDE_FROM_ABI float
 strtof_l(const char *__nptr, char **__endptr, locale_t) {
   return ::strtof(__nptr, __endptr);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI double
+inline _LIBCUDACXX_HIDE_FROM_ABI double
 strtod_l(const char *__nptr, char **__endptr, locale_t) {
   return ::strtod(__nptr, __endptr);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI long double
+inline _LIBCUDACXX_HIDE_FROM_ABI long double
 strtold_l(const char *__nptr, char **__endptr, locale_t) {
   return ::strtold(__nptr, __endptr);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI long long
+inline _LIBCUDACXX_HIDE_FROM_ABI long long
 strtoll_l(const char *__nptr, char **__endptr, int __base, locale_t) {
   return ::strtoll(__nptr, __endptr, __base);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
+inline _LIBCUDACXX_HIDE_FROM_ABI unsigned long long
 strtoull_l(const char *__nptr, char **__endptr, int __base, locale_t) {
   return ::strtoull(__nptr, __endptr, __base);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI long long
+inline _LIBCUDACXX_HIDE_FROM_ABI long long
 wcstoll_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
   return ::wcstoll(__nptr, __endptr, __base);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
+inline _LIBCUDACXX_HIDE_FROM_ABI unsigned long long
 wcstoull_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
   return ::wcstoull(__nptr, __endptr, __base);
 }
 
-inline _LIBCPP_HIDE_FROM_ABI long double
+inline _LIBCUDACXX_HIDE_FROM_ABI long double
 wcstold_l(const wchar_t *__nptr, wchar_t **__endptr, locale_t) {
   return ::wcstold(__nptr, __endptr);
 }
@@ -63,4 +63,4 @@ wcstold_l(const wchar_t *__nptr, wchar_t **__endptr, locale_t) {
 }
 #endif
 
-#endif // _LIBCPP_SUPPORT_XLOCALE_STRTONUM_FALLBACK_H
+#endif // _LIBCUDACXX_SUPPORT_XLOCALE_STRTONUM_FALLBACK_H

diff  --git a/libcxx/include/__thread/poll_with_backoff.h b/libcxx/include/__thread/poll_with_backoff.h
index 0bbafd186657..e1f3e0ff32ed 100644
--- a/libcxx/include/__thread/poll_with_backoff.h
+++ b/libcxx/include/__thread/poll_with_backoff.h
@@ -6,8 +6,8 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-#ifndef _LIBCPP___THREAD_POLL_WITH_BACKOFF_H
-#define _LIBCPP___THREAD_POLL_WITH_BACKOFF_H
+#ifndef _LIBCUDACXX___THREAD_POLL_WITH_BACKOFF_H
+#define _LIBCUDACXX___THREAD_POLL_WITH_BACKOFF_H
 
 #include <__availability>
 #include <__chrono/duration.h>
@@ -17,13 +17,13 @@
 #include <__config>
 #include <__filesystem/file_time_type.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-static _LIBCPP_CONSTEXPR const int __libcpp_polling_count = 64;
+static _LIBCUDACXX_CONSTEXPR const int __LIBCUDACXX_polling_count = 64;
 
 // Polls a thread for a condition given by a predicate, and backs off based on a backoff policy
 // before polling again.
@@ -37,13 +37,13 @@ static _LIBCPP_CONSTEXPR const int __libcpp_polling_count = 64;
 // - __max_elapsed is the maximum duration to try polling for. If the maximum duration is exceeded,
 //   the polling loop will return false to report a timeout.
 template<class _Fn, class _BFn>
-_LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI
-bool __libcpp_thread_poll_with_backoff(_Fn&& __f, _BFn&& __bf, chrono::nanoseconds __max_elapsed = chrono::nanoseconds::zero()) {
+_LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_HIDE_FROM_ABI
+bool __LIBCUDACXX_thread_poll_with_backoff(_Fn&& __f, _BFn&& __bf, chrono::nanoseconds __max_elapsed = chrono::nanoseconds::zero()) {
     auto const __start = chrono::high_resolution_clock::now();
     for (int __count = 0;;) {
       if (__f())
         return true; // _Fn completion means success
-      if (__count < __libcpp_polling_count) {
+      if (__count < __LIBCUDACXX_polling_count) {
         __count += 1;
         continue;
       }
@@ -62,12 +62,12 @@ bool __libcpp_thread_poll_with_backoff(_Fn&& __f, _BFn&& __bf, chrono::nanosecon
 // so this should most likely only be used on single-threaded systems where there
 // are no other threads to compete with.
 struct __spinning_backoff_policy {
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR
   bool operator()(chrono::nanoseconds const&) const {
       return false;
   }
 };
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___THREAD_POLL_WITH_BACKOFF_H
+#endif // _LIBCUDACXX___THREAD_POLL_WITH_BACKOFF_H

diff  --git a/libcxx/include/__thread/timed_backoff_policy.h b/libcxx/include/__thread/timed_backoff_policy.h
index 28fe75d6fd80..56ddb1274b61 100644
--- a/libcxx/include/__thread/timed_backoff_policy.h
+++ b/libcxx/include/__thread/timed_backoff_policy.h
@@ -6,40 +6,40 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-#ifndef _LIBCPP___THREAD_TIMED_BACKOFF_POLICY_H
-#define _LIBCPP___THREAD_TIMED_BACKOFF_POLICY_H
+#ifndef _LIBCUDACXX___THREAD_TIMED_BACKOFF_POLICY_H
+#define _LIBCUDACXX___THREAD_TIMED_BACKOFF_POLICY_H
 
 #include <__config>
 
-#ifndef _LIBCPP_HAS_NO_THREADS
+#ifndef _LIBCUDACXX_HAS_NO_THREADS
 
 #  include <__chrono/duration.h>
 #  include <__threading_support>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-struct __libcpp_timed_backoff_policy {
-  _LIBCPP_INLINE_VISIBILITY
+struct __LIBCUDACXX_timed_backoff_policy {
+  _LIBCUDACXX_INLINE_VISIBILITY
   bool operator()(chrono::nanoseconds __elapsed) const
   {
       if(__elapsed > chrono::milliseconds(128))
-          __libcpp_thread_sleep_for(chrono::milliseconds(8));
+          __LIBCUDACXX_thread_sleep_for(chrono::milliseconds(8));
       else if(__elapsed > chrono::microseconds(64))
-          __libcpp_thread_sleep_for(__elapsed / 2);
+          __LIBCUDACXX_thread_sleep_for(__elapsed / 2);
       else if(__elapsed > chrono::microseconds(4))
-        __libcpp_thread_yield();
+        __LIBCUDACXX_thread_yield();
       else
         {} // poll
       return false;
   }
 };
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_HAS_NO_THREADS
+#endif // _LIBCUDACXX_HAS_NO_THREADS
 
-#endif // _LIBCPP___THREAD_TIMED_BACKOFF_POLICY_H
+#endif // _LIBCUDACXX___THREAD_TIMED_BACKOFF_POLICY_H

diff  --git a/libcxx/include/__threading_support b/libcxx/include/__threading_support
index a7f0da972a8d..ecd5ab3d3d6b 100644
--- a/libcxx/include/__threading_support
+++ b/libcxx/include/__threading_support
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___THREADING_SUPPORT
-#define _LIBCPP___THREADING_SUPPORT
+#ifndef _LIBCUDACXX___THREADING_SUPPORT
+#define _LIBCUDACXX___THREADING_SUPPORT
 
 #include <__availability>
 #include <__chrono/convert_to_timespec.h>
@@ -23,239 +23,239 @@
 # include <__support/ibm/nanosleep.h>
 #endif
 
-#ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
+#ifndef _LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER
 #  pragma GCC system_header
 #endif
 
-#if defined(_LIBCPP_HAS_THREAD_API_EXTERNAL)
+#if defined(_LIBCUDACXX_HAS_THREAD_API_EXTERNAL)
 # include <__external_threading>
-#elif !defined(_LIBCPP_HAS_NO_THREADS)
+#elif !defined(_LIBCUDACXX_HAS_NO_THREADS)
 
-#if defined(_LIBCPP_HAS_THREAD_API_PTHREAD)
+#if defined(_LIBCUDACXX_HAS_THREAD_API_PTHREAD)
 # include <pthread.h>
 # include <sched.h>
-#elif defined(_LIBCPP_HAS_THREAD_API_C11)
+#elif defined(_LIBCUDACXX_HAS_THREAD_API_C11)
 # include <threads.h>
 #endif
 
-#if defined(_LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL) || \
-    defined(_LIBCPP_BUILDING_THREAD_LIBRARY_EXTERNAL) || \
-    defined(_LIBCPP_HAS_THREAD_API_WIN32)
-#define _LIBCPP_THREAD_ABI_VISIBILITY _LIBCPP_FUNC_VIS
+#if defined(_LIBCUDACXX_HAS_THREAD_LIBRARY_EXTERNAL) || \
+    defined(_LIBCUDACXX_BUILDING_THREAD_LIBRARY_EXTERNAL) || \
+    defined(_LIBCUDACXX_HAS_THREAD_API_WIN32)
+#define _LIBCUDACXX_THREAD_ABI_VISIBILITY _LIBCUDACXX_FUNC_VIS
 #else
-#define _LIBCPP_THREAD_ABI_VISIBILITY inline _LIBCPP_INLINE_VISIBILITY
+#define _LIBCUDACXX_THREAD_ABI_VISIBILITY inline _LIBCUDACXX_INLINE_VISIBILITY
 #endif
 
 #if defined(__FreeBSD__) && defined(__clang__) && __has_attribute(no_thread_safety_analysis)
-#define _LIBCPP_NO_THREAD_SAFETY_ANALYSIS __attribute__((no_thread_safety_analysis))
+#define _LIBCUDACXX_NO_THREAD_SAFETY_ANALYSIS __attribute__((no_thread_safety_analysis))
 #else
-#define _LIBCPP_NO_THREAD_SAFETY_ANALYSIS
+#define _LIBCUDACXX_NO_THREAD_SAFETY_ANALYSIS
 #endif
 
-typedef ::timespec __libcpp_timespec_t;
-#endif // !defined(_LIBCPP_HAS_NO_THREADS)
+typedef ::timespec __LIBCUDACXX_timespec_t;
+#endif // !defined(_LIBCUDACXX_HAS_NO_THREADS)
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if !defined(_LIBCPP_HAS_NO_THREADS)
+#if !defined(_LIBCUDACXX_HAS_NO_THREADS)
 
-#if defined(_LIBCPP_HAS_THREAD_API_PTHREAD)
+#if defined(_LIBCUDACXX_HAS_THREAD_API_PTHREAD)
 // Mutex
-typedef pthread_mutex_t __libcpp_mutex_t;
-#define _LIBCPP_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER
+typedef pthread_mutex_t __LIBCUDACXX_mutex_t;
+#define _LIBCUDACXX_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER
 
-typedef pthread_mutex_t __libcpp_recursive_mutex_t;
+typedef pthread_mutex_t __LIBCUDACXX_recursive_mutex_t;
 
 // Condition Variable
-typedef pthread_cond_t __libcpp_condvar_t;
-#define _LIBCPP_CONDVAR_INITIALIZER PTHREAD_COND_INITIALIZER
+typedef pthread_cond_t __LIBCUDACXX_condvar_t;
+#define _LIBCUDACXX_CONDVAR_INITIALIZER PTHREAD_COND_INITIALIZER
 
 // Execute once
-typedef pthread_once_t __libcpp_exec_once_flag;
-#define _LIBCPP_EXEC_ONCE_INITIALIZER PTHREAD_ONCE_INIT
+typedef pthread_once_t __LIBCUDACXX_exec_once_flag;
+#define _LIBCUDACXX_EXEC_ONCE_INITIALIZER PTHREAD_ONCE_INIT
 
 // Thread id
 #if defined(__MVS__)
-  typedef unsigned long long __libcpp_thread_id;
+  typedef unsigned long long __LIBCUDACXX_thread_id;
 #else
-  typedef pthread_t __libcpp_thread_id;
+  typedef pthread_t __LIBCUDACXX_thread_id;
 #endif
 
 // Thread
-#define _LIBCPP_NULL_THREAD ((__libcpp_thread_t()))
-typedef pthread_t __libcpp_thread_t;
+#define _LIBCUDACXX_NULL_THREAD ((__LIBCUDACXX_thread_t()))
+typedef pthread_t __LIBCUDACXX_thread_t;
 
 // Thread Local Storage
-typedef pthread_key_t __libcpp_tls_key;
+typedef pthread_key_t __LIBCUDACXX_tls_key;
 
-#define _LIBCPP_TLS_DESTRUCTOR_CC
-#elif defined(_LIBCPP_HAS_THREAD_API_C11)
+#define _LIBCUDACXX_TLS_DESTRUCTOR_CC
+#elif defined(_LIBCUDACXX_HAS_THREAD_API_C11)
 // Mutex
-typedef mtx_t __libcpp_mutex_t;
+typedef mtx_t __LIBCUDACXX_mutex_t;
 // mtx_t is a struct so using {} for initialization is valid.
-#define _LIBCPP_MUTEX_INITIALIZER {}
+#define _LIBCUDACXX_MUTEX_INITIALIZER {}
 
-typedef mtx_t __libcpp_recursive_mutex_t;
+typedef mtx_t __LIBCUDACXX_recursive_mutex_t;
 
 // Condition Variable
-typedef cnd_t __libcpp_condvar_t;
+typedef cnd_t __LIBCUDACXX_condvar_t;
 // cnd_t is a struct so using {} for initialization is valid.
-#define _LIBCPP_CONDVAR_INITIALIZER {}
+#define _LIBCUDACXX_CONDVAR_INITIALIZER {}
 
 // Execute once
-typedef once_flag __libcpp_exec_once_flag;
-#define _LIBCPP_EXEC_ONCE_INITIALIZER ONCE_FLAG_INIT
+typedef once_flag __LIBCUDACXX_exec_once_flag;
+#define _LIBCUDACXX_EXEC_ONCE_INITIALIZER ONCE_FLAG_INIT
 
 // Thread id
-typedef thrd_t __libcpp_thread_id;
+typedef thrd_t __LIBCUDACXX_thread_id;
 
 // Thread
-#define _LIBCPP_NULL_THREAD 0U
+#define _LIBCUDACXX_NULL_THREAD 0U
 
-typedef thrd_t __libcpp_thread_t;
+typedef thrd_t __LIBCUDACXX_thread_t;
 
 // Thread Local Storage
-typedef tss_t __libcpp_tls_key;
+typedef tss_t __LIBCUDACXX_tls_key;
 
-#define _LIBCPP_TLS_DESTRUCTOR_CC
-#elif !defined(_LIBCPP_HAS_THREAD_API_EXTERNAL)
+#define _LIBCUDACXX_TLS_DESTRUCTOR_CC
+#elif !defined(_LIBCUDACXX_HAS_THREAD_API_EXTERNAL)
 // Mutex
-typedef void* __libcpp_mutex_t;
-#define _LIBCPP_MUTEX_INITIALIZER 0
+typedef void* __LIBCUDACXX_mutex_t;
+#define _LIBCUDACXX_MUTEX_INITIALIZER 0
 
 #if defined(_M_IX86) || defined(__i386__) || defined(_M_ARM) || defined(__arm__)
-typedef void* __libcpp_recursive_mutex_t[6];
+typedef void* __LIBCUDACXX_recursive_mutex_t[6];
 #elif defined(_M_AMD64) || defined(__x86_64__) || defined(_M_ARM64) || defined(__aarch64__)
-typedef void* __libcpp_recursive_mutex_t[5];
+typedef void* __LIBCUDACXX_recursive_mutex_t[5];
 #else
 # error Unsupported architecture
 #endif
 
 // Condition Variable
-typedef void* __libcpp_condvar_t;
-#define _LIBCPP_CONDVAR_INITIALIZER 0
+typedef void* __LIBCUDACXX_condvar_t;
+#define _LIBCUDACXX_CONDVAR_INITIALIZER 0
 
 // Execute Once
-typedef void* __libcpp_exec_once_flag;
-#define _LIBCPP_EXEC_ONCE_INITIALIZER 0
+typedef void* __LIBCUDACXX_exec_once_flag;
+#define _LIBCUDACXX_EXEC_ONCE_INITIALIZER 0
 
 // Thread ID
-typedef long __libcpp_thread_id;
+typedef long __LIBCUDACXX_thread_id;
 
 // Thread
-#define _LIBCPP_NULL_THREAD 0U
+#define _LIBCUDACXX_NULL_THREAD 0U
 
-typedef void* __libcpp_thread_t;
+typedef void* __LIBCUDACXX_thread_t;
 
 // Thread Local Storage
-typedef long __libcpp_tls_key;
+typedef long __LIBCUDACXX_tls_key;
 
-#define _LIBCPP_TLS_DESTRUCTOR_CC __stdcall
-#endif // !defined(_LIBCPP_HAS_THREAD_API_PTHREAD) && !defined(_LIBCPP_HAS_THREAD_API_EXTERNAL)
+#define _LIBCUDACXX_TLS_DESTRUCTOR_CC __stdcall
+#endif // !defined(_LIBCUDACXX_HAS_THREAD_API_PTHREAD) && !defined(_LIBCUDACXX_HAS_THREAD_API_EXTERNAL)
 
-#if !defined(_LIBCPP_HAS_THREAD_API_EXTERNAL)
+#if !defined(_LIBCUDACXX_HAS_THREAD_API_EXTERNAL)
 // Mutex
-_LIBCPP_THREAD_ABI_VISIBILITY
-int __libcpp_recursive_mutex_init(__libcpp_recursive_mutex_t *__m);
+_LIBCUDACXX_THREAD_ABI_VISIBILITY
+int __LIBCUDACXX_recursive_mutex_init(__LIBCUDACXX_recursive_mutex_t *__m);
 
-_LIBCPP_THREAD_ABI_VISIBILITY _LIBCPP_NO_THREAD_SAFETY_ANALYSIS
-int __libcpp_recursive_mutex_lock(__libcpp_recursive_mutex_t *__m);
+_LIBCUDACXX_THREAD_ABI_VISIBILITY _LIBCUDACXX_NO_THREAD_SAFETY_ANALYSIS
+int __LIBCUDACXX_recursive_mutex_lock(__LIBCUDACXX_recursive_mutex_t *__m);
 
-_LIBCPP_THREAD_ABI_VISIBILITY _LIBCPP_NO_THREAD_SAFETY_ANALYSIS
-bool __libcpp_recursive_mutex_trylock(__libcpp_recursive_mutex_t *__m);
+_LIBCUDACXX_THREAD_ABI_VISIBILITY _LIBCUDACXX_NO_THREAD_SAFETY_ANALYSIS
+bool __LIBCUDACXX_recursive_mutex_trylock(__LIBCUDACXX_recursive_mutex_t *__m);
 
-_LIBCPP_THREAD_ABI_VISIBILITY _LIBCPP_NO_THREAD_SAFETY_ANALYSIS
-int __libcpp_recursive_mutex_unlock(__libcpp_recursive_mutex_t *__m);
+_LIBCUDACXX_THREAD_ABI_VISIBILITY _LIBCUDACXX_NO_THREAD_SAFETY_ANALYSIS
+int __LIBCUDACXX_recursive_mutex_unlock(__LIBCUDACXX_recursive_mutex_t *__m);
 
-_LIBCPP_THREAD_ABI_VISIBILITY
-int __libcpp_recursive_mutex_destroy(__libcpp_recursive_mutex_t *__m);
+_LIBCUDACXX_THREAD_ABI_VISIBILITY
+int __LIBCUDACXX_recursive_mutex_destroy(__LIBCUDACXX_recursive_mutex_t *__m);
 
-_LIBCPP_THREAD_ABI_VISIBILITY _LIBCPP_NO_THREAD_SAFETY_ANALYSIS
-int __libcpp_mutex_lock(__libcpp_mutex_t *__m);
+_LIBCUDACXX_THREAD_ABI_VISIBILITY _LIBCUDACXX_NO_THREAD_SAFETY_ANALYSIS
+int __LIBCUDACXX_mutex_lock(__LIBCUDACXX_mutex_t *__m);
 
-_LIBCPP_THREAD_ABI_VISIBILITY _LIBCPP_NO_THREAD_SAFETY_ANALYSIS
-bool __libcpp_mutex_trylock(__libcpp_mutex_t *__m);
+_LIBCUDACXX_THREAD_ABI_VISIBILITY _LIBCUDACXX_NO_THREAD_SAFETY_ANALYSIS
+bool __LIBCUDACXX_mutex_trylock(__LIBCUDACXX_mutex_t *__m);
 
-_LIBCPP_THREAD_ABI_VISIBILITY _LIBCPP_NO_THREAD_SAFETY_ANALYSIS
-int __libcpp_mutex_unlock(__libcpp_mutex_t *__m);
+_LIBCUDACXX_THREAD_ABI_VISIBILITY _LIBCUDACXX_NO_THREAD_SAFETY_ANALYSIS
+int __LIBCUDACXX_mutex_unlock(__LIBCUDACXX_mutex_t *__m);
 
-_LIBCPP_THREAD_ABI_VISIBILITY
-int __libcpp_mutex_destroy(__libcpp_mutex_t *__m);
+_LIBCUDACXX_THREAD_ABI_VISIBILITY
+int __LIBCUDACXX_mutex_destroy(__LIBCUDACXX_mutex_t *__m);
 
 // Condition variable
-_LIBCPP_THREAD_ABI_VISIBILITY
-int __libcpp_condvar_signal(__libcpp_condvar_t* __cv);
+_LIBCUDACXX_THREAD_ABI_VISIBILITY
+int __LIBCUDACXX_condvar_signal(__LIBCUDACXX_condvar_t* __cv);
 
-_LIBCPP_THREAD_ABI_VISIBILITY
-int __libcpp_condvar_broadcast(__libcpp_condvar_t* __cv);
+_LIBCUDACXX_THREAD_ABI_VISIBILITY
+int __LIBCUDACXX_condvar_broadcast(__LIBCUDACXX_condvar_t* __cv);
 
-_LIBCPP_THREAD_ABI_VISIBILITY _LIBCPP_NO_THREAD_SAFETY_ANALYSIS
-int __libcpp_condvar_wait(__libcpp_condvar_t* __cv, __libcpp_mutex_t* __m);
+_LIBCUDACXX_THREAD_ABI_VISIBILITY _LIBCUDACXX_NO_THREAD_SAFETY_ANALYSIS
+int __LIBCUDACXX_condvar_wait(__LIBCUDACXX_condvar_t* __cv, __LIBCUDACXX_mutex_t* __m);
 
-_LIBCPP_THREAD_ABI_VISIBILITY _LIBCPP_NO_THREAD_SAFETY_ANALYSIS
-int __libcpp_condvar_timedwait(__libcpp_condvar_t *__cv, __libcpp_mutex_t *__m,
-                               __libcpp_timespec_t *__ts);
+_LIBCUDACXX_THREAD_ABI_VISIBILITY _LIBCUDACXX_NO_THREAD_SAFETY_ANALYSIS
+int __LIBCUDACXX_condvar_timedwait(__LIBCUDACXX_condvar_t *__cv, __LIBCUDACXX_mutex_t *__m,
+                               __LIBCUDACXX_timespec_t *__ts);
 
-_LIBCPP_THREAD_ABI_VISIBILITY
-int __libcpp_condvar_destroy(__libcpp_condvar_t* __cv);
+_LIBCUDACXX_THREAD_ABI_VISIBILITY
+int __LIBCUDACXX_condvar_destroy(__LIBCUDACXX_condvar_t* __cv);
 
 // Execute once
-_LIBCPP_THREAD_ABI_VISIBILITY
-int __libcpp_execute_once(__libcpp_exec_once_flag *__flag,
+_LIBCUDACXX_THREAD_ABI_VISIBILITY
+int __LIBCUDACXX_execute_once(__LIBCUDACXX_exec_once_flag *__flag,
                           void (*__init_routine)());
 
 // Thread id
-_LIBCPP_THREAD_ABI_VISIBILITY
-bool __libcpp_thread_id_equal(__libcpp_thread_id __t1, __libcpp_thread_id __t2);
+_LIBCUDACXX_THREAD_ABI_VISIBILITY
+bool __LIBCUDACXX_thread_id_equal(__LIBCUDACXX_thread_id __t1, __LIBCUDACXX_thread_id __t2);
 
-_LIBCPP_THREAD_ABI_VISIBILITY
-bool __libcpp_thread_id_less(__libcpp_thread_id __t1, __libcpp_thread_id __t2);
+_LIBCUDACXX_THREAD_ABI_VISIBILITY
+bool __LIBCUDACXX_thread_id_less(__LIBCUDACXX_thread_id __t1, __LIBCUDACXX_thread_id __t2);
 
 // Thread
-_LIBCPP_THREAD_ABI_VISIBILITY
-bool __libcpp_thread_isnull(const __libcpp_thread_t *__t);
+_LIBCUDACXX_THREAD_ABI_VISIBILITY
+bool __LIBCUDACXX_thread_isnull(const __LIBCUDACXX_thread_t *__t);
 
-_LIBCPP_THREAD_ABI_VISIBILITY
-int __libcpp_thread_create(__libcpp_thread_t *__t, void *(*__func)(void *),
+_LIBCUDACXX_THREAD_ABI_VISIBILITY
+int __LIBCUDACXX_thread_create(__LIBCUDACXX_thread_t *__t, void *(*__func)(void *),
                            void *__arg);
 
-_LIBCPP_THREAD_ABI_VISIBILITY
-__libcpp_thread_id __libcpp_thread_get_current_id();
+_LIBCUDACXX_THREAD_ABI_VISIBILITY
+__LIBCUDACXX_thread_id __LIBCUDACXX_thread_get_current_id();
 
-_LIBCPP_THREAD_ABI_VISIBILITY
-__libcpp_thread_id __libcpp_thread_get_id(const __libcpp_thread_t *__t);
+_LIBCUDACXX_THREAD_ABI_VISIBILITY
+__LIBCUDACXX_thread_id __LIBCUDACXX_thread_get_id(const __LIBCUDACXX_thread_t *__t);
 
-_LIBCPP_THREAD_ABI_VISIBILITY
-int __libcpp_thread_join(__libcpp_thread_t *__t);
+_LIBCUDACXX_THREAD_ABI_VISIBILITY
+int __LIBCUDACXX_thread_join(__LIBCUDACXX_thread_t *__t);
 
-_LIBCPP_THREAD_ABI_VISIBILITY
-int __libcpp_thread_detach(__libcpp_thread_t *__t);
+_LIBCUDACXX_THREAD_ABI_VISIBILITY
+int __LIBCUDACXX_thread_detach(__LIBCUDACXX_thread_t *__t);
 
-_LIBCPP_THREAD_ABI_VISIBILITY
-void __libcpp_thread_yield();
+_LIBCUDACXX_THREAD_ABI_VISIBILITY
+void __LIBCUDACXX_thread_yield();
 
-_LIBCPP_THREAD_ABI_VISIBILITY
-void __libcpp_thread_sleep_for(const chrono::nanoseconds& __ns);
+_LIBCUDACXX_THREAD_ABI_VISIBILITY
+void __LIBCUDACXX_thread_sleep_for(const chrono::nanoseconds& __ns);
 
 // Thread local storage
-_LIBCPP_THREAD_ABI_VISIBILITY
-int __libcpp_tls_create(__libcpp_tls_key* __key,
-                        void(_LIBCPP_TLS_DESTRUCTOR_CC* __at_exit)(void*));
+_LIBCUDACXX_THREAD_ABI_VISIBILITY
+int __LIBCUDACXX_tls_create(__LIBCUDACXX_tls_key* __key,
+                        void(_LIBCUDACXX_TLS_DESTRUCTOR_CC* __at_exit)(void*));
 
-_LIBCPP_THREAD_ABI_VISIBILITY
-void *__libcpp_tls_get(__libcpp_tls_key __key);
+_LIBCUDACXX_THREAD_ABI_VISIBILITY
+void *__LIBCUDACXX_tls_get(__LIBCUDACXX_tls_key __key);
 
-_LIBCPP_THREAD_ABI_VISIBILITY
-int __libcpp_tls_set(__libcpp_tls_key __key, void *__p);
+_LIBCUDACXX_THREAD_ABI_VISIBILITY
+int __LIBCUDACXX_tls_set(__LIBCUDACXX_tls_key __key, void *__p);
 
-#endif // !defined(_LIBCPP_HAS_THREAD_API_EXTERNAL)
+#endif // !defined(_LIBCUDACXX_HAS_THREAD_API_EXTERNAL)
 
-#if (!defined(_LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL) || \
-     defined(_LIBCPP_BUILDING_THREAD_LIBRARY_EXTERNAL))
+#if (!defined(_LIBCUDACXX_HAS_THREAD_LIBRARY_EXTERNAL) || \
+     defined(_LIBCUDACXX_BUILDING_THREAD_LIBRARY_EXTERNAL))
 
-#if defined(_LIBCPP_HAS_THREAD_API_PTHREAD)
+#if defined(_LIBCUDACXX_HAS_THREAD_API_PTHREAD)
 
-int __libcpp_recursive_mutex_init(__libcpp_recursive_mutex_t *__m)
+int __LIBCUDACXX_recursive_mutex_init(__LIBCUDACXX_recursive_mutex_t *__m)
 {
   pthread_mutexattr_t attr;
   int __ec = pthread_mutexattr_init(&attr);
@@ -279,110 +279,110 @@ int __libcpp_recursive_mutex_init(__libcpp_recursive_mutex_t *__m)
   return 0;
 }
 
-int __libcpp_recursive_mutex_lock(__libcpp_recursive_mutex_t *__m)
+int __LIBCUDACXX_recursive_mutex_lock(__LIBCUDACXX_recursive_mutex_t *__m)
 {
   return pthread_mutex_lock(__m);
 }
 
-bool __libcpp_recursive_mutex_trylock(__libcpp_recursive_mutex_t *__m)
+bool __LIBCUDACXX_recursive_mutex_trylock(__LIBCUDACXX_recursive_mutex_t *__m)
 {
   return pthread_mutex_trylock(__m) == 0;
 }
 
-int __libcpp_recursive_mutex_unlock(__libcpp_recursive_mutex_t *__m)
+int __LIBCUDACXX_recursive_mutex_unlock(__LIBCUDACXX_recursive_mutex_t *__m)
 {
   return pthread_mutex_unlock(__m);
 }
 
-int __libcpp_recursive_mutex_destroy(__libcpp_recursive_mutex_t *__m)
+int __LIBCUDACXX_recursive_mutex_destroy(__LIBCUDACXX_recursive_mutex_t *__m)
 {
   return pthread_mutex_destroy(__m);
 }
 
-int __libcpp_mutex_lock(__libcpp_mutex_t *__m)
+int __LIBCUDACXX_mutex_lock(__LIBCUDACXX_mutex_t *__m)
 {
   return pthread_mutex_lock(__m);
 }
 
-bool __libcpp_mutex_trylock(__libcpp_mutex_t *__m)
+bool __LIBCUDACXX_mutex_trylock(__LIBCUDACXX_mutex_t *__m)
 {
   return pthread_mutex_trylock(__m) == 0;
 }
 
-int __libcpp_mutex_unlock(__libcpp_mutex_t *__m)
+int __LIBCUDACXX_mutex_unlock(__LIBCUDACXX_mutex_t *__m)
 {
   return pthread_mutex_unlock(__m);
 }
 
-int __libcpp_mutex_destroy(__libcpp_mutex_t *__m)
+int __LIBCUDACXX_mutex_destroy(__LIBCUDACXX_mutex_t *__m)
 {
   return pthread_mutex_destroy(__m);
 }
 
 // Condition Variable
-int __libcpp_condvar_signal(__libcpp_condvar_t *__cv)
+int __LIBCUDACXX_condvar_signal(__LIBCUDACXX_condvar_t *__cv)
 {
   return pthread_cond_signal(__cv);
 }
 
-int __libcpp_condvar_broadcast(__libcpp_condvar_t *__cv)
+int __LIBCUDACXX_condvar_broadcast(__LIBCUDACXX_condvar_t *__cv)
 {
   return pthread_cond_broadcast(__cv);
 }
 
-int __libcpp_condvar_wait(__libcpp_condvar_t *__cv, __libcpp_mutex_t *__m)
+int __LIBCUDACXX_condvar_wait(__LIBCUDACXX_condvar_t *__cv, __LIBCUDACXX_mutex_t *__m)
 {
   return pthread_cond_wait(__cv, __m);
 }
 
-int __libcpp_condvar_timedwait(__libcpp_condvar_t *__cv, __libcpp_mutex_t *__m,
-                               __libcpp_timespec_t *__ts)
+int __LIBCUDACXX_condvar_timedwait(__LIBCUDACXX_condvar_t *__cv, __LIBCUDACXX_mutex_t *__m,
+                               __LIBCUDACXX_timespec_t *__ts)
 {
   return pthread_cond_timedwait(__cv, __m, __ts);
 }
 
-int __libcpp_condvar_destroy(__libcpp_condvar_t *__cv)
+int __LIBCUDACXX_condvar_destroy(__LIBCUDACXX_condvar_t *__cv)
 {
   return pthread_cond_destroy(__cv);
 }
 
 // Execute once
-int __libcpp_execute_once(__libcpp_exec_once_flag *__flag,
+int __LIBCUDACXX_execute_once(__LIBCUDACXX_exec_once_flag *__flag,
                           void (*__init_routine)()) {
   return pthread_once(__flag, __init_routine);
 }
 
 // Thread id
 // Returns non-zero if the thread ids are equal, otherwise 0
-bool __libcpp_thread_id_equal(__libcpp_thread_id __t1, __libcpp_thread_id __t2)
+bool __LIBCUDACXX_thread_id_equal(__LIBCUDACXX_thread_id __t1, __LIBCUDACXX_thread_id __t2)
 {
   return __t1 == __t2;
 }
 
 // Returns non-zero if t1 < t2, otherwise 0
-bool __libcpp_thread_id_less(__libcpp_thread_id __t1, __libcpp_thread_id __t2)
+bool __LIBCUDACXX_thread_id_less(__LIBCUDACXX_thread_id __t1, __LIBCUDACXX_thread_id __t2)
 {
   return __t1 < __t2;
 }
 
 // Thread
-bool __libcpp_thread_isnull(const __libcpp_thread_t *__t) {
-  return __libcpp_thread_get_id(__t) == 0;
+bool __LIBCUDACXX_thread_isnull(const __LIBCUDACXX_thread_t *__t) {
+  return __LIBCUDACXX_thread_get_id(__t) == 0;
 }
 
-int __libcpp_thread_create(__libcpp_thread_t *__t, void *(*__func)(void *),
+int __LIBCUDACXX_thread_create(__LIBCUDACXX_thread_t *__t, void *(*__func)(void *),
                            void *__arg)
 {
   return pthread_create(__t, nullptr, __func, __arg);
 }
 
-__libcpp_thread_id __libcpp_thread_get_current_id()
+__LIBCUDACXX_thread_id __LIBCUDACXX_thread_get_current_id()
 {
-  const __libcpp_thread_t thread = pthread_self();
-  return __libcpp_thread_get_id(&thread);
+  const __LIBCUDACXX_thread_t thread = pthread_self();
+  return __LIBCUDACXX_thread_get_id(&thread);
 }
 
-__libcpp_thread_id __libcpp_thread_get_id(const __libcpp_thread_t *__t)
+__LIBCUDACXX_thread_id __LIBCUDACXX_thread_get_id(const __LIBCUDACXX_thread_t *__t)
 {
 #if defined(__MVS__)
   return __t->__;
@@ -391,123 +391,123 @@ __libcpp_thread_id __libcpp_thread_get_id(const __libcpp_thread_t *__t)
 #endif
 }
 
-int __libcpp_thread_join(__libcpp_thread_t *__t)
+int __LIBCUDACXX_thread_join(__LIBCUDACXX_thread_t *__t)
 {
   return pthread_join(*__t, nullptr);
 }
 
-int __libcpp_thread_detach(__libcpp_thread_t *__t)
+int __LIBCUDACXX_thread_detach(__LIBCUDACXX_thread_t *__t)
 {
   return pthread_detach(*__t);
 }
 
-void __libcpp_thread_yield()
+void __LIBCUDACXX_thread_yield()
 {
   sched_yield();
 }
 
-void __libcpp_thread_sleep_for(const chrono::nanoseconds& __ns)
+void __LIBCUDACXX_thread_sleep_for(const chrono::nanoseconds& __ns)
 {
-   __libcpp_timespec_t __ts = _VSTD::__convert_to_timespec<__libcpp_timespec_t>(__ns);
+   __LIBCUDACXX_timespec_t __ts = _CUDA_VSTD::__convert_to_timespec<__LIBCUDACXX_timespec_t>(__ns);
    while (nanosleep(&__ts, &__ts) == -1 && errno == EINTR);
 }
 
 // Thread local storage
-int __libcpp_tls_create(__libcpp_tls_key *__key, void (*__at_exit)(void *))
+int __LIBCUDACXX_tls_create(__LIBCUDACXX_tls_key *__key, void (*__at_exit)(void *))
 {
   return pthread_key_create(__key, __at_exit);
 }
 
-void *__libcpp_tls_get(__libcpp_tls_key __key)
+void *__LIBCUDACXX_tls_get(__LIBCUDACXX_tls_key __key)
 {
   return pthread_getspecific(__key);
 }
 
-int __libcpp_tls_set(__libcpp_tls_key __key, void *__p)
+int __LIBCUDACXX_tls_set(__LIBCUDACXX_tls_key __key, void *__p)
 {
     return pthread_setspecific(__key, __p);
 }
 
-#elif defined(_LIBCPP_HAS_THREAD_API_C11)
+#elif defined(_LIBCUDACXX_HAS_THREAD_API_C11)
 
-int __libcpp_recursive_mutex_init(__libcpp_recursive_mutex_t *__m)
+int __LIBCUDACXX_recursive_mutex_init(__LIBCUDACXX_recursive_mutex_t *__m)
 {
   return mtx_init(__m, mtx_plain | mtx_recursive) == thrd_success ? 0 : EINVAL;
 }
 
-int __libcpp_recursive_mutex_lock(__libcpp_recursive_mutex_t *__m)
+int __LIBCUDACXX_recursive_mutex_lock(__LIBCUDACXX_recursive_mutex_t *__m)
 {
   return mtx_lock(__m) == thrd_success ? 0 : EINVAL;
 }
 
-bool __libcpp_recursive_mutex_trylock(__libcpp_recursive_mutex_t *__m)
+bool __LIBCUDACXX_recursive_mutex_trylock(__LIBCUDACXX_recursive_mutex_t *__m)
 {
   return mtx_trylock(__m) == thrd_success;
 }
 
-int __libcpp_recursive_mutex_unlock(__libcpp_recursive_mutex_t *__m)
+int __LIBCUDACXX_recursive_mutex_unlock(__LIBCUDACXX_recursive_mutex_t *__m)
 {
   return mtx_unlock(__m) == thrd_success ? 0 : EINVAL;
 }
 
-int __libcpp_recursive_mutex_destroy(__libcpp_recursive_mutex_t *__m)
+int __LIBCUDACXX_recursive_mutex_destroy(__LIBCUDACXX_recursive_mutex_t *__m)
 {
   mtx_destroy(__m);
   return 0;
 }
 
-int __libcpp_mutex_lock(__libcpp_mutex_t *__m)
+int __LIBCUDACXX_mutex_lock(__LIBCUDACXX_mutex_t *__m)
 {
   return mtx_lock(__m) == thrd_success ? 0 : EINVAL;
 }
 
-bool __libcpp_mutex_trylock(__libcpp_mutex_t *__m)
+bool __LIBCUDACXX_mutex_trylock(__LIBCUDACXX_mutex_t *__m)
 {
   return mtx_trylock(__m) == thrd_success;
 }
 
-int __libcpp_mutex_unlock(__libcpp_mutex_t *__m)
+int __LIBCUDACXX_mutex_unlock(__LIBCUDACXX_mutex_t *__m)
 {
   return mtx_unlock(__m) == thrd_success ? 0 : EINVAL;
 }
 
-int __libcpp_mutex_destroy(__libcpp_mutex_t *__m)
+int __LIBCUDACXX_mutex_destroy(__LIBCUDACXX_mutex_t *__m)
 {
   mtx_destroy(__m);
   return 0;
 }
 
 // Condition Variable
-int __libcpp_condvar_signal(__libcpp_condvar_t *__cv)
+int __LIBCUDACXX_condvar_signal(__LIBCUDACXX_condvar_t *__cv)
 {
   return cnd_signal(__cv) == thrd_success ? 0 : EINVAL;
 }
 
-int __libcpp_condvar_broadcast(__libcpp_condvar_t *__cv)
+int __LIBCUDACXX_condvar_broadcast(__LIBCUDACXX_condvar_t *__cv)
 {
   return cnd_broadcast(__cv) == thrd_success ? 0 : EINVAL;
 }
 
-int __libcpp_condvar_wait(__libcpp_condvar_t *__cv, __libcpp_mutex_t *__m)
+int __LIBCUDACXX_condvar_wait(__LIBCUDACXX_condvar_t *__cv, __LIBCUDACXX_mutex_t *__m)
 {
   return cnd_wait(__cv, __m) == thrd_success ? 0 : EINVAL;
 }
 
-int __libcpp_condvar_timedwait(__libcpp_condvar_t *__cv, __libcpp_mutex_t *__m,
+int __LIBCUDACXX_condvar_timedwait(__LIBCUDACXX_condvar_t *__cv, __LIBCUDACXX_mutex_t *__m,
                                timespec *__ts)
 {
   int __ec = cnd_timedwait(__cv, __m, __ts);
   return __ec == thrd_timedout ? ETIMEDOUT : __ec;
 }
 
-int __libcpp_condvar_destroy(__libcpp_condvar_t *__cv)
+int __LIBCUDACXX_condvar_destroy(__LIBCUDACXX_condvar_t *__cv)
 {
   cnd_destroy(__cv);
   return 0;
 }
 
 // Execute once
-int __libcpp_execute_once(__libcpp_exec_once_flag *flag,
+int __LIBCUDACXX_execute_once(__LIBCUDACXX_exec_once_flag *flag,
                           void (*init_routine)(void)) {
   ::call_once(flag, init_routine);
   return 0;
@@ -515,72 +515,72 @@ int __libcpp_execute_once(__libcpp_exec_once_flag *flag,
 
 // Thread id
 // Returns non-zero if the thread ids are equal, otherwise 0
-bool __libcpp_thread_id_equal(__libcpp_thread_id t1, __libcpp_thread_id t2)
+bool __LIBCUDACXX_thread_id_equal(__LIBCUDACXX_thread_id t1, __LIBCUDACXX_thread_id t2)
 {
   return thrd_equal(t1, t2) != 0;
 }
 
 // Returns non-zero if t1 < t2, otherwise 0
-bool __libcpp_thread_id_less(__libcpp_thread_id t1, __libcpp_thread_id t2)
+bool __LIBCUDACXX_thread_id_less(__LIBCUDACXX_thread_id t1, __LIBCUDACXX_thread_id t2)
 {
   return t1 < t2;
 }
 
 // Thread
-bool __libcpp_thread_isnull(const __libcpp_thread_t *__t) {
-  return __libcpp_thread_get_id(__t) == 0;
+bool __LIBCUDACXX_thread_isnull(const __LIBCUDACXX_thread_t *__t) {
+  return __LIBCUDACXX_thread_get_id(__t) == 0;
 }
 
-int __libcpp_thread_create(__libcpp_thread_t *__t, void *(*__func)(void *),
+int __LIBCUDACXX_thread_create(__LIBCUDACXX_thread_t *__t, void *(*__func)(void *),
                            void *__arg)
 {
   int __ec = thrd_create(__t, reinterpret_cast<thrd_start_t>(__func), __arg);
   return __ec == thrd_nomem ? ENOMEM : __ec;
 }
 
-__libcpp_thread_id __libcpp_thread_get_current_id()
+__LIBCUDACXX_thread_id __LIBCUDACXX_thread_get_current_id()
 {
   return thrd_current();
 }
 
-__libcpp_thread_id __libcpp_thread_get_id(const __libcpp_thread_t *__t)
+__LIBCUDACXX_thread_id __LIBCUDACXX_thread_get_id(const __LIBCUDACXX_thread_t *__t)
 {
   return *__t;
 }
 
-int __libcpp_thread_join(__libcpp_thread_t *__t)
+int __LIBCUDACXX_thread_join(__LIBCUDACXX_thread_t *__t)
 {
   return thrd_join(*__t, nullptr) == thrd_success ? 0 : EINVAL;
 }
 
-int __libcpp_thread_detach(__libcpp_thread_t *__t)
+int __LIBCUDACXX_thread_detach(__LIBCUDACXX_thread_t *__t)
 {
   return thrd_detach(*__t) == thrd_success ? 0 : EINVAL;
 }
 
-void __libcpp_thread_yield()
+void __LIBCUDACXX_thread_yield()
 {
   thrd_yield();
 }
 
-void __libcpp_thread_sleep_for(const chrono::nanoseconds& __ns)
+void __LIBCUDACXX_thread_sleep_for(const chrono::nanoseconds& __ns)
 {
-   __libcpp_timespec_t __ts = _VSTD::__convert_to_timespec<__libcpp_timespec_t>(__ns);
+   __LIBCUDACXX_timespec_t __ts = _CUDA_VSTD::__convert_to_timespec<__LIBCUDACXX_timespec_t>(__ns);
   thrd_sleep(&__ts, nullptr);
 }
 
 // Thread local storage
-int __libcpp_tls_create(__libcpp_tls_key *__key, void (*__at_exit)(void *))
+int __LIBCUDACXX_tls_create(__LIBCUDACXX_tls_key *__key, void (*__at_exit)(void *))
 {
   return tss_create(__key, __at_exit) == thrd_success ? 0 : EINVAL;
 }
 
-void *__libcpp_tls_get(__libcpp_tls_key __key)
+void *__LIBCUDACXX_tls_get(__LIBCUDACXX_tls_key __key)
 {
   return tss_get(__key);
 }
 
-int __libcpp_tls_set(__libcpp_tls_key __key, void *__p)
+int __LIBCUDACXX_tls_set(__LIBCUDACXX_tls_key __key, void *__p)
 {
   return tss_set(__key, __p) == thrd_success ? 0 : EINVAL;
 }
@@ -588,90 +588,90 @@ int __libcpp_tls_set(__libcpp_tls_key __key, void *__p)
 #endif
 
 
-#endif // !_LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL || _LIBCPP_BUILDING_THREAD_LIBRARY_EXTERNAL
+#endif // !_LIBCUDACXX_HAS_THREAD_LIBRARY_EXTERNAL || _LIBCUDACXX_BUILDING_THREAD_LIBRARY_EXTERNAL
 
-class _LIBCPP_TYPE_VIS thread;
-class _LIBCPP_TYPE_VIS __thread_id;
+class _LIBCUDACXX_TYPE_VIS thread;
+class _LIBCUDACXX_TYPE_VIS __thread_id;
 
 namespace this_thread
 {
 
-_LIBCPP_INLINE_VISIBILITY __thread_id get_id() _NOEXCEPT;
+_LIBCUDACXX_INLINE_VISIBILITY __thread_id get_id() _NOEXCEPT;
 
 } // namespace this_thread
 
 template<> struct hash<__thread_id>;
 
-class _LIBCPP_TEMPLATE_VIS __thread_id
+class _LIBCUDACXX_TEMPLATE_VIS __thread_id
 {
     // FIXME: pthread_t is a pointer on Darwin but a long on Linux.
     // NULL is the no-thread value on Darwin.  Someone needs to check
     // on other platforms.  We assume 0 works everywhere for now.
-    __libcpp_thread_id __id_;
+    __LIBCUDACXX_thread_id __id_;
 
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __thread_id() _NOEXCEPT : __id_(0) {}
 
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator==(__thread_id __x, __thread_id __y) _NOEXCEPT
         { // don't pass id==0 to underlying routines
         if (__x.__id_ == 0) return __y.__id_ == 0;
         if (__y.__id_ == 0) return false;
-        return __libcpp_thread_id_equal(__x.__id_, __y.__id_);
+        return __LIBCUDACXX_thread_id_equal(__x.__id_, __y.__id_);
         }
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator!=(__thread_id __x, __thread_id __y) _NOEXCEPT
         {return !(__x == __y);}
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator< (__thread_id __x, __thread_id __y) _NOEXCEPT
         { // id==0 is always less than any other thread_id
         if (__x.__id_ == 0) return __y.__id_ != 0;
         if (__y.__id_ == 0) return false;
-        return  __libcpp_thread_id_less(__x.__id_, __y.__id_);
+        return  __LIBCUDACXX_thread_id_less(__x.__id_, __y.__id_);
         }
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator<=(__thread_id __x, __thread_id __y) _NOEXCEPT
         {return !(__y < __x);}
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator> (__thread_id __x, __thread_id __y) _NOEXCEPT
         {return   __y < __x ;}
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator>=(__thread_id __x, __thread_id __y) _NOEXCEPT
         {return !(__x < __y);}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __reset() { __id_ = 0; }
 
     template<class _CharT, class _Traits>
     friend
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_ostream<_CharT, _Traits>&
     operator<<(basic_ostream<_CharT, _Traits>& __os, __thread_id __id);
 
 private:
-    _LIBCPP_INLINE_VISIBILITY
-    __thread_id(__libcpp_thread_id __id) : __id_(__id) {}
+    _LIBCUDACXX_INLINE_VISIBILITY
+    __thread_id(__LIBCUDACXX_thread_id __id) : __id_(__id) {}
 
     friend __thread_id this_thread::get_id() _NOEXCEPT;
-    friend class _LIBCPP_TYPE_VIS thread;
-    friend struct _LIBCPP_TEMPLATE_VIS hash<__thread_id>;
+    friend class _LIBCUDACXX_TYPE_VIS thread;
+    friend struct _LIBCUDACXX_TEMPLATE_VIS hash<__thread_id>;
 };
 
 namespace this_thread
 {
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 __thread_id
 get_id() _NOEXCEPT
 {
-    return __libcpp_thread_get_current_id();
+    return __LIBCUDACXX_thread_get_current_id();
 }
 
 } // namespace this_thread
 
-#endif // !_LIBCPP_HAS_NO_THREADS
+#endif // !_LIBCUDACXX_HAS_NO_THREADS
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___THREADING_SUPPORT
+#endif // _LIBCUDACXX___THREADING_SUPPORT

diff  --git a/libcxx/include/__tree b/libcxx/include/__tree
index 59525a03047a..4d4c9d880e62 100644
--- a/libcxx/include/__tree
+++ b/libcxx/include/__tree
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TREE
-#define _LIBCPP___TREE
+#ifndef _LIBCUDACXX___TREE
+#define _LIBCUDACXX___TREE
 
 #include <__algorithm/min.h>
 #include <__assert>
@@ -24,26 +24,26 @@
 #include <memory>
 #include <stdexcept>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-template <class, class, class, class> class _LIBCPP_TEMPLATE_VIS map;
-template <class, class, class, class> class _LIBCPP_TEMPLATE_VIS multimap;
-template <class, class, class> class _LIBCPP_TEMPLATE_VIS set;
-template <class, class, class> class _LIBCPP_TEMPLATE_VIS multiset;
+template <class, class, class, class> class _LIBCUDACXX_TEMPLATE_VIS map;
+template <class, class, class, class> class _LIBCUDACXX_TEMPLATE_VIS multimap;
+template <class, class, class> class _LIBCUDACXX_TEMPLATE_VIS set;
+template <class, class, class> class _LIBCUDACXX_TEMPLATE_VIS multiset;
 
 template <class _Tp, class _Compare, class _Allocator> class __tree;
 template <class _Tp, class _NodePtr, class _DiffType>
-    class _LIBCPP_TEMPLATE_VIS __tree_iterator;
+    class _LIBCUDACXX_TEMPLATE_VIS __tree_iterator;
 template <class _Tp, class _ConstNodePtr, class _DiffType>
-    class _LIBCPP_TEMPLATE_VIS __tree_const_iterator;
+    class _LIBCUDACXX_TEMPLATE_VIS __tree_const_iterator;
 
 template <class _Pointer> class __tree_end_node;
 template <class _VoidPtr> class __tree_node_base;
@@ -53,8 +53,8 @@ template <class _Key, class _Value>
 struct __value_type;
 
 template <class _Allocator> class __map_node_destructor;
-template <class _TreeIterator> class _LIBCPP_TEMPLATE_VIS __map_iterator;
-template <class _TreeIterator> class _LIBCPP_TEMPLATE_VIS __map_const_iterator;
+template <class _TreeIterator> class _LIBCUDACXX_TEMPLATE_VIS __map_iterator;
+template <class _TreeIterator> class _LIBCUDACXX_TEMPLATE_VIS __map_const_iterator;
 
 /*
 
@@ -80,7 +80,7 @@ __root, have a non-null __parent_ field.
 // Returns:  true if __x is a left child of its parent, else false
 // Precondition:  __x != nullptr.
 template <class _NodePtr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 __tree_is_left_child(_NodePtr __x) _NOEXCEPT
 {
@@ -114,10 +114,10 @@ __tree_sub_invariant(_NodePtr __x)
         if (__x->__right_ && !__x->__right_->__is_black_)
             return 0;
     }
-    unsigned __h = _VSTD::__tree_sub_invariant(__x->__left_);
+    unsigned __h = _CUDA_VSTD::__tree_sub_invariant(__x->__left_);
     if (__h == 0)
         return 0;  // invalid left subtree
-    if (__h != _VSTD::__tree_sub_invariant(__x->__right_))
+    if (__h != _CUDA_VSTD::__tree_sub_invariant(__x->__right_))
         return 0;  // invalid or 
diff erent height right subtree
     return __h + __x->__is_black_;  // return black height of this node
 }
@@ -134,22 +134,22 @@ __tree_invariant(_NodePtr __root)
     // check __x->__parent_ consistency
     if (__root->__parent_ == nullptr)
         return false;
-    if (!_VSTD::__tree_is_left_child(__root))
+    if (!_CUDA_VSTD::__tree_is_left_child(__root))
         return false;
     // root must be black
     if (!__root->__is_black_)
         return false;
     // do normal node checks
-    return _VSTD::__tree_sub_invariant(__root) != 0;
+    return _CUDA_VSTD::__tree_sub_invariant(__root) != 0;
 }
 
 // Returns:  pointer to the left-most node under __x.
 template <class _NodePtr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 _NodePtr
 __tree_min(_NodePtr __x) _NOEXCEPT
 {
-    _LIBCPP_ASSERT(__x != nullptr, "Root node shouldn't be null");
+    _LIBCUDACXX_ASSERT(__x != nullptr, "Root node shouldn't be null");
     while (__x->__left_ != nullptr)
         __x = __x->__left_;
     return __x;
@@ -157,11 +157,11 @@ __tree_min(_NodePtr __x) _NOEXCEPT
 
 // Returns:  pointer to the right-most node under __x.
 template <class _NodePtr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 _NodePtr
 __tree_max(_NodePtr __x) _NOEXCEPT
 {
-    _LIBCPP_ASSERT(__x != nullptr, "Root node shouldn't be null");
+    _LIBCUDACXX_ASSERT(__x != nullptr, "Root node shouldn't be null");
     while (__x->__right_ != nullptr)
         __x = __x->__right_;
     return __x;
@@ -172,23 +172,23 @@ template <class _NodePtr>
 _NodePtr
 __tree_next(_NodePtr __x) _NOEXCEPT
 {
-    _LIBCPP_ASSERT(__x != nullptr, "node shouldn't be null");
+    _LIBCUDACXX_ASSERT(__x != nullptr, "node shouldn't be null");
     if (__x->__right_ != nullptr)
-        return _VSTD::__tree_min(__x->__right_);
-    while (!_VSTD::__tree_is_left_child(__x))
+        return _CUDA_VSTD::__tree_min(__x->__right_);
+    while (!_CUDA_VSTD::__tree_is_left_child(__x))
         __x = __x->__parent_unsafe();
     return __x->__parent_unsafe();
 }
 
 template <class _EndNodePtr, class _NodePtr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 _EndNodePtr
 __tree_next_iter(_NodePtr __x) _NOEXCEPT
 {
-    _LIBCPP_ASSERT(__x != nullptr, "node shouldn't be null");
+    _LIBCUDACXX_ASSERT(__x != nullptr, "node shouldn't be null");
     if (__x->__right_ != nullptr)
-        return static_cast<_EndNodePtr>(_VSTD::__tree_min(__x->__right_));
-    while (!_VSTD::__tree_is_left_child(__x))
+        return static_cast<_EndNodePtr>(_CUDA_VSTD::__tree_min(__x->__right_));
+    while (!_CUDA_VSTD::__tree_is_left_child(__x))
         __x = __x->__parent_unsafe();
     return static_cast<_EndNodePtr>(__x->__parent_);
 }
@@ -196,15 +196,15 @@ __tree_next_iter(_NodePtr __x) _NOEXCEPT
 // Returns:  pointer to the previous in-order node before __x.
 // Note: __x may be the end node.
 template <class _NodePtr, class _EndNodePtr>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 _NodePtr
 __tree_prev_iter(_EndNodePtr __x) _NOEXCEPT
 {
-    _LIBCPP_ASSERT(__x != nullptr, "node shouldn't be null");
+    _LIBCUDACXX_ASSERT(__x != nullptr, "node shouldn't be null");
     if (__x->__left_ != nullptr)
-        return _VSTD::__tree_max(__x->__left_);
+        return _CUDA_VSTD::__tree_max(__x->__left_);
     _NodePtr __xx = static_cast<_NodePtr>(__x);
-    while (_VSTD::__tree_is_left_child(__xx))
+    while (_CUDA_VSTD::__tree_is_left_child(__xx))
         __xx = __xx->__parent_unsafe();
     return __xx->__parent_unsafe();
 }
@@ -214,7 +214,7 @@ template <class _NodePtr>
 _NodePtr
 __tree_leaf(_NodePtr __x) _NOEXCEPT
 {
-    _LIBCPP_ASSERT(__x != nullptr, "node shouldn't be null");
+    _LIBCUDACXX_ASSERT(__x != nullptr, "node shouldn't be null");
     while (true)
     {
         if (__x->__left_ != nullptr)
@@ -238,14 +238,14 @@ template <class _NodePtr>
 void
 __tree_left_rotate(_NodePtr __x) _NOEXCEPT
 {
-    _LIBCPP_ASSERT(__x != nullptr, "node shouldn't be null");
-    _LIBCPP_ASSERT(__x->__right_ != nullptr, "node should have a right child");
+    _LIBCUDACXX_ASSERT(__x != nullptr, "node shouldn't be null");
+    _LIBCUDACXX_ASSERT(__x->__right_ != nullptr, "node should have a right child");
     _NodePtr __y = __x->__right_;
     __x->__right_ = __y->__left_;
     if (__x->__right_ != nullptr)
         __x->__right_->__set_parent(__x);
     __y->__parent_ = __x->__parent_;
-    if (_VSTD::__tree_is_left_child(__x))
+    if (_CUDA_VSTD::__tree_is_left_child(__x))
         __x->__parent_->__left_ = __y;
     else
         __x->__parent_unsafe()->__right_ = __y;
@@ -259,14 +259,14 @@ template <class _NodePtr>
 void
 __tree_right_rotate(_NodePtr __x) _NOEXCEPT
 {
-    _LIBCPP_ASSERT(__x != nullptr, "node shouldn't be null");
-    _LIBCPP_ASSERT(__x->__left_ != nullptr, "node should have a left child");
+    _LIBCUDACXX_ASSERT(__x != nullptr, "node shouldn't be null");
+    _LIBCUDACXX_ASSERT(__x->__left_ != nullptr, "node should have a left child");
     _NodePtr __y = __x->__left_;
     __x->__left_ = __y->__right_;
     if (__x->__left_ != nullptr)
         __x->__left_->__set_parent(__x);
     __y->__parent_ = __x->__parent_;
-    if (_VSTD::__tree_is_left_child(__x))
+    if (_CUDA_VSTD::__tree_is_left_child(__x))
         __x->__parent_->__left_ = __y;
     else
         __x->__parent_unsafe()->__right_ = __y;
@@ -285,13 +285,13 @@ template <class _NodePtr>
 void
 __tree_balance_after_insert(_NodePtr __root, _NodePtr __x) _NOEXCEPT
 {
-    _LIBCPP_ASSERT(__root != nullptr, "Root of the tree shouldn't be null");
-    _LIBCPP_ASSERT(__x != nullptr, "Can't attach null node to a leaf");
+    _LIBCUDACXX_ASSERT(__root != nullptr, "Root of the tree shouldn't be null");
+    _LIBCUDACXX_ASSERT(__x != nullptr, "Can't attach null node to a leaf");
     __x->__is_black_ = __x == __root;
     while (__x != __root && !__x->__parent_unsafe()->__is_black_)
     {
         // __x->__parent_ != __root because __x->__parent_->__is_black == false
-        if (_VSTD::__tree_is_left_child(__x->__parent_unsafe()))
+        if (_CUDA_VSTD::__tree_is_left_child(__x->__parent_unsafe()))
         {
             _NodePtr __y = __x->__parent_unsafe()->__parent_unsafe()->__right_;
             if (__y != nullptr && !__y->__is_black_)
@@ -304,16 +304,16 @@ __tree_balance_after_insert(_NodePtr __root, _NodePtr __x) _NOEXCEPT
             }
             else
             {
-                if (!_VSTD::__tree_is_left_child(__x))
+                if (!_CUDA_VSTD::__tree_is_left_child(__x))
                 {
                     __x = __x->__parent_unsafe();
-                    _VSTD::__tree_left_rotate(__x);
+                    _CUDA_VSTD::__tree_left_rotate(__x);
                 }
                 __x = __x->__parent_unsafe();
                 __x->__is_black_ = true;
                 __x = __x->__parent_unsafe();
                 __x->__is_black_ = false;
-                _VSTD::__tree_right_rotate(__x);
+                _CUDA_VSTD::__tree_right_rotate(__x);
                 break;
             }
         }
@@ -330,16 +330,16 @@ __tree_balance_after_insert(_NodePtr __root, _NodePtr __x) _NOEXCEPT
             }
             else
             {
-                if (_VSTD::__tree_is_left_child(__x))
+                if (_CUDA_VSTD::__tree_is_left_child(__x))
                 {
                     __x = __x->__parent_unsafe();
-                    _VSTD::__tree_right_rotate(__x);
+                    _CUDA_VSTD::__tree_right_rotate(__x);
                 }
                 __x = __x->__parent_unsafe();
                 __x->__is_black_ = true;
                 __x = __x->__parent_unsafe();
                 __x->__is_black_ = false;
-                _VSTD::__tree_left_rotate(__x);
+                _CUDA_VSTD::__tree_left_rotate(__x);
                 break;
             }
         }
@@ -355,15 +355,15 @@ template <class _NodePtr>
 void
 __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT
 {
-    _LIBCPP_ASSERT(__root != nullptr, "Root node should not be null");
-    _LIBCPP_ASSERT(__z != nullptr, "The node to remove should not be null");
-    _LIBCPP_DEBUG_ASSERT(__tree_invariant(__root), "The tree invariants should hold");
+    _LIBCUDACXX_ASSERT(__root != nullptr, "Root node should not be null");
+    _LIBCUDACXX_ASSERT(__z != nullptr, "The node to remove should not be null");
+    _LIBCUDACXX_DEBUG_ASSERT(__tree_invariant(__root), "The tree invariants should hold");
     // __z will be removed from the tree.  Client still needs to destruct/deallocate it
     // __y is either __z, or if __z has two children, __tree_next(__z).
     // __y will have at most one child.
     // __y will be the initial hole in the tree (make the hole at a leaf)
     _NodePtr __y = (__z->__left_ == nullptr || __z->__right_ == nullptr) ?
-                    __z : _VSTD::__tree_next(__z);
+                    __z : _CUDA_VSTD::__tree_next(__z);
     // __x is __y's possibly null single child
     _NodePtr __x = __y->__left_ != nullptr ? __y->__left_ : __y->__right_;
     // __w is __x's possibly null uncle (will become __x's sibling)
@@ -371,7 +371,7 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT
     // link __x to __y's parent, and find __w
     if (__x != nullptr)
         __x->__parent_ = __y->__parent_;
-    if (_VSTD::__tree_is_left_child(__y))
+    if (_CUDA_VSTD::__tree_is_left_child(__y))
     {
         __y->__parent_->__left_ = __x;
         if (__y != __root)
@@ -392,7 +392,7 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT
     {
         // __z->__left_ != nulptr but __z->__right_ might == __x == nullptr
         __y->__parent_ = __z->__parent_;
-        if (_VSTD::__tree_is_left_child(__z))
+        if (_CUDA_VSTD::__tree_is_left_child(__z))
             __y->__parent_->__left_ = __y;
         else
             __y->__parent_unsafe()->__right_ = __y;
@@ -432,13 +432,13 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT
             //     with a non-null black child).
             while (true)
             {
-                if (!_VSTD::__tree_is_left_child(__w))  // if x is left child
+                if (!_CUDA_VSTD::__tree_is_left_child(__w))  // if x is left child
                 {
                     if (!__w->__is_black_)
                     {
                         __w->__is_black_ = true;
                         __w->__parent_unsafe()->__is_black_ = false;
-                        _VSTD::__tree_left_rotate(__w->__parent_unsafe());
+                        _CUDA_VSTD::__tree_left_rotate(__w->__parent_unsafe());
                         // __x is still valid
                         // reset __root only if necessary
                         if (__root == __w->__left_)
@@ -459,7 +459,7 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT
                             break;
                         }
                         // reset sibling, and it still can't be null
-                        __w = _VSTD::__tree_is_left_child(__x) ?
+                        __w = _CUDA_VSTD::__tree_is_left_child(__x) ?
                                     __x->__parent_unsafe()->__right_ :
                                     __x->__parent_->__left_;
                         // continue;
@@ -471,7 +471,7 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT
                             // __w left child is non-null and red
                             __w->__left_->__is_black_ = true;
                             __w->__is_black_ = false;
-                            _VSTD::__tree_right_rotate(__w);
+                            _CUDA_VSTD::__tree_right_rotate(__w);
                             // __w is known not to be root, so root hasn't changed
                             // reset sibling, and it still can't be null
                             __w = __w->__parent_unsafe();
@@ -480,7 +480,7 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT
                         __w->__is_black_ = __w->__parent_unsafe()->__is_black_;
                         __w->__parent_unsafe()->__is_black_ = true;
                         __w->__right_->__is_black_ = true;
-                        _VSTD::__tree_left_rotate(__w->__parent_unsafe());
+                        _CUDA_VSTD::__tree_left_rotate(__w->__parent_unsafe());
                         break;
                     }
                 }
@@ -490,7 +490,7 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT
                     {
                         __w->__is_black_ = true;
                         __w->__parent_unsafe()->__is_black_ = false;
-                        _VSTD::__tree_right_rotate(__w->__parent_unsafe());
+                        _CUDA_VSTD::__tree_right_rotate(__w->__parent_unsafe());
                         // __x is still valid
                         // reset __root only if necessary
                         if (__root == __w->__right_)
@@ -511,7 +511,7 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT
                             break;
                         }
                         // reset sibling, and it still can't be null
-                        __w = _VSTD::__tree_is_left_child(__x) ?
+                        __w = _CUDA_VSTD::__tree_is_left_child(__x) ?
                                     __x->__parent_unsafe()->__right_ :
                                     __x->__parent_->__left_;
                         // continue;
@@ -523,7 +523,7 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT
                             // __w right child is non-null and red
                             __w->__right_->__is_black_ = true;
                             __w->__is_black_ = false;
-                            _VSTD::__tree_left_rotate(__w);
+                            _CUDA_VSTD::__tree_left_rotate(__w);
                             // __w is known not to be root, so root hasn't changed
                             // reset sibling, and it still can't be null
                             __w = __w->__parent_unsafe();
@@ -532,7 +532,7 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT
                         __w->__is_black_ = __w->__parent_unsafe()->__is_black_;
                         __w->__parent_unsafe()->__is_black_ = true;
                         __w->__left_->__is_black_ = true;
-                        _VSTD::__tree_right_rotate(__w->__parent_unsafe());
+                        _CUDA_VSTD::__tree_right_rotate(__w->__parent_unsafe());
                         break;
                     }
                 }
@@ -563,21 +563,21 @@ struct __tree_key_value_types {
   typedef _Tp __container_value_type;
   static const bool __is_map = false;
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   static key_type const& __get_key(_Tp const& __v) {
     return __v;
   }
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   static __container_value_type const& __get_value(__node_value_type const& __v) {
     return __v;
   }
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   static __container_value_type* __get_ptr(__node_value_type& __n) {
-    return _VSTD::addressof(__n);
+    return _CUDA_VSTD::addressof(__n);
   }
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   static __container_value_type&& __move(__node_value_type& __v) {
-    return _VSTD::move(__v);
+    return _CUDA_VSTD::move(__v);
   }
 };
 
@@ -590,38 +590,38 @@ struct __tree_key_value_types<__value_type<_Key, _Tp> > {
   typedef __container_value_type                       __map_value_type;
   static const bool __is_map = true;
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   static key_type const&
   __get_key(__node_value_type const& __t) {
     return __t.__get_value().first;
   }
 
   template <class _Up>
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   static __enable_if_t<__is_same_uncvref<_Up, __container_value_type>::value, key_type const&>
   __get_key(_Up& __t) {
     return __t.first;
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   static __container_value_type const&
   __get_value(__node_value_type const& __t) {
     return __t.__get_value();
   }
 
   template <class _Up>
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   static __enable_if_t<__is_same_uncvref<_Up, __container_value_type>::value, __container_value_type const&>
   __get_value(_Up& __t) {
     return __t;
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   static __container_value_type* __get_ptr(__node_value_type& __n) {
-    return _VSTD::addressof(__n.__get_value());
+    return _CUDA_VSTD::addressof(__n.__get_value());
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   static pair<key_type&&, mapped_type&&> __move(__node_value_type& __v) {
     return __v.__move();
   }
@@ -638,7 +638,7 @@ struct __tree_node_base_types {
   typedef __tree_end_node<__node_base_pointer>                  __end_node_type;
   typedef typename __rebind_pointer<_VoidPtr, __end_node_type>::type
                                                              __end_node_pointer;
-#if defined(_LIBCPP_ABI_TREE_REMOVE_NODE_POINTER_UB)
+#if defined(_LIBCUDACXX_ABI_TREE_REMOVE_NODE_POINTER_UB)
   typedef __end_node_pointer __parent_pointer;
 #else
   typedef typename conditional<
@@ -687,7 +687,7 @@ public:
                                                       __node_value_type_pointer;
   typedef typename __rebind_pointer<_VoidPtr, const __node_value_type>::type
                                                 __const_node_value_type_pointer;
-#if defined(_LIBCPP_ABI_TREE_REMOVE_NODE_POINTER_UB)
+#if defined(_LIBCUDACXX_ABI_TREE_REMOVE_NODE_POINTER_UB)
   typedef typename __base::__end_node_pointer __iter_pointer;
 #else
   typedef typename conditional<
@@ -718,12 +718,12 @@ public:
     typedef _Pointer pointer;
     pointer __left_;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __tree_end_node() _NOEXCEPT : __left_() {}
 };
 
 template <class _VoidPtr>
-class _LIBCPP_STANDALONE_DEBUG __tree_node_base
+class _LIBCUDACXX_STANDALONE_DEBUG __tree_node_base
     : public __tree_node_base_types<_VoidPtr>::__end_node_type
 {
     typedef __tree_node_base_types<_VoidPtr> _NodeBaseTypes;
@@ -736,10 +736,10 @@ public:
     __parent_pointer __parent_;
     bool __is_black_;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     pointer __parent_unsafe() const { return static_cast<pointer>(__parent_);}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __set_parent(pointer __p) {
         __parent_ = static_cast<__parent_pointer>(__p);
     }
@@ -751,7 +751,7 @@ private:
 };
 
 template <class _Tp, class _VoidPtr>
-class _LIBCPP_STANDALONE_DEBUG __tree_node
+class _LIBCUDACXX_STANDALONE_DEBUG __tree_node
     : public __tree_node_base<_VoidPtr>
 {
 public:
@@ -786,13 +786,13 @@ public:
     __tree_node_destructor(const __tree_node_destructor &) = default;
     __tree_node_destructor& operator=(const __tree_node_destructor&) = delete;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __tree_node_destructor(allocator_type& __na, bool __val = false) _NOEXCEPT
         : __na_(__na),
           __value_constructed(__val)
         {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void operator()(pointer __p) _NOEXCEPT
     {
         if (__value_constructed)
@@ -804,7 +804,7 @@ public:
     template <class> friend class __map_node_destructor;
 };
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _NodeType, class _Alloc>
 struct __generic_container_node_destructor;
 template <class _Tp, class _VoidPtr, class _Alloc>
@@ -816,7 +816,7 @@ struct __generic_container_node_destructor<__tree_node<_Tp, _VoidPtr>, _Alloc>
 #endif
 
 template <class _Tp, class _NodePtr, class _DiffType>
-class _LIBCPP_TEMPLATE_VIS __tree_iterator
+class _LIBCUDACXX_TEMPLATE_VIS __tree_iterator
 {
     typedef __tree_node_types<_NodePtr>                     _NodeTypes;
     typedef _NodePtr                                        __node_pointer;
@@ -834,62 +834,62 @@ public:
     typedef value_type&                                    reference;
     typedef typename _NodeTypes::__node_value_type_pointer pointer;
 
-    _LIBCPP_INLINE_VISIBILITY __tree_iterator() _NOEXCEPT
-#if _LIBCPP_STD_VER > 11
+    _LIBCUDACXX_INLINE_VISIBILITY __tree_iterator() _NOEXCEPT
+#if _LIBCUDACXX_STD_VER > 11
     : __ptr_(nullptr)
 #endif
     {}
 
-    _LIBCPP_INLINE_VISIBILITY reference operator*() const
+    _LIBCUDACXX_INLINE_VISIBILITY reference operator*() const
         {return __get_np()->__value_;}
-    _LIBCPP_INLINE_VISIBILITY pointer operator->() const
+    _LIBCUDACXX_INLINE_VISIBILITY pointer operator->() const
         {return pointer_traits<pointer>::pointer_to(__get_np()->__value_);}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __tree_iterator& operator++() {
       __ptr_ = static_cast<__iter_pointer>(
-          _VSTD::__tree_next_iter<__end_node_pointer>(static_cast<__node_base_pointer>(__ptr_)));
+          _CUDA_VSTD::__tree_next_iter<__end_node_pointer>(static_cast<__node_base_pointer>(__ptr_)));
       return *this;
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __tree_iterator operator++(int)
         {__tree_iterator __t(*this); ++(*this); return __t;}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __tree_iterator& operator--() {
-      __ptr_ = static_cast<__iter_pointer>(_VSTD::__tree_prev_iter<__node_base_pointer>(
+      __ptr_ = static_cast<__iter_pointer>(_CUDA_VSTD::__tree_prev_iter<__node_base_pointer>(
           static_cast<__end_node_pointer>(__ptr_)));
       return *this;
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __tree_iterator operator--(int)
         {__tree_iterator __t(*this); --(*this); return __t;}
 
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator==(const __tree_iterator& __x, const __tree_iterator& __y)
         {return __x.__ptr_ == __y.__ptr_;}
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator!=(const __tree_iterator& __x, const __tree_iterator& __y)
         {return !(__x == __y);}
 
 private:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __tree_iterator(__node_pointer __p) _NOEXCEPT : __ptr_(__p) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __tree_iterator(__end_node_pointer __p) _NOEXCEPT : __ptr_(__p) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __node_pointer __get_np() const { return static_cast<__node_pointer>(__ptr_); }
     template <class, class, class> friend class __tree;
-    template <class, class, class> friend class _LIBCPP_TEMPLATE_VIS __tree_const_iterator;
-    template <class> friend class _LIBCPP_TEMPLATE_VIS __map_iterator;
-    template <class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS map;
-    template <class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS multimap;
-    template <class, class, class> friend class _LIBCPP_TEMPLATE_VIS set;
-    template <class, class, class> friend class _LIBCPP_TEMPLATE_VIS multiset;
+    template <class, class, class> friend class _LIBCUDACXX_TEMPLATE_VIS __tree_const_iterator;
+    template <class> friend class _LIBCUDACXX_TEMPLATE_VIS __map_iterator;
+    template <class, class, class, class> friend class _LIBCUDACXX_TEMPLATE_VIS map;
+    template <class, class, class, class> friend class _LIBCUDACXX_TEMPLATE_VIS multimap;
+    template <class, class, class> friend class _LIBCUDACXX_TEMPLATE_VIS set;
+    template <class, class, class> friend class _LIBCUDACXX_TEMPLATE_VIS multiset;
 };
 
 template <class _Tp, class _NodePtr, class _DiffType>
-class _LIBCPP_TEMPLATE_VIS __tree_const_iterator
+class _LIBCUDACXX_TEMPLATE_VIS __tree_const_iterator
 {
     typedef __tree_node_types<_NodePtr>                     _NodeTypes;
     typedef typename _NodeTypes::__node_pointer             __node_pointer;
@@ -907,8 +907,8 @@ public:
     typedef const value_type&                                    reference;
     typedef typename _NodeTypes::__const_node_value_type_pointer pointer;
 
-    _LIBCPP_INLINE_VISIBILITY __tree_const_iterator() _NOEXCEPT
-#if _LIBCPP_STD_VER > 11
+    _LIBCUDACXX_INLINE_VISIBILITY __tree_const_iterator() _NOEXCEPT
+#if _LIBCUDACXX_STD_VER > 11
     : __ptr_(nullptr)
 #endif
     {}
@@ -917,66 +917,66 @@ private:
     typedef __tree_iterator<value_type, __node_pointer, 
diff erence_type>
                                                            __non_const_iterator;
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __tree_const_iterator(__non_const_iterator __p) _NOEXCEPT
         : __ptr_(__p.__ptr_) {}
 
-    _LIBCPP_INLINE_VISIBILITY reference operator*() const
+    _LIBCUDACXX_INLINE_VISIBILITY reference operator*() const
         {return __get_np()->__value_;}
-    _LIBCPP_INLINE_VISIBILITY pointer operator->() const
+    _LIBCUDACXX_INLINE_VISIBILITY pointer operator->() const
         {return pointer_traits<pointer>::pointer_to(__get_np()->__value_);}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __tree_const_iterator& operator++() {
       __ptr_ = static_cast<__iter_pointer>(
-          _VSTD::__tree_next_iter<__end_node_pointer>(static_cast<__node_base_pointer>(__ptr_)));
+          _CUDA_VSTD::__tree_next_iter<__end_node_pointer>(static_cast<__node_base_pointer>(__ptr_)));
       return *this;
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __tree_const_iterator operator++(int)
         {__tree_const_iterator __t(*this); ++(*this); return __t;}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __tree_const_iterator& operator--() {
-      __ptr_ = static_cast<__iter_pointer>(_VSTD::__tree_prev_iter<__node_base_pointer>(
+      __ptr_ = static_cast<__iter_pointer>(_CUDA_VSTD::__tree_prev_iter<__node_base_pointer>(
           static_cast<__end_node_pointer>(__ptr_)));
       return *this;
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __tree_const_iterator operator--(int)
         {__tree_const_iterator __t(*this); --(*this); return __t;}
 
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator==(const __tree_const_iterator& __x, const __tree_const_iterator& __y)
         {return __x.__ptr_ == __y.__ptr_;}
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
         bool operator!=(const __tree_const_iterator& __x, const __tree_const_iterator& __y)
         {return !(__x == __y);}
 
 private:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __tree_const_iterator(__node_pointer __p) _NOEXCEPT
         : __ptr_(__p) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __tree_const_iterator(__end_node_pointer __p) _NOEXCEPT
         : __ptr_(__p) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __node_pointer __get_np() const { return static_cast<__node_pointer>(__ptr_); }
 
     template <class, class, class> friend class __tree;
-    template <class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS map;
-    template <class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS multimap;
-    template <class, class, class> friend class _LIBCPP_TEMPLATE_VIS set;
-    template <class, class, class> friend class _LIBCPP_TEMPLATE_VIS multiset;
-    template <class> friend class _LIBCPP_TEMPLATE_VIS __map_const_iterator;
+    template <class, class, class, class> friend class _LIBCUDACXX_TEMPLATE_VIS map;
+    template <class, class, class, class> friend class _LIBCUDACXX_TEMPLATE_VIS multimap;
+    template <class, class, class> friend class _LIBCUDACXX_TEMPLATE_VIS set;
+    template <class, class, class> friend class _LIBCUDACXX_TEMPLATE_VIS multiset;
+    template <class> friend class _LIBCUDACXX_TEMPLATE_VIS __map_const_iterator;
 
 };
 
 template<class _Tp, class _Compare>
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_DIAGNOSE_WARNING(!__invokable<_Compare const&, _Tp const&, _Tp const&>::value,
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_DIAGNOSE_WARNING(!__invokable<_Compare const&, _Tp const&, _Tp const&>::value,
         "the specified comparator type does not provide a viable const call operator")
 #endif
 int __diagnose_non_const_comparator();
@@ -1040,14 +1040,14 @@ private:
     __compressed_pair<size_type, value_compare>        __pair3_;
 
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __iter_pointer __end_node() _NOEXCEPT
     {
         return static_cast<__iter_pointer>(
                 pointer_traits<__end_node_ptr>::pointer_to(__pair1_.first())
         );
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __iter_pointer __end_node() const _NOEXCEPT
     {
         return static_cast<__iter_pointer>(
@@ -1056,39 +1056,39 @@ public:
             )
         );
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
           __node_allocator& __node_alloc() _NOEXCEPT {return __pair1_.second();}
 private:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const __node_allocator& __node_alloc() const _NOEXCEPT
         {return __pair1_.second();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
           __iter_pointer& __begin_node() _NOEXCEPT {return __begin_node_;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const __iter_pointer& __begin_node() const _NOEXCEPT {return __begin_node_;}
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     allocator_type __alloc() const _NOEXCEPT
         {return allocator_type(__node_alloc());}
 private:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
           size_type& size() _NOEXCEPT {return __pair3_.first();}
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const size_type& size() const _NOEXCEPT {return __pair3_.first();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
           value_compare& value_comp() _NOEXCEPT {return __pair3_.second();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const value_compare& value_comp() const _NOEXCEPT
         {return __pair3_.second();}
 public:
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __node_pointer __root() const _NOEXCEPT
         {return static_cast<__node_pointer>(__end_node()->__left_);}
 
     __node_base_pointer* __root_ptr() const _NOEXCEPT {
-        return _VSTD::addressof(__end_node()->__left_);
+        return _CUDA_VSTD::addressof(__end_node()->__left_);
     }
 
     typedef __tree_iterator<value_type, __node_pointer, 
diff erence_type>             iterator;
@@ -1118,25 +1118,25 @@ public:
             is_nothrow_move_assignable<__node_allocator>::value);
     ~__tree();
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
           iterator begin()  _NOEXCEPT {return       iterator(__begin_node());}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator begin() const _NOEXCEPT {return const_iterator(__begin_node());}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
           iterator end() _NOEXCEPT {return       iterator(__end_node());}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator end() const _NOEXCEPT {return const_iterator(__end_node());}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type max_size() const _NOEXCEPT
-        {return _VSTD::min<size_type>(
+        {return _CUDA_VSTD::min<size_type>(
                 __node_traits::max_size(__node_alloc()),
                 numeric_limits<
diff erence_type >::max());}
 
     void clear() _NOEXCEPT;
 
     void swap(__tree& __t)
-#if _LIBCPP_STD_VER <= 11
+#if _LIBCUDACXX_STD_VER <= 11
         _NOEXCEPT_(
             __is_nothrow_swappable<value_compare>::value
             && (!__node_traits::propagate_on_container_swap::value ||
@@ -1166,185 +1166,185 @@ public:
     iterator __emplace_hint_multi(const_iterator __p, _Args&&... __args);
 
     template <class _Pp>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     pair<iterator, bool> __emplace_unique(_Pp&& __x) {
-        return __emplace_unique_extract_key(_VSTD::forward<_Pp>(__x),
+        return __emplace_unique_extract_key(_CUDA_VSTD::forward<_Pp>(__x),
                                             __can_extract_key<_Pp, key_type>());
     }
 
     template <class _First, class _Second>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __enable_if_t<__can_extract_map_key<_First, key_type, __container_value_type>::value, pair<iterator, bool> >
     __emplace_unique(_First&& __f, _Second&& __s) {
-        return __emplace_unique_key_args(__f, _VSTD::forward<_First>(__f),
-                                              _VSTD::forward<_Second>(__s));
+        return __emplace_unique_key_args(__f, _CUDA_VSTD::forward<_First>(__f),
+                                              _CUDA_VSTD::forward<_Second>(__s));
     }
 
     template <class... _Args>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     pair<iterator, bool> __emplace_unique(_Args&&... __args) {
-        return __emplace_unique_impl(_VSTD::forward<_Args>(__args)...);
+        return __emplace_unique_impl(_CUDA_VSTD::forward<_Args>(__args)...);
     }
 
     template <class _Pp>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     pair<iterator, bool>
     __emplace_unique_extract_key(_Pp&& __x, __extract_key_fail_tag) {
-      return __emplace_unique_impl(_VSTD::forward<_Pp>(__x));
+      return __emplace_unique_impl(_CUDA_VSTD::forward<_Pp>(__x));
     }
 
     template <class _Pp>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     pair<iterator, bool>
     __emplace_unique_extract_key(_Pp&& __x, __extract_key_self_tag) {
-      return __emplace_unique_key_args(__x, _VSTD::forward<_Pp>(__x));
+      return __emplace_unique_key_args(__x, _CUDA_VSTD::forward<_Pp>(__x));
     }
 
     template <class _Pp>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     pair<iterator, bool>
     __emplace_unique_extract_key(_Pp&& __x, __extract_key_first_tag) {
-      return __emplace_unique_key_args(__x.first, _VSTD::forward<_Pp>(__x));
+      return __emplace_unique_key_args(__x.first, _CUDA_VSTD::forward<_Pp>(__x));
     }
 
     template <class _Pp>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator __emplace_hint_unique(const_iterator __p, _Pp&& __x) {
-        return __emplace_hint_unique_extract_key(__p, _VSTD::forward<_Pp>(__x),
+        return __emplace_hint_unique_extract_key(__p, _CUDA_VSTD::forward<_Pp>(__x),
                                             __can_extract_key<_Pp, key_type>());
     }
 
     template <class _First, class _Second>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __enable_if_t<__can_extract_map_key<_First, key_type, __container_value_type>::value, iterator>
     __emplace_hint_unique(const_iterator __p, _First&& __f, _Second&& __s) {
         return __emplace_hint_unique_key_args(__p, __f,
-                                              _VSTD::forward<_First>(__f),
-                                              _VSTD::forward<_Second>(__s)).first;
+                                              _CUDA_VSTD::forward<_First>(__f),
+                                              _CUDA_VSTD::forward<_Second>(__s)).first;
     }
 
     template <class... _Args>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator __emplace_hint_unique(const_iterator __p, _Args&&... __args) {
-        return __emplace_hint_unique_impl(__p, _VSTD::forward<_Args>(__args)...);
+        return __emplace_hint_unique_impl(__p, _CUDA_VSTD::forward<_Args>(__args)...);
     }
 
     template <class _Pp>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator
     __emplace_hint_unique_extract_key(const_iterator __p, _Pp&& __x, __extract_key_fail_tag) {
-      return __emplace_hint_unique_impl(__p, _VSTD::forward<_Pp>(__x));
+      return __emplace_hint_unique_impl(__p, _CUDA_VSTD::forward<_Pp>(__x));
     }
 
     template <class _Pp>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator
     __emplace_hint_unique_extract_key(const_iterator __p, _Pp&& __x, __extract_key_self_tag) {
-      return __emplace_hint_unique_key_args(__p, __x, _VSTD::forward<_Pp>(__x)).first;
+      return __emplace_hint_unique_key_args(__p, __x, _CUDA_VSTD::forward<_Pp>(__x)).first;
     }
 
     template <class _Pp>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator
     __emplace_hint_unique_extract_key(const_iterator __p, _Pp&& __x, __extract_key_first_tag) {
-      return __emplace_hint_unique_key_args(__p, __x.first, _VSTD::forward<_Pp>(__x)).first;
+      return __emplace_hint_unique_key_args(__p, __x.first, _CUDA_VSTD::forward<_Pp>(__x)).first;
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     pair<iterator, bool> __insert_unique(const __container_value_type& __v) {
         return __emplace_unique_key_args(_NodeTypes::__get_key(__v), __v);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator __insert_unique(const_iterator __p, const __container_value_type& __v) {
         return __emplace_hint_unique_key_args(__p, _NodeTypes::__get_key(__v), __v).first;
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     pair<iterator, bool> __insert_unique(__container_value_type&& __v) {
-        return __emplace_unique_key_args(_NodeTypes::__get_key(__v), _VSTD::move(__v));
+        return __emplace_unique_key_args(_NodeTypes::__get_key(__v), _CUDA_VSTD::move(__v));
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator __insert_unique(const_iterator __p, __container_value_type&& __v) {
-        return __emplace_hint_unique_key_args(__p, _NodeTypes::__get_key(__v), _VSTD::move(__v)).first;
+        return __emplace_hint_unique_key_args(__p, _NodeTypes::__get_key(__v), _CUDA_VSTD::move(__v)).first;
     }
 
     template <class _Vp,
               class = __enable_if_t<!is_same<typename __unconstref<_Vp>::type, __container_value_type>::value> >
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     pair<iterator, bool> __insert_unique(_Vp&& __v) {
-        return __emplace_unique(_VSTD::forward<_Vp>(__v));
+        return __emplace_unique(_CUDA_VSTD::forward<_Vp>(__v));
     }
 
     template <class _Vp,
               class = __enable_if_t<!is_same<typename __unconstref<_Vp>::type, __container_value_type>::value> >
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator __insert_unique(const_iterator __p, _Vp&& __v) {
-        return __emplace_hint_unique(__p, _VSTD::forward<_Vp>(__v));
+        return __emplace_hint_unique(__p, _CUDA_VSTD::forward<_Vp>(__v));
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator __insert_multi(__container_value_type&& __v) {
-        return __emplace_multi(_VSTD::move(__v));
+        return __emplace_multi(_CUDA_VSTD::move(__v));
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator __insert_multi(const_iterator __p, __container_value_type&& __v) {
-        return __emplace_hint_multi(__p, _VSTD::move(__v));
+        return __emplace_hint_multi(__p, _CUDA_VSTD::move(__v));
     }
 
     template <class _Vp>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator __insert_multi(_Vp&& __v) {
-        return __emplace_multi(_VSTD::forward<_Vp>(__v));
+        return __emplace_multi(_CUDA_VSTD::forward<_Vp>(__v));
     }
 
     template <class _Vp>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator __insert_multi(const_iterator __p, _Vp&& __v) {
-        return __emplace_hint_multi(__p, _VSTD::forward<_Vp>(__v));
+        return __emplace_hint_multi(__p, _CUDA_VSTD::forward<_Vp>(__v));
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     pair<iterator, bool> __node_assign_unique(const __container_value_type& __v, __node_pointer __dest);
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator __node_insert_multi(__node_pointer __nd);
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator __node_insert_multi(const_iterator __p, __node_pointer __nd);
 
 
-    _LIBCPP_INLINE_VISIBILITY iterator
+    _LIBCUDACXX_INLINE_VISIBILITY iterator
     __remove_node_pointer(__node_pointer) _NOEXCEPT;
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
     template <class _NodeHandle, class _InsertReturnType>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _InsertReturnType __node_handle_insert_unique(_NodeHandle&&);
     template <class _NodeHandle>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator __node_handle_insert_unique(const_iterator, _NodeHandle&&);
     template <class _Tree>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __node_handle_merge_unique(_Tree& __source);
 
     template <class _NodeHandle>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator __node_handle_insert_multi(_NodeHandle&&);
     template <class _NodeHandle>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator __node_handle_insert_multi(const_iterator, _NodeHandle&&);
     template <class _Tree>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __node_handle_merge_multi(_Tree& __source);
 
 
     template <class _NodeHandle>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _NodeHandle __node_handle_extract(key_type const&);
     template <class _NodeHandle>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _NodeHandle __node_handle_extract(const_iterator);
 #endif
 
@@ -1370,7 +1370,7 @@ public:
         size_type __count_multi(const _Key& __k) const;
 
     template <class _Key>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         iterator lower_bound(const _Key& __v)
             {return __lower_bound(__v, __root(), __end_node());}
     template <class _Key>
@@ -1378,7 +1378,7 @@ public:
                                __node_pointer __root,
                                __iter_pointer __result);
     template <class _Key>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         const_iterator lower_bound(const _Key& __v) const
             {return __lower_bound(__v, __root(), __end_node());}
     template <class _Key>
@@ -1386,7 +1386,7 @@ public:
                                      __node_pointer __root,
                                      __iter_pointer __result) const;
     template <class _Key>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         iterator upper_bound(const _Key& __v)
             {return __upper_bound(__v, __root(), __end_node());}
     template <class _Key>
@@ -1394,7 +1394,7 @@ public:
                                __node_pointer __root,
                                __iter_pointer __result);
     template <class _Key>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         const_iterator upper_bound(const _Key& __v) const
             {return __upper_bound(__v, __root(), __end_node());}
     template <class _Key>
@@ -1433,7 +1433,7 @@ private:
     __node_base_pointer&
         __find_equal(__parent_pointer& __parent, const _Key& __v);
     template <class _Key>
-    _LIBCPP_INLINE_VISIBILITY __node_base_pointer&
+    _LIBCUDACXX_INLINE_VISIBILITY __node_base_pointer&
     __find_equal(__parent_pointer& __parent, const _Key& __v) const {
       return const_cast<__tree*>(this)->__find_equal(__parent, __v);
     }
@@ -1448,19 +1448,19 @@ private:
 
     void destroy(__node_pointer __nd) _NOEXCEPT;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __copy_assign_alloc(const __tree& __t)
         {__copy_assign_alloc(__t, integral_constant<bool,
              __node_traits::propagate_on_container_copy_assignment::value>());}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __copy_assign_alloc(const __tree& __t, true_type)
         {
         if (__node_alloc() != __t.__node_alloc())
             clear();
         __node_alloc() = __t.__node_alloc();
         }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __copy_assign_alloc(const __tree&, false_type) {}
 
     void __move_assign(__tree& __t, false_type);
@@ -1468,7 +1468,7 @@ private:
         _NOEXCEPT_(is_nothrow_move_assignable<value_compare>::value &&
                    is_nothrow_move_assignable<__node_allocator>::value);
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __move_assign_alloc(__tree& __t)
         _NOEXCEPT_(
             !__node_traits::propagate_on_container_move_assignment::value ||
@@ -1476,26 +1476,26 @@ private:
         {__move_assign_alloc(__t, integral_constant<bool,
              __node_traits::propagate_on_container_move_assignment::value>());}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __move_assign_alloc(__tree& __t, true_type)
         _NOEXCEPT_(is_nothrow_move_assignable<__node_allocator>::value)
-        {__node_alloc() = _VSTD::move(__t.__node_alloc());}
-    _LIBCPP_INLINE_VISIBILITY
+        {__node_alloc() = _CUDA_VSTD::move(__t.__node_alloc());}
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __move_assign_alloc(__tree&, false_type) _NOEXCEPT {}
 
     struct _DetachedTreeCache {
-      _LIBCPP_INLINE_VISIBILITY
+      _LIBCUDACXX_INLINE_VISIBILITY
       explicit _DetachedTreeCache(__tree *__t) _NOEXCEPT : __t_(__t),
         __cache_root_(__detach_from_tree(__t)) {
           __advance();
         }
 
-      _LIBCPP_INLINE_VISIBILITY
+      _LIBCUDACXX_INLINE_VISIBILITY
       __node_pointer __get() const _NOEXCEPT {
         return __cache_elem_;
       }
 
-      _LIBCPP_INLINE_VISIBILITY
+      _LIBCUDACXX_INLINE_VISIBILITY
       void __advance() _NOEXCEPT {
         __cache_elem_ = __cache_root_;
         if (__cache_root_) {
@@ -1503,7 +1503,7 @@ private:
         }
       }
 
-      _LIBCPP_INLINE_VISIBILITY
+      _LIBCUDACXX_INLINE_VISIBILITY
       ~_DetachedTreeCache() {
         __t_->destroy(__cache_elem_);
         if (__cache_root_) {
@@ -1517,9 +1517,9 @@ private:
        _DetachedTreeCache& operator=(_DetachedTreeCache const&) = delete;
 
     private:
-      _LIBCPP_INLINE_VISIBILITY
+      _LIBCUDACXX_INLINE_VISIBILITY
       static __node_pointer __detach_from_tree(__tree *__t) _NOEXCEPT;
-      _LIBCPP_INLINE_VISIBILITY
+      _LIBCUDACXX_INLINE_VISIBILITY
       static __node_pointer __detach_next(__node_pointer) _NOEXCEPT;
 
       __tree *__t_;
@@ -1528,8 +1528,8 @@ private:
     };
 
 
-    template <class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS map;
-    template <class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS multimap;
+    template <class, class, class, class> friend class _LIBCUDACXX_TEMPLATE_VIS map;
+    template <class, class, class, class> friend class _LIBCUDACXX_TEMPLATE_VIS multimap;
 };
 
 template <class _Tp, class _Compare, class _Allocator>
@@ -1589,27 +1589,27 @@ __tree<_Tp, _Compare, _Allocator>::_DetachedTreeCache::__detach_next(__node_poin
 {
     if (__cache->__parent_ == nullptr)
         return nullptr;
-    if (_VSTD::__tree_is_left_child(static_cast<__node_base_pointer>(__cache)))
+    if (_CUDA_VSTD::__tree_is_left_child(static_cast<__node_base_pointer>(__cache)))
     {
         __cache->__parent_->__left_ = nullptr;
         __cache = static_cast<__node_pointer>(__cache->__parent_);
         if (__cache->__right_ == nullptr)
             return __cache;
-        return static_cast<__node_pointer>(_VSTD::__tree_leaf(__cache->__right_));
+        return static_cast<__node_pointer>(_CUDA_VSTD::__tree_leaf(__cache->__right_));
     }
     // __cache is right child
     __cache->__parent_unsafe()->__right_ = nullptr;
     __cache = static_cast<__node_pointer>(__cache->__parent_);
     if (__cache->__left_ == nullptr)
         return __cache;
-    return static_cast<__node_pointer>(_VSTD::__tree_leaf(__cache->__left_));
+    return static_cast<__node_pointer>(_CUDA_VSTD::__tree_leaf(__cache->__left_));
 }
 
 template <class _Tp, class _Compare, class _Allocator>
 __tree<_Tp, _Compare, _Allocator>&
 __tree<_Tp, _Compare, _Allocator>::operator=(const __tree& __t)
 {
-    if (this != _VSTD::addressof(__t))
+    if (this != _CUDA_VSTD::addressof(__t))
     {
         value_comp() = __t.value_comp();
         __copy_assign_alloc(__t);
@@ -1679,9 +1679,9 @@ __tree<_Tp, _Compare, _Allocator>::__tree(__tree&& __t)
     _NOEXCEPT_(
         is_nothrow_move_constructible<__node_allocator>::value &&
         is_nothrow_move_constructible<value_compare>::value)
-    : __begin_node_(_VSTD::move(__t.__begin_node_)),
-      __pair1_(_VSTD::move(__t.__pair1_)),
-      __pair3_(_VSTD::move(__t.__pair3_))
+    : __begin_node_(_CUDA_VSTD::move(__t.__begin_node_)),
+      __pair1_(_CUDA_VSTD::move(__t.__pair1_)),
+      __pair3_(_CUDA_VSTD::move(__t.__pair3_))
 {
     if (size() == 0)
         __begin_node() = __end_node();
@@ -1697,7 +1697,7 @@ __tree<_Tp, _Compare, _Allocator>::__tree(__tree&& __t)
 template <class _Tp, class _Compare, class _Allocator>
 __tree<_Tp, _Compare, _Allocator>::__tree(__tree&& __t, const allocator_type& __a)
     : __pair1_(__default_init_tag(), __node_allocator(__a)),
-      __pair3_(0, _VSTD::move(__t.value_comp()))
+      __pair3_(0, _CUDA_VSTD::move(__t.value_comp()))
 {
     if (__a == __t.__alloc())
     {
@@ -1730,7 +1730,7 @@ __tree<_Tp, _Compare, _Allocator>::__move_assign(__tree& __t, true_type)
     __begin_node_ = __t.__begin_node_;
     __pair1_.first() = __t.__pair1_.first();
     __move_assign_alloc(__t);
-    __pair3_ = _VSTD::move(__t.__pair3_);
+    __pair3_ = _CUDA_VSTD::move(__t.__pair3_);
     if (size() == 0)
         __begin_node() = __end_node();
     else
@@ -1750,13 +1750,13 @@ __tree<_Tp, _Compare, _Allocator>::__move_assign(__tree& __t, false_type)
         __move_assign(__t, true_type());
     else
     {
-        value_comp() = _VSTD::move(__t.value_comp());
+        value_comp() = _CUDA_VSTD::move(__t.value_comp());
         const_iterator __e = end();
         if (size() != 0)
         {
             _DetachedTreeCache __cache(this);
             while (__cache.__get() != nullptr && __t.size() != 0) {
-              __cache.__get()->__value_ = _VSTD::move(__t.remove(__t.begin())->__value_);
+              __cache.__get()->__value_ = _CUDA_VSTD::move(__t.remove(__t.begin())->__value_);
               __node_insert_multi(__cache.__get());
               __cache.__advance();
             }
@@ -1805,7 +1805,7 @@ __tree<_Tp, _Compare, _Allocator>::destroy(__node_pointer __nd) _NOEXCEPT
 template <class _Tp, class _Compare, class _Allocator>
 void
 __tree<_Tp, _Compare, _Allocator>::swap(__tree& __t)
-#if _LIBCPP_STD_VER <= 11
+#if _LIBCUDACXX_STD_VER <= 11
         _NOEXCEPT_(
             __is_nothrow_swappable<value_compare>::value
             && (!__node_traits::propagate_on_container_swap::value ||
@@ -1815,10 +1815,10 @@ __tree<_Tp, _Compare, _Allocator>::swap(__tree& __t)
         _NOEXCEPT_(__is_nothrow_swappable<value_compare>::value)
 #endif
 {
-    using _VSTD::swap;
+    using _CUDA_VSTD::swap;
     swap(__begin_node_, __t.__begin_node_);
     swap(__pair1_.first(), __t.__pair1_.first());
-    _VSTD::__swap_allocator(__node_alloc(), __t.__node_alloc());
+    _CUDA_VSTD::__swap_allocator(__node_alloc(), __t.__node_alloc());
     __pair3_.swap(__t.__pair3_);
     if (size() == 0)
         __begin_node() = __end_node();
@@ -1974,7 +1974,7 @@ __tree<_Tp, _Compare, _Allocator>::__find_equal(__parent_pointer& __parent,
             if (value_comp()(__v, __nd->__value_))
             {
                 if (__nd->__left_ != nullptr) {
-                    __nd_ptr = _VSTD::addressof(__nd->__left_);
+                    __nd_ptr = _CUDA_VSTD::addressof(__nd->__left_);
                     __nd = static_cast<__node_pointer>(__nd->__left_);
                 } else {
                     __parent = static_cast<__parent_pointer>(__nd);
@@ -1984,7 +1984,7 @@ __tree<_Tp, _Compare, _Allocator>::__find_equal(__parent_pointer& __parent,
             else if (value_comp()(__nd->__value_, __v))
             {
                 if (__nd->__right_ != nullptr) {
-                    __nd_ptr = _VSTD::addressof(__nd->__right_);
+                    __nd_ptr = _CUDA_VSTD::addressof(__nd->__right_);
                     __nd = static_cast<__node_pointer>(__nd->__right_);
                 } else {
                     __parent = static_cast<__parent_pointer>(__nd);
@@ -2041,10 +2041,10 @@ __tree<_Tp, _Compare, _Allocator>::__find_equal(const_iterator __hint,
     else if (value_comp()(*__hint, __v))  // check after
     {
         // *__hint < __v
-        const_iterator __next = _VSTD::next(__hint);
+        const_iterator __next = _CUDA_VSTD::next(__hint);
         if (__next == end() || value_comp()(__v, *__next))
         {
-            // *__hint < __v < *_VSTD::next(__hint)
+            // *__hint < __v < *_CUDA_VSTD::next(__hint)
             if (__hint.__get_np()->__right_ == nullptr)
             {
                 __parent = static_cast<__parent_pointer>(__hint.__ptr_);
@@ -2077,7 +2077,7 @@ void __tree<_Tp, _Compare, _Allocator>::__insert_node_at(
     __child = __new_node;
     if (__begin_node()->__left_ != nullptr)
         __begin_node() = static_cast<__iter_pointer>(__begin_node()->__left_);
-    _VSTD::__tree_balance_after_insert(__end_node()->__left_, __child);
+    _CUDA_VSTD::__tree_balance_after_insert(__end_node()->__left_, __child);
     ++size();
 }
 
@@ -2092,7 +2092,7 @@ __tree<_Tp, _Compare, _Allocator>::__emplace_unique_key_args(_Key const& __k, _A
     bool __inserted = false;
     if (__child == nullptr)
     {
-        __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
+        __node_holder __h = __construct_node(_CUDA_VSTD::forward<_Args>(__args)...);
         __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
         __r = __h.release();
         __inserted = true;
@@ -2113,7 +2113,7 @@ __tree<_Tp, _Compare, _Allocator>::__emplace_hint_unique_key_args(
     bool __inserted = false;
     if (__child == nullptr)
     {
-        __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
+        __node_holder __h = __construct_node(_CUDA_VSTD::forward<_Args>(__args)...);
         __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
         __r = __h.release();
         __inserted = true;
@@ -2130,7 +2130,7 @@ __tree<_Tp, _Compare, _Allocator>::__construct_node(_Args&& ...__args)
                   "Cannot construct from __value_type");
     __node_allocator& __na = __node_alloc();
     __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
-    __node_traits::construct(__na, _NodeTypes::__get_ptr(__h->__value_), _VSTD::forward<_Args>(__args)...);
+    __node_traits::construct(__na, _NodeTypes::__get_ptr(__h->__value_), _CUDA_VSTD::forward<_Args>(__args)...);
     __h.get_deleter().__value_constructed = true;
     return __h;
 }
@@ -2141,7 +2141,7 @@ template <class... _Args>
 pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, bool>
 __tree<_Tp, _Compare, _Allocator>::__emplace_unique_impl(_Args&&... __args)
 {
-    __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
+    __node_holder __h = __construct_node(_CUDA_VSTD::forward<_Args>(__args)...);
     __parent_pointer __parent;
     __node_base_pointer& __child = __find_equal(__parent, __h->__value_);
     __node_pointer __r = static_cast<__node_pointer>(__child);
@@ -2160,7 +2160,7 @@ template <class... _Args>
 typename __tree<_Tp, _Compare, _Allocator>::iterator
 __tree<_Tp, _Compare, _Allocator>::__emplace_hint_unique_impl(const_iterator __p, _Args&&... __args)
 {
-    __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
+    __node_holder __h = __construct_node(_CUDA_VSTD::forward<_Args>(__args)...);
     __parent_pointer __parent;
     __node_base_pointer __dummy;
     __node_base_pointer& __child = __find_equal(__p, __parent, __dummy, __h->__value_);
@@ -2178,7 +2178,7 @@ template <class... _Args>
 typename __tree<_Tp, _Compare, _Allocator>::iterator
 __tree<_Tp, _Compare, _Allocator>::__emplace_multi(_Args&&... __args)
 {
-    __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
+    __node_holder __h = __construct_node(_CUDA_VSTD::forward<_Args>(__args)...);
     __parent_pointer __parent;
     __node_base_pointer& __child = __find_leaf_high(__parent, _NodeTypes::__get_key(__h->__value_));
     __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
@@ -2191,7 +2191,7 @@ typename __tree<_Tp, _Compare, _Allocator>::iterator
 __tree<_Tp, _Compare, _Allocator>::__emplace_hint_multi(const_iterator __p,
                                                         _Args&&... __args)
 {
-    __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
+    __node_holder __h = __construct_node(_CUDA_VSTD::forward<_Args>(__args)...);
     __parent_pointer __parent;
     __node_base_pointer& __child = __find_leaf(__p, __parent, _NodeTypes::__get_key(__h->__value_));
     __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
@@ -2247,15 +2247,15 @@ __tree<_Tp, _Compare, _Allocator>::__remove_node_pointer(__node_pointer __ptr) _
     if (__begin_node() == __ptr)
         __begin_node() = __r.__ptr_;
     --size();
-    _VSTD::__tree_remove(__end_node()->__left_,
+    _CUDA_VSTD::__tree_remove(__end_node()->__left_,
                          static_cast<__node_base_pointer>(__ptr));
     return __r;
 }
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp, class _Compare, class _Allocator>
 template <class _NodeHandle, class _InsertReturnType>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _InsertReturnType
 __tree<_Tp, _Compare, _Allocator>::__node_handle_insert_unique(
     _NodeHandle&& __nh)
@@ -2270,7 +2270,7 @@ __tree<_Tp, _Compare, _Allocator>::__node_handle_insert_unique(
     if (__child != nullptr)
         return _InsertReturnType{
             iterator(static_cast<__node_pointer>(__child)),
-            false, _VSTD::move(__nh)};
+            false, _CUDA_VSTD::move(__nh)};
 
     __insert_node_at(__parent, __child,
                      static_cast<__node_base_pointer>(__ptr));
@@ -2280,7 +2280,7 @@ __tree<_Tp, _Compare, _Allocator>::__node_handle_insert_unique(
 
 template <class _Tp, class _Compare, class _Allocator>
 template <class _NodeHandle>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 typename __tree<_Tp, _Compare, _Allocator>::iterator
 __tree<_Tp, _Compare, _Allocator>::__node_handle_insert_unique(
     const_iterator __hint, _NodeHandle&& __nh)
@@ -2306,7 +2306,7 @@ __tree<_Tp, _Compare, _Allocator>::__node_handle_insert_unique(
 
 template <class _Tp, class _Compare, class _Allocator>
 template <class _NodeHandle>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _NodeHandle
 __tree<_Tp, _Compare, _Allocator>::__node_handle_extract(key_type const& __key)
 {
@@ -2318,7 +2318,7 @@ __tree<_Tp, _Compare, _Allocator>::__node_handle_extract(key_type const& __key)
 
 template <class _Tp, class _Compare, class _Allocator>
 template <class _NodeHandle>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _NodeHandle
 __tree<_Tp, _Compare, _Allocator>::__node_handle_extract(const_iterator __p)
 {
@@ -2329,7 +2329,7 @@ __tree<_Tp, _Compare, _Allocator>::__node_handle_extract(const_iterator __p)
 
 template <class _Tp, class _Compare, class _Allocator>
 template <class _Tree>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 void
 __tree<_Tp, _Compare, _Allocator>::__node_handle_merge_unique(_Tree& __source)
 {
@@ -2353,7 +2353,7 @@ __tree<_Tp, _Compare, _Allocator>::__node_handle_merge_unique(_Tree& __source)
 
 template <class _Tp, class _Compare, class _Allocator>
 template <class _NodeHandle>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 typename __tree<_Tp, _Compare, _Allocator>::iterator
 __tree<_Tp, _Compare, _Allocator>::__node_handle_insert_multi(_NodeHandle&& __nh)
 {
@@ -2370,7 +2370,7 @@ __tree<_Tp, _Compare, _Allocator>::__node_handle_insert_multi(_NodeHandle&& __nh
 
 template <class _Tp, class _Compare, class _Allocator>
 template <class _NodeHandle>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 typename __tree<_Tp, _Compare, _Allocator>::iterator
 __tree<_Tp, _Compare, _Allocator>::__node_handle_insert_multi(
     const_iterator __hint, _NodeHandle&& __nh)
@@ -2389,7 +2389,7 @@ __tree<_Tp, _Compare, _Allocator>::__node_handle_insert_multi(
 
 template <class _Tp, class _Compare, class _Allocator>
 template <class _Tree>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 void
 __tree<_Tp, _Compare, _Allocator>::__node_handle_merge_multi(_Tree& __source)
 {
@@ -2409,7 +2409,7 @@ __tree<_Tp, _Compare, _Allocator>::__node_handle_merge_multi(_Tree& __source)
     }
 }
 
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCUDACXX_STD_VER > 14
 
 template <class _Tp, class _Compare, class _Allocator>
 typename __tree<_Tp, _Compare, _Allocator>::iterator
@@ -2516,7 +2516,7 @@ __tree<_Tp, _Compare, _Allocator>::__count_multi(const _Key& __k) const
         else if (value_comp()(__rt->__value_, __k))
             __rt = static_cast<__node_pointer>(__rt->__right_);
         else
-            return _VSTD::distance(
+            return _CUDA_VSTD::distance(
                 __lower_bound(__k, static_cast<__node_pointer>(__rt->__left_), static_cast<__iter_pointer>(__rt)),
                 __upper_bound(__k, static_cast<__node_pointer>(__rt->__right_), __result)
             );
@@ -2626,7 +2626,7 @@ __tree<_Tp, _Compare, _Allocator>::__equal_range_unique(const _Key& __k)
             return _Pp(iterator(__rt),
                       iterator(
                           __rt->__right_ != nullptr ?
-                              static_cast<__iter_pointer>(_VSTD::__tree_min(__rt->__right_))
+                              static_cast<__iter_pointer>(_CUDA_VSTD::__tree_min(__rt->__right_))
                             : __result));
     }
     return _Pp(iterator(__result), iterator(__result));
@@ -2654,7 +2654,7 @@ __tree<_Tp, _Compare, _Allocator>::__equal_range_unique(const _Key& __k) const
             return _Pp(const_iterator(__rt),
                       const_iterator(
                           __rt->__right_ != nullptr ?
-                              static_cast<__iter_pointer>(_VSTD::__tree_min(__rt->__right_))
+                              static_cast<__iter_pointer>(_CUDA_VSTD::__tree_min(__rt->__right_))
                             : __result));
     }
     return _Pp(const_iterator(__result), const_iterator(__result));
@@ -2723,13 +2723,13 @@ __tree<_Tp, _Compare, _Allocator>::remove(const_iterator __p) _NOEXCEPT
             __begin_node() = static_cast<__iter_pointer>(__np->__parent_);
     }
     --size();
-    _VSTD::__tree_remove(__end_node()->__left_,
+    _CUDA_VSTD::__tree_remove(__end_node()->__left_,
                          static_cast<__node_base_pointer>(__np));
     return __node_holder(__np, _Dp(__node_alloc(), true));
 }
 
 template <class _Tp, class _Compare, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 swap(__tree<_Tp, _Compare, _Allocator>& __x,
      __tree<_Tp, _Compare, _Allocator>& __y)
@@ -2738,8 +2738,8 @@ swap(__tree<_Tp, _Compare, _Allocator>& __x,
     __x.swap(__y);
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___TREE
+#endif // _LIBCUDACXX___TREE

diff  --git a/libcxx/include/__tuple b/libcxx/include/__tuple
index f85036e7af1d..e775bda935a3 100644
--- a/libcxx/include/__tuple
+++ b/libcxx/include/__tuple
@@ -7,70 +7,70 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TUPLE
-#define _LIBCPP___TUPLE
+#ifndef _LIBCUDACXX___TUPLE
+#define _LIBCUDACXX___TUPLE
 
 #include <__config>
 #include <cstddef>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS tuple_size;
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS tuple_size;
 
-#if !defined(_LIBCPP_CXX03_LANG)
+#if !defined(_LIBCUDACXX_CXX03_LANG)
 template <class _Tp, class...>
 using __enable_if_tuple_size_imp = _Tp;
 
 template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS tuple_size<__enable_if_tuple_size_imp<
+struct _LIBCUDACXX_TEMPLATE_VIS tuple_size<__enable_if_tuple_size_imp<
     const _Tp,
     __enable_if_t<!is_volatile<_Tp>::value>,
     integral_constant<size_t, sizeof(tuple_size<_Tp>)>>>
     : public integral_constant<size_t, tuple_size<_Tp>::value> {};
 
 template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS tuple_size<__enable_if_tuple_size_imp<
+struct _LIBCUDACXX_TEMPLATE_VIS tuple_size<__enable_if_tuple_size_imp<
     volatile _Tp,
     __enable_if_t<!is_const<_Tp>::value>,
     integral_constant<size_t, sizeof(tuple_size<_Tp>)>>>
     : public integral_constant<size_t, tuple_size<_Tp>::value> {};
 
 template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS tuple_size<__enable_if_tuple_size_imp<
+struct _LIBCUDACXX_TEMPLATE_VIS tuple_size<__enable_if_tuple_size_imp<
     const volatile _Tp,
     integral_constant<size_t, sizeof(tuple_size<_Tp>)>>>
     : public integral_constant<size_t, tuple_size<_Tp>::value> {};
 
 #else
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS tuple_size<const _Tp> : public tuple_size<_Tp> {};
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS tuple_size<volatile _Tp> : public tuple_size<_Tp> {};
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS tuple_size<const volatile _Tp> : public tuple_size<_Tp> {};
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS tuple_size<const _Tp> : public tuple_size<_Tp> {};
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS tuple_size<volatile _Tp> : public tuple_size<_Tp> {};
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS tuple_size<const volatile _Tp> : public tuple_size<_Tp> {};
 #endif
 
-template <size_t _Ip, class _Tp> struct _LIBCPP_TEMPLATE_VIS tuple_element;
+template <size_t _Ip, class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS tuple_element;
 
 template <size_t _Ip, class _Tp>
-struct _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, const _Tp>
+struct _LIBCUDACXX_TEMPLATE_VIS tuple_element<_Ip, const _Tp>
 {
-    typedef _LIBCPP_NODEBUG typename add_const<typename tuple_element<_Ip, _Tp>::type>::type type;
+    typedef _LIBCUDACXX_NODEBUG typename add_const<typename tuple_element<_Ip, _Tp>::type>::type type;
 };
 
 template <size_t _Ip, class _Tp>
-struct _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, volatile _Tp>
+struct _LIBCUDACXX_TEMPLATE_VIS tuple_element<_Ip, volatile _Tp>
 {
-    typedef _LIBCPP_NODEBUG typename add_volatile<typename tuple_element<_Ip, _Tp>::type>::type type;
+    typedef _LIBCUDACXX_NODEBUG typename add_volatile<typename tuple_element<_Ip, _Tp>::type>::type type;
 };
 
 template <size_t _Ip, class _Tp>
-struct _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, const volatile _Tp>
+struct _LIBCUDACXX_TEMPLATE_VIS tuple_element<_Ip, const volatile _Tp>
 {
-    typedef _LIBCPP_NODEBUG typename add_cv<typename tuple_element<_Ip, _Tp>::type>::type type;
+    typedef _LIBCUDACXX_NODEBUG typename add_cv<typename tuple_element<_Ip, _Tp>::type>::type type;
 };
 
 template <class _Tp> struct __tuple_like : false_type {};
@@ -81,7 +81,7 @@ template <class _Tp> struct __tuple_like<const volatile _Tp> : public __tuple_li
 
 // tuple specializations
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
 template <size_t...> struct __tuple_indices {};
 
@@ -94,12 +94,12 @@ struct __integer_sequence {
   using __to_tuple_indices = __tuple_indices<(_Values + _Sp)...>;
 };
 
-#if !__has_builtin(__make_integer_seq) || defined(_LIBCPP_TESTING_FALLBACK_MAKE_INTEGER_SEQUENCE)
+#if !__has_builtin(__make_integer_seq) || defined(_LIBCUDACXX_TESTING_FALLBACK_MAKE_INTEGER_SEQUENCE)
 namespace __detail {
 
 template<typename _Tp, size_t ..._Extra> struct __repeat;
 template<typename _Tp, _Tp ..._Np, size_t ..._Extra> struct __repeat<__integer_sequence<_Tp, _Np...>, _Extra...> {
-  typedef _LIBCPP_NODEBUG __integer_sequence<_Tp,
+  typedef _LIBCUDACXX_NODEBUG __integer_sequence<_Tp,
                            _Np...,
                            sizeof...(_Np) + _Np...,
                            2 * sizeof...(_Np) + _Np...,
@@ -134,7 +134,7 @@ template<> struct __parity<7> { template<size_t _Np> struct __pmake : __repeat<t
 
 } // namespace detail
 
-#endif // !__has_builtin(__make_integer_seq) || defined(_LIBCPP_TESTING_FALLBACK_MAKE_INTEGER_SEQUENCE)
+#endif // !__has_builtin(__make_integer_seq) || defined(_LIBCUDACXX_TESTING_FALLBACK_MAKE_INTEGER_SEQUENCE)
 
 #if __has_builtin(__make_integer_seq)
 template <size_t _Ep, size_t _Sp>
@@ -156,93 +156,93 @@ struct __make_tuple_indices
 };
 
 
-template <class ..._Tp> class _LIBCPP_TEMPLATE_VIS tuple;
+template <class ..._Tp> class _LIBCUDACXX_TEMPLATE_VIS tuple;
 
 template <class... _Tp> struct __tuple_like<tuple<_Tp...> > : true_type {};
 
 template <class ..._Tp>
-struct _LIBCPP_TEMPLATE_VIS tuple_size<tuple<_Tp...> >
+struct _LIBCUDACXX_TEMPLATE_VIS tuple_size<tuple<_Tp...> >
     : public integral_constant<size_t, sizeof...(_Tp)>
 {
 };
 
 template <size_t _Ip, class ..._Tp>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 typename tuple_element<_Ip, tuple<_Tp...> >::type&
 get(tuple<_Tp...>&) _NOEXCEPT;
 
 template <size_t _Ip, class ..._Tp>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 const typename tuple_element<_Ip, tuple<_Tp...> >::type&
 get(const tuple<_Tp...>&) _NOEXCEPT;
 
 template <size_t _Ip, class ..._Tp>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 typename tuple_element<_Ip, tuple<_Tp...> >::type&&
 get(tuple<_Tp...>&&) _NOEXCEPT;
 
 template <size_t _Ip, class ..._Tp>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 const typename tuple_element<_Ip, tuple<_Tp...> >::type&&
 get(const tuple<_Tp...>&&) _NOEXCEPT;
 
-#endif // !defined(_LIBCPP_CXX03_LANG)
+#endif // !defined(_LIBCUDACXX_CXX03_LANG)
 
 // pair specializations
 
 template <class _T1, class _T2> struct __tuple_like<pair<_T1, _T2> > : true_type {};
 
 template <size_t _Ip, class _T1, class _T2>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 typename tuple_element<_Ip, pair<_T1, _T2> >::type&
 get(pair<_T1, _T2>&) _NOEXCEPT;
 
 template <size_t _Ip, class _T1, class _T2>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 const typename tuple_element<_Ip, pair<_T1, _T2> >::type&
 get(const pair<_T1, _T2>&) _NOEXCEPT;
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 template <size_t _Ip, class _T1, class _T2>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 typename tuple_element<_Ip, pair<_T1, _T2> >::type&&
 get(pair<_T1, _T2>&&) _NOEXCEPT;
 
 template <size_t _Ip, class _T1, class _T2>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 const typename tuple_element<_Ip, pair<_T1, _T2> >::type&&
 get(const pair<_T1, _T2>&&) _NOEXCEPT;
 #endif
 
 // array specializations
 
-template <class _Tp, size_t _Size> struct _LIBCPP_TEMPLATE_VIS array;
+template <class _Tp, size_t _Size> struct _LIBCUDACXX_TEMPLATE_VIS array;
 
 template <class _Tp, size_t _Size> struct __tuple_like<array<_Tp, _Size> > : true_type {};
 
 template <size_t _Ip, class _Tp, size_t _Size>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 _Tp&
 get(array<_Tp, _Size>&) _NOEXCEPT;
 
 template <size_t _Ip, class _Tp, size_t _Size>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 const _Tp&
 get(const array<_Tp, _Size>&) _NOEXCEPT;
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 template <size_t _Ip, class _Tp, size_t _Size>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 _Tp&&
 get(array<_Tp, _Size>&&) _NOEXCEPT;
 
 template <size_t _Ip, class _Tp, size_t _Size>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 const _Tp&&
 get(const array<_Tp, _Size>&&) _NOEXCEPT;
 #endif
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
 // __tuple_types
 
@@ -253,7 +253,7 @@ template <class ..._Tp> struct __tuple_types {};
 namespace __indexer_detail {
 
 template <size_t _Idx, class _Tp>
-struct __indexed { using type _LIBCPP_NODEBUG = _Tp; };
+struct __indexed { using type _LIBCUDACXX_NODEBUG = _Tp; };
 
 template <class _Types, class _Indexes> struct __indexer;
 
@@ -268,7 +268,7 @@ __indexed<_Idx, _Tp> __at_index(__indexed<_Idx, _Tp> const&);
 } // namespace __indexer_detail
 
 template <size_t _Idx, class ..._Types>
-using __type_pack_element _LIBCPP_NODEBUG = typename decltype(
+using __type_pack_element _LIBCUDACXX_NODEBUG = typename decltype(
     __indexer_detail::__at_index<_Idx>(
         __indexer_detail::__indexer<
             __tuple_types<_Types...>,
@@ -278,15 +278,15 @@ using __type_pack_element _LIBCPP_NODEBUG = typename decltype(
 #endif
 
 template <size_t _Ip, class ..._Types>
-struct _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, __tuple_types<_Types...> >
+struct _LIBCUDACXX_TEMPLATE_VIS tuple_element<_Ip, __tuple_types<_Types...> >
 {
     static_assert(_Ip < sizeof...(_Types), "tuple_element index out of range");
-    typedef _LIBCPP_NODEBUG __type_pack_element<_Ip, _Types...> type;
+    typedef _LIBCUDACXX_NODEBUG __type_pack_element<_Ip, _Types...> type;
 };
 
 
 template <class ..._Tp>
-struct _LIBCPP_TEMPLATE_VIS tuple_size<__tuple_types<_Tp...> >
+struct _LIBCUDACXX_TEMPLATE_VIS tuple_size<__tuple_types<_Tp...> >
     : public integral_constant<size_t, sizeof...(_Tp)>
 {
 };
@@ -301,34 +301,34 @@ struct __apply_cv_mf<false, false, false> {
 };
 template <>
 struct __apply_cv_mf<false, true, false> {
-  template <class _Tp> using __apply _LIBCPP_NODEBUG = const _Tp;
+  template <class _Tp> using __apply _LIBCUDACXX_NODEBUG = const _Tp;
 };
 template <>
 struct __apply_cv_mf<false, false, true> {
-  template <class _Tp> using __apply _LIBCPP_NODEBUG = volatile _Tp;
+  template <class _Tp> using __apply _LIBCUDACXX_NODEBUG = volatile _Tp;
 };
 template <>
 struct __apply_cv_mf<false, true, true> {
-  template <class _Tp> using __apply _LIBCPP_NODEBUG = const volatile _Tp;
+  template <class _Tp> using __apply _LIBCUDACXX_NODEBUG = const volatile _Tp;
 };
 template <>
 struct __apply_cv_mf<true, false, false> {
-  template <class _Tp> using __apply _LIBCPP_NODEBUG = _Tp&;
+  template <class _Tp> using __apply _LIBCUDACXX_NODEBUG = _Tp&;
 };
 template <>
 struct __apply_cv_mf<true, true, false> {
-  template <class _Tp> using __apply _LIBCPP_NODEBUG = const _Tp&;
+  template <class _Tp> using __apply _LIBCUDACXX_NODEBUG = const _Tp&;
 };
 template <>
 struct __apply_cv_mf<true, false, true> {
-  template <class _Tp> using __apply _LIBCPP_NODEBUG = volatile _Tp&;
+  template <class _Tp> using __apply _LIBCUDACXX_NODEBUG = volatile _Tp&;
 };
 template <>
 struct __apply_cv_mf<true, true, true> {
-  template <class _Tp> using __apply _LIBCPP_NODEBUG = const volatile _Tp&;
+  template <class _Tp> using __apply _LIBCUDACXX_NODEBUG = const volatile _Tp&;
 };
 template <class _Tp, class _RawTp = typename remove_reference<_Tp>::type>
-using __apply_cv_t _LIBCPP_NODEBUG = __apply_cv_mf<
+using __apply_cv_t _LIBCUDACXX_NODEBUG = __apply_cv_mf<
     is_lvalue_reference<_Tp>::value,
     is_const<_RawTp>::value,
     is_volatile<_RawTp>::value>;
@@ -347,7 +347,7 @@ template <template <class...> class _Tuple, class ..._Types, size_t ..._Idx>
 struct __make_tuple_types_flat<_Tuple<_Types...>, __tuple_indices<_Idx...>> {
   // Specialization for pair, tuple, and __tuple_types
   template <class _Tp, class _ApplyFn = __apply_cv_t<_Tp>>
-  using __apply_quals _LIBCPP_NODEBUG = __tuple_types<
+  using __apply_quals _LIBCUDACXX_NODEBUG = __tuple_types<
       typename _ApplyFn::template __apply<__type_pack_element<_Idx, _Types...>>...
     >;
 };
@@ -375,12 +375,12 @@ struct __make_tuple_types
 
 template <class ..._Types, size_t _Ep>
 struct __make_tuple_types<tuple<_Types...>, _Ep, 0, true> {
-  typedef _LIBCPP_NODEBUG __tuple_types<_Types...> type;
+  typedef _LIBCUDACXX_NODEBUG __tuple_types<_Types...> type;
 };
 
 template <class ..._Types, size_t _Ep>
 struct __make_tuple_types<__tuple_types<_Types...>, _Ep, 0, true> {
-  typedef _LIBCPP_NODEBUG __tuple_types<_Types...> type;
+  typedef _LIBCUDACXX_NODEBUG __tuple_types<_Types...> type;
 };
 
 template <bool ..._Preds>
@@ -452,14 +452,14 @@ struct __tuple_assignable<_Tp, _Up, true, true>
 
 
 template <size_t _Ip, class ..._Tp>
-struct _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, tuple<_Tp...> >
+struct _LIBCUDACXX_TEMPLATE_VIS tuple_element<_Ip, tuple<_Tp...> >
 {
-    typedef _LIBCPP_NODEBUG typename tuple_element<_Ip, __tuple_types<_Tp...> >::type type;
+    typedef _LIBCUDACXX_NODEBUG typename tuple_element<_Ip, __tuple_types<_Tp...> >::type type;
 };
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <size_t _Ip, class ..._Tp>
-using tuple_element_t _LIBCPP_NODEBUG = typename tuple_element <_Ip, _Tp...>::type;
+using tuple_element_t _LIBCUDACXX_NODEBUG = typename tuple_element <_Ip, _Tp...>::type;
 #endif
 
 template <bool _IsTuple, class _SizeTrait, size_t _Expected>
@@ -470,12 +470,12 @@ struct __tuple_like_with_size_imp<true, _SizeTrait, _Expected>
     : integral_constant<bool, _SizeTrait::value == _Expected> {};
 
 template <class _Tuple, size_t _ExpectedSize, class _RawTuple = __uncvref_t<_Tuple> >
-using __tuple_like_with_size _LIBCPP_NODEBUG = __tuple_like_with_size_imp<
+using __tuple_like_with_size _LIBCUDACXX_NODEBUG = __tuple_like_with_size_imp<
                                    __tuple_like<_RawTuple>::value,
                                    tuple_size<_RawTuple>, _ExpectedSize
                               >;
 
-struct _LIBCPP_TYPE_VIS __check_tuple_constructor_fail {
+struct _LIBCUDACXX_TYPE_VIS __check_tuple_constructor_fail {
 
     static constexpr bool __enable_explicit_default() { return false; }
     static constexpr bool __enable_implicit_default() { return false; }
@@ -486,9 +486,9 @@ struct _LIBCPP_TYPE_VIS __check_tuple_constructor_fail {
     template <class ...>
     static constexpr bool __enable_assign() { return false; }
 };
-#endif // !defined(_LIBCPP_CXX03_LANG)
+#endif // !defined(_LIBCUDACXX_CXX03_LANG)
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 
 template <bool _CanCopy, bool _CanMove>
 struct __sfinae_ctor_base {};
@@ -543,8 +543,8 @@ struct __sfinae_assign_base<false, true> {
   __sfinae_assign_base& operator=(__sfinae_assign_base const&) = delete;
   __sfinae_assign_base& operator=(__sfinae_assign_base&&) = default;
 };
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCUDACXX_STD_VER > 14
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TUPLE
+#endif // _LIBCUDACXX___TUPLE

diff  --git a/libcxx/include/__type_traits/add_const.h b/libcxx/include/__type_traits/add_const.h
index c616a13f8408..66bf7d22b6f1 100644
--- a/libcxx/include/__type_traits/add_const.h
+++ b/libcxx/include/__type_traits/add_const.h
@@ -6,25 +6,25 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_ADD_CONST_H
-#define _LIBCPP___TYPE_TRAITS_ADD_CONST_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_ADD_CONST_H
+#define _LIBCUDACXX___TYPE_TRAITS_ADD_CONST_H
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS add_const {
-  typedef _LIBCPP_NODEBUG const _Tp type;
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS add_const {
+  typedef _LIBCUDACXX_NODEBUG const _Tp type;
 };
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <class _Tp> using add_const_t = typename add_const<_Tp>::type;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_ADD_CONST_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_ADD_CONST_H

diff  --git a/libcxx/include/__type_traits/add_cv.h b/libcxx/include/__type_traits/add_cv.h
index 8a85353f16c0..8f94750d5d72 100644
--- a/libcxx/include/__type_traits/add_cv.h
+++ b/libcxx/include/__type_traits/add_cv.h
@@ -6,25 +6,25 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_ADD_CV_H
-#define _LIBCPP___TYPE_TRAITS_ADD_CV_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_ADD_CV_H
+#define _LIBCUDACXX___TYPE_TRAITS_ADD_CV_H
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS add_cv {
-  typedef _LIBCPP_NODEBUG const volatile _Tp type;
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS add_cv {
+  typedef _LIBCUDACXX_NODEBUG const volatile _Tp type;
 };
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <class _Tp> using add_cv_t = typename add_cv<_Tp>::type;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_ADD_CV_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_ADD_CV_H

diff  --git a/libcxx/include/__type_traits/add_lvalue_reference.h b/libcxx/include/__type_traits/add_lvalue_reference.h
index 0d1ee4185c8c..66010d1ecf7e 100644
--- a/libcxx/include/__type_traits/add_lvalue_reference.h
+++ b/libcxx/include/__type_traits/add_lvalue_reference.h
@@ -6,28 +6,28 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_ADD_LVALUE_REFERENCE_H
-#define _LIBCPP___TYPE_TRAITS_ADD_LVALUE_REFERENCE_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_ADD_LVALUE_REFERENCE_H
+#define _LIBCUDACXX___TYPE_TRAITS_ADD_LVALUE_REFERENCE_H
 
 #include <__config>
 #include <__type_traits/is_referenceable.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-template <class _Tp, bool = __is_referenceable<_Tp>::value> struct __add_lvalue_reference_impl            { typedef _LIBCPP_NODEBUG _Tp  type; };
-template <class _Tp                                       > struct __add_lvalue_reference_impl<_Tp, true> { typedef _LIBCPP_NODEBUG _Tp& type; };
+template <class _Tp, bool = __is_referenceable<_Tp>::value> struct __add_lvalue_reference_impl            { typedef _LIBCUDACXX_NODEBUG _Tp  type; };
+template <class _Tp                                       > struct __add_lvalue_reference_impl<_Tp, true> { typedef _LIBCUDACXX_NODEBUG _Tp& type; };
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS add_lvalue_reference
-{typedef _LIBCPP_NODEBUG typename  __add_lvalue_reference_impl<_Tp>::type type;};
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS add_lvalue_reference
+{typedef _LIBCUDACXX_NODEBUG typename  __add_lvalue_reference_impl<_Tp>::type type;};
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <class _Tp> using add_lvalue_reference_t = typename add_lvalue_reference<_Tp>::type;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_ADD_LVALUE_REFERENCE_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_ADD_LVALUE_REFERENCE_H

diff  --git a/libcxx/include/__type_traits/add_pointer.h b/libcxx/include/__type_traits/add_pointer.h
index aea2490c5d0c..25062a80ce39 100644
--- a/libcxx/include/__type_traits/add_pointer.h
+++ b/libcxx/include/__type_traits/add_pointer.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_ADD_POINTER_H
-#define _LIBCPP___TYPE_TRAITS_ADD_POINTER_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_ADD_POINTER_H
+#define _LIBCUDACXX___TYPE_TRAITS_ADD_POINTER_H
 
 #include <__config>
 #include <__type_traits/is_referenceable.h>
@@ -15,27 +15,27 @@
 #include <__type_traits/remove_cv.h>
 #include <__type_traits/remove_reference.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Tp,
         bool = __is_referenceable<_Tp>::value ||
                 _IsSame<typename remove_cv<_Tp>::type, void>::value>
 struct __add_pointer_impl
-    {typedef _LIBCPP_NODEBUG typename remove_reference<_Tp>::type* type;};
+    {typedef _LIBCUDACXX_NODEBUG typename remove_reference<_Tp>::type* type;};
 template <class _Tp> struct __add_pointer_impl<_Tp, false>
-    {typedef _LIBCPP_NODEBUG _Tp type;};
+    {typedef _LIBCUDACXX_NODEBUG _Tp type;};
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS add_pointer
-    {typedef _LIBCPP_NODEBUG typename __add_pointer_impl<_Tp>::type type;};
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS add_pointer
+    {typedef _LIBCUDACXX_NODEBUG typename __add_pointer_impl<_Tp>::type type;};
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <class _Tp> using add_pointer_t = typename add_pointer<_Tp>::type;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_ADD_POINTER_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_ADD_POINTER_H

diff  --git a/libcxx/include/__type_traits/add_rvalue_reference.h b/libcxx/include/__type_traits/add_rvalue_reference.h
index b2a1428095d8..468effc2fe52 100644
--- a/libcxx/include/__type_traits/add_rvalue_reference.h
+++ b/libcxx/include/__type_traits/add_rvalue_reference.h
@@ -6,28 +6,28 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_ADD_RVALUE_REFERENCE_H
-#define _LIBCPP___TYPE_TRAITS_ADD_RVALUE_REFERENCE_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_ADD_RVALUE_REFERENCE_H
+#define _LIBCUDACXX___TYPE_TRAITS_ADD_RVALUE_REFERENCE_H
 
 #include <__config>
 #include <__type_traits/is_referenceable.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-template <class _Tp, bool = __is_referenceable<_Tp>::value> struct __add_rvalue_reference_impl            { typedef _LIBCPP_NODEBUG _Tp   type; };
-template <class _Tp                                       > struct __add_rvalue_reference_impl<_Tp, true> { typedef _LIBCPP_NODEBUG _Tp&& type; };
+template <class _Tp, bool = __is_referenceable<_Tp>::value> struct __add_rvalue_reference_impl            { typedef _LIBCUDACXX_NODEBUG _Tp   type; };
+template <class _Tp                                       > struct __add_rvalue_reference_impl<_Tp, true> { typedef _LIBCUDACXX_NODEBUG _Tp&& type; };
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS add_rvalue_reference
-{typedef _LIBCPP_NODEBUG typename __add_rvalue_reference_impl<_Tp>::type type;};
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS add_rvalue_reference
+{typedef _LIBCUDACXX_NODEBUG typename __add_rvalue_reference_impl<_Tp>::type type;};
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <class _Tp> using add_rvalue_reference_t = typename add_rvalue_reference<_Tp>::type;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_ADD_RVALUE_REFERENCE_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_ADD_RVALUE_REFERENCE_H

diff  --git a/libcxx/include/__type_traits/add_volatile.h b/libcxx/include/__type_traits/add_volatile.h
index 73b1cb8418fe..1021487ba398 100644
--- a/libcxx/include/__type_traits/add_volatile.h
+++ b/libcxx/include/__type_traits/add_volatile.h
@@ -6,25 +6,25 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_ADD_VOLATILE_H
-#define _LIBCPP___TYPE_TRAITS_ADD_VOLATILE_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_ADD_VOLATILE_H
+#define _LIBCUDACXX___TYPE_TRAITS_ADD_VOLATILE_H
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS add_volatile {
-  typedef _LIBCPP_NODEBUG volatile _Tp type;
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS add_volatile {
+  typedef _LIBCUDACXX_NODEBUG volatile _Tp type;
 };
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <class _Tp> using add_volatile_t = typename add_volatile<_Tp>::type;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_ADD_VOLATILE_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_ADD_VOLATILE_H

diff  --git a/libcxx/include/__type_traits/aligned_storage.h b/libcxx/include/__type_traits/aligned_storage.h
index 9659a90ae50c..c912b7df19a9 100644
--- a/libcxx/include/__type_traits/aligned_storage.h
+++ b/libcxx/include/__type_traits/aligned_storage.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_ALIGNED_STORAGE_H
-#define _LIBCPP___TYPE_TRAITS_ALIGNED_STORAGE_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_ALIGNED_STORAGE_H
+#define _LIBCUDACXX___TYPE_TRAITS_ALIGNED_STORAGE_H
 
 #include <__config>
 #include <__type_traits/conditional.h>
@@ -16,16 +16,16 @@
 #include <__type_traits/type_list.h>
 #include <cstddef>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Tp>
 struct __align_type
 {
-    static const size_t value = _LIBCPP_PREFERRED_ALIGNOF(_Tp);
+    static const size_t value = _LIBCUDACXX_PREFERRED_ALIGNOF(_Tp);
     typedef _Tp type;
 };
 
@@ -91,7 +91,7 @@ struct __find_max_align<__type_list<_Hp, _Tp>, _Len>
     : public integral_constant<size_t, __select_align<_Len, _Hp::value, __find_max_align<_Tp, _Len>::value>::value> {};
 
 template <size_t _Len, size_t _Align = __find_max_align<__all_types, _Len>::value>
-struct _LIBCPP_TEMPLATE_VIS aligned_storage
+struct _LIBCUDACXX_TEMPLATE_VIS aligned_storage
 {
     typedef typename __find_pod<__all_types, _Align>::type _Aligner;
     union type
@@ -101,14 +101,14 @@ struct _LIBCPP_TEMPLATE_VIS aligned_storage
     };
 };
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <size_t _Len, size_t _Align = __find_max_align<__all_types, _Len>::value>
     using aligned_storage_t = typename aligned_storage<_Len, _Align>::type;
 #endif
 
 #define _CREATE_ALIGNED_STORAGE_SPECIALIZATION(n) \
 template <size_t _Len>\
-struct _LIBCPP_TEMPLATE_VIS aligned_storage<_Len, n>\
+struct _LIBCUDACXX_TEMPLATE_VIS aligned_storage<_Len, n>\
 {\
     struct _ALIGNAS(n) type\
     {\
@@ -131,12 +131,12 @@ _CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x800);
 _CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x1000);
 _CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x2000);
 // PE/COFF does not support alignment beyond 8192 (=0x2000)
-#if !defined(_LIBCPP_OBJECT_FORMAT_COFF)
+#if !defined(_LIBCUDACXX_OBJECT_FORMAT_COFF)
 _CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x4000);
-#endif // !defined(_LIBCPP_OBJECT_FORMAT_COFF)
+#endif // !defined(_LIBCUDACXX_OBJECT_FORMAT_COFF)
 
 #undef _CREATE_ALIGNED_STORAGE_SPECIALIZATION
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_ALIGNED_STORAGE_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_ALIGNED_STORAGE_H

diff  --git a/libcxx/include/__type_traits/aligned_union.h b/libcxx/include/__type_traits/aligned_union.h
index 31eb9353a9e2..c5bb41f05d44 100644
--- a/libcxx/include/__type_traits/aligned_union.h
+++ b/libcxx/include/__type_traits/aligned_union.h
@@ -6,19 +6,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_ALIGNED_UNION_H
-#define _LIBCPP___TYPE_TRAITS_ALIGNED_UNION_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_ALIGNED_UNION_H
+#define _LIBCUDACXX___TYPE_TRAITS_ALIGNED_UNION_H
 
 #include <__config>
 #include <__type_traits/aligned_storage.h>
 #include <__type_traits/integral_constant.h>
 #include <cstddef>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <size_t _I0, size_t ..._In>
 struct __static_max;
@@ -39,17 +39,17 @@ struct __static_max<_I0, _I1, _In...>
 template <size_t _Len, class _Type0, class ..._Types>
 struct aligned_union
 {
-    static const size_t alignment_value = __static_max<_LIBCPP_PREFERRED_ALIGNOF(_Type0),
-                                                       _LIBCPP_PREFERRED_ALIGNOF(_Types)...>::value;
+    static const size_t alignment_value = __static_max<_LIBCUDACXX_PREFERRED_ALIGNOF(_Type0),
+                                                       _LIBCUDACXX_PREFERRED_ALIGNOF(_Types)...>::value;
     static const size_t __len = __static_max<_Len, sizeof(_Type0),
                                              sizeof(_Types)...>::value;
     typedef typename aligned_storage<__len, alignment_value>::type type;
 };
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <size_t _Len, class ..._Types> using aligned_union_t = typename aligned_union<_Len, _Types...>::type;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_ALIGNED_UNION_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_ALIGNED_UNION_H

diff  --git a/libcxx/include/__type_traits/alignment_of.h b/libcxx/include/__type_traits/alignment_of.h
index 65c603058ffa..a99ae740f8c8 100644
--- a/libcxx/include/__type_traits/alignment_of.h
+++ b/libcxx/include/__type_traits/alignment_of.h
@@ -6,27 +6,27 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_ALIGNMENT_OF_H
-#define _LIBCPP___TYPE_TRAITS_ALIGNMENT_OF_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_ALIGNMENT_OF_H
+#define _LIBCUDACXX___TYPE_TRAITS_ALIGNMENT_OF_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 #include <cstddef>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS alignment_of
-    : public integral_constant<size_t, _LIBCPP_ALIGNOF(_Tp)> {};
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS alignment_of
+    : public integral_constant<size_t, _LIBCUDACXX_ALIGNOF(_Tp)> {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr size_t alignment_of_v = alignment_of<_Tp>::value;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_ALIGNMENT_OF_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_ALIGNMENT_OF_H

diff  --git a/libcxx/include/__type_traits/apply_cv.h b/libcxx/include/__type_traits/apply_cv.h
index 4a5aab48a723..6a6fa03db044 100644
--- a/libcxx/include/__type_traits/apply_cv.h
+++ b/libcxx/include/__type_traits/apply_cv.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_APPLY_CV_H
-#define _LIBCPP___TYPE_TRAITS_APPLY_CV_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_APPLY_CV_H
+#define _LIBCUDACXX___TYPE_TRAITS_APPLY_CV_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
@@ -16,23 +16,23 @@
 #include <__type_traits/remove_reference.h>
 #include <cstddef>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Tp, class _Up, bool = is_const<typename remove_reference<_Tp>::type>::value,
                              bool = is_volatile<typename remove_reference<_Tp>::type>::value>
 struct __apply_cv
 {
-    typedef _LIBCPP_NODEBUG _Up type;
+    typedef _LIBCUDACXX_NODEBUG _Up type;
 };
 
 template <class _Tp, class _Up>
 struct __apply_cv<_Tp, _Up, true, false>
 {
-    typedef _LIBCPP_NODEBUG const _Up type;
+    typedef _LIBCUDACXX_NODEBUG const _Up type;
 };
 
 template <class _Tp, class _Up>
@@ -71,6 +71,6 @@ struct __apply_cv<_Tp&, _Up, true, true>
     typedef const volatile _Up& type;
 };
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_APPLY_CV_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_APPLY_CV_H

diff  --git a/libcxx/include/__type_traits/common_reference.h b/libcxx/include/__type_traits/common_reference.h
index 559d39858ec8..5e5af230a1f7 100644
--- a/libcxx/include/__type_traits/common_reference.h
+++ b/libcxx/include/__type_traits/common_reference.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_COMMON_REFERENCE_H
-#define _LIBCPP___TYPE_TRAITS_COMMON_REFERENCE_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_COMMON_REFERENCE_H
+#define _LIBCUDACXX___TYPE_TRAITS_COMMON_REFERENCE_H
 
 #include <__config>
 #include <__type_traits/common_type.h>
@@ -20,14 +20,14 @@
 #include <__type_traits/remove_reference.h>
 #include <__utility/declval.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 // common_reference
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 // Let COND_RES(X, Y) be:
 template <class _Xp, class _Yp>
 using __cond_res =
@@ -181,8 +181,8 @@ struct common_reference<_Tp, _Up, _Vp, _Rest...>
 // bullet 5 - Otherwise, there shall be no member `type`.
 template <class...> struct common_reference {};
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_COMMON_REFERENCE_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_COMMON_REFERENCE_H

diff  --git a/libcxx/include/__type_traits/common_type.h b/libcxx/include/__type_traits/common_type.h
index 55321e9936dd..24e167668236 100644
--- a/libcxx/include/__type_traits/common_type.h
+++ b/libcxx/include/__type_traits/common_type.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_COMMON_TYPE_H
-#define _LIBCPP___TYPE_TRAITS_COMMON_TYPE_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_COMMON_TYPE_H
+#define _LIBCUDACXX___TYPE_TRAITS_COMMON_TYPE_H
 
 #include <__config>
 #include <__type_traits/conditional.h>
@@ -17,13 +17,13 @@
 #include <__type_traits/void_t.h>
 #include <__utility/declval.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 // Let COND_RES(X, Y) be:
 template <class _Tp, class _Up>
 using __cond_type = decltype(false ? declval<_Tp>() : declval<_Up>());
@@ -52,7 +52,7 @@ struct __common_type2_imp<_Tp, _Up,
                                             true ? declval<_Tp>() : declval<_Up>()
                                             )>::type>
 {
-  typedef _LIBCPP_NODEBUG typename decay<decltype(
+  typedef _LIBCUDACXX_NODEBUG typename decay<decltype(
                          true ? declval<_Tp>() : declval<_Up>()
                          )>::type type;
 };
@@ -61,14 +61,14 @@ template <class, class = void>
 struct __common_type_impl {};
 
 // Clang provides variadic templates in C++03 as an extension.
-#if !defined(_LIBCPP_CXX03_LANG) || defined(__clang__)
-# define _LIBCPP_OPTIONAL_PACK(...) , __VA_ARGS__
+#if !defined(_LIBCUDACXX_CXX03_LANG) || defined(__clang__)
+# define _LIBCUDACXX_OPTIONAL_PACK(...) , __VA_ARGS__
 template <class... _Tp>
 struct __common_types;
 template <class... _Tp>
-struct _LIBCPP_TEMPLATE_VIS common_type;
+struct _LIBCUDACXX_TEMPLATE_VIS common_type;
 #else
-# define _LIBCPP_OPTIONAL_PACK(...)
+# define _LIBCUDACXX_OPTIONAL_PACK(...)
 struct __no_arg;
 template <class _Tp, class _Up, class = __no_arg>
 struct __common_types;
@@ -78,7 +78,7 @@ struct common_type {
   static_assert(sizeof(_Unused) == 0,
                 "common_type accepts at most 3 arguments in C++03");
 };
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
 template <class _Tp, class _Up>
 struct __common_type_impl<
@@ -88,30 +88,30 @@ struct __common_type_impl<
   typedef typename common_type<_Tp, _Up>::type type;
 };
 
-template <class _Tp, class _Up, class _Vp _LIBCPP_OPTIONAL_PACK(class... _Rest)>
+template <class _Tp, class _Up, class _Vp _LIBCUDACXX_OPTIONAL_PACK(class... _Rest)>
 struct __common_type_impl<
-    __common_types<_Tp, _Up, _Vp _LIBCPP_OPTIONAL_PACK(_Rest...)>,
+    __common_types<_Tp, _Up, _Vp _LIBCUDACXX_OPTIONAL_PACK(_Rest...)>,
     typename __void_t<typename common_type<_Tp, _Up>::type>::type>
     : __common_type_impl<__common_types<typename common_type<_Tp, _Up>::type,
-                                        _Vp _LIBCPP_OPTIONAL_PACK(_Rest...)> > {
+                                        _Vp _LIBCUDACXX_OPTIONAL_PACK(_Rest...)> > {
 };
 
 // bullet 1 - sizeof...(Tp) == 0
 
 template <>
-struct _LIBCPP_TEMPLATE_VIS common_type<> {};
+struct _LIBCUDACXX_TEMPLATE_VIS common_type<> {};
 
 // bullet 2 - sizeof...(Tp) == 1
 
 template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS common_type<_Tp>
+struct _LIBCUDACXX_TEMPLATE_VIS common_type<_Tp>
     : public common_type<_Tp, _Tp> {};
 
 // bullet 3 - sizeof...(Tp) == 2
 
 // sub-bullet 1 - "If is_same_v<T1, D1> is false or ..."
 template <class _Tp, class _Up>
-struct _LIBCPP_TEMPLATE_VIS common_type<_Tp, _Up>
+struct _LIBCUDACXX_TEMPLATE_VIS common_type<_Tp, _Up>
     : conditional<
         _IsSame<_Tp, typename decay<_Tp>::type>::value && _IsSame<_Up, typename decay<_Up>::type>::value,
         __common_type2_imp<_Tp, _Up>,
@@ -121,18 +121,18 @@ struct _LIBCPP_TEMPLATE_VIS common_type<_Tp, _Up>
 
 // bullet 4 - sizeof...(Tp) > 2
 
-template <class _Tp, class _Up, class _Vp _LIBCPP_OPTIONAL_PACK(class... _Rest)>
-struct _LIBCPP_TEMPLATE_VIS
-    common_type<_Tp, _Up, _Vp _LIBCPP_OPTIONAL_PACK(_Rest...)>
+template <class _Tp, class _Up, class _Vp _LIBCUDACXX_OPTIONAL_PACK(class... _Rest)>
+struct _LIBCUDACXX_TEMPLATE_VIS
+    common_type<_Tp, _Up, _Vp _LIBCUDACXX_OPTIONAL_PACK(_Rest...)>
     : __common_type_impl<
-          __common_types<_Tp, _Up, _Vp _LIBCPP_OPTIONAL_PACK(_Rest...)> > {};
+          __common_types<_Tp, _Up, _Vp _LIBCUDACXX_OPTIONAL_PACK(_Rest...)> > {};
 
-#undef _LIBCPP_OPTIONAL_PACK
+#undef _LIBCUDACXX_OPTIONAL_PACK
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <class ..._Tp> using common_type_t = typename common_type<_Tp...>::type;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_COMMON_TYPE_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_COMMON_TYPE_H

diff  --git a/libcxx/include/__type_traits/conditional.h b/libcxx/include/__type_traits/conditional.h
index 4b1a560ddc7c..91a5fe78eda8 100644
--- a/libcxx/include/__type_traits/conditional.h
+++ b/libcxx/include/__type_traits/conditional.h
@@ -6,16 +6,16 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_CONDITIONAL_H
-#define _LIBCPP___TYPE_TRAITS_CONDITIONAL_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_CONDITIONAL_H
+#define _LIBCUDACXX___TYPE_TRAITS_CONDITIONAL_H
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <bool>
 struct _IfImpl;
@@ -23,24 +23,24 @@ struct _IfImpl;
 template <>
 struct _IfImpl<true> {
   template <class _IfRes, class _ElseRes>
-  using _Select _LIBCPP_NODEBUG = _IfRes;
+  using _Select _LIBCUDACXX_NODEBUG = _IfRes;
 };
 
 template <>
 struct _IfImpl<false> {
   template <class _IfRes, class _ElseRes>
-  using _Select _LIBCPP_NODEBUG = _ElseRes;
+  using _Select _LIBCUDACXX_NODEBUG = _ElseRes;
 };
 
 template <bool _Cond, class _IfRes, class _ElseRes>
-using _If _LIBCPP_NODEBUG = typename _IfImpl<_Cond>::template _Select<_IfRes, _ElseRes>;
+using _If _LIBCUDACXX_NODEBUG = typename _IfImpl<_Cond>::template _Select<_IfRes, _ElseRes>;
 
 template <bool _Bp, class _If, class _Then>
-    struct _LIBCPP_TEMPLATE_VIS conditional {typedef _If type;};
+    struct _LIBCUDACXX_TEMPLATE_VIS conditional {typedef _If type;};
 template <class _If, class _Then>
-    struct _LIBCPP_TEMPLATE_VIS conditional<false, _If, _Then> {typedef _Then type;};
+    struct _LIBCUDACXX_TEMPLATE_VIS conditional<false, _If, _Then> {typedef _Then type;};
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <bool _Bp, class _IfRes, class _ElseRes>
 using conditional_t = typename conditional<_Bp, _IfRes, _ElseRes>::type;
 #endif
@@ -48,6 +48,6 @@ using conditional_t = typename conditional<_Bp, _IfRes, _ElseRes>::type;
 // Helper so we can use "conditional_t" in all language versions.
 template <bool _Bp, class _If, class _Then> using __conditional_t = typename conditional<_Bp, _If, _Then>::type;
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_CONDITIONAL_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_CONDITIONAL_H

diff  --git a/libcxx/include/__type_traits/conjunction.h b/libcxx/include/__type_traits/conjunction.h
index 45fe5cdca351..6260d771df35 100644
--- a/libcxx/include/__type_traits/conjunction.h
+++ b/libcxx/include/__type_traits/conjunction.h
@@ -6,21 +6,21 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_CONJUNCTION_H
-#define _LIBCPP___TYPE_TRAITS_CONJUNCTION_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_CONJUNCTION_H
+#define _LIBCUDACXX___TYPE_TRAITS_CONJUNCTION_H
 
 #include <__config>
 #include <__type_traits/conditional.h>
 #include <__type_traits/enable_if.h>
 #include <__type_traits/integral_constant.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 
 template <class _Arg, class... _Args>
 struct __conjunction_impl {
@@ -38,7 +38,7 @@ struct conjunction : __conjunction_impl<true_type, _Args...>::type {};
 template<class... _Args>
 inline constexpr bool conjunction_v = conjunction<_Args...>::value;
 
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCUDACXX_STD_VER > 14
 
 template <class...>
 using __expand_to_true = true_type;
@@ -50,8 +50,8 @@ template <class...>
 false_type __and_helper(...);
 
 template <class... _Pred>
-using _And _LIBCPP_NODEBUG = decltype(__and_helper<_Pred...>(0));
+using _And _LIBCUDACXX_NODEBUG = decltype(__and_helper<_Pred...>(0));
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_CONJUNCTION_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_CONJUNCTION_H

diff  --git a/libcxx/include/__type_traits/copy_cv.h b/libcxx/include/__type_traits/copy_cv.h
index 8e9bfe0a522f..8810b0cff59c 100644
--- a/libcxx/include/__type_traits/copy_cv.h
+++ b/libcxx/include/__type_traits/copy_cv.h
@@ -6,19 +6,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_COPY_CV_H
-#define _LIBCPP___TYPE_TRAITS_COPY_CV_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_COPY_CV_H
+#define _LIBCUDACXX___TYPE_TRAITS_COPY_CV_H
 
 #include <__config>
 #include <__type_traits/add_const.h>
 #include <__type_traits/add_cv.h>
 #include <__type_traits/add_volatile.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 // Let COPYCV(FROM, TO) be an alias for type TO with the addition of FROM's
 // top-level cv-qualifiers.
@@ -49,6 +49,6 @@ struct __copy_cv<const volatile _From, _To>
 template <class _From, class _To>
 using __copy_cv_t = typename __copy_cv<_From, _To>::type;
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_COPY_CV_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_COPY_CV_H

diff  --git a/libcxx/include/__type_traits/copy_cvref.h b/libcxx/include/__type_traits/copy_cvref.h
index 69b97ac1cb17..182b2eb7f771 100644
--- a/libcxx/include/__type_traits/copy_cvref.h
+++ b/libcxx/include/__type_traits/copy_cvref.h
@@ -6,19 +6,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_COPY_CVREF_H
-#define _LIBCPP___TYPE_TRAITS_COPY_CVREF_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_COPY_CVREF_H
+#define _LIBCUDACXX___TYPE_TRAITS_COPY_CVREF_H
 
 #include <__config>
 #include <__type_traits/add_lvalue_reference.h>
 #include <__type_traits/add_rvalue_reference.h>
 #include <__type_traits/copy_cv.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _From, class _To>
 struct __copy_cvref
@@ -41,6 +41,6 @@ struct __copy_cvref<_From&&, _To>
 template <class _From, class _To>
 using __copy_cvref_t = typename __copy_cvref<_From, _To>::type;
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_COPY_CVREF_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_COPY_CVREF_H

diff  --git a/libcxx/include/__type_traits/decay.h b/libcxx/include/__type_traits/decay.h
index d47ad03fe008..3dfa8bd22dfb 100644
--- a/libcxx/include/__type_traits/decay.h
+++ b/libcxx/include/__type_traits/decay.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_DECAY_H
-#define _LIBCPP___TYPE_TRAITS_DECAY_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_DECAY_H
+#define _LIBCUDACXX___TYPE_TRAITS_DECAY_H
 
 #include <__config>
 #include <__type_traits/add_pointer.h>
@@ -20,21 +20,21 @@
 #include <__type_traits/remove_extent.h>
 #include <__type_traits/remove_reference.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Up, bool>
 struct __decay {
-    typedef _LIBCPP_NODEBUG typename remove_cv<_Up>::type type;
+    typedef _LIBCUDACXX_NODEBUG typename remove_cv<_Up>::type type;
 };
 
 template <class _Up>
 struct __decay<_Up, true> {
 public:
-    typedef _LIBCPP_NODEBUG typename conditional
+    typedef _LIBCUDACXX_NODEBUG typename conditional
                      <
                          is_array<_Up>::value,
                          typename remove_extent<_Up>::type*,
@@ -48,18 +48,18 @@ struct __decay<_Up, true> {
 };
 
 template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS decay
+struct _LIBCUDACXX_TEMPLATE_VIS decay
 {
 private:
-    typedef _LIBCPP_NODEBUG typename remove_reference<_Tp>::type _Up;
+    typedef _LIBCUDACXX_NODEBUG typename remove_reference<_Tp>::type _Up;
 public:
-    typedef _LIBCPP_NODEBUG typename __decay<_Up, __is_referenceable<_Up>::value>::type type;
+    typedef _LIBCUDACXX_NODEBUG typename __decay<_Up, __is_referenceable<_Up>::value>::type type;
 };
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <class _Tp> using decay_t = typename decay<_Tp>::type;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_DECAY_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_DECAY_H

diff  --git a/libcxx/include/__type_traits/disjunction.h b/libcxx/include/__type_traits/disjunction.h
index 6c6d1a8f21b6..0f11e5e6d69d 100644
--- a/libcxx/include/__type_traits/disjunction.h
+++ b/libcxx/include/__type_traits/disjunction.h
@@ -6,18 +6,18 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_DISJUNCTION_H
-#define _LIBCPP___TYPE_TRAITS_DISJUNCTION_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_DISJUNCTION_H
+#define _LIBCUDACXX___TYPE_TRAITS_DISJUNCTION_H
 
 #include <__config>
 #include <__type_traits/conditional.h>
 #include <__type_traits/integral_constant.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <bool>
 struct _OrImpl;
@@ -25,7 +25,7 @@ struct _OrImpl;
 template <>
 struct _OrImpl<true> {
   template <class _Res, class _First, class... _Rest>
-  using _Result _LIBCPP_NODEBUG =
+  using _Result _LIBCUDACXX_NODEBUG =
       typename _OrImpl<!bool(_First::value) && sizeof...(_Rest) != 0>::template _Result<_First, _Rest...>;
 };
 
@@ -36,9 +36,9 @@ struct _OrImpl<false> {
 };
 
 template <class... _Args>
-using _Or _LIBCPP_NODEBUG = typename _OrImpl<sizeof...(_Args) != 0>::template _Result<false_type, _Args...>;
+using _Or _LIBCUDACXX_NODEBUG = typename _OrImpl<sizeof...(_Args) != 0>::template _Result<false_type, _Args...>;
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 
 template <class... _Args>
 struct disjunction : _Or<_Args...> {};
@@ -46,8 +46,8 @@ struct disjunction : _Or<_Args...> {};
 template <class... _Args>
 inline constexpr bool disjunction_v = _Or<_Args...>::value;
 
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCUDACXX_STD_VER > 14
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_DISJUNCTION_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_DISJUNCTION_H

diff  --git a/libcxx/include/__type_traits/enable_if.h b/libcxx/include/__type_traits/enable_if.h
index c5e8df45ea58..fb6bb63936e6 100644
--- a/libcxx/include/__type_traits/enable_if.h
+++ b/libcxx/include/__type_traits/enable_if.h
@@ -6,26 +6,26 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_ENABLE_IF_H
-#define _LIBCPP___TYPE_TRAITS_ENABLE_IF_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_ENABLE_IF_H
+#define _LIBCUDACXX___TYPE_TRAITS_ENABLE_IF_H
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-template <bool, class _Tp = void> struct _LIBCPP_TEMPLATE_VIS enable_if {};
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS enable_if<true, _Tp> {typedef _Tp type;};
+template <bool, class _Tp = void> struct _LIBCUDACXX_TEMPLATE_VIS enable_if {};
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS enable_if<true, _Tp> {typedef _Tp type;};
 
-template <bool _Bp, class _Tp = void> using __enable_if_t _LIBCPP_NODEBUG = typename enable_if<_Bp, _Tp>::type;
+template <bool _Bp, class _Tp = void> using __enable_if_t _LIBCUDACXX_NODEBUG = typename enable_if<_Bp, _Tp>::type;
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <bool _Bp, class _Tp = void> using enable_if_t = typename enable_if<_Bp, _Tp>::type;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_ENABLE_IF_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_ENABLE_IF_H

diff  --git a/libcxx/include/__type_traits/extent.h b/libcxx/include/__type_traits/extent.h
index 0a4d84e05e23..7697aa7eec2a 100644
--- a/libcxx/include/__type_traits/extent.h
+++ b/libcxx/include/__type_traits/extent.h
@@ -6,50 +6,50 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_EXTENT_H
-#define _LIBCPP___TYPE_TRAITS_EXTENT_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_EXTENT_H
+#define _LIBCUDACXX___TYPE_TRAITS_EXTENT_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 #include <cstddef>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 #if __has_builtin(__array_extent)
 
 template<class _Tp, size_t _Dim = 0>
-struct _LIBCPP_TEMPLATE_VIS extent
+struct _LIBCUDACXX_TEMPLATE_VIS extent
     : integral_constant<size_t, __array_extent(_Tp, _Dim)> { };
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp, unsigned _Ip = 0>
 inline constexpr size_t extent_v = __array_extent(_Tp, _Ip);
 #endif
 
 #else // __has_builtin(__array_extent)
 
-template <class _Tp, unsigned _Ip = 0> struct _LIBCPP_TEMPLATE_VIS extent
+template <class _Tp, unsigned _Ip = 0> struct _LIBCUDACXX_TEMPLATE_VIS extent
     : public integral_constant<size_t, 0> {};
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS extent<_Tp[], 0>
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS extent<_Tp[], 0>
     : public integral_constant<size_t, 0> {};
-template <class _Tp, unsigned _Ip> struct _LIBCPP_TEMPLATE_VIS extent<_Tp[], _Ip>
+template <class _Tp, unsigned _Ip> struct _LIBCUDACXX_TEMPLATE_VIS extent<_Tp[], _Ip>
     : public integral_constant<size_t, extent<_Tp, _Ip-1>::value> {};
-template <class _Tp, size_t _Np> struct _LIBCPP_TEMPLATE_VIS extent<_Tp[_Np], 0>
+template <class _Tp, size_t _Np> struct _LIBCUDACXX_TEMPLATE_VIS extent<_Tp[_Np], 0>
     : public integral_constant<size_t, _Np> {};
-template <class _Tp, size_t _Np, unsigned _Ip> struct _LIBCPP_TEMPLATE_VIS extent<_Tp[_Np], _Ip>
+template <class _Tp, size_t _Np, unsigned _Ip> struct _LIBCUDACXX_TEMPLATE_VIS extent<_Tp[_Np], _Ip>
     : public integral_constant<size_t, extent<_Tp, _Ip-1>::value> {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp, unsigned _Ip = 0>
 inline constexpr size_t extent_v = extent<_Tp, _Ip>::value;
 #endif
 
 #endif // __has_builtin(__array_extent)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_EXTENT_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_EXTENT_H

diff  --git a/libcxx/include/__type_traits/has_unique_object_representation.h b/libcxx/include/__type_traits/has_unique_object_representation.h
index d6f75c9ce5c9..0ea1f56b4b7d 100644
--- a/libcxx/include/__type_traits/has_unique_object_representation.h
+++ b/libcxx/include/__type_traits/has_unique_object_representation.h
@@ -6,23 +6,23 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_HAS_UNIQUE_OBJECT_REPRESENTATION_H
-#define _LIBCPP___TYPE_TRAITS_HAS_UNIQUE_OBJECT_REPRESENTATION_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_HAS_UNIQUE_OBJECT_REPRESENTATION_H
+#define _LIBCUDACXX___TYPE_TRAITS_HAS_UNIQUE_OBJECT_REPRESENTATION_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 #include <__type_traits/remove_all_extents.h>
 #include <__type_traits/remove_cv.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS has_unique_object_representations
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS has_unique_object_representations
     : public integral_constant<bool,
        __has_unique_object_representations(remove_cv_t<remove_all_extents_t<_Tp>>)> {};
 
@@ -31,6 +31,6 @@ inline constexpr bool has_unique_object_representations_v = has_unique_object_re
 
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_HAS_UNIQUE_OBJECT_REPRESENTATION_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_HAS_UNIQUE_OBJECT_REPRESENTATION_H

diff  --git a/libcxx/include/__type_traits/has_virtual_destructor.h b/libcxx/include/__type_traits/has_virtual_destructor.h
index 1f0bd188b717..871d22950784 100644
--- a/libcxx/include/__type_traits/has_virtual_destructor.h
+++ b/libcxx/include/__type_traits/has_virtual_destructor.h
@@ -6,35 +6,35 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_HAS_VIRTUAL_DESTRUCTOR_H
-#define _LIBCPP___TYPE_TRAITS_HAS_VIRTUAL_DESTRUCTOR_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_HAS_VIRTUAL_DESTRUCTOR_H
+#define _LIBCUDACXX___TYPE_TRAITS_HAS_VIRTUAL_DESTRUCTOR_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 #if __has_builtin(__has_virtual_destructor)
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS has_virtual_destructor
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS has_virtual_destructor
     : public integral_constant<bool, __has_virtual_destructor(_Tp)> {};
 
 #else
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS has_virtual_destructor
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS has_virtual_destructor
     : public false_type {};
 
 #endif
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool has_virtual_destructor_v = has_virtual_destructor<_Tp>::value;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_HAS_VIRTUAL_DESTRUCTOR_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_HAS_VIRTUAL_DESTRUCTOR_H

diff  --git a/libcxx/include/__type_traits/integral_constant.h b/libcxx/include/__type_traits/integral_constant.h
index 2449d1a906e8..c54fa4b6f7a4 100644
--- a/libcxx/include/__type_traits/integral_constant.h
+++ b/libcxx/include/__type_traits/integral_constant.h
@@ -6,45 +6,45 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_INTEGRAL_CONSTANT_H
-#define _LIBCPP___TYPE_TRAITS_INTEGRAL_CONSTANT_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_INTEGRAL_CONSTANT_H
+#define _LIBCUDACXX___TYPE_TRAITS_INTEGRAL_CONSTANT_H
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Tp, _Tp __v>
-struct _LIBCPP_TEMPLATE_VIS integral_constant
+struct _LIBCUDACXX_TEMPLATE_VIS integral_constant
 {
-  static _LIBCPP_CONSTEXPR const _Tp      value = __v;
+  static _LIBCUDACXX_CONSTEXPR const _Tp      value = __v;
   typedef _Tp               value_type;
   typedef integral_constant type;
-  _LIBCPP_INLINE_VISIBILITY
-  _LIBCPP_CONSTEXPR operator value_type() const _NOEXCEPT {return value;}
-#if _LIBCPP_STD_VER > 11
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
+  _LIBCUDACXX_CONSTEXPR operator value_type() const _NOEXCEPT {return value;}
+#if _LIBCUDACXX_STD_VER > 11
+  _LIBCUDACXX_INLINE_VISIBILITY
   constexpr value_type operator ()() const _NOEXCEPT {return value;}
 #endif
 };
 
 template <class _Tp, _Tp __v>
-_LIBCPP_CONSTEXPR const _Tp integral_constant<_Tp, __v>::value;
+_LIBCUDACXX_CONSTEXPR const _Tp integral_constant<_Tp, __v>::value;
 
 typedef integral_constant<bool, true>  true_type;
 typedef integral_constant<bool, false> false_type;
 
 template <bool _Val>
-using _BoolConstant _LIBCPP_NODEBUG = integral_constant<bool, _Val>;
+using _BoolConstant _LIBCUDACXX_NODEBUG = integral_constant<bool, _Val>;
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <bool __b>
 using bool_constant = integral_constant<bool, __b>;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_INTEGRAL_CONSTANT_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_INTEGRAL_CONSTANT_H

diff  --git a/libcxx/include/__type_traits/is_abstract.h b/libcxx/include/__type_traits/is_abstract.h
index c74b3284f75d..b52c23be1835 100644
--- a/libcxx/include/__type_traits/is_abstract.h
+++ b/libcxx/include/__type_traits/is_abstract.h
@@ -6,26 +6,26 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_ABSTRACT_H
-#define _LIBCPP___TYPE_TRAITS_IS_ABSTRACT_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_ABSTRACT_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_ABSTRACT_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_abstract
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_abstract
     : public integral_constant<bool, __is_abstract(_Tp)> {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_abstract_v = __is_abstract(_Tp);
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_ABSTRACT_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_ABSTRACT_H

diff  --git a/libcxx/include/__type_traits/is_aggregate.h b/libcxx/include/__type_traits/is_aggregate.h
index ea9de84f96d0..116753b96a96 100644
--- a/libcxx/include/__type_traits/is_aggregate.h
+++ b/libcxx/include/__type_traits/is_aggregate.h
@@ -6,28 +6,28 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_AGGREGATE_H
-#define _LIBCPP___TYPE_TRAITS_IS_AGGREGATE_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_AGGREGATE_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_AGGREGATE_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS
 is_aggregate : public integral_constant<bool, __is_aggregate(_Tp)> {};
 
 template <class _Tp>
 inline constexpr bool is_aggregate_v = __is_aggregate(_Tp);
 
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCUDACXX_STD_VER > 14
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_AGGREGATE_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_AGGREGATE_H

diff  --git a/libcxx/include/__type_traits/is_arithmetic.h b/libcxx/include/__type_traits/is_arithmetic.h
index 6d631f41c7d4..e29134b7a1ce 100644
--- a/libcxx/include/__type_traits/is_arithmetic.h
+++ b/libcxx/include/__type_traits/is_arithmetic.h
@@ -6,29 +6,29 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_ARITHMETIC_H
-#define _LIBCPP___TYPE_TRAITS_IS_ARITHMETIC_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_ARITHMETIC_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_ARITHMETIC_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 #include <__type_traits/is_floating_point.h>
 #include <__type_traits/is_integral.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_arithmetic
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_arithmetic
     : public integral_constant<bool, is_integral<_Tp>::value      ||
                                      is_floating_point<_Tp>::value> {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_arithmetic_v = is_arithmetic<_Tp>::value;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_ARITHMETIC_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_ARITHMETIC_H

diff  --git a/libcxx/include/__type_traits/is_array.h b/libcxx/include/__type_traits/is_array.h
index bc105908982c..64c29cf4d8b8 100644
--- a/libcxx/include/__type_traits/is_array.h
+++ b/libcxx/include/__type_traits/is_array.h
@@ -6,47 +6,47 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_ARRAY_H
-#define _LIBCPP___TYPE_TRAITS_IS_ARRAY_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_ARRAY_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_ARRAY_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 #include <cstddef>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 // TODO: Clang incorrectly reports that __is_array is true for T[0].
 //       Re-enable the branch once https://llvm.org/PR54705 is fixed.
 #if __has_builtin(__is_array) && 0
 
 template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_array : _BoolConstant<__is_array(_Tp)> { };
+struct _LIBCUDACXX_TEMPLATE_VIS is_array : _BoolConstant<__is_array(_Tp)> { };
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_array_v = __is_array(_Tp);
 #endif
 
 #else
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_array
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_array
     : public false_type {};
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_array<_Tp[]>
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_array<_Tp[]>
     : public true_type {};
-template <class _Tp, size_t _Np> struct _LIBCPP_TEMPLATE_VIS is_array<_Tp[_Np]>
+template <class _Tp, size_t _Np> struct _LIBCUDACXX_TEMPLATE_VIS is_array<_Tp[_Np]>
     : public true_type {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_array_v = is_array<_Tp>::value;
 #endif
 
 #endif // __has_builtin(__is_array)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_ARRAY_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_ARRAY_H

diff  --git a/libcxx/include/__type_traits/is_assignable.h b/libcxx/include/__type_traits/is_assignable.h
index b8cb6df9df4a..aea18fc950c0 100644
--- a/libcxx/include/__type_traits/is_assignable.h
+++ b/libcxx/include/__type_traits/is_assignable.h
@@ -6,26 +6,26 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_ASSIGNABLE_H
-#define _LIBCPP___TYPE_TRAITS_IS_ASSIGNABLE_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_ASSIGNABLE_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_ASSIGNABLE_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-template<typename, typename _Tp> struct __select_2nd { typedef _LIBCPP_NODEBUG _Tp type; };
+template<typename, typename _Tp> struct __select_2nd { typedef _LIBCUDACXX_NODEBUG _Tp type; };
 
 #if __has_builtin(__is_assignable)
 
 template<class _Tp, class _Up>
-struct _LIBCPP_TEMPLATE_VIS is_assignable : _BoolConstant<__is_assignable(_Tp, _Up)> { };
+struct _LIBCUDACXX_TEMPLATE_VIS is_assignable : _BoolConstant<__is_assignable(_Tp, _Up)> { };
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp, class _Arg>
 inline constexpr bool is_assignable_v = __is_assignable(_Tp, _Arg);
 #endif
@@ -42,7 +42,7 @@ false_type __is_assignable_test(...);
 
 template <class _Tp, class _Arg, bool = is_void<_Tp>::value || is_void<_Arg>::value>
 struct __is_assignable_imp
-    : public decltype((_VSTD::__is_assignable_test<_Tp, _Arg>(0))) {};
+    : public decltype((_CUDA_VSTD::__is_assignable_test<_Tp, _Arg>(0))) {};
 
 template <class _Tp, class _Arg>
 struct __is_assignable_imp<_Tp, _Arg, true>
@@ -54,13 +54,13 @@ template <class _Tp, class _Arg>
 struct is_assignable
     : public __is_assignable_imp<_Tp, _Arg> {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp, class _Arg>
 inline constexpr bool is_assignable_v = is_assignable<_Tp, _Arg>::value;
 #endif
 
 #endif // __has_builtin(__is_assignable)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_ASSIGNABLE_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_ASSIGNABLE_H

diff  --git a/libcxx/include/__type_traits/is_base_of.h b/libcxx/include/__type_traits/is_base_of.h
index 0e6dec0b5ee0..202848736afd 100644
--- a/libcxx/include/__type_traits/is_base_of.h
+++ b/libcxx/include/__type_traits/is_base_of.h
@@ -6,27 +6,27 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_BASE_OF_H
-#define _LIBCPP___TYPE_TRAITS_IS_BASE_OF_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_BASE_OF_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_BASE_OF_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Bp, class _Dp>
-struct _LIBCPP_TEMPLATE_VIS is_base_of
+struct _LIBCUDACXX_TEMPLATE_VIS is_base_of
     : public integral_constant<bool, __is_base_of(_Bp, _Dp)> {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Bp, class _Dp>
 inline constexpr bool is_base_of_v = __is_base_of(_Bp, _Dp);
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_BASE_OF_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_BASE_OF_H

diff  --git a/libcxx/include/__type_traits/is_bounded_array.h b/libcxx/include/__type_traits/is_bounded_array.h
index 27de9dfd3864..b0ccad74ec52 100644
--- a/libcxx/include/__type_traits/is_bounded_array.h
+++ b/libcxx/include/__type_traits/is_bounded_array.h
@@ -6,26 +6,26 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_BOUNDED_ARRAY_H
-#define _LIBCPP___TYPE_TRAITS_IS_BOUNDED_ARRAY_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_BOUNDED_ARRAY_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_BOUNDED_ARRAY_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 #include <cstddef>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-template <class>                 struct _LIBCPP_TEMPLATE_VIS __libcpp_is_bounded_array           : false_type {};
-template <class _Tp, size_t _Np> struct _LIBCPP_TEMPLATE_VIS __libcpp_is_bounded_array<_Tp[_Np]> : true_type {};
+template <class>                 struct _LIBCUDACXX_TEMPLATE_VIS __LIBCUDACXX_is_bounded_array           : false_type {};
+template <class _Tp, size_t _Np> struct _LIBCUDACXX_TEMPLATE_VIS __LIBCUDACXX_is_bounded_array<_Tp[_Np]> : true_type {};
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
-template <class>                 struct _LIBCPP_TEMPLATE_VIS is_bounded_array           : false_type {};
-template <class _Tp, size_t _Np> struct _LIBCPP_TEMPLATE_VIS is_bounded_array<_Tp[_Np]> : true_type {};
+template <class>                 struct _LIBCUDACXX_TEMPLATE_VIS is_bounded_array           : false_type {};
+template <class _Tp, size_t _Np> struct _LIBCUDACXX_TEMPLATE_VIS is_bounded_array<_Tp[_Np]> : true_type {};
 
 template <class _Tp>
 inline constexpr
@@ -33,6 +33,6 @@ bool is_bounded_array_v  = is_bounded_array<_Tp>::value;
 
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_BOUNDED_ARRAY_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_BOUNDED_ARRAY_H

diff  --git a/libcxx/include/__type_traits/is_callable.h b/libcxx/include/__type_traits/is_callable.h
index 73f894dce94c..c6d5eb84ec5b 100644
--- a/libcxx/include/__type_traits/is_callable.h
+++ b/libcxx/include/__type_traits/is_callable.h
@@ -6,18 +6,18 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_CALLABLE_H
-#define _LIBCPP___TYPE_TRAITS_IS_CALLABLE_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_CALLABLE_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_CALLABLE_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 #include <__utility/declval.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template<class _Func, class... _Args, class = decltype(std::declval<_Func>()(std::declval<_Args>()...))>
 true_type __is_callable_helper(int);
@@ -27,6 +27,6 @@ false_type __is_callable_helper(...);
 template<class _Func, class... _Args>
 struct __is_callable : decltype(__is_callable_helper<_Func, _Args...>(0)) {};
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_CALLABLE_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_CALLABLE_H

diff  --git a/libcxx/include/__type_traits/is_class.h b/libcxx/include/__type_traits/is_class.h
index cddaeae6e8a9..f20f39741256 100644
--- a/libcxx/include/__type_traits/is_class.h
+++ b/libcxx/include/__type_traits/is_class.h
@@ -6,28 +6,28 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_CLASS_H
-#define _LIBCPP___TYPE_TRAITS_IS_CLASS_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_CLASS_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_CLASS_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 #include <__type_traits/is_union.h>
 #include <__type_traits/remove_cv.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_class
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_class
     : public integral_constant<bool, __is_class(_Tp)> {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_class_v = __is_class(_Tp);
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_CLASS_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_CLASS_H

diff  --git a/libcxx/include/__type_traits/is_compound.h b/libcxx/include/__type_traits/is_compound.h
index 1395ed8d417f..eaef5e585089 100644
--- a/libcxx/include/__type_traits/is_compound.h
+++ b/libcxx/include/__type_traits/is_compound.h
@@ -6,41 +6,41 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_COMPOUND_H
-#define _LIBCPP___TYPE_TRAITS_IS_COMPOUND_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_COMPOUND_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_COMPOUND_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 #include <__type_traits/is_fundamental.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 #if __has_builtin(__is_compound)
 
 template<class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_compound : _BoolConstant<__is_compound(_Tp)> { };
+struct _LIBCUDACXX_TEMPLATE_VIS is_compound : _BoolConstant<__is_compound(_Tp)> { };
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_compound_v = __is_compound(_Tp);
 #endif
 
 #else // __has_builtin(__is_compound)
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_compound
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_compound
     : public integral_constant<bool, !is_fundamental<_Tp>::value> {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_compound_v = is_compound<_Tp>::value;
 #endif
 
 #endif // __has_builtin(__is_compound)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_COMPOUND_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_COMPOUND_H

diff  --git a/libcxx/include/__type_traits/is_const.h b/libcxx/include/__type_traits/is_const.h
index 42b892c58d50..efb66db20926 100644
--- a/libcxx/include/__type_traits/is_const.h
+++ b/libcxx/include/__type_traits/is_const.h
@@ -6,40 +6,40 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_CONST_H
-#define _LIBCPP___TYPE_TRAITS_IS_CONST_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_CONST_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_CONST_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 #if __has_builtin(__is_const)
 
 template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_const : _BoolConstant<__is_const(_Tp)> { };
+struct _LIBCUDACXX_TEMPLATE_VIS is_const : _BoolConstant<__is_const(_Tp)> { };
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_const_v = __is_const(_Tp);
 #endif
 
 #else
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_const            : public false_type {};
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_const<_Tp const> : public true_type {};
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_const            : public false_type {};
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_const<_Tp const> : public true_type {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_const_v = is_const<_Tp>::value;
 #endif
 
 #endif // __has_builtin(__is_const)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_CONST_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_CONST_H

diff  --git a/libcxx/include/__type_traits/is_constant_evaluated.h b/libcxx/include/__type_traits/is_constant_evaluated.h
index de5ff6c43f40..2aa37bd7040d 100644
--- a/libcxx/include/__type_traits/is_constant_evaluated.h
+++ b/libcxx/include/__type_traits/is_constant_evaluated.h
@@ -6,27 +6,27 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_CONSTANT_EVALUATED_H
-#define _LIBCPP___TYPE_TRAITS_IS_CONSTANT_EVALUATED_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_CONSTANT_EVALUATED_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_CONSTANT_EVALUATED_H
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
-_LIBCPP_INLINE_VISIBILITY
+#if _LIBCUDACXX_STD_VER > 17
+_LIBCUDACXX_INLINE_VISIBILITY
 inline constexpr bool is_constant_evaluated() noexcept {
   return __builtin_is_constant_evaluated();
 }
 #endif
 
-inline _LIBCPP_CONSTEXPR
-bool __libcpp_is_constant_evaluated() _NOEXCEPT { return __builtin_is_constant_evaluated(); }
+inline _LIBCUDACXX_CONSTEXPR
+bool __LIBCUDACXX_is_constant_evaluated() _NOEXCEPT { return __builtin_is_constant_evaluated(); }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_CONSTANT_EVALUATED_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_CONSTANT_EVALUATED_H

diff  --git a/libcxx/include/__type_traits/is_constructible.h b/libcxx/include/__type_traits/is_constructible.h
index 9a96c3df13e8..30d7870194b2 100644
--- a/libcxx/include/__type_traits/is_constructible.h
+++ b/libcxx/include/__type_traits/is_constructible.h
@@ -6,28 +6,28 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_IS_CONSTRUCTIBLE_H
-#define _LIBCPP___TYPE_IS_CONSTRUCTIBLE_H
+#ifndef _LIBCUDACXX___TYPE_IS_CONSTRUCTIBLE_H
+#define _LIBCUDACXX___TYPE_IS_CONSTRUCTIBLE_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Tp, class ..._Args>
-struct _LIBCPP_TEMPLATE_VIS is_constructible
+struct _LIBCUDACXX_TEMPLATE_VIS is_constructible
     : public integral_constant<bool, __is_constructible(_Tp, _Args...)>
 { };
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp, class ..._Args>
 inline constexpr bool is_constructible_v = is_constructible<_Tp, _Args...>::value;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_IS_CONSTRUCTIBLE_H
+#endif // _LIBCUDACXX___TYPE_IS_CONSTRUCTIBLE_H

diff  --git a/libcxx/include/__type_traits/is_convertible.h b/libcxx/include/__type_traits/is_convertible.h
index 7e49cd4e6a31..f660a1aca939 100644
--- a/libcxx/include/__type_traits/is_convertible.h
+++ b/libcxx/include/__type_traits/is_convertible.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_CONVERTIBLE_H
-#define _LIBCPP___TYPE_TRAITS_IS_CONVERTIBLE_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_CONVERTIBLE_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_CONVERTIBLE_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
@@ -18,18 +18,18 @@
 #include <__utility/declval.h>
 #include <cstddef>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if __has_builtin(__is_convertible_to) && !defined(_LIBCPP_USE_IS_CONVERTIBLE_FALLBACK)
+#if __has_builtin(__is_convertible_to) && !defined(_LIBCUDACXX_USE_IS_CONVERTIBLE_FALLBACK)
 
-template <class _T1, class _T2> struct _LIBCPP_TEMPLATE_VIS is_convertible
+template <class _T1, class _T2> struct _LIBCUDACXX_TEMPLATE_VIS is_convertible
     : public integral_constant<bool, __is_convertible_to(_T1, _T2)> {};
 
-#else  // __has_builtin(__is_convertible_to) && !defined(_LIBCPP_USE_IS_CONVERTIBLE_FALLBACK)
+#else  // __has_builtin(__is_convertible_to) && !defined(_LIBCUDACXX_USE_IS_CONVERTIBLE_FALLBACK)
 
 namespace __is_convertible_imp
 {
@@ -89,20 +89,20 @@ template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 1, 3> : public
 template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 2, 3> : public false_type {};
 template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 3, 3> : public true_type {};
 
-template <class _T1, class _T2> struct _LIBCPP_TEMPLATE_VIS is_convertible
+template <class _T1, class _T2> struct _LIBCUDACXX_TEMPLATE_VIS is_convertible
     : public __is_convertible<_T1, _T2>
 {
     static const size_t __complete_check1 = __is_convertible_check<_T1>::__v;
     static const size_t __complete_check2 = __is_convertible_check<_T2>::__v;
 };
 
-#endif // __has_builtin(__is_convertible_to) && !defined(_LIBCPP_USE_IS_CONVERTIBLE_FALLBACK)
+#endif // __has_builtin(__is_convertible_to) && !defined(_LIBCUDACXX_USE_IS_CONVERTIBLE_FALLBACK)
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _From, class _To>
 inline constexpr bool is_convertible_v = is_convertible<_From, _To>::value;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_CONVERTIBLE_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_CONVERTIBLE_H

diff  --git a/libcxx/include/__type_traits/is_copy_assignable.h b/libcxx/include/__type_traits/is_copy_assignable.h
index e46b1249459e..bbae42297206 100644
--- a/libcxx/include/__type_traits/is_copy_assignable.h
+++ b/libcxx/include/__type_traits/is_copy_assignable.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_COPY_ASSIGNABLE_H
-#define _LIBCPP___TYPE_TRAITS_IS_COPY_ASSIGNABLE_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_COPY_ASSIGNABLE_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_COPY_ASSIGNABLE_H
 
 #include <__config>
 #include <__type_traits/add_const.h>
@@ -15,21 +15,21 @@
 #include <__type_traits/integral_constant.h>
 #include <__type_traits/is_assignable.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_copy_assignable
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_copy_assignable
     : public is_assignable<typename add_lvalue_reference<_Tp>::type,
                   typename add_lvalue_reference<typename add_const<_Tp>::type>::type> {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_copy_assignable_v = is_copy_assignable<_Tp>::value;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_COPY_ASSIGNABLE_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_COPY_ASSIGNABLE_H

diff  --git a/libcxx/include/__type_traits/is_copy_constructible.h b/libcxx/include/__type_traits/is_copy_constructible.h
index 18dc27f2ef75..14aa4268b417 100644
--- a/libcxx/include/__type_traits/is_copy_constructible.h
+++ b/libcxx/include/__type_traits/is_copy_constructible.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_COPY_CONSTRUCTIBLE_H
-#define _LIBCPP___TYPE_TRAITS_IS_COPY_CONSTRUCTIBLE_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_COPY_CONSTRUCTIBLE_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_COPY_CONSTRUCTIBLE_H
 
 #include <__config>
 #include <__type_traits/add_const.h>
@@ -15,22 +15,22 @@
 #include <__type_traits/integral_constant.h>
 #include <__type_traits/is_constructible.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_copy_constructible
+struct _LIBCUDACXX_TEMPLATE_VIS is_copy_constructible
     : public is_constructible<_Tp,
                   typename add_lvalue_reference<typename add_const<_Tp>::type>::type> {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_copy_constructible_v = is_copy_constructible<_Tp>::value;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_COPY_CONSTRUCTIBLE_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_COPY_CONSTRUCTIBLE_H

diff  --git a/libcxx/include/__type_traits/is_core_convertible.h b/libcxx/include/__type_traits/is_core_convertible.h
index 1ce407913052..574eb23ce470 100644
--- a/libcxx/include/__type_traits/is_core_convertible.h
+++ b/libcxx/include/__type_traits/is_core_convertible.h
@@ -6,17 +6,17 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_CORE_CONVERTIBLE_H
-#define _LIBCPP___TYPE_TRAITS_IS_CORE_CONVERTIBLE_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_CORE_CONVERTIBLE_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_CORE_CONVERTIBLE_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 // [conv.general]/3 says "E is convertible to T" whenever "T t=E;" is well-formed.
 // We can't test for that, but we can test implicit convertibility by passing it
@@ -31,6 +31,6 @@ struct __is_core_convertible<_Tp, _Up, decltype(
     static_cast<void(*)(_Up)>(0) ( static_cast<_Tp(*)()>(0)() )
 )> : public true_type {};
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_CORE_CONVERTIBLE_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_CORE_CONVERTIBLE_H

diff  --git a/libcxx/include/__type_traits/is_default_constructible.h b/libcxx/include/__type_traits/is_default_constructible.h
index a6368413d6b4..d7bf96197fa7 100644
--- a/libcxx/include/__type_traits/is_default_constructible.h
+++ b/libcxx/include/__type_traits/is_default_constructible.h
@@ -6,29 +6,29 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_DEFAULT_CONSTRUCTIBLE_H
-#define _LIBCPP___TYPE_TRAITS_IS_DEFAULT_CONSTRUCTIBLE_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_DEFAULT_CONSTRUCTIBLE_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_DEFAULT_CONSTRUCTIBLE_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 #include <__type_traits/is_constructible.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_default_constructible
+struct _LIBCUDACXX_TEMPLATE_VIS is_default_constructible
     : public is_constructible<_Tp>
     {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_default_constructible_v = is_default_constructible<_Tp>::value;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_DEFAULT_CONSTRUCTIBLE_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_DEFAULT_CONSTRUCTIBLE_H

diff  --git a/libcxx/include/__type_traits/is_destructible.h b/libcxx/include/__type_traits/is_destructible.h
index 5e9ac5579fdd..886ecff2cc96 100644
--- a/libcxx/include/__type_traits/is_destructible.h
+++ b/libcxx/include/__type_traits/is_destructible.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_DESTRUCTIBLE_H
-#define _LIBCPP___TYPE_TRAITS_IS_DESTRUCTIBLE_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_DESTRUCTIBLE_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_DESTRUCTIBLE_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
@@ -16,18 +16,18 @@
 #include <__type_traits/remove_all_extents.h>
 #include <__utility/declval.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 #if __has_builtin(__is_destructible)
 
 template<class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_destructible : _BoolConstant<__is_destructible(_Tp)> { };
+struct _LIBCUDACXX_TEMPLATE_VIS is_destructible : _BoolConstant<__is_destructible(_Tp)> { };
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_destructible_v = __is_destructible(_Tp);
 #endif
@@ -90,13 +90,13 @@ template <>
 struct is_destructible<void>
     : public false_type {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_destructible_v = is_destructible<_Tp>::value;
 #endif
 
 #endif // __has_builtin(__is_destructible)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_DESTRUCTIBLE_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_DESTRUCTIBLE_H

diff  --git a/libcxx/include/__type_traits/is_empty.h b/libcxx/include/__type_traits/is_empty.h
index 042b4e68074c..ef6c8624845c 100644
--- a/libcxx/include/__type_traits/is_empty.h
+++ b/libcxx/include/__type_traits/is_empty.h
@@ -6,27 +6,27 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_EMPTY_H
-#define _LIBCPP___TYPE_TRAITS_IS_EMPTY_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_EMPTY_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_EMPTY_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_empty
+struct _LIBCUDACXX_TEMPLATE_VIS is_empty
     : public integral_constant<bool, __is_empty(_Tp)> {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_empty_v = __is_empty(_Tp);
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_EMPTY_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_EMPTY_H

diff  --git a/libcxx/include/__type_traits/is_enum.h b/libcxx/include/__type_traits/is_enum.h
index bf6921c88c94..3e30241293ea 100644
--- a/libcxx/include/__type_traits/is_enum.h
+++ b/libcxx/include/__type_traits/is_enum.h
@@ -6,27 +6,27 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_ENUM_H
-#define _LIBCPP___TYPE_TRAITS_IS_ENUM_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_ENUM_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_ENUM_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 #include <__type_traits/remove_cv.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_enum
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_enum
     : public integral_constant<bool, __is_enum(_Tp)> {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_enum_v = __is_enum(_Tp);
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_ENUM_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_ENUM_H

diff  --git a/libcxx/include/__type_traits/is_final.h b/libcxx/include/__type_traits/is_final.h
index 74ced23a14e0..015e324e0c4d 100644
--- a/libcxx/include/__type_traits/is_final.h
+++ b/libcxx/include/__type_traits/is_final.h
@@ -6,31 +6,31 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_FINAL_H
-#define _LIBCPP___TYPE_TRAITS_IS_FINAL_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_FINAL_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_FINAL_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS
-__libcpp_is_final : public integral_constant<bool, __is_final(_Tp)> {};
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS
+__LIBCUDACXX_is_final : public integral_constant<bool, __is_final(_Tp)> {};
 
-#if _LIBCPP_STD_VER > 11
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS
+#if _LIBCUDACXX_STD_VER > 11
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS
 is_final : public integral_constant<bool, __is_final(_Tp)> {};
 #endif
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_final_v = __is_final(_Tp);
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_FINAL_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_FINAL_H

diff  --git a/libcxx/include/__type_traits/is_floating_point.h b/libcxx/include/__type_traits/is_floating_point.h
index d93e5d99d07b..cf165bbe65c6 100644
--- a/libcxx/include/__type_traits/is_floating_point.h
+++ b/libcxx/include/__type_traits/is_floating_point.h
@@ -6,32 +6,32 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_FLOATING_POINT_H
-#define _LIBCPP___TYPE_TRAITS_IS_FLOATING_POINT_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_FLOATING_POINT_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_FLOATING_POINT_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 #include <__type_traits/remove_cv.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-template <class _Tp> struct __libcpp_is_floating_point              : public false_type {};
-template <>          struct __libcpp_is_floating_point<float>       : public true_type {};
-template <>          struct __libcpp_is_floating_point<double>      : public true_type {};
-template <>          struct __libcpp_is_floating_point<long double> : public true_type {};
+template <class _Tp> struct __LIBCUDACXX_is_floating_point              : public false_type {};
+template <>          struct __LIBCUDACXX_is_floating_point<float>       : public true_type {};
+template <>          struct __LIBCUDACXX_is_floating_point<double>      : public true_type {};
+template <>          struct __LIBCUDACXX_is_floating_point<long double> : public true_type {};
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_floating_point
-    : public __libcpp_is_floating_point<typename remove_cv<_Tp>::type> {};
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_floating_point
+    : public __LIBCUDACXX_is_floating_point<typename remove_cv<_Tp>::type> {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_floating_point_v = is_floating_point<_Tp>::value;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_FLOATING_POINT_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_FLOATING_POINT_H

diff  --git a/libcxx/include/__type_traits/is_function.h b/libcxx/include/__type_traits/is_function.h
index 53f34b39eb9a..1bb958b10bfc 100644
--- a/libcxx/include/__type_traits/is_function.h
+++ b/libcxx/include/__type_traits/is_function.h
@@ -6,38 +6,38 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_FUNCTIONAL_H
-#define _LIBCPP___TYPE_TRAITS_IS_FUNCTIONAL_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_FUNCTIONAL_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_FUNCTIONAL_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 #include <__type_traits/is_const.h>
 #include <__type_traits/is_reference.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 #if __has_builtin(__is_function)
 
 template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_function : integral_constant<bool, __is_function(_Tp)> {};
+struct _LIBCUDACXX_TEMPLATE_VIS is_function : integral_constant<bool, __is_function(_Tp)> {};
 
 #else
 
 template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_function
+struct _LIBCUDACXX_TEMPLATE_VIS is_function
     : public integral_constant<bool, !(is_reference<_Tp>::value || is_const<const _Tp>::value)> {};
 
 #endif // __has_builtin(__is_function)
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_function_v = is_function<_Tp>::value;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_FUNCTIONAL_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_FUNCTIONAL_H

diff  --git a/libcxx/include/__type_traits/is_fundamental.h b/libcxx/include/__type_traits/is_fundamental.h
index 46f81a103583..4d96ae7570f6 100644
--- a/libcxx/include/__type_traits/is_fundamental.h
+++ b/libcxx/include/__type_traits/is_fundamental.h
@@ -6,44 +6,44 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_FUNDAMENTAL_H
-#define _LIBCPP___TYPE_TRAITS_IS_FUNDAMENTAL_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_FUNDAMENTAL_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_FUNDAMENTAL_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 #include <__type_traits/is_null_pointer.h>
 #include <__type_traits/is_void.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 #if __has_builtin(__is_fundamental)
 
 template<class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_fundamental : _BoolConstant<__is_fundamental(_Tp)> { };
+struct _LIBCUDACXX_TEMPLATE_VIS is_fundamental : _BoolConstant<__is_fundamental(_Tp)> { };
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_fundamental_v = __is_fundamental(_Tp);
 #endif
 
 #else // __has_builtin(__is_fundamental)
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_fundamental
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_fundamental
     : public integral_constant<bool, is_void<_Tp>::value        ||
                                      __is_nullptr_t<_Tp>::value ||
                                      is_arithmetic<_Tp>::value> {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_fundamental_v = is_fundamental<_Tp>::value;
 #endif
 
 #endif // __has_builtin(__is_fundamental)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_FUNDAMENTAL_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_FUNDAMENTAL_H

diff  --git a/libcxx/include/__type_traits/is_integral.h b/libcxx/include/__type_traits/is_integral.h
index c1c573a75e0a..3e0475c188c1 100644
--- a/libcxx/include/__type_traits/is_integral.h
+++ b/libcxx/include/__type_traits/is_integral.h
@@ -6,67 +6,67 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_INTEGRAL_H
-#define _LIBCPP___TYPE_TRAITS_IS_INTEGRAL_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_INTEGRAL_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_INTEGRAL_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 #include <__type_traits/remove_cv.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-template <class _Tp> struct __libcpp_is_integral                     { enum { value = 0 }; };
-template <>          struct __libcpp_is_integral<bool>               { enum { value = 1 }; };
-template <>          struct __libcpp_is_integral<char>               { enum { value = 1 }; };
-template <>          struct __libcpp_is_integral<signed char>        { enum { value = 1 }; };
-template <>          struct __libcpp_is_integral<unsigned char>      { enum { value = 1 }; };
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-template <>          struct __libcpp_is_integral<wchar_t>            { enum { value = 1 }; };
+template <class _Tp> struct __LIBCUDACXX_is_integral                     { enum { value = 0 }; };
+template <>          struct __LIBCUDACXX_is_integral<bool>               { enum { value = 1 }; };
+template <>          struct __LIBCUDACXX_is_integral<char>               { enum { value = 1 }; };
+template <>          struct __LIBCUDACXX_is_integral<signed char>        { enum { value = 1 }; };
+template <>          struct __LIBCUDACXX_is_integral<unsigned char>      { enum { value = 1 }; };
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
+template <>          struct __LIBCUDACXX_is_integral<wchar_t>            { enum { value = 1 }; };
 #endif
-#ifndef _LIBCPP_HAS_NO_CHAR8_T
-template <>          struct __libcpp_is_integral<char8_t>            { enum { value = 1 }; };
+#ifndef _LIBCUDACXX_HAS_NO_CHAR8_T
+template <>          struct __LIBCUDACXX_is_integral<char8_t>            { enum { value = 1 }; };
 #endif
-template <>          struct __libcpp_is_integral<char16_t>           { enum { value = 1 }; };
-template <>          struct __libcpp_is_integral<char32_t>           { enum { value = 1 }; };
-template <>          struct __libcpp_is_integral<short>              { enum { value = 1 }; };
-template <>          struct __libcpp_is_integral<unsigned short>     { enum { value = 1 }; };
-template <>          struct __libcpp_is_integral<int>                { enum { value = 1 }; };
-template <>          struct __libcpp_is_integral<unsigned int>       { enum { value = 1 }; };
-template <>          struct __libcpp_is_integral<long>               { enum { value = 1 }; };
-template <>          struct __libcpp_is_integral<unsigned long>      { enum { value = 1 }; };
-template <>          struct __libcpp_is_integral<long long>          { enum { value = 1 }; };
-template <>          struct __libcpp_is_integral<unsigned long long> { enum { value = 1 }; };
-#ifndef _LIBCPP_HAS_NO_INT128
-template <>          struct __libcpp_is_integral<__int128_t>         { enum { value = 1 }; };
-template <>          struct __libcpp_is_integral<__uint128_t>        { enum { value = 1 }; };
+template <>          struct __LIBCUDACXX_is_integral<char16_t>           { enum { value = 1 }; };
+template <>          struct __LIBCUDACXX_is_integral<char32_t>           { enum { value = 1 }; };
+template <>          struct __LIBCUDACXX_is_integral<short>              { enum { value = 1 }; };
+template <>          struct __LIBCUDACXX_is_integral<unsigned short>     { enum { value = 1 }; };
+template <>          struct __LIBCUDACXX_is_integral<int>                { enum { value = 1 }; };
+template <>          struct __LIBCUDACXX_is_integral<unsigned int>       { enum { value = 1 }; };
+template <>          struct __LIBCUDACXX_is_integral<long>               { enum { value = 1 }; };
+template <>          struct __LIBCUDACXX_is_integral<unsigned long>      { enum { value = 1 }; };
+template <>          struct __LIBCUDACXX_is_integral<long long>          { enum { value = 1 }; };
+template <>          struct __LIBCUDACXX_is_integral<unsigned long long> { enum { value = 1 }; };
+#ifndef _LIBCUDACXX_HAS_NO_INT128
+template <>          struct __LIBCUDACXX_is_integral<__int128_t>         { enum { value = 1 }; };
+template <>          struct __LIBCUDACXX_is_integral<__uint128_t>        { enum { value = 1 }; };
 #endif
 
 #if __has_builtin(__is_integral)
 
 template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_integral : _BoolConstant<__is_integral(_Tp)> { };
+struct _LIBCUDACXX_TEMPLATE_VIS is_integral : _BoolConstant<__is_integral(_Tp)> { };
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_integral_v = __is_integral(_Tp);
 #endif
 
 #else
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_integral
-    : public _BoolConstant<__libcpp_is_integral<typename remove_cv<_Tp>::type>::value> {};
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_integral
+    : public _BoolConstant<__LIBCUDACXX_is_integral<typename remove_cv<_Tp>::type>::value> {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_integral_v = is_integral<_Tp>::value;
 #endif
 
 #endif // __has_builtin(__is_integral)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_INTEGRAL_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_INTEGRAL_H

diff  --git a/libcxx/include/__type_traits/is_literal_type.h b/libcxx/include/__type_traits/is_literal_type.h
index df525ecee208..3e6b30c92802 100644
--- a/libcxx/include/__type_traits/is_literal_type.h
+++ b/libcxx/include/__type_traits/is_literal_type.h
@@ -6,29 +6,29 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_LITERAL_TYPE
-#define _LIBCPP___TYPE_TRAITS_IS_LITERAL_TYPE
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_LITERAL_TYPE
+#define _LIBCUDACXX___TYPE_TRAITS_IS_LITERAL_TYPE
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS)
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 is_literal_type
+#if _LIBCUDACXX_STD_VER <= 17 || defined(_LIBCUDACXX_ENABLE_CXX20_REMOVED_TYPE_TRAITS)
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_DEPRECATED_IN_CXX17 is_literal_type
     : public integral_constant<bool, __is_literal_type(_Tp)>
     {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
-_LIBCPP_DEPRECATED_IN_CXX17 inline constexpr bool is_literal_type_v = is_literal_type<_Tp>::value;
-#endif // _LIBCPP_STD_VER > 14
-#endif // _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS)
+_LIBCUDACXX_DEPRECATED_IN_CXX17 inline constexpr bool is_literal_type_v = is_literal_type<_Tp>::value;
+#endif // _LIBCUDACXX_STD_VER > 14
+#endif // _LIBCUDACXX_STD_VER <= 17 || defined(_LIBCUDACXX_ENABLE_CXX20_REMOVED_TYPE_TRAITS)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_LITERAL_TYPE
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_LITERAL_TYPE

diff  --git a/libcxx/include/__type_traits/is_member_function_pointer.h b/libcxx/include/__type_traits/is_member_function_pointer.h
index 2d2ff81e091a..1ff194fc8c5a 100644
--- a/libcxx/include/__type_traits/is_member_function_pointer.h
+++ b/libcxx/include/__type_traits/is_member_function_pointer.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_MEMBER_FUNCTION_POINTER_H
-#define _LIBCPP___TYPE_TRAITS_IS_MEMBER_FUNCTION_POINTER_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_MEMBER_FUNCTION_POINTER_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_MEMBER_FUNCTION_POINTER_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
@@ -15,20 +15,20 @@
 #include <__type_traits/remove_cv.h>
 #include <cstddef>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-template <class _Tp> struct __libcpp_is_member_pointer {
+template <class _Tp> struct __LIBCUDACXX_is_member_pointer {
   enum {
     __is_member = false,
     __is_func = false,
     __is_obj = false
   };
 };
-template <class _Tp, class _Up> struct __libcpp_is_member_pointer<_Tp _Up::*> {
+template <class _Tp, class _Up> struct __LIBCUDACXX_is_member_pointer<_Tp _Up::*> {
   enum {
     __is_member = true,
     __is_func = is_function<_Tp>::value,
@@ -39,26 +39,26 @@ template <class _Tp, class _Up> struct __libcpp_is_member_pointer<_Tp _Up::*> {
 #if __has_builtin(__is_member_function_pointer)
 
 template<class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_member_function_pointer
+struct _LIBCUDACXX_TEMPLATE_VIS is_member_function_pointer
     : _BoolConstant<__is_member_function_pointer(_Tp)> { };
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_member_function_pointer_v = __is_member_function_pointer(_Tp);
 #endif
 
 #else // __has_builtin(__is_member_function_pointer)
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_member_function_pointer
-    : public _BoolConstant< __libcpp_is_member_pointer<typename remove_cv<_Tp>::type>::__is_func > {};
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_member_function_pointer
+    : public _BoolConstant< __LIBCUDACXX_is_member_pointer<typename remove_cv<_Tp>::type>::__is_func > {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_member_function_pointer_v = is_member_function_pointer<_Tp>::value;
 #endif
 
 #endif // __has_builtin(__is_member_function_pointer)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_MEMBER_FUNCTION_POINTER_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_MEMBER_FUNCTION_POINTER_H

diff  --git a/libcxx/include/__type_traits/is_member_object_pointer.h b/libcxx/include/__type_traits/is_member_object_pointer.h
index 250a22c97440..05eb475ed8dd 100644
--- a/libcxx/include/__type_traits/is_member_object_pointer.h
+++ b/libcxx/include/__type_traits/is_member_object_pointer.h
@@ -6,41 +6,41 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_MEMBER_OBJECT_POINTER_H
-#define _LIBCPP___TYPE_TRAITS_IS_MEMBER_OBJECT_POINTER_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_MEMBER_OBJECT_POINTER_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_MEMBER_OBJECT_POINTER_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 #if __has_builtin(__is_member_object_pointer)
 
 template<class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_member_object_pointer
+struct _LIBCUDACXX_TEMPLATE_VIS is_member_object_pointer
     : _BoolConstant<__is_member_object_pointer(_Tp)> { };
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_member_object_pointer_v = __is_member_object_pointer(_Tp);
 #endif
 
 #else // __has_builtin(__is_member_object_pointer)
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_member_object_pointer
-    : public _BoolConstant< __libcpp_is_member_pointer<typename remove_cv<_Tp>::type>::__is_obj >  {};
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_member_object_pointer
+    : public _BoolConstant< __LIBCUDACXX_is_member_pointer<typename remove_cv<_Tp>::type>::__is_obj >  {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_member_object_pointer_v = is_member_object_pointer<_Tp>::value;
 #endif
 
 #endif // __has_builtin(__is_member_object_pointer)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_MEMBER_FUNCTION_POINTER_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_MEMBER_FUNCTION_POINTER_H

diff  --git a/libcxx/include/__type_traits/is_member_pointer.h b/libcxx/include/__type_traits/is_member_pointer.h
index 448bcc23d55e..9e9752a8792d 100644
--- a/libcxx/include/__type_traits/is_member_pointer.h
+++ b/libcxx/include/__type_traits/is_member_pointer.h
@@ -6,40 +6,40 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_MEMBER_POINTER_H
-#define _LIBCPP___TYPE_TRAITS_IS_MEMBER_POINTER_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_MEMBER_POINTER_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_MEMBER_POINTER_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 #if __has_builtin(__is_member_pointer)
 
 template<class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_member_pointer : _BoolConstant<__is_member_pointer(_Tp)> { };
+struct _LIBCUDACXX_TEMPLATE_VIS is_member_pointer : _BoolConstant<__is_member_pointer(_Tp)> { };
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_member_pointer_v = __is_member_pointer(_Tp);
 #endif
 
 #else // __has_builtin(__is_member_pointer)
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_member_pointer
- : public _BoolConstant< __libcpp_is_member_pointer<typename remove_cv<_Tp>::type>::__is_member > {};
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_member_pointer
+ : public _BoolConstant< __LIBCUDACXX_is_member_pointer<typename remove_cv<_Tp>::type>::__is_member > {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_member_pointer_v = is_member_pointer<_Tp>::value;
 #endif
 
 #endif // __has_builtin(__is_member_pointer)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_MEMBER_POINTER_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_MEMBER_POINTER_H

diff  --git a/libcxx/include/__type_traits/is_move_assignable.h b/libcxx/include/__type_traits/is_move_assignable.h
index 1e8aa23bea37..3cb653df48d5 100644
--- a/libcxx/include/__type_traits/is_move_assignable.h
+++ b/libcxx/include/__type_traits/is_move_assignable.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_MOVE_ASSIGNABLE_H
-#define _LIBCPP___TYPE_TRAITS_IS_MOVE_ASSIGNABLE_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_MOVE_ASSIGNABLE_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_MOVE_ASSIGNABLE_H
 
 #include <__config>
 #include <__type_traits/add_const.h>
@@ -16,21 +16,21 @@
 #include <__type_traits/integral_constant.h>
 #include <__type_traits/is_assignable.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_move_assignable
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_move_assignable
     : public is_assignable<typename add_lvalue_reference<_Tp>::type,
                            typename add_rvalue_reference<_Tp>::type> {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_move_assignable_v = is_move_assignable<_Tp>::value;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_MOVE_ASSIGNABLE_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_MOVE_ASSIGNABLE_H

diff  --git a/libcxx/include/__type_traits/is_move_constructible.h b/libcxx/include/__type_traits/is_move_constructible.h
index 228cee7efffa..64fd7ec8d1e5 100644
--- a/libcxx/include/__type_traits/is_move_constructible.h
+++ b/libcxx/include/__type_traits/is_move_constructible.h
@@ -6,30 +6,30 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_MOVE_CONSTRUCTIBLE_H
-#define _LIBCPP___TYPE_TRAITS_IS_MOVE_CONSTRUCTIBLE_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_MOVE_CONSTRUCTIBLE_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_MOVE_CONSTRUCTIBLE_H
 
 #include <__config>
 #include <__type_traits/add_rvalue_reference.h>
 #include <__type_traits/integral_constant.h>
 #include <__type_traits/is_constructible.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_move_constructible
+struct _LIBCUDACXX_TEMPLATE_VIS is_move_constructible
     : public is_constructible<_Tp, typename add_rvalue_reference<_Tp>::type>
     {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_move_constructible_v = is_move_constructible<_Tp>::value;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_MOVE_CONSTRUCTIBLE_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_MOVE_CONSTRUCTIBLE_H

diff  --git a/libcxx/include/__type_traits/is_nothrow_assignable.h b/libcxx/include/__type_traits/is_nothrow_assignable.h
index e3ce33ece895..0a01828ab4a0 100644
--- a/libcxx/include/__type_traits/is_nothrow_assignable.h
+++ b/libcxx/include/__type_traits/is_nothrow_assignable.h
@@ -6,54 +6,54 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_NOTHROW_ASSIGNABLE_H
-#define _LIBCPP___TYPE_TRAITS_IS_NOTHROW_ASSIGNABLE_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_NOTHROW_ASSIGNABLE_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_NOTHROW_ASSIGNABLE_H
 
 #include <__config>
 #include <__type_traits/add_const.h>
 #include <__type_traits/integral_constant.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 #if __has_builtin(__is_nothrow_assignable)
 
 template <class _Tp, class _Arg>
-struct _LIBCPP_TEMPLATE_VIS is_nothrow_assignable
+struct _LIBCUDACXX_TEMPLATE_VIS is_nothrow_assignable
     : public integral_constant<bool, __is_nothrow_assignable(_Tp, _Arg)> {};
 
 #else
 
-template <bool, class _Tp, class _Arg> struct __libcpp_is_nothrow_assignable;
+template <bool, class _Tp, class _Arg> struct __LIBCUDACXX_is_nothrow_assignable;
 
 template <class _Tp, class _Arg>
-struct __libcpp_is_nothrow_assignable<false, _Tp, _Arg>
+struct __LIBCUDACXX_is_nothrow_assignable<false, _Tp, _Arg>
     : public false_type
 {
 };
 
 template <class _Tp, class _Arg>
-struct __libcpp_is_nothrow_assignable<true, _Tp, _Arg>
+struct __LIBCUDACXX_is_nothrow_assignable<true, _Tp, _Arg>
     : public integral_constant<bool, noexcept(declval<_Tp>() = declval<_Arg>()) >
 {
 };
 
 template <class _Tp, class _Arg>
-struct _LIBCPP_TEMPLATE_VIS is_nothrow_assignable
-    : public __libcpp_is_nothrow_assignable<is_assignable<_Tp, _Arg>::value, _Tp, _Arg>
+struct _LIBCUDACXX_TEMPLATE_VIS is_nothrow_assignable
+    : public __LIBCUDACXX_is_nothrow_assignable<is_assignable<_Tp, _Arg>::value, _Tp, _Arg>
 {
 };
 
 #endif // __has_builtin(__is_nothrow_assignable)
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp, class _Arg>
 inline constexpr bool is_nothrow_assignable_v = is_nothrow_assignable<_Tp, _Arg>::value;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_NOTHROW_ASSIGNABLE_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_NOTHROW_ASSIGNABLE_H

diff  --git a/libcxx/include/__type_traits/is_nothrow_constructible.h b/libcxx/include/__type_traits/is_nothrow_constructible.h
index 92d6e8343e03..5c75e75a5f73 100644
--- a/libcxx/include/__type_traits/is_nothrow_constructible.h
+++ b/libcxx/include/__type_traits/is_nothrow_constructible.h
@@ -6,31 +6,31 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_NOTHROW_CONSTRUCTIBLE_H
-#define _LIBCPP___TYPE_TRAITS_IS_NOTHROW_CONSTRUCTIBLE_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_NOTHROW_CONSTRUCTIBLE_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_NOTHROW_CONSTRUCTIBLE_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 #include <__utility/declval.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 #if __has_builtin(__is_nothrow_constructible)
 
 template <class _Tp, class... _Args>
-struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible
+struct _LIBCUDACXX_TEMPLATE_VIS is_nothrow_constructible
     : public integral_constant<bool, __is_nothrow_constructible(_Tp, _Args...)> {};
 
 #else
 
-template <bool, bool, class _Tp, class... _Args> struct __libcpp_is_nothrow_constructible;
+template <bool, bool, class _Tp, class... _Args> struct __LIBCUDACXX_is_nothrow_constructible;
 
 template <class _Tp, class... _Args>
-struct __libcpp_is_nothrow_constructible</*is constructible*/true, /*is reference*/false, _Tp, _Args...>
+struct __LIBCUDACXX_is_nothrow_constructible</*is constructible*/true, /*is reference*/false, _Tp, _Args...>
     : public integral_constant<bool, noexcept(_Tp(declval<_Args>()...))>
 {
 };
@@ -39,37 +39,37 @@ template <class _Tp>
 void __implicit_conversion_to(_Tp) noexcept { }
 
 template <class _Tp, class _Arg>
-struct __libcpp_is_nothrow_constructible</*is constructible*/true, /*is reference*/true, _Tp, _Arg>
-    : public integral_constant<bool, noexcept(_VSTD::__implicit_conversion_to<_Tp>(declval<_Arg>()))>
+struct __LIBCUDACXX_is_nothrow_constructible</*is constructible*/true, /*is reference*/true, _Tp, _Arg>
+    : public integral_constant<bool, noexcept(_CUDA_VSTD::__implicit_conversion_to<_Tp>(declval<_Arg>()))>
 {
 };
 
 template <class _Tp, bool _IsReference, class... _Args>
-struct __libcpp_is_nothrow_constructible</*is constructible*/false, _IsReference, _Tp, _Args...>
+struct __LIBCUDACXX_is_nothrow_constructible</*is constructible*/false, _IsReference, _Tp, _Args...>
     : public false_type
 {
 };
 
 template <class _Tp, class... _Args>
-struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible
-    : __libcpp_is_nothrow_constructible<is_constructible<_Tp, _Args...>::value, is_reference<_Tp>::value, _Tp, _Args...>
+struct _LIBCUDACXX_TEMPLATE_VIS is_nothrow_constructible
+    : __LIBCUDACXX_is_nothrow_constructible<is_constructible<_Tp, _Args...>::value, is_reference<_Tp>::value, _Tp, _Args...>
 {
 };
 
 template <class _Tp, size_t _Ns>
-struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp[_Ns]>
-    : __libcpp_is_nothrow_constructible<is_constructible<_Tp>::value, is_reference<_Tp>::value, _Tp>
+struct _LIBCUDACXX_TEMPLATE_VIS is_nothrow_constructible<_Tp[_Ns]>
+    : __LIBCUDACXX_is_nothrow_constructible<is_constructible<_Tp>::value, is_reference<_Tp>::value, _Tp>
 {
 };
 
 #endif // __has_builtin(__is_nothrow_constructible)
 
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp, class ..._Args>
 inline constexpr bool is_nothrow_constructible_v = is_nothrow_constructible<_Tp, _Args...>::value;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_NOTHROW_CONSTRUCTIBLE_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_NOTHROW_CONSTRUCTIBLE_H

diff  --git a/libcxx/include/__type_traits/is_nothrow_convertible.h b/libcxx/include/__type_traits/is_nothrow_convertible.h
index 712b6f2cf4b8..809dc8c75758 100644
--- a/libcxx/include/__type_traits/is_nothrow_convertible.h
+++ b/libcxx/include/__type_traits/is_nothrow_convertible.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_NOTHROW_CONVERTIBLE_H
-#define _LIBCPP___TYPE_TRAITS_IS_NOTHROW_CONVERTIBLE_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_NOTHROW_CONVERTIBLE_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_NOTHROW_CONVERTIBLE_H
 
 #include <__config>
 #include <__type_traits/conjunction.h>
@@ -18,19 +18,19 @@
 #include <__type_traits/lazy.h>
 #include <__utility/declval.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 template <typename _Tp>
 static void __test_noexcept(_Tp) noexcept;
 
 template<typename _Fm, typename _To>
-static bool_constant<noexcept(_VSTD::__test_noexcept<_To>(declval<_Fm>()))>
+static bool_constant<noexcept(_CUDA_VSTD::__test_noexcept<_To>(declval<_Fm>()))>
 __is_nothrow_convertible_test();
 
 template <typename _Fm, typename _To>
@@ -46,8 +46,8 @@ struct is_nothrow_convertible : _Or<
 template <typename _Fm, typename _To>
 inline constexpr bool is_nothrow_convertible_v = is_nothrow_convertible<_Fm, _To>::value;
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_NOTHROW_CONVERTIBLE_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_NOTHROW_CONVERTIBLE_H

diff  --git a/libcxx/include/__type_traits/is_nothrow_copy_assignable.h b/libcxx/include/__type_traits/is_nothrow_copy_assignable.h
index 8c4b8fd1628b..61a81d0d0cc0 100644
--- a/libcxx/include/__type_traits/is_nothrow_copy_assignable.h
+++ b/libcxx/include/__type_traits/is_nothrow_copy_assignable.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_NOTHROW_COPY_ASSIGNABLE_H
-#define _LIBCPP___TYPE_TRAITS_IS_NOTHROW_COPY_ASSIGNABLE_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_NOTHROW_COPY_ASSIGNABLE_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_NOTHROW_COPY_ASSIGNABLE_H
 
 #include <__config>
 #include <__type_traits/add_const.h>
@@ -15,21 +15,21 @@
 #include <__type_traits/integral_constant.h>
 #include <__type_traits/is_nothrow_assignable.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_nothrow_copy_assignable
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_nothrow_copy_assignable
     : public is_nothrow_assignable<typename add_lvalue_reference<_Tp>::type,
                   typename add_lvalue_reference<typename add_const<_Tp>::type>::type> {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_nothrow_copy_assignable_v = is_nothrow_copy_assignable<_Tp>::value;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_NOTHROW_COPY_ASSIGNABLE_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_NOTHROW_COPY_ASSIGNABLE_H

diff  --git a/libcxx/include/__type_traits/is_nothrow_copy_constructible.h b/libcxx/include/__type_traits/is_nothrow_copy_constructible.h
index 966df860e4b8..e0a6690e616f 100644
--- a/libcxx/include/__type_traits/is_nothrow_copy_constructible.h
+++ b/libcxx/include/__type_traits/is_nothrow_copy_constructible.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_NOTHROW_COPY_CONSTRUCTIBLE_H
-#define _LIBCPP___TYPE_TRAITS_IS_NOTHROW_COPY_CONSTRUCTIBLE_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_NOTHROW_COPY_CONSTRUCTIBLE_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_NOTHROW_COPY_CONSTRUCTIBLE_H
 
 #include <__config>
 #include <__type_traits/add_const.h>
@@ -15,21 +15,21 @@
 #include <__type_traits/integral_constant.h>
 #include <__type_traits/is_nothrow_constructible.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_nothrow_copy_constructible
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_nothrow_copy_constructible
     : public is_nothrow_constructible<_Tp,
                   typename add_lvalue_reference<typename add_const<_Tp>::type>::type> {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_nothrow_copy_constructible_v = is_nothrow_copy_constructible<_Tp>::value;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_NOTHROW_COPY_CONSTRUCTIBLE_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_NOTHROW_COPY_CONSTRUCTIBLE_H

diff  --git a/libcxx/include/__type_traits/is_nothrow_default_constructible.h b/libcxx/include/__type_traits/is_nothrow_default_constructible.h
index addf359ec3d6..02afb13a2cdd 100644
--- a/libcxx/include/__type_traits/is_nothrow_default_constructible.h
+++ b/libcxx/include/__type_traits/is_nothrow_default_constructible.h
@@ -6,28 +6,28 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_NOTHROW_DEFAULT_CONSTRUCTIBLE_H
-#define _LIBCPP___TYPE_TRAITS_IS_NOTHROW_DEFAULT_CONSTRUCTIBLE_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_NOTHROW_DEFAULT_CONSTRUCTIBLE_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_NOTHROW_DEFAULT_CONSTRUCTIBLE_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 #include <__type_traits/is_nothrow_constructible.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_nothrow_default_constructible
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_nothrow_default_constructible
     : public is_nothrow_constructible<_Tp>
     {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_nothrow_default_constructible_v = is_nothrow_default_constructible<_Tp>::value;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_NOTHROW_DEFAULT_CONSTRUCTIBLE_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_NOTHROW_DEFAULT_CONSTRUCTIBLE_H

diff  --git a/libcxx/include/__type_traits/is_nothrow_destructible.h b/libcxx/include/__type_traits/is_nothrow_destructible.h
index 4763ae84086a..e2f459ce73fb 100644
--- a/libcxx/include/__type_traits/is_nothrow_destructible.h
+++ b/libcxx/include/__type_traits/is_nothrow_destructible.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_NOTHROW_DESTRUCTIBLE_H
-#define _LIBCPP___TYPE_TRAITS_IS_NOTHROW_DESTRUCTIBLE_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_NOTHROW_DESTRUCTIBLE_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_NOTHROW_DESTRUCTIBLE_H
 
 #include <__config>
 #include <__type_traits/add_const.h>
@@ -19,72 +19,72 @@
 #include <__utility/declval.h>
 #include <cstddef>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if !defined(_LIBCPP_CXX03_LANG)
+#if !defined(_LIBCUDACXX_CXX03_LANG)
 
-template <bool, class _Tp> struct __libcpp_is_nothrow_destructible;
+template <bool, class _Tp> struct __LIBCUDACXX_is_nothrow_destructible;
 
 template <class _Tp>
-struct __libcpp_is_nothrow_destructible<false, _Tp>
+struct __LIBCUDACXX_is_nothrow_destructible<false, _Tp>
     : public false_type
 {
 };
 
 template <class _Tp>
-struct __libcpp_is_nothrow_destructible<true, _Tp>
+struct __LIBCUDACXX_is_nothrow_destructible<true, _Tp>
     : public integral_constant<bool, noexcept(declval<_Tp>().~_Tp()) >
 {
 };
 
 template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible
-    : public __libcpp_is_nothrow_destructible<is_destructible<_Tp>::value, _Tp>
+struct _LIBCUDACXX_TEMPLATE_VIS is_nothrow_destructible
+    : public __LIBCUDACXX_is_nothrow_destructible<is_destructible<_Tp>::value, _Tp>
 {
 };
 
 template <class _Tp, size_t _Ns>
-struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible<_Tp[_Ns]>
+struct _LIBCUDACXX_TEMPLATE_VIS is_nothrow_destructible<_Tp[_Ns]>
     : public is_nothrow_destructible<_Tp>
 {
 };
 
 template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible<_Tp&>
+struct _LIBCUDACXX_TEMPLATE_VIS is_nothrow_destructible<_Tp&>
     : public true_type
 {
 };
 
 template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible<_Tp&&>
+struct _LIBCUDACXX_TEMPLATE_VIS is_nothrow_destructible<_Tp&&>
     : public true_type
 {
 };
 
 #else
 
-template <class _Tp> struct __libcpp_nothrow_destructor
+template <class _Tp> struct __LIBCUDACXX_nothrow_destructor
     : public integral_constant<bool, is_scalar<_Tp>::value ||
                                      is_reference<_Tp>::value> {};
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible
-    : public __libcpp_nothrow_destructor<typename remove_all_extents<_Tp>::type> {};
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_nothrow_destructible
+    : public __LIBCUDACXX_nothrow_destructor<typename remove_all_extents<_Tp>::type> {};
 
 template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible<_Tp[]>
+struct _LIBCUDACXX_TEMPLATE_VIS is_nothrow_destructible<_Tp[]>
     : public false_type {};
 
 #endif
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_nothrow_destructible_v = is_nothrow_destructible<_Tp>::value;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_NOTHROW_DESTRUCTIBLE_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_NOTHROW_DESTRUCTIBLE_H

diff  --git a/libcxx/include/__type_traits/is_nothrow_move_assignable.h b/libcxx/include/__type_traits/is_nothrow_move_assignable.h
index 44cea1f9cd56..b0c93eca11f8 100644
--- a/libcxx/include/__type_traits/is_nothrow_move_assignable.h
+++ b/libcxx/include/__type_traits/is_nothrow_move_assignable.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_NOTHROW_MOVE_ASSIGNABLE_H
-#define _LIBCPP___TYPE_TRAITS_IS_NOTHROW_MOVE_ASSIGNABLE_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_NOTHROW_MOVE_ASSIGNABLE_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_NOTHROW_MOVE_ASSIGNABLE_H
 
 #include <__config>
 #include <__type_traits/add_lvalue_reference.h>
@@ -15,22 +15,22 @@
 #include <__type_traits/integral_constant.h>
 #include <__type_traits/is_nothrow_assignable.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_nothrow_move_assignable
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_nothrow_move_assignable
     : public is_nothrow_assignable<typename add_lvalue_reference<_Tp>::type,
                                      typename add_rvalue_reference<_Tp>::type>
     {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_nothrow_move_assignable_v = is_nothrow_move_assignable<_Tp>::value;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_NOTHROW_MOVE_ASSIGNABLE_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_NOTHROW_MOVE_ASSIGNABLE_H

diff  --git a/libcxx/include/__type_traits/is_nothrow_move_constructible.h b/libcxx/include/__type_traits/is_nothrow_move_constructible.h
index e3b1171a4826..9b0e11e79aa9 100644
--- a/libcxx/include/__type_traits/is_nothrow_move_constructible.h
+++ b/libcxx/include/__type_traits/is_nothrow_move_constructible.h
@@ -6,29 +6,29 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_NOTHROW_MOVE_CONSTRUCTIBLE_H
-#define _LIBCPP___TYPE_TRAITS_IS_NOTHROW_MOVE_CONSTRUCTIBLE_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_NOTHROW_MOVE_CONSTRUCTIBLE_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_NOTHROW_MOVE_CONSTRUCTIBLE_H
 
 #include <__config>
 #include <__type_traits/add_rvalue_reference.h>
 #include <__type_traits/integral_constant.h>
 #include <__type_traits/is_nothrow_constructible.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_nothrow_move_constructible
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_nothrow_move_constructible
     : public is_nothrow_constructible<_Tp, typename add_rvalue_reference<_Tp>::type>
     {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_nothrow_move_constructible_v = is_nothrow_move_constructible<_Tp>::value;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_NOTHROW_MOVE_CONSTRUCTIBLE_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_NOTHROW_MOVE_CONSTRUCTIBLE_H

diff  --git a/libcxx/include/__type_traits/is_null_pointer.h b/libcxx/include/__type_traits/is_null_pointer.h
index f81cb9aadb2f..6e2277315f91 100644
--- a/libcxx/include/__type_traits/is_null_pointer.h
+++ b/libcxx/include/__type_traits/is_null_pointer.h
@@ -6,36 +6,36 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_NULL_POINTER_H
-#define _LIBCPP___TYPE_TRAITS_IS_NULL_POINTER_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_NULL_POINTER_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_NULL_POINTER_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 #include <__type_traits/remove_cv.h>
 #include <cstddef>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Tp> struct __is_nullptr_t_impl       : public false_type {};
 template <>          struct __is_nullptr_t_impl<nullptr_t> : public true_type {};
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS __is_nullptr_t
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS __is_nullptr_t
     : public __is_nullptr_t_impl<typename remove_cv<_Tp>::type> {};
 
-#if _LIBCPP_STD_VER > 11
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_null_pointer
+#if _LIBCUDACXX_STD_VER > 11
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_null_pointer
     : public __is_nullptr_t_impl<typename remove_cv<_Tp>::type> {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_null_pointer_v = is_null_pointer<_Tp>::value;
 #endif
-#endif // _LIBCPP_STD_VER > 11
+#endif // _LIBCUDACXX_STD_VER > 11
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_NULL_POINTER_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_NULL_POINTER_H

diff  --git a/libcxx/include/__type_traits/is_object.h b/libcxx/include/__type_traits/is_object.h
index 943f1a736cd5..dca1892efb6a 100644
--- a/libcxx/include/__type_traits/is_object.h
+++ b/libcxx/include/__type_traits/is_object.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_OBJECT_H
-#define _LIBCPP___TYPE_TRAITS_IS_OBJECT_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_OBJECT_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_OBJECT_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
@@ -16,37 +16,37 @@
 #include <__type_traits/is_scalar.h>
 #include <__type_traits/is_union.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 #if __has_builtin(__is_object)
 
 template<class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_object : _BoolConstant<__is_object(_Tp)> { };
+struct _LIBCUDACXX_TEMPLATE_VIS is_object : _BoolConstant<__is_object(_Tp)> { };
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_object_v = __is_object(_Tp);
 #endif
 
 #else // __has_builtin(__is_object)
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_object
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_object
     : public integral_constant<bool, is_scalar<_Tp>::value ||
                                      is_array<_Tp>::value  ||
                                      is_union<_Tp>::value  ||
                                      is_class<_Tp>::value  > {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_object_v = is_object<_Tp>::value;
 #endif
 
 #endif // __has_builtin(__is_object)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_OBJECT_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_OBJECT_H

diff  --git a/libcxx/include/__type_traits/is_pod.h b/libcxx/include/__type_traits/is_pod.h
index 497060e00557..8743ef79575b 100644
--- a/libcxx/include/__type_traits/is_pod.h
+++ b/libcxx/include/__type_traits/is_pod.h
@@ -6,26 +6,26 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_POD_H
-#define _LIBCPP___TYPE_TRAITS_IS_POD_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_POD_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_POD_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 #if __has_builtin(__is_pod)
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_pod
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_pod
     : public integral_constant<bool, __is_pod(_Tp)> {};
 
 #else
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_pod
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_pod
     : public integral_constant<bool, is_trivially_default_constructible<_Tp>::value   &&
                                      is_trivially_copy_constructible<_Tp>::value      &&
                                      is_trivially_copy_assignable<_Tp>::value    &&
@@ -33,11 +33,11 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_pod
 
 #endif // __has_builtin(__is_pod)
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_pod_v = is_pod<_Tp>::value;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_POD_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_POD_H

diff  --git a/libcxx/include/__type_traits/is_pointer.h b/libcxx/include/__type_traits/is_pointer.h
index 63c82ae4715c..9788bc2e0337 100644
--- a/libcxx/include/__type_traits/is_pointer.h
+++ b/libcxx/include/__type_traits/is_pointer.h
@@ -6,52 +6,52 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_POINTER_H
-#define _LIBCPP___TYPE_TRAITS_IS_POINTER_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_POINTER_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_POINTER_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 #include <__type_traits/remove_cv.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 #if __has_builtin(__is_pointer)
 
 template<class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_pointer : _BoolConstant<__is_pointer(_Tp)> { };
+struct _LIBCUDACXX_TEMPLATE_VIS is_pointer : _BoolConstant<__is_pointer(_Tp)> { };
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_pointer_v = __is_pointer(_Tp);
 #endif
 
 #else // __has_builtin(__is_pointer)
 
-template <class _Tp> struct __libcpp_is_pointer       : public false_type {};
-template <class _Tp> struct __libcpp_is_pointer<_Tp*> : public true_type {};
+template <class _Tp> struct __LIBCUDACXX_is_pointer       : public false_type {};
+template <class _Tp> struct __LIBCUDACXX_is_pointer<_Tp*> : public true_type {};
 
-template <class _Tp> struct __libcpp_remove_objc_qualifiers { typedef _Tp type; };
-#if defined(_LIBCPP_HAS_OBJC_ARC)
-template <class _Tp> struct __libcpp_remove_objc_qualifiers<_Tp __strong> { typedef _Tp type; };
-template <class _Tp> struct __libcpp_remove_objc_qualifiers<_Tp __weak> { typedef _Tp type; };
-template <class _Tp> struct __libcpp_remove_objc_qualifiers<_Tp __autoreleasing> { typedef _Tp type; };
-template <class _Tp> struct __libcpp_remove_objc_qualifiers<_Tp __unsafe_unretained> { typedef _Tp type; };
+template <class _Tp> struct __LIBCUDACXX_remove_objc_qualifiers { typedef _Tp type; };
+#if defined(_LIBCUDACXX_HAS_OBJC_ARC)
+template <class _Tp> struct __LIBCUDACXX_remove_objc_qualifiers<_Tp __strong> { typedef _Tp type; };
+template <class _Tp> struct __LIBCUDACXX_remove_objc_qualifiers<_Tp __weak> { typedef _Tp type; };
+template <class _Tp> struct __LIBCUDACXX_remove_objc_qualifiers<_Tp __autoreleasing> { typedef _Tp type; };
+template <class _Tp> struct __LIBCUDACXX_remove_objc_qualifiers<_Tp __unsafe_unretained> { typedef _Tp type; };
 #endif
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_pointer
-    : public __libcpp_is_pointer<typename __libcpp_remove_objc_qualifiers<typename remove_cv<_Tp>::type>::type> {};
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_pointer
+    : public __LIBCUDACXX_is_pointer<typename __LIBCUDACXX_remove_objc_qualifiers<typename remove_cv<_Tp>::type>::type> {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_pointer_v = is_pointer<_Tp>::value;
 #endif
 
 #endif // __has_builtin(__is_pointer)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_POINTER_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_POINTER_H

diff  --git a/libcxx/include/__type_traits/is_polymorphic.h b/libcxx/include/__type_traits/is_polymorphic.h
index 96da48abeeec..c95a1dacb2fe 100644
--- a/libcxx/include/__type_traits/is_polymorphic.h
+++ b/libcxx/include/__type_traits/is_polymorphic.h
@@ -6,27 +6,27 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_POLYMORPHIC_H
-#define _LIBCPP___TYPE_TRAITS_IS_POLYMORPHIC_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_POLYMORPHIC_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_POLYMORPHIC_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_polymorphic
+struct _LIBCUDACXX_TEMPLATE_VIS is_polymorphic
     : public integral_constant<bool, __is_polymorphic(_Tp)> {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_polymorphic_v = __is_polymorphic(_Tp);
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_POLYMORPHIC_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_POLYMORPHIC_H

diff  --git a/libcxx/include/__type_traits/is_primary_template.h b/libcxx/include/__type_traits/is_primary_template.h
index a9bebcf7e64c..00727ef3ea81 100644
--- a/libcxx/include/__type_traits/is_primary_template.h
+++ b/libcxx/include/__type_traits/is_primary_template.h
@@ -6,19 +6,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_PRIMARY_TEMPLATE_H
-#define _LIBCPP___TYPE_TRAITS_IS_PRIMARY_TEMPLATE_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_PRIMARY_TEMPLATE_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_PRIMARY_TEMPLATE_H
 
 #include <__config>
 #include <__type_traits/enable_if.h>
 #include <__type_traits/is_same.h>
 #include <__type_traits/is_valid_expansion.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Tp>
 using __test_for_primary_template = __enable_if_t<
@@ -29,6 +29,6 @@ using __is_primary_template = _IsValidExpansion<
     __test_for_primary_template, _Tp
   >;
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_PRIMARY_TEMPLATE_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_PRIMARY_TEMPLATE_H

diff  --git a/libcxx/include/__type_traits/is_reference.h b/libcxx/include/__type_traits/is_reference.h
index 27ca2ddb5a72..8470b9e41016 100644
--- a/libcxx/include/__type_traits/is_reference.h
+++ b/libcxx/include/__type_traits/is_reference.h
@@ -6,32 +6,32 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_REFERENCE_H
-#define _LIBCPP___TYPE_TRAITS_IS_REFERENCE_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_REFERENCE_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_REFERENCE_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 #if __has_builtin(__is_lvalue_reference) && \
     __has_builtin(__is_rvalue_reference) && \
     __has_builtin(__is_reference)
 
 template<class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_lvalue_reference : _BoolConstant<__is_lvalue_reference(_Tp)> { };
+struct _LIBCUDACXX_TEMPLATE_VIS is_lvalue_reference : _BoolConstant<__is_lvalue_reference(_Tp)> { };
 
 template<class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_rvalue_reference : _BoolConstant<__is_rvalue_reference(_Tp)> { };
+struct _LIBCUDACXX_TEMPLATE_VIS is_rvalue_reference : _BoolConstant<__is_rvalue_reference(_Tp)> { };
 
 template<class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_reference : _BoolConstant<__is_reference(_Tp)> { };
+struct _LIBCUDACXX_TEMPLATE_VIS is_reference : _BoolConstant<__is_reference(_Tp)> { };
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_reference_v = __is_reference(_Tp);
 template <class _Tp>
@@ -42,17 +42,17 @@ inline constexpr bool is_rvalue_reference_v = __is_rvalue_reference(_Tp);
 
 #else // __has_builtin(__is_lvalue_reference) && etc...
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_lvalue_reference       : public false_type {};
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_lvalue_reference<_Tp&> : public true_type {};
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_lvalue_reference       : public false_type {};
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_lvalue_reference<_Tp&> : public true_type {};
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_rvalue_reference        : public false_type {};
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_rvalue_reference<_Tp&&> : public true_type {};
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_rvalue_reference        : public false_type {};
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_rvalue_reference<_Tp&&> : public true_type {};
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_reference        : public false_type {};
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_reference<_Tp&>  : public true_type {};
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_reference<_Tp&&> : public true_type {};
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_reference        : public false_type {};
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_reference<_Tp&>  : public true_type {};
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_reference<_Tp&&> : public true_type {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_reference_v = is_reference<_Tp>::value;
 
@@ -65,6 +65,6 @@ inline constexpr bool is_rvalue_reference_v = is_rvalue_reference<_Tp>::value;
 
 #endif // __has_builtin(__is_lvalue_reference) && etc...
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_REFERENCE_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_REFERENCE_H

diff  --git a/libcxx/include/__type_traits/is_reference_wrapper.h b/libcxx/include/__type_traits/is_reference_wrapper.h
index cd391bb07e78..ded683ad792f 100644
--- a/libcxx/include/__type_traits/is_reference_wrapper.h
+++ b/libcxx/include/__type_traits/is_reference_wrapper.h
@@ -6,26 +6,26 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_REFERENCE_WRAPPER_H
-#define _LIBCPP___TYPE_TRAITS_IS_REFERENCE_WRAPPER_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_REFERENCE_WRAPPER_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_REFERENCE_WRAPPER_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 #include <__type_traits/remove_cv.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-template <class _Tp> class _LIBCPP_TEMPLATE_VIS reference_wrapper;
+template <class _Tp> class _LIBCUDACXX_TEMPLATE_VIS reference_wrapper;
 
 template <class _Tp> struct __is_reference_wrapper_impl : public false_type {};
 template <class _Tp> struct __is_reference_wrapper_impl<reference_wrapper<_Tp> > : public true_type {};
 template <class _Tp> struct __is_reference_wrapper
     : public __is_reference_wrapper_impl<typename remove_cv<_Tp>::type> {};
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_ENABLE_IF_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_ENABLE_IF_H

diff  --git a/libcxx/include/__type_traits/is_referenceable.h b/libcxx/include/__type_traits/is_referenceable.h
index b97631cc39dd..32c796b2e7a6 100644
--- a/libcxx/include/__type_traits/is_referenceable.h
+++ b/libcxx/include/__type_traits/is_referenceable.h
@@ -6,18 +6,18 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_REFERENCEABLE_H
-#define _LIBCPP___TYPE_TRAITS_IS_REFERENCEABLE_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_REFERENCEABLE_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_REFERENCEABLE_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 #include <__type_traits/is_same.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 struct __is_referenceable_impl {
     template <class _Tp> static _Tp& __test(int);
@@ -28,6 +28,6 @@ template <class _Tp>
 struct __is_referenceable : integral_constant<bool,
     _IsNotSame<decltype(__is_referenceable_impl::__test<_Tp>(0)), false_type>::value> {};
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_REFERENCEABLE_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_REFERENCEABLE_H

diff  --git a/libcxx/include/__type_traits/is_same.h b/libcxx/include/__type_traits/is_same.h
index 6fa0afbc18ca..56dde9fe9555 100644
--- a/libcxx/include/__type_traits/is_same.h
+++ b/libcxx/include/__type_traits/is_same.h
@@ -6,22 +6,22 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_SAME_H
-#define _LIBCPP___TYPE_TRAITS_IS_SAME_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_SAME_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_SAME_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Tp, class _Up>
-struct _LIBCPP_TEMPLATE_VIS is_same : _BoolConstant<__is_same(_Tp, _Up)> { };
+struct _LIBCUDACXX_TEMPLATE_VIS is_same : _BoolConstant<__is_same(_Tp, _Up)> { };
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp, class _Up>
 inline constexpr bool is_same_v = __is_same(_Tp, _Up);
 #endif
@@ -39,6 +39,6 @@ using _IsSame = _BoolConstant<__is_same(_Tp, _Up)>;
 template <class _Tp, class _Up>
 using _IsNotSame = _BoolConstant<!__is_same(_Tp, _Up)>;
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_SAME_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_SAME_H

diff  --git a/libcxx/include/__type_traits/is_scalar.h b/libcxx/include/__type_traits/is_scalar.h
index ee856dbbfec7..a69856748e86 100644
--- a/libcxx/include/__type_traits/is_scalar.h
+++ b/libcxx/include/__type_traits/is_scalar.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_SCALAR_H
-#define _LIBCPP___TYPE_TRAITS_IS_SCALAR_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_SCALAR_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_SCALAR_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
@@ -16,18 +16,18 @@
 #include <__type_traits/is_member_pointer.h>
 #include <__type_traits/is_pointer.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 #if __has_builtin(__is_scalar)
 
 template<class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_scalar : _BoolConstant<__is_scalar(_Tp)> { };
+struct _LIBCUDACXX_TEMPLATE_VIS is_scalar : _BoolConstant<__is_scalar(_Tp)> { };
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_scalar_v = __is_scalar(_Tp);
 #endif
@@ -35,11 +35,11 @@ inline constexpr bool is_scalar_v = __is_scalar(_Tp);
 #else // __has_builtin(__is_scalar)
 
 template <class _Tp> struct __is_block : false_type {};
-#if defined(_LIBCPP_HAS_EXTENSION_BLOCKS)
+#if defined(_LIBCUDACXX_HAS_EXTENSION_BLOCKS)
 template <class _Rp, class ..._Args> struct __is_block<_Rp (^)(_Args...)> : true_type {};
 #endif
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_scalar
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_scalar
     : public integral_constant<bool, is_arithmetic<_Tp>::value     ||
                                      is_member_pointer<_Tp>::value ||
                                      is_pointer<_Tp>::value        ||
@@ -47,15 +47,15 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_scalar
                                      __is_block<_Tp>::value        ||
                                      is_enum<_Tp>::value           > {};
 
-template <> struct _LIBCPP_TEMPLATE_VIS is_scalar<nullptr_t> : public true_type {};
+template <> struct _LIBCUDACXX_TEMPLATE_VIS is_scalar<nullptr_t> : public true_type {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_scalar_v = is_scalar<_Tp>::value;
 #endif
 
 #endif // __has_builtin(__is_scalar)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_SCALAR_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_SCALAR_H

diff  --git a/libcxx/include/__type_traits/is_scoped_enum.h b/libcxx/include/__type_traits/is_scoped_enum.h
index 85a412813304..ce75d0875f8c 100644
--- a/libcxx/include/__type_traits/is_scoped_enum.h
+++ b/libcxx/include/__type_traits/is_scoped_enum.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_SCOPED_ENUM_H
-#define _LIBCPP___TYPE_TRAITS_IS_SCOPED_ENUM_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_SCOPED_ENUM_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_SCOPED_ENUM_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
@@ -15,13 +15,13 @@
 #include <__type_traits/is_enum.h>
 #include <__type_traits/underlying_type.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 20
+#if _LIBCUDACXX_STD_VER > 20
 template <class _Tp, bool = is_enum_v<_Tp> >
 struct __is_scoped_enum_helper : false_type {};
 
@@ -30,13 +30,13 @@ struct __is_scoped_enum_helper<_Tp, true>
     : public bool_constant<!is_convertible_v<_Tp, underlying_type_t<_Tp> > > {};
 
 template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_scoped_enum
+struct _LIBCUDACXX_TEMPLATE_VIS is_scoped_enum
     : public __is_scoped_enum_helper<_Tp> {};
 
 template <class _Tp>
 inline constexpr bool is_scoped_enum_v = is_scoped_enum<_Tp>::value;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_SCOPED_ENUM_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_SCOPED_ENUM_H

diff  --git a/libcxx/include/__type_traits/is_signed.h b/libcxx/include/__type_traits/is_signed.h
index e9722c9b2192..25b1f6679657 100644
--- a/libcxx/include/__type_traits/is_signed.h
+++ b/libcxx/include/__type_traits/is_signed.h
@@ -6,24 +6,24 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_SIGNED_H
-#define _LIBCPP___TYPE_TRAITS_IS_SIGNED_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_SIGNED_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_SIGNED_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 #if __has_builtin(__is_signed)
 
 template<class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_signed : _BoolConstant<__is_signed(_Tp)> { };
+struct _LIBCUDACXX_TEMPLATE_VIS is_signed : _BoolConstant<__is_signed(_Tp)> { };
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_signed_v = __is_signed(_Tp);
 #endif
@@ -31,25 +31,25 @@ inline constexpr bool is_signed_v = __is_signed(_Tp);
 #else // __has_builtin(__is_signed)
 
 template <class _Tp, bool = is_integral<_Tp>::value>
-struct __libcpp_is_signed_impl : public _BoolConstant<(_Tp(-1) < _Tp(0))> {};
+struct __LIBCUDACXX_is_signed_impl : public _BoolConstant<(_Tp(-1) < _Tp(0))> {};
 
 template <class _Tp>
-struct __libcpp_is_signed_impl<_Tp, false> : public true_type {};  // floating point
+struct __LIBCUDACXX_is_signed_impl<_Tp, false> : public true_type {};  // floating point
 
 template <class _Tp, bool = is_arithmetic<_Tp>::value>
-struct __libcpp_is_signed : public __libcpp_is_signed_impl<_Tp> {};
+struct __LIBCUDACXX_is_signed : public __LIBCUDACXX_is_signed_impl<_Tp> {};
 
-template <class _Tp> struct __libcpp_is_signed<_Tp, false> : public false_type {};
+template <class _Tp> struct __LIBCUDACXX_is_signed<_Tp, false> : public false_type {};
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_signed : public __libcpp_is_signed<_Tp> {};
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_signed : public __LIBCUDACXX_is_signed<_Tp> {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_signed_v = is_signed<_Tp>::value;
 #endif
 
 #endif // __has_builtin(__is_signed)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_SIGNED_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_SIGNED_H

diff  --git a/libcxx/include/__type_traits/is_signed_integer.h b/libcxx/include/__type_traits/is_signed_integer.h
index 95aa11bfa1b5..204b051f79b2 100644
--- a/libcxx/include/__type_traits/is_signed_integer.h
+++ b/libcxx/include/__type_traits/is_signed_integer.h
@@ -6,28 +6,28 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_SIGNED_INTEGER_H
-#define _LIBCPP___TYPE_TRAITS_IS_SIGNED_INTEGER_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_SIGNED_INTEGER_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_SIGNED_INTEGER_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-template <class _Tp> struct __libcpp_is_signed_integer : public false_type {};
-template <> struct __libcpp_is_signed_integer<signed char>      : public true_type {};
-template <> struct __libcpp_is_signed_integer<signed short>     : public true_type {};
-template <> struct __libcpp_is_signed_integer<signed int>       : public true_type {};
-template <> struct __libcpp_is_signed_integer<signed long>      : public true_type {};
-template <> struct __libcpp_is_signed_integer<signed long long> : public true_type {};
-#ifndef _LIBCPP_HAS_NO_INT128
-template <> struct __libcpp_is_signed_integer<__int128_t>       : public true_type {};
+template <class _Tp> struct __LIBCUDACXX_is_signed_integer : public false_type {};
+template <> struct __LIBCUDACXX_is_signed_integer<signed char>      : public true_type {};
+template <> struct __LIBCUDACXX_is_signed_integer<signed short>     : public true_type {};
+template <> struct __LIBCUDACXX_is_signed_integer<signed int>       : public true_type {};
+template <> struct __LIBCUDACXX_is_signed_integer<signed long>      : public true_type {};
+template <> struct __LIBCUDACXX_is_signed_integer<signed long long> : public true_type {};
+#ifndef _LIBCUDACXX_HAS_NO_INT128
+template <> struct __LIBCUDACXX_is_signed_integer<__int128_t>       : public true_type {};
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_SIGNED_INTEGER_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_SIGNED_INTEGER_H

diff  --git a/libcxx/include/__type_traits/is_standard_layout.h b/libcxx/include/__type_traits/is_standard_layout.h
index 0d8b5f480f0c..016de766a394 100644
--- a/libcxx/include/__type_traits/is_standard_layout.h
+++ b/libcxx/include/__type_traits/is_standard_layout.h
@@ -6,19 +6,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_STANDARD_LAYOUT_H
-#define _LIBCPP___TYPE_TRAITS_IS_STANDARD_LAYOUT_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_STANDARD_LAYOUT_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_STANDARD_LAYOUT_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_standard_layout
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_standard_layout
 #if __has_builtin(__is_standard_layout)
     : public integral_constant<bool, __is_standard_layout(_Tp)>
 #else
@@ -26,11 +26,11 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_standard_layout
 #endif
     {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_standard_layout_v = is_standard_layout<_Tp>::value;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_STANDARD_LAYOUT_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_STANDARD_LAYOUT_H

diff  --git a/libcxx/include/__type_traits/is_trivial.h b/libcxx/include/__type_traits/is_trivial.h
index 73c2093d4082..675f3c6efba1 100644
--- a/libcxx/include/__type_traits/is_trivial.h
+++ b/libcxx/include/__type_traits/is_trivial.h
@@ -6,19 +6,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_TRIVIAL_H
-#define _LIBCPP___TYPE_TRAITS_IS_TRIVIAL_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_TRIVIAL_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_TRIVIAL_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivial
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_trivial
 #if __has_builtin(__is_trivial)
     : public integral_constant<bool, __is_trivial(_Tp)>
 #else
@@ -27,11 +27,11 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivial
 #endif
     {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_trivial_v = is_trivial<_Tp>::value;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_TRIVIAL_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_TRIVIAL_H

diff  --git a/libcxx/include/__type_traits/is_trivially_assignable.h b/libcxx/include/__type_traits/is_trivially_assignable.h
index 01540f959efe..8e828dcaaba9 100644
--- a/libcxx/include/__type_traits/is_trivially_assignable.h
+++ b/libcxx/include/__type_traits/is_trivially_assignable.h
@@ -6,28 +6,28 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_ASSIGNABLE_H
-#define _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_ASSIGNABLE_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_TRIVIALLY_ASSIGNABLE_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_TRIVIALLY_ASSIGNABLE_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Tp, class _Arg>
 struct is_trivially_assignable
     : integral_constant<bool, __is_trivially_assignable(_Tp, _Arg)>
 { };
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp, class _Arg>
 inline constexpr bool is_trivially_assignable_v = is_trivially_assignable<_Tp, _Arg>::value;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_ASSIGNABLE_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_TRIVIALLY_ASSIGNABLE_H

diff  --git a/libcxx/include/__type_traits/is_trivially_constructible.h b/libcxx/include/__type_traits/is_trivially_constructible.h
index 92ea58005f84..4a65d667dcf3 100644
--- a/libcxx/include/__type_traits/is_trivially_constructible.h
+++ b/libcxx/include/__type_traits/is_trivially_constructible.h
@@ -6,29 +6,29 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_CONSTRUCTIBLE_H
-#define _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_CONSTRUCTIBLE_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_TRIVIALLY_CONSTRUCTIBLE_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_TRIVIALLY_CONSTRUCTIBLE_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Tp, class... _Args>
-struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible
+struct _LIBCUDACXX_TEMPLATE_VIS is_trivially_constructible
     : integral_constant<bool, __is_trivially_constructible(_Tp, _Args...)>
 {
 };
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp, class... _Args>
 inline constexpr bool is_trivially_constructible_v = is_trivially_constructible<_Tp, _Args...>::value;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_CONSTRUCTIBLE_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_TRIVIALLY_CONSTRUCTIBLE_H

diff  --git a/libcxx/include/__type_traits/is_trivially_copy_assignable.h b/libcxx/include/__type_traits/is_trivially_copy_assignable.h
index 066d763884b0..cf8551f0bbca 100644
--- a/libcxx/include/__type_traits/is_trivially_copy_assignable.h
+++ b/libcxx/include/__type_traits/is_trivially_copy_assignable.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_COPY_ASSIGNABLE_H
-#define _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_COPY_ASSIGNABLE_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_TRIVIALLY_COPY_ASSIGNABLE_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_TRIVIALLY_COPY_ASSIGNABLE_H
 
 #include <__config>
 #include <__type_traits/add_const.h>
@@ -15,21 +15,21 @@
 #include <__type_traits/integral_constant.h>
 #include <__type_traits/is_trivially_assignable.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivially_copy_assignable
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_trivially_copy_assignable
     : public is_trivially_assignable<typename add_lvalue_reference<_Tp>::type,
                   typename add_lvalue_reference<typename add_const<_Tp>::type>::type> {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_trivially_copy_assignable_v = is_trivially_copy_assignable<_Tp>::value;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_COPY_ASSIGNABLE_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_TRIVIALLY_COPY_ASSIGNABLE_H

diff  --git a/libcxx/include/__type_traits/is_trivially_copy_constructible.h b/libcxx/include/__type_traits/is_trivially_copy_constructible.h
index e0c054d775d6..f8460766d839 100644
--- a/libcxx/include/__type_traits/is_trivially_copy_constructible.h
+++ b/libcxx/include/__type_traits/is_trivially_copy_constructible.h
@@ -6,29 +6,29 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_COPY_CONSTRUCTIBLE_H
-#define _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_COPY_CONSTRUCTIBLE_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_TRIVIALLY_COPY_CONSTRUCTIBLE_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_TRIVIALLY_COPY_CONSTRUCTIBLE_H
 
 #include <__config>
 #include <__type_traits/add_lvalue_reference.h>
 #include <__type_traits/integral_constant.h>
 #include <__type_traits/is_trivially_constructible.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivially_copy_constructible
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_trivially_copy_constructible
     : public is_trivially_constructible<_Tp, typename add_lvalue_reference<const _Tp>::type>
     {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_trivially_copy_constructible_v = is_trivially_copy_constructible<_Tp>::value;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_COPY_CONSTRUCTIBLE_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_TRIVIALLY_COPY_CONSTRUCTIBLE_H

diff  --git a/libcxx/include/__type_traits/is_trivially_copyable.h b/libcxx/include/__type_traits/is_trivially_copyable.h
index 3b7665217292..9cc3545697c6 100644
--- a/libcxx/include/__type_traits/is_trivially_copyable.h
+++ b/libcxx/include/__type_traits/is_trivially_copyable.h
@@ -6,27 +6,27 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_COPYABLE_H
-#define _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_COPYABLE_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_TRIVIALLY_COPYABLE_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_TRIVIALLY_COPYABLE_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivially_copyable
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_trivially_copyable
     : public integral_constant<bool, __is_trivially_copyable(_Tp)>
     {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_trivially_copyable_v = is_trivially_copyable<_Tp>::value;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_COPYABLE_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_TRIVIALLY_COPYABLE_H

diff  --git a/libcxx/include/__type_traits/is_trivially_default_constructible.h b/libcxx/include/__type_traits/is_trivially_default_constructible.h
index 822fa9c910c9..ec02da534045 100644
--- a/libcxx/include/__type_traits/is_trivially_default_constructible.h
+++ b/libcxx/include/__type_traits/is_trivially_default_constructible.h
@@ -6,28 +6,28 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_DEFAULT_CONSTRUCTIBLE_H
-#define _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_DEFAULT_CONSTRUCTIBLE_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_TRIVIALLY_DEFAULT_CONSTRUCTIBLE_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_TRIVIALLY_DEFAULT_CONSTRUCTIBLE_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 #include <__type_traits/is_trivially_constructible.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivially_default_constructible
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_trivially_default_constructible
     : public is_trivially_constructible<_Tp>
     {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_trivially_default_constructible_v = is_trivially_default_constructible<_Tp>::value;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_DEFAULT_CONSTRUCTIBLE_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_TRIVIALLY_DEFAULT_CONSTRUCTIBLE_H

diff  --git a/libcxx/include/__type_traits/is_trivially_destructible.h b/libcxx/include/__type_traits/is_trivially_destructible.h
index 3376c3eeff43..81c06c20904e 100644
--- a/libcxx/include/__type_traits/is_trivially_destructible.h
+++ b/libcxx/include/__type_traits/is_trivially_destructible.h
@@ -6,47 +6,47 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_DESTRUCTIBLE_H
-#define _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_DESTRUCTIBLE_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_TRIVIALLY_DESTRUCTIBLE_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_TRIVIALLY_DESTRUCTIBLE_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 #if __has_builtin(__is_trivially_destructible)
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivially_destructible
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_trivially_destructible
     : public integral_constant<bool, __is_trivially_destructible(_Tp)> {};
 
 #elif __has_builtin(__has_trivial_destructor)
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivially_destructible
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_trivially_destructible
     : public integral_constant<bool, is_destructible<_Tp>::value && __has_trivial_destructor(_Tp)> {};
 
 #else
 
-template <class _Tp> struct __libcpp_trivial_destructor
+template <class _Tp> struct __LIBCUDACXX_trivial_destructor
     : public integral_constant<bool, is_scalar<_Tp>::value ||
                                      is_reference<_Tp>::value> {};
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivially_destructible
-    : public __libcpp_trivial_destructor<typename remove_all_extents<_Tp>::type> {};
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_trivially_destructible
+    : public __LIBCUDACXX_trivial_destructor<typename remove_all_extents<_Tp>::type> {};
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivially_destructible<_Tp[]>
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_trivially_destructible<_Tp[]>
     : public false_type {};
 
 #endif // __has_builtin(__is_trivially_destructible)
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_trivially_destructible_v = is_trivially_destructible<_Tp>::value;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_DESTRUCTIBLE_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_TRIVIALLY_DESTRUCTIBLE_H

diff  --git a/libcxx/include/__type_traits/is_trivially_move_assignable.h b/libcxx/include/__type_traits/is_trivially_move_assignable.h
index fc033a40dea8..7b6799a2d09a 100644
--- a/libcxx/include/__type_traits/is_trivially_move_assignable.h
+++ b/libcxx/include/__type_traits/is_trivially_move_assignable.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_MOVE_ASSIGNABLE_H
-#define _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_MOVE_ASSIGNABLE_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_TRIVIALLY_MOVE_ASSIGNABLE_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_TRIVIALLY_MOVE_ASSIGNABLE_H
 
 #include <__config>
 #include <__type_traits/add_lvalue_reference.h>
@@ -15,22 +15,22 @@
 #include <__type_traits/integral_constant.h>
 #include <__type_traits/is_trivially_assignable.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivially_move_assignable
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_trivially_move_assignable
     : public is_trivially_assignable<typename add_lvalue_reference<_Tp>::type,
                                      typename add_rvalue_reference<_Tp>::type>
     {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_trivially_move_assignable_v = is_trivially_move_assignable<_Tp>::value;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_MOVE_ASSIGNABLE_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_TRIVIALLY_MOVE_ASSIGNABLE_H

diff  --git a/libcxx/include/__type_traits/is_trivially_move_constructible.h b/libcxx/include/__type_traits/is_trivially_move_constructible.h
index be005cc26406..d6e78d69bd88 100644
--- a/libcxx/include/__type_traits/is_trivially_move_constructible.h
+++ b/libcxx/include/__type_traits/is_trivially_move_constructible.h
@@ -6,29 +6,29 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_MOVE_CONSTRUCTIBLE_H
-#define _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_MOVE_CONSTRUCTIBLE_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_TRIVIALLY_MOVE_CONSTRUCTIBLE_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_TRIVIALLY_MOVE_CONSTRUCTIBLE_H
 
 #include <__config>
 #include <__type_traits/add_rvalue_reference.h>
 #include <__type_traits/integral_constant.h>
 #include <__type_traits/is_trivially_constructible.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivially_move_constructible
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_trivially_move_constructible
     : public is_trivially_constructible<_Tp, typename add_rvalue_reference<_Tp>::type>
     {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_trivially_move_constructible_v = is_trivially_move_constructible<_Tp>::value;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_MOVE_CONSTRUCTIBLE_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_TRIVIALLY_MOVE_CONSTRUCTIBLE_H

diff  --git a/libcxx/include/__type_traits/is_unbounded_array.h b/libcxx/include/__type_traits/is_unbounded_array.h
index 11a12607e1e0..f01b3ee2997e 100644
--- a/libcxx/include/__type_traits/is_unbounded_array.h
+++ b/libcxx/include/__type_traits/is_unbounded_array.h
@@ -6,25 +6,25 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_UNBOUNDED_ARRAY_H
-#define _LIBCPP___TYPE_TRAITS_IS_UNBOUNDED_ARRAY_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_UNBOUNDED_ARRAY_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_UNBOUNDED_ARRAY_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-template <class>     struct _LIBCPP_TEMPLATE_VIS __libcpp_is_unbounded_array        : false_type {};
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS __libcpp_is_unbounded_array<_Tp[]> : true_type {};
+template <class>     struct _LIBCUDACXX_TEMPLATE_VIS __LIBCUDACXX_is_unbounded_array        : false_type {};
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS __LIBCUDACXX_is_unbounded_array<_Tp[]> : true_type {};
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
-template <class>     struct _LIBCPP_TEMPLATE_VIS is_unbounded_array        : false_type {};
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_unbounded_array<_Tp[]> : true_type {};
+template <class>     struct _LIBCUDACXX_TEMPLATE_VIS is_unbounded_array        : false_type {};
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_unbounded_array<_Tp[]> : true_type {};
 
 template <class _Tp>
 inline constexpr
@@ -32,6 +32,6 @@ bool is_unbounded_array_v  = is_unbounded_array<_Tp>::value;
 
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_UNBOUNDED_ARRAY_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_UNBOUNDED_ARRAY_H

diff  --git a/libcxx/include/__type_traits/is_union.h b/libcxx/include/__type_traits/is_union.h
index 3e8cffe034d4..8abebceae2c4 100644
--- a/libcxx/include/__type_traits/is_union.h
+++ b/libcxx/include/__type_traits/is_union.h
@@ -6,27 +6,27 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_UNION_H
-#define _LIBCPP___TYPE_TRAITS_IS_UNION_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_UNION_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_UNION_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 #include <__type_traits/remove_cv.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_union
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_union
     : public integral_constant<bool, __is_union(_Tp)> {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_union_v = __is_union(_Tp);
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_UNION_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_UNION_H

diff  --git a/libcxx/include/__type_traits/is_unsigned.h b/libcxx/include/__type_traits/is_unsigned.h
index 17cd909d5478..fb62d2ab6c6e 100644
--- a/libcxx/include/__type_traits/is_unsigned.h
+++ b/libcxx/include/__type_traits/is_unsigned.h
@@ -6,27 +6,27 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_UNSIGNED_H
-#define _LIBCPP___TYPE_TRAITS_IS_UNSIGNED_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_UNSIGNED_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_UNSIGNED_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 #include <__type_traits/is_arithmetic.h>
 #include <__type_traits/is_integral.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 // Before AppleClang 14, __is_unsigned returned true for enums with signed underlying type.
-#if __has_builtin(__is_unsigned) && !(defined(_LIBCPP_APPLE_CLANG_VER) && _LIBCPP_APPLE_CLANG_VER < 1400)
+#if __has_builtin(__is_unsigned) && !(defined(_LIBCUDACXX_APPLE_CLANG_VER) && _LIBCUDACXX_APPLE_CLANG_VER < 1400)
 
 template<class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_unsigned : _BoolConstant<__is_unsigned(_Tp)> { };
+struct _LIBCUDACXX_TEMPLATE_VIS is_unsigned : _BoolConstant<__is_unsigned(_Tp)> { };
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_unsigned_v = __is_unsigned(_Tp);
 #endif
@@ -34,25 +34,25 @@ inline constexpr bool is_unsigned_v = __is_unsigned(_Tp);
 #else // __has_builtin(__is_unsigned)
 
 template <class _Tp, bool = is_integral<_Tp>::value>
-struct __libcpp_is_unsigned_impl : public _BoolConstant<(_Tp(0) < _Tp(-1))> {};
+struct __LIBCUDACXX_is_unsigned_impl : public _BoolConstant<(_Tp(0) < _Tp(-1))> {};
 
 template <class _Tp>
-struct __libcpp_is_unsigned_impl<_Tp, false> : public false_type {};  // floating point
+struct __LIBCUDACXX_is_unsigned_impl<_Tp, false> : public false_type {};  // floating point
 
 template <class _Tp, bool = is_arithmetic<_Tp>::value>
-struct __libcpp_is_unsigned : public __libcpp_is_unsigned_impl<_Tp> {};
+struct __LIBCUDACXX_is_unsigned : public __LIBCUDACXX_is_unsigned_impl<_Tp> {};
 
-template <class _Tp> struct __libcpp_is_unsigned<_Tp, false> : public false_type {};
+template <class _Tp> struct __LIBCUDACXX_is_unsigned<_Tp, false> : public false_type {};
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_unsigned : public __libcpp_is_unsigned<_Tp> {};
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_unsigned : public __LIBCUDACXX_is_unsigned<_Tp> {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_unsigned_v = is_unsigned<_Tp>::value;
 #endif
 
 #endif // __has_builtin(__is_unsigned)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_UNSIGNED_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_UNSIGNED_H

diff  --git a/libcxx/include/__type_traits/is_unsigned_integer.h b/libcxx/include/__type_traits/is_unsigned_integer.h
index 54b29acd9ea3..a124ae526ce5 100644
--- a/libcxx/include/__type_traits/is_unsigned_integer.h
+++ b/libcxx/include/__type_traits/is_unsigned_integer.h
@@ -6,28 +6,28 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_UNSIGNED_INTEGER_H
-#define _LIBCPP___TYPE_TRAITS_IS_UNSIGNED_INTEGER_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_UNSIGNED_INTEGER_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_UNSIGNED_INTEGER_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-template <class _Tp> struct __libcpp_is_unsigned_integer : public false_type {};
-template <> struct __libcpp_is_unsigned_integer<unsigned char>      : public true_type {};
-template <> struct __libcpp_is_unsigned_integer<unsigned short>     : public true_type {};
-template <> struct __libcpp_is_unsigned_integer<unsigned int>       : public true_type {};
-template <> struct __libcpp_is_unsigned_integer<unsigned long>      : public true_type {};
-template <> struct __libcpp_is_unsigned_integer<unsigned long long> : public true_type {};
-#ifndef _LIBCPP_HAS_NO_INT128
-template <> struct __libcpp_is_unsigned_integer<__uint128_t>        : public true_type {};
+template <class _Tp> struct __LIBCUDACXX_is_unsigned_integer : public false_type {};
+template <> struct __LIBCUDACXX_is_unsigned_integer<unsigned char>      : public true_type {};
+template <> struct __LIBCUDACXX_is_unsigned_integer<unsigned short>     : public true_type {};
+template <> struct __LIBCUDACXX_is_unsigned_integer<unsigned int>       : public true_type {};
+template <> struct __LIBCUDACXX_is_unsigned_integer<unsigned long>      : public true_type {};
+template <> struct __LIBCUDACXX_is_unsigned_integer<unsigned long long> : public true_type {};
+#ifndef _LIBCUDACXX_HAS_NO_INT128
+template <> struct __LIBCUDACXX_is_unsigned_integer<__uint128_t>        : public true_type {};
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_UNSIGNED_INTEGER_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_UNSIGNED_INTEGER_H

diff  --git a/libcxx/include/__type_traits/is_valid_expansion.h b/libcxx/include/__type_traits/is_valid_expansion.h
index c45db7509e41..08f14dce641b 100644
--- a/libcxx/include/__type_traits/is_valid_expansion.h
+++ b/libcxx/include/__type_traits/is_valid_expansion.h
@@ -6,17 +6,17 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_VALID_EXPANSION_H
-#define _LIBCPP___TYPE_TRAITS_IS_VALID_EXPANSION_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_VALID_EXPANSION_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_VALID_EXPANSION_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <template <class...> class _Templ, class ..._Args, class = _Templ<_Args...> >
 true_type __sfinae_test_impl(int);
@@ -24,8 +24,8 @@ template <template <class...> class, class ...>
 false_type __sfinae_test_impl(...);
 
 template <template <class ...> class _Templ, class ..._Args>
-using _IsValidExpansion _LIBCPP_NODEBUG = decltype(__sfinae_test_impl<_Templ, _Args...>(0));
+using _IsValidExpansion _LIBCUDACXX_NODEBUG = decltype(__sfinae_test_impl<_Templ, _Args...>(0));
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_VALID_EXPANSION_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_VALID_EXPANSION_H

diff  --git a/libcxx/include/__type_traits/is_void.h b/libcxx/include/__type_traits/is_void.h
index 4cebf18633b2..90e3c055cd37 100644
--- a/libcxx/include/__type_traits/is_void.h
+++ b/libcxx/include/__type_traits/is_void.h
@@ -6,40 +6,40 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_VOID_H
-#define _LIBCPP___TYPE_TRAITS_IS_VOID_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_VOID_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_VOID_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 #if __has_builtin(__is_void)
 
 template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_void : _BoolConstant<__is_void(_Tp)> { };
+struct _LIBCUDACXX_TEMPLATE_VIS is_void : _BoolConstant<__is_void(_Tp)> { };
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_void_v = __is_void(_Tp);
 #endif
 
 #else
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_void
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_void
     : public is_same<typename remove_cv<_Tp>::type, void> {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_void_v = is_void<_Tp>::value;
 #endif
 
 #endif // __has_builtin(__is_void)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_VOID_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_VOID_H

diff  --git a/libcxx/include/__type_traits/is_volatile.h b/libcxx/include/__type_traits/is_volatile.h
index fb922679d62b..364be7822199 100644
--- a/libcxx/include/__type_traits/is_volatile.h
+++ b/libcxx/include/__type_traits/is_volatile.h
@@ -6,40 +6,40 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_IS_VOLATILE_H
-#define _LIBCPP___TYPE_TRAITS_IS_VOLATILE_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_IS_VOLATILE_H
+#define _LIBCUDACXX___TYPE_TRAITS_IS_VOLATILE_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 #if __has_builtin(__is_volatile)
 
 template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_volatile : _BoolConstant<__is_volatile(_Tp)> { };
+struct _LIBCUDACXX_TEMPLATE_VIS is_volatile : _BoolConstant<__is_volatile(_Tp)> { };
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_volatile_v = __is_volatile(_Tp);
 #endif
 
 #else
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_volatile               : public false_type {};
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_volatile<_Tp volatile> : public true_type {};
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_volatile               : public false_type {};
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS is_volatile<_Tp volatile> : public true_type {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr bool is_volatile_v = is_volatile<_Tp>::value;
 #endif
 
 #endif // __has_builtin(__is_volatile)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_IS_VOLATILE_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_IS_VOLATILE_H

diff  --git a/libcxx/include/__type_traits/lazy.h b/libcxx/include/__type_traits/lazy.h
index 6874b06f3c5a..060ddffd1504 100644
--- a/libcxx/include/__type_traits/lazy.h
+++ b/libcxx/include/__type_traits/lazy.h
@@ -6,20 +6,20 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_LAZY_H
-#define _LIBCPP___TYPE_TRAITS_LAZY_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_LAZY_H
+#define _LIBCUDACXX___TYPE_TRAITS_LAZY_H
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <template <class...> class _Func, class ..._Args>
 struct _Lazy : _Func<_Args...> {};
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_LAZY_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_LAZY_H

diff  --git a/libcxx/include/__type_traits/make_32_64_or_128_bit.h b/libcxx/include/__type_traits/make_32_64_or_128_bit.h
index 87340eac7fb1..fe7329f75b3d 100644
--- a/libcxx/include/__type_traits/make_32_64_or_128_bit.h
+++ b/libcxx/include/__type_traits/make_32_64_or_128_bit.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_MAKE_32_64_OR_128_BIT_H
-#define _LIBCPP___TYPE_TRAITS_MAKE_32_64_OR_128_BIT_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_MAKE_32_64_OR_128_BIT_H
+#define _LIBCUDACXX___TYPE_TRAITS_MAKE_32_64_OR_128_BIT_H
 
 #include <__config>
 #include <__type_traits/conditional.h>
@@ -17,24 +17,24 @@
 #include <__type_traits/make_unsigned.h>
 #include <cstdint>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 /// Helper to promote an integral to smallest 32, 64, or 128 bit representation.
 ///
 /// The restriction is the same as the integral version of to_char.
 template <class _Tp>
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
   requires (is_signed_v<_Tp> || is_unsigned_v<_Tp> || is_same_v<_Tp, char>)
 #endif
 using __make_32_64_or_128_bit_t =
   __copy_unsigned_t<_Tp,
     __conditional_t<sizeof(_Tp) <= sizeof(int32_t),    int32_t,
     __conditional_t<sizeof(_Tp) <= sizeof(int64_t),    int64_t,
-#ifndef _LIBCPP_HAS_NO_INT128
+#ifndef _LIBCUDACXX_HAS_NO_INT128
     __conditional_t<sizeof(_Tp) <= sizeof(__int128_t), __int128_t,
     /* else */                                         void>
 #else
@@ -43,6 +43,6 @@ using __make_32_64_or_128_bit_t =
     > >
   >;
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_MAKE_32_64_OR_128_BIT_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_MAKE_32_64_OR_128_BIT_H

diff  --git a/libcxx/include/__type_traits/make_signed.h b/libcxx/include/__type_traits/make_signed.h
index fbc31172a978..6353023ddba8 100644
--- a/libcxx/include/__type_traits/make_signed.h
+++ b/libcxx/include/__type_traits/make_signed.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_MAKE_SIGNED_H
-#define _LIBCPP___TYPE_TRAITS_MAKE_SIGNED_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_MAKE_SIGNED_H
+#define _LIBCUDACXX___TYPE_TRAITS_MAKE_SIGNED_H
 
 #include <__config>
 #include <__type_traits/apply_cv.h>
@@ -17,11 +17,11 @@
 #include <__type_traits/remove_cv.h>
 #include <__type_traits/type_list.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 typedef
     __type_list<signed char,
@@ -29,11 +29,11 @@ typedef
     __type_list<signed int,
     __type_list<signed long,
     __type_list<signed long long,
-#ifndef _LIBCPP_HAS_NO_INT128
+#ifndef _LIBCUDACXX_HAS_NO_INT128
     __type_list<__int128_t,
 #endif
     __nat
-#ifndef _LIBCPP_HAS_NO_INT128
+#ifndef _LIBCUDACXX_HAS_NO_INT128
     >
 #endif
     > > > > > __signed_types;
@@ -56,21 +56,21 @@ template <> struct __make_signed<  signed long,      true> {typedef long      ty
 template <> struct __make_signed<unsigned long,      true> {typedef long      type;};
 template <> struct __make_signed<  signed long long, true> {typedef long long type;};
 template <> struct __make_signed<unsigned long long, true> {typedef long long type;};
-#ifndef _LIBCPP_HAS_NO_INT128
+#ifndef _LIBCUDACXX_HAS_NO_INT128
 template <> struct __make_signed<__int128_t,         true> {typedef __int128_t type;};
 template <> struct __make_signed<__uint128_t,        true> {typedef __int128_t type;};
 #endif
 
 template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS make_signed
+struct _LIBCUDACXX_TEMPLATE_VIS make_signed
 {
     typedef typename __apply_cv<_Tp, typename __make_signed<typename remove_cv<_Tp>::type>::type>::type type;
 };
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <class _Tp> using make_signed_t = typename make_signed<_Tp>::type;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_MAKE_SIGNED_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_MAKE_SIGNED_H

diff  --git a/libcxx/include/__type_traits/make_unsigned.h b/libcxx/include/__type_traits/make_unsigned.h
index 8110a5ca9609..8fea076229b6 100644
--- a/libcxx/include/__type_traits/make_unsigned.h
+++ b/libcxx/include/__type_traits/make_unsigned.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_MAKE_UNSIGNED_H
-#define _LIBCPP___TYPE_TRAITS_MAKE_UNSIGNED_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_MAKE_UNSIGNED_H
+#define _LIBCUDACXX___TYPE_TRAITS_MAKE_UNSIGNED_H
 
 #include <__config>
 #include <__type_traits/apply_cv.h>
@@ -19,11 +19,11 @@
 #include <__type_traits/remove_cv.h>
 #include <__type_traits/type_list.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 typedef
     __type_list<unsigned char,
@@ -31,11 +31,11 @@ typedef
     __type_list<unsigned int,
     __type_list<unsigned long,
     __type_list<unsigned long long,
-#ifndef _LIBCPP_HAS_NO_INT128
+#ifndef _LIBCUDACXX_HAS_NO_INT128
     __type_list<__uint128_t,
 #endif
     __nat
-#ifndef _LIBCPP_HAS_NO_INT128
+#ifndef _LIBCUDACXX_HAS_NO_INT128
     >
 #endif
     > > > > > __unsigned_types;
@@ -58,24 +58,24 @@ template <> struct __make_unsigned<  signed long,      true> {typedef unsigned l
 template <> struct __make_unsigned<unsigned long,      true> {typedef unsigned long      type;};
 template <> struct __make_unsigned<  signed long long, true> {typedef unsigned long long type;};
 template <> struct __make_unsigned<unsigned long long, true> {typedef unsigned long long type;};
-#ifndef _LIBCPP_HAS_NO_INT128
+#ifndef _LIBCUDACXX_HAS_NO_INT128
 template <> struct __make_unsigned<__int128_t,         true> {typedef __uint128_t        type;};
 template <> struct __make_unsigned<__uint128_t,        true> {typedef __uint128_t        type;};
 #endif
 
 template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS make_unsigned
+struct _LIBCUDACXX_TEMPLATE_VIS make_unsigned
 {
     typedef typename __apply_cv<_Tp, typename __make_unsigned<typename remove_cv<_Tp>::type>::type>::type type;
 };
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <class _Tp> using make_unsigned_t = typename make_unsigned<_Tp>::type;
 #endif
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 template <class _Tp>
-_LIBCPP_HIDE_FROM_ABI constexpr
+_LIBCUDACXX_HIDE_FROM_ABI constexpr
 typename make_unsigned<_Tp>::type __to_unsigned_like(_Tp __x) noexcept {
     return static_cast<typename make_unsigned<_Tp>::type>(__x);
 }
@@ -84,6 +84,6 @@ typename make_unsigned<_Tp>::type __to_unsigned_like(_Tp __x) noexcept {
 template <class _Tp, class _Up>
 using __copy_unsigned_t = __conditional_t<is_unsigned<_Tp>::value, typename make_unsigned<_Up>::type, _Up>;
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_MAKE_UNSIGNED_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_MAKE_UNSIGNED_H

diff  --git a/libcxx/include/__type_traits/nat.h b/libcxx/include/__type_traits/nat.h
index 5216ef520420..7f5d026cdea4 100644
--- a/libcxx/include/__type_traits/nat.h
+++ b/libcxx/include/__type_traits/nat.h
@@ -6,20 +6,20 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_NAT_H
-#define _LIBCPP___TYPE_TRAITS_NAT_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_NAT_H
+#define _LIBCUDACXX___TYPE_TRAITS_NAT_H
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 struct __nat
 {
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
     __nat() = delete;
     __nat(const __nat&) = delete;
     __nat& operator=(const __nat&) = delete;
@@ -27,6 +27,6 @@ struct __nat
 #endif
 };
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_NAT_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_NAT_H

diff  --git a/libcxx/include/__type_traits/negation.h b/libcxx/include/__type_traits/negation.h
index 92f205fb838e..9506c58060fa 100644
--- a/libcxx/include/__type_traits/negation.h
+++ b/libcxx/include/__type_traits/negation.h
@@ -6,28 +6,28 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_NEGATION_H
-#define _LIBCPP___TYPE_TRAITS_NEGATION_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_NEGATION_H
+#define _LIBCUDACXX___TYPE_TRAITS_NEGATION_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Pred>
 struct _Not : _BoolConstant<!_Pred::value> {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 struct negation : _Not<_Tp> {};
 template<class _Tp>
 inline constexpr bool negation_v = negation<_Tp>::value;
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCUDACXX_STD_VER > 14
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_NEGATION_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_NEGATION_H

diff  --git a/libcxx/include/__type_traits/promote.h b/libcxx/include/__type_traits/promote.h
index a9226a74b300..f6a60fe16022 100644
--- a/libcxx/include/__type_traits/promote.h
+++ b/libcxx/include/__type_traits/promote.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_PROMOTE_H
-#define _LIBCPP___TYPE_TRAITS_PROMOTE_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_PROMOTE_H
+#define _LIBCUDACXX___TYPE_TRAITS_PROMOTE_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
@@ -15,11 +15,11 @@
 #include <__utility/declval.h>
 #include <cstddef>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Tp>
 struct __numeric_type
@@ -90,6 +90,6 @@ class __promote_imp<_A1, void, void, true>
 template <class _A1, class _A2 = void, class _A3 = void>
 class __promote : public __promote_imp<_A1, _A2, _A3> {};
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_PROMOTE_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_PROMOTE_H

diff  --git a/libcxx/include/__type_traits/rank.h b/libcxx/include/__type_traits/rank.h
index 193d3fd129a1..ab0084d8d8e7 100644
--- a/libcxx/include/__type_traits/rank.h
+++ b/libcxx/include/__type_traits/rank.h
@@ -6,31 +6,31 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_RANK_H
-#define _LIBCPP___TYPE_TRAITS_RANK_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_RANK_H
+#define _LIBCUDACXX___TYPE_TRAITS_RANK_H
 
 #include <__config>
 #include <__type_traits/integral_constant.h>
 #include <cstddef>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS rank
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS rank
     : public integral_constant<size_t, 0> {};
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS rank<_Tp[]>
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS rank<_Tp[]>
     : public integral_constant<size_t, rank<_Tp>::value + 1> {};
-template <class _Tp, size_t _Np> struct _LIBCPP_TEMPLATE_VIS rank<_Tp[_Np]>
+template <class _Tp, size_t _Np> struct _LIBCUDACXX_TEMPLATE_VIS rank<_Tp[_Np]>
     : public integral_constant<size_t, rank<_Tp>::value + 1> {};
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
 inline constexpr size_t rank_v = rank<_Tp>::value;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_RANK_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_RANK_H

diff  --git a/libcxx/include/__type_traits/remove_all_extents.h b/libcxx/include/__type_traits/remove_all_extents.h
index 075e3acabb44..3f84ccb2ebb4 100644
--- a/libcxx/include/__type_traits/remove_all_extents.h
+++ b/libcxx/include/__type_traits/remove_all_extents.h
@@ -6,29 +6,29 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_REMOVE_ALL_EXTENTS_H
-#define _LIBCPP___TYPE_TRAITS_REMOVE_ALL_EXTENTS_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_REMOVE_ALL_EXTENTS_H
+#define _LIBCUDACXX___TYPE_TRAITS_REMOVE_ALL_EXTENTS_H
 
 #include <__config>
 #include <cstddef>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_all_extents
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS remove_all_extents
     {typedef _Tp type;};
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_all_extents<_Tp[]>
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS remove_all_extents<_Tp[]>
     {typedef typename remove_all_extents<_Tp>::type type;};
-template <class _Tp, size_t _Np> struct _LIBCPP_TEMPLATE_VIS remove_all_extents<_Tp[_Np]>
+template <class _Tp, size_t _Np> struct _LIBCUDACXX_TEMPLATE_VIS remove_all_extents<_Tp[_Np]>
     {typedef typename remove_all_extents<_Tp>::type type;};
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <class _Tp> using remove_all_extents_t = typename remove_all_extents<_Tp>::type;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_REMOVE_ALL_EXTENTS_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_REMOVE_ALL_EXTENTS_H

diff  --git a/libcxx/include/__type_traits/remove_const.h b/libcxx/include/__type_traits/remove_const.h
index 8efc893e965a..7704896df4ee 100644
--- a/libcxx/include/__type_traits/remove_const.h
+++ b/libcxx/include/__type_traits/remove_const.h
@@ -6,23 +6,23 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_REMOVE_CONST_H
-#define _LIBCPP___TYPE_TRAITS_REMOVE_CONST_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_REMOVE_CONST_H
+#define _LIBCUDACXX___TYPE_TRAITS_REMOVE_CONST_H
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_const            {typedef _Tp type;};
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_const<const _Tp> {typedef _Tp type;};
-#if _LIBCPP_STD_VER > 11
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS remove_const            {typedef _Tp type;};
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS remove_const<const _Tp> {typedef _Tp type;};
+#if _LIBCUDACXX_STD_VER > 11
 template <class _Tp> using remove_const_t = typename remove_const<_Tp>::type;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_REMOVE_CONST_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_REMOVE_CONST_H

diff  --git a/libcxx/include/__type_traits/remove_cv.h b/libcxx/include/__type_traits/remove_cv.h
index ce1e4e45c6d1..356cf92725fd 100644
--- a/libcxx/include/__type_traits/remove_cv.h
+++ b/libcxx/include/__type_traits/remove_cv.h
@@ -6,25 +6,25 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_REMOVE_CV_H
-#define _LIBCPP___TYPE_TRAITS_REMOVE_CV_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_REMOVE_CV_H
+#define _LIBCUDACXX___TYPE_TRAITS_REMOVE_CV_H
 
 #include <__config>
 #include <__type_traits/remove_const.h>
 #include <__type_traits/remove_volatile.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_cv
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS remove_cv
 {typedef typename remove_volatile<typename remove_const<_Tp>::type>::type type;};
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <class _Tp> using remove_cv_t = typename remove_cv<_Tp>::type;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_REMOVE_CV_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_REMOVE_CV_H

diff  --git a/libcxx/include/__type_traits/remove_cvref.h b/libcxx/include/__type_traits/remove_cvref.h
index d937501fedce..19be1f8d268c 100644
--- a/libcxx/include/__type_traits/remove_cvref.h
+++ b/libcxx/include/__type_traits/remove_cvref.h
@@ -6,36 +6,36 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_REMOVE_CVREF_H
-#define _LIBCPP___TYPE_TRAITS_REMOVE_CVREF_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_REMOVE_CVREF_H
+#define _LIBCUDACXX___TYPE_TRAITS_REMOVE_CVREF_H
 
 #include <__config>
 #include <__type_traits/is_same.h>
 #include <__type_traits/remove_cv.h>
 #include <__type_traits/remove_reference.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Tp>
-using __uncvref_t _LIBCPP_NODEBUG = typename remove_cv<typename remove_reference<_Tp>::type>::type;
+using __uncvref_t _LIBCUDACXX_NODEBUG = typename remove_cv<typename remove_reference<_Tp>::type>::type;
 
 template <class _Tp, class _Up>
 struct __is_same_uncvref : _IsSame<__uncvref_t<_Tp>, __uncvref_t<_Up> > {};
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 // remove_cvref - same as __uncvref
 template <class _Tp>
 struct remove_cvref {
-    using type _LIBCPP_NODEBUG = __uncvref_t<_Tp>;
+    using type _LIBCUDACXX_NODEBUG = __uncvref_t<_Tp>;
 };
 
 template <class _Tp> using remove_cvref_t = typename remove_cvref<_Tp>::type;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_REMOVE_CVREF_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_REMOVE_CVREF_H

diff  --git a/libcxx/include/__type_traits/remove_extent.h b/libcxx/include/__type_traits/remove_extent.h
index e353de361616..b833e57273a9 100644
--- a/libcxx/include/__type_traits/remove_extent.h
+++ b/libcxx/include/__type_traits/remove_extent.h
@@ -6,29 +6,29 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_REMOVE_EXTENT_H
-#define _LIBCPP___TYPE_TRAITS_REMOVE_EXTENT_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_REMOVE_EXTENT_H
+#define _LIBCUDACXX___TYPE_TRAITS_REMOVE_EXTENT_H
 
 #include <__config>
 #include <cstddef>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_extent
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS remove_extent
     {typedef _Tp type;};
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_extent<_Tp[]>
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS remove_extent<_Tp[]>
     {typedef _Tp type;};
-template <class _Tp, size_t _Np> struct _LIBCPP_TEMPLATE_VIS remove_extent<_Tp[_Np]>
+template <class _Tp, size_t _Np> struct _LIBCUDACXX_TEMPLATE_VIS remove_extent<_Tp[_Np]>
     {typedef _Tp type;};
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <class _Tp> using remove_extent_t = typename remove_extent<_Tp>::type;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_REMOVE_EXTENT_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_REMOVE_EXTENT_H

diff  --git a/libcxx/include/__type_traits/remove_pointer.h b/libcxx/include/__type_traits/remove_pointer.h
index 50cde3829470..af25ac92d267 100644
--- a/libcxx/include/__type_traits/remove_pointer.h
+++ b/libcxx/include/__type_traits/remove_pointer.h
@@ -6,27 +6,27 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_REMOVE_POINTER_H
-#define _LIBCPP___TYPE_TRAITS_REMOVE_POINTER_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_REMOVE_POINTER_H
+#define _LIBCUDACXX___TYPE_TRAITS_REMOVE_POINTER_H
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_pointer                      {typedef _LIBCPP_NODEBUG _Tp type;};
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_pointer<_Tp*>                {typedef _LIBCPP_NODEBUG _Tp type;};
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_pointer<_Tp* const>          {typedef _LIBCPP_NODEBUG _Tp type;};
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_pointer<_Tp* volatile>       {typedef _LIBCPP_NODEBUG _Tp type;};
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_pointer<_Tp* const volatile> {typedef _LIBCPP_NODEBUG _Tp type;};
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS remove_pointer                      {typedef _LIBCUDACXX_NODEBUG _Tp type;};
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS remove_pointer<_Tp*>                {typedef _LIBCUDACXX_NODEBUG _Tp type;};
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS remove_pointer<_Tp* const>          {typedef _LIBCUDACXX_NODEBUG _Tp type;};
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS remove_pointer<_Tp* volatile>       {typedef _LIBCUDACXX_NODEBUG _Tp type;};
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS remove_pointer<_Tp* const volatile> {typedef _LIBCUDACXX_NODEBUG _Tp type;};
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <class _Tp> using remove_pointer_t = typename remove_pointer<_Tp>::type;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_REMOVE_POINTER_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_REMOVE_POINTER_H

diff  --git a/libcxx/include/__type_traits/remove_reference.h b/libcxx/include/__type_traits/remove_reference.h
index a69e48dc584b..79e614c8b6f5 100644
--- a/libcxx/include/__type_traits/remove_reference.h
+++ b/libcxx/include/__type_traits/remove_reference.h
@@ -6,26 +6,26 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_REMOVE_REFERENCE_H
-#define _LIBCPP___TYPE_TRAITS_REMOVE_REFERENCE_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_REMOVE_REFERENCE_H
+#define _LIBCUDACXX___TYPE_TRAITS_REMOVE_REFERENCE_H
 
 #include <__config>
 #include <cstddef>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_reference        {typedef _LIBCPP_NODEBUG _Tp type;};
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_reference<_Tp&>  {typedef _LIBCPP_NODEBUG _Tp type;};
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_reference<_Tp&&> {typedef _LIBCPP_NODEBUG _Tp type;};
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS remove_reference        {typedef _LIBCUDACXX_NODEBUG _Tp type;};
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS remove_reference<_Tp&>  {typedef _LIBCUDACXX_NODEBUG _Tp type;};
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS remove_reference<_Tp&&> {typedef _LIBCUDACXX_NODEBUG _Tp type;};
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <class _Tp> using remove_reference_t = typename remove_reference<_Tp>::type;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_REMOVE_REFERENCE_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_REMOVE_REFERENCE_H

diff  --git a/libcxx/include/__type_traits/remove_volatile.h b/libcxx/include/__type_traits/remove_volatile.h
index 79f64c46a27d..722819f49265 100644
--- a/libcxx/include/__type_traits/remove_volatile.h
+++ b/libcxx/include/__type_traits/remove_volatile.h
@@ -6,23 +6,23 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_REMOVE_VOLATILE_H
-#define _LIBCPP___TYPE_TRAITS_REMOVE_VOLATILE_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_REMOVE_VOLATILE_H
+#define _LIBCUDACXX___TYPE_TRAITS_REMOVE_VOLATILE_H
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_volatile               {typedef _Tp type;};
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_volatile<volatile _Tp> {typedef _Tp type;};
-#if _LIBCPP_STD_VER > 11
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS remove_volatile               {typedef _Tp type;};
+template <class _Tp> struct _LIBCUDACXX_TEMPLATE_VIS remove_volatile<volatile _Tp> {typedef _Tp type;};
+#if _LIBCUDACXX_STD_VER > 11
 template <class _Tp> using remove_volatile_t = typename remove_volatile<_Tp>::type;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_REMOVE_VOLATILE_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_REMOVE_VOLATILE_H

diff  --git a/libcxx/include/__type_traits/type_identity.h b/libcxx/include/__type_traits/type_identity.h
index 42e52b16725b..e470b31f40ed 100644
--- a/libcxx/include/__type_traits/type_identity.h
+++ b/libcxx/include/__type_traits/type_identity.h
@@ -6,28 +6,28 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_TYPE_IDENTITY_H
-#define _LIBCPP___TYPE_TRAITS_TYPE_IDENTITY_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_TYPE_IDENTITY_H
+#define _LIBCUDACXX___TYPE_TRAITS_TYPE_IDENTITY_H
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Tp>
 struct __type_identity { typedef _Tp type; };
 
 template <class _Tp>
-using __type_identity_t _LIBCPP_NODEBUG = typename __type_identity<_Tp>::type;
+using __type_identity_t _LIBCUDACXX_NODEBUG = typename __type_identity<_Tp>::type;
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 template<class _Tp> struct type_identity { typedef _Tp type; };
 template<class _Tp> using type_identity_t = typename type_identity<_Tp>::type;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_TYPE_IDENTITY_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_TYPE_IDENTITY_H

diff  --git a/libcxx/include/__type_traits/type_list.h b/libcxx/include/__type_traits/type_list.h
index 5a9e3319a1d4..cea868fc5235 100644
--- a/libcxx/include/__type_traits/type_list.h
+++ b/libcxx/include/__type_traits/type_list.h
@@ -6,17 +6,17 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_TYPE_LIST_H
-#define _LIBCPP___TYPE_TRAITS_TYPE_LIST_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_TYPE_LIST_H
+#define _LIBCUDACXX___TYPE_TRAITS_TYPE_LIST_H
 
 #include <__config>
 #include <cstddef>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Hp, class _Tp>
 struct __type_list
@@ -30,15 +30,15 @@ template <class _TypeList, size_t _Size, bool = _Size <= sizeof(typename _TypeLi
 template <class _Hp, class _Tp, size_t _Size>
 struct __find_first<__type_list<_Hp, _Tp>, _Size, true>
 {
-    typedef _LIBCPP_NODEBUG _Hp type;
+    typedef _LIBCUDACXX_NODEBUG _Hp type;
 };
 
 template <class _Hp, class _Tp, size_t _Size>
 struct __find_first<__type_list<_Hp, _Tp>, _Size, false>
 {
-    typedef _LIBCPP_NODEBUG typename __find_first<_Tp, _Size>::type type;
+    typedef _LIBCUDACXX_NODEBUG typename __find_first<_Tp, _Size>::type type;
 };
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_TYPE_LIST_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_TYPE_LIST_H

diff  --git a/libcxx/include/__type_traits/underlying_type.h b/libcxx/include/__type_traits/underlying_type.h
index 1c8db6432371..44141178430f 100644
--- a/libcxx/include/__type_traits/underlying_type.h
+++ b/libcxx/include/__type_traits/underlying_type.h
@@ -6,17 +6,17 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_UNDERLYING_TYPE_H
-#define _LIBCPP___TYPE_TRAITS_UNDERLYING_TYPE_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_UNDERLYING_TYPE_H
+#define _LIBCUDACXX___TYPE_TRAITS_UNDERLYING_TYPE_H
 
 #include <__config>
 #include <__type_traits/is_enum.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Tp, bool = is_enum<_Tp>::value> struct __underlying_type_impl;
 
@@ -32,10 +32,10 @@ struct __underlying_type_impl<_Tp, true>
 template <class _Tp>
 struct underlying_type : __underlying_type_impl<_Tp, is_enum<_Tp>::value> {};
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <class _Tp> using underlying_type_t = typename underlying_type<_Tp>::type;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_UNDERLYING_TYPE_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_UNDERLYING_TYPE_H

diff  --git a/libcxx/include/__type_traits/void_t.h b/libcxx/include/__type_traits/void_t.h
index a71ab5e4b07f..56d24870e271 100644
--- a/libcxx/include/__type_traits/void_t.h
+++ b/libcxx/include/__type_traits/void_t.h
@@ -6,24 +6,24 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___TYPE_TRAITS_VOID_T_H
-#define _LIBCPP___TYPE_TRAITS_VOID_T_H
+#ifndef _LIBCUDACXX___TYPE_TRAITS_VOID_T_H
+#define _LIBCUDACXX___TYPE_TRAITS_VOID_T_H
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class...> using void_t = void;
 #endif
 
 template <class>
 struct __void_t { typedef void type; };
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___TYPE_TRAITS_VOID_T_H
+#endif // _LIBCUDACXX___TYPE_TRAITS_VOID_T_H

diff  --git a/libcxx/include/__utility/as_const.h b/libcxx/include/__utility/as_const.h
index be7dd8c7cf23..a288fda6570e 100644
--- a/libcxx/include/__utility/as_const.h
+++ b/libcxx/include/__utility/as_const.h
@@ -6,28 +6,28 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___UTILITY_AS_CONST_H
-#define _LIBCPP___UTILITY_AS_CONST_H
+#ifndef _LIBCUDACXX___UTILITY_AS_CONST_H
+#define _LIBCUDACXX___UTILITY_AS_CONST_H
 
 #include <__config>
 #include <__utility/forward.h>
 #include <__utility/move.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
-_LIBCPP_NODISCARD_EXT constexpr add_const_t<_Tp>& as_const(_Tp& __t) noexcept { return __t; }
+_LIBCUDACXX_NODISCARD_EXT constexpr add_const_t<_Tp>& as_const(_Tp& __t) noexcept { return __t; }
 
 template <class _Tp>
 void as_const(const _Tp&&) = delete;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___UTILITY_AS_CONST_H
+#endif // _LIBCUDACXX___UTILITY_AS_CONST_H

diff  --git a/libcxx/include/__utility/auto_cast.h b/libcxx/include/__utility/auto_cast.h
index e9079443959f..524d5e4fe95f 100644
--- a/libcxx/include/__utility/auto_cast.h
+++ b/libcxx/include/__utility/auto_cast.h
@@ -7,16 +7,16 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___UTILITY_AUTO_CAST_H
-#define _LIBCPP___UTILITY_AUTO_CAST_H
+#ifndef _LIBCUDACXX___UTILITY_AUTO_CAST_H
+#define _LIBCUDACXX___UTILITY_AUTO_CAST_H
 
 #include <__config>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#define _LIBCPP_AUTO_CAST(expr) static_cast<typename decay<decltype((expr))>::type>(expr)
+#define _LIBCUDACXX_AUTO_CAST(expr) static_cast<typename decay<decltype((expr))>::type>(expr)
 
-#endif // _LIBCPP___UTILITY_AUTO_CAST_H
+#endif // _LIBCUDACXX___UTILITY_AUTO_CAST_H

diff  --git a/libcxx/include/__utility/cmp.h b/libcxx/include/__utility/cmp.h
index 3cfd98106705..caaa6d1838ea 100644
--- a/libcxx/include/__utility/cmp.h
+++ b/libcxx/include/__utility/cmp.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___UTILITY_CMP_H
-#define _LIBCPP___UTILITY_CMP_H
+#ifndef _LIBCUDACXX___UTILITY_CMP_H
+#define _LIBCUDACXX___UTILITY_CMP_H
 
 #include <__config>
 #include <__utility/forward.h>
@@ -15,32 +15,32 @@
 #include <limits>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 template<class _Tp, class... _Up>
 struct _IsSameAsAny : _Or<_IsSame<_Tp, _Up>...> {};
 
 template<class _Tp>
 concept __is_safe_integral_cmp = is_integral_v<_Tp> &&
                       !_IsSameAsAny<_Tp, bool, char, char16_t, char32_t
-#ifndef _LIBCPP_HAS_NO_CHAR8_T
+#ifndef _LIBCUDACXX_HAS_NO_CHAR8_T
                                     , char8_t
 #endif
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
                                     , wchar_t
 #endif
                                     >::value;
 
 template<__is_safe_integral_cmp _Tp, __is_safe_integral_cmp _Up>
-_LIBCPP_INLINE_VISIBILITY constexpr
+_LIBCUDACXX_INLINE_VISIBILITY constexpr
 bool cmp_equal(_Tp __t, _Up __u) noexcept
 {
   if constexpr (is_signed_v<_Tp> == is_signed_v<_Up>)
@@ -52,14 +52,14 @@ bool cmp_equal(_Tp __t, _Up __u) noexcept
 }
 
 template<__is_safe_integral_cmp _Tp, __is_safe_integral_cmp _Up>
-_LIBCPP_INLINE_VISIBILITY constexpr
+_LIBCUDACXX_INLINE_VISIBILITY constexpr
 bool cmp_not_equal(_Tp __t, _Up __u) noexcept
 {
-  return !_VSTD::cmp_equal(__t, __u);
+  return !_CUDA_VSTD::cmp_equal(__t, __u);
 }
 
 template<__is_safe_integral_cmp _Tp, __is_safe_integral_cmp _Up>
-_LIBCPP_INLINE_VISIBILITY constexpr
+_LIBCUDACXX_INLINE_VISIBILITY constexpr
 bool cmp_less(_Tp __t, _Up __u) noexcept
 {
   if constexpr (is_signed_v<_Tp> == is_signed_v<_Up>)
@@ -71,37 +71,37 @@ bool cmp_less(_Tp __t, _Up __u) noexcept
 }
 
 template<__is_safe_integral_cmp _Tp, __is_safe_integral_cmp _Up>
-_LIBCPP_INLINE_VISIBILITY constexpr
+_LIBCUDACXX_INLINE_VISIBILITY constexpr
 bool cmp_greater(_Tp __t, _Up __u) noexcept
 {
-  return _VSTD::cmp_less(__u, __t);
+  return _CUDA_VSTD::cmp_less(__u, __t);
 }
 
 template<__is_safe_integral_cmp _Tp, __is_safe_integral_cmp _Up>
-_LIBCPP_INLINE_VISIBILITY constexpr
+_LIBCUDACXX_INLINE_VISIBILITY constexpr
 bool cmp_less_equal(_Tp __t, _Up __u) noexcept
 {
-  return !_VSTD::cmp_greater(__t, __u);
+  return !_CUDA_VSTD::cmp_greater(__t, __u);
 }
 
 template<__is_safe_integral_cmp _Tp, __is_safe_integral_cmp _Up>
-_LIBCPP_INLINE_VISIBILITY constexpr
+_LIBCUDACXX_INLINE_VISIBILITY constexpr
 bool cmp_greater_equal(_Tp __t, _Up __u) noexcept
 {
-  return !_VSTD::cmp_less(__t, __u);
+  return !_CUDA_VSTD::cmp_less(__t, __u);
 }
 
 template<__is_safe_integral_cmp _Tp, __is_safe_integral_cmp _Up>
-_LIBCPP_INLINE_VISIBILITY constexpr
+_LIBCUDACXX_INLINE_VISIBILITY constexpr
 bool in_range(_Up __u) noexcept
 {
-  return _VSTD::cmp_less_equal(__u, numeric_limits<_Tp>::max()) &&
-         _VSTD::cmp_greater_equal(__u, numeric_limits<_Tp>::min());
+  return _CUDA_VSTD::cmp_less_equal(__u, numeric_limits<_Tp>::max()) &&
+         _CUDA_VSTD::cmp_greater_equal(__u, numeric_limits<_Tp>::min());
 }
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP___UTILITY_CMP_H
+#endif // _LIBCUDACXX___UTILITY_CMP_H

diff  --git a/libcxx/include/__utility/declval.h b/libcxx/include/__utility/declval.h
index 97fd1eba91c6..29f2dcf42345 100644
--- a/libcxx/include/__utility/declval.h
+++ b/libcxx/include/__utility/declval.h
@@ -6,29 +6,29 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___UTILITY_DECLVAL_H
-#define _LIBCPP___UTILITY_DECLVAL_H
+#ifndef _LIBCUDACXX___UTILITY_DECLVAL_H
+#define _LIBCUDACXX___UTILITY_DECLVAL_H
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 // Suppress deprecation notice for volatile-qualified return type resulting
 // from volatile-qualified types _Tp.
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+_LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
 template <class _Tp>
 _Tp&& __declval(int);
 template <class _Tp>
 _Tp __declval(long);
-_LIBCPP_SUPPRESS_DEPRECATED_POP
+_LIBCUDACXX_SUPPRESS_DEPRECATED_POP
 
 template <class _Tp>
 decltype(__declval<_Tp>(0)) declval() _NOEXCEPT;
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___UTILITY_DECLVAL_H
+#endif // _LIBCUDACXX___UTILITY_DECLVAL_H

diff  --git a/libcxx/include/__utility/exchange.h b/libcxx/include/__utility/exchange.h
index d9b3c151755f..607cfd915731 100644
--- a/libcxx/include/__utility/exchange.h
+++ b/libcxx/include/__utility/exchange.h
@@ -6,32 +6,32 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___UTILITY_EXCHANGE_H
-#define _LIBCPP___UTILITY_EXCHANGE_H
+#ifndef _LIBCUDACXX___UTILITY_EXCHANGE_H
+#define _LIBCUDACXX___UTILITY_EXCHANGE_H
 
 #include <__config>
 #include <__utility/forward.h>
 #include <__utility/move.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template<class _T1, class _T2 = _T1>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 _T1 exchange(_T1& __obj, _T2&& __new_value)
     noexcept(is_nothrow_move_constructible<_T1>::value && is_nothrow_assignable<_T1&, _T2>::value)
 {
-    _T1 __old_value = _VSTD::move(__obj);
-    __obj = _VSTD::forward<_T2>(__new_value);
+    _T1 __old_value = _CUDA_VSTD::move(__obj);
+    __obj = _CUDA_VSTD::forward<_T2>(__new_value);
     return __old_value;
 }
-#endif // _LIBCPP_STD_VER > 11
+#endif // _LIBCUDACXX_STD_VER > 11
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___UTILITY_EXCHANGE_H
+#endif // _LIBCUDACXX___UTILITY_EXCHANGE_H

diff  --git a/libcxx/include/__utility/forward.h b/libcxx/include/__utility/forward.h
index 03ca16d9f955..e6d0ff1f5b4a 100644
--- a/libcxx/include/__utility/forward.h
+++ b/libcxx/include/__utility/forward.h
@@ -7,32 +7,32 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___UTILITY_FORWARD_H
-#define _LIBCPP___UTILITY_FORWARD_H
+#ifndef _LIBCUDACXX___UTILITY_FORWARD_H
+#define _LIBCUDACXX___UTILITY_FORWARD_H
 
 #include <__config>
 #include <__type_traits/is_reference.h>
 #include <__type_traits/remove_reference.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Tp>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR _Tp&&
+_LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR _Tp&&
 forward(typename remove_reference<_Tp>::type& __t) _NOEXCEPT {
   return static_cast<_Tp&&>(__t);
 }
 
 template <class _Tp>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR _Tp&&
+_LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR _Tp&&
 forward(typename remove_reference<_Tp>::type&& __t) _NOEXCEPT {
   static_assert(!is_lvalue_reference<_Tp>::value, "cannot forward an rvalue as an lvalue");
   return static_cast<_Tp&&>(__t);
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___UTILITY_FORWARD_H
+#endif // _LIBCUDACXX___UTILITY_FORWARD_H

diff  --git a/libcxx/include/__utility/in_place.h b/libcxx/include/__utility/in_place.h
index 7a4973fa0407..243c38845b11 100644
--- a/libcxx/include/__utility/in_place.h
+++ b/libcxx/include/__utility/in_place.h
@@ -6,34 +6,34 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___UTILITY_IN_PLACE_H
-#define _LIBCPP___UTILITY_IN_PLACE_H
+#ifndef _LIBCUDACXX___UTILITY_IN_PLACE_H
+#define _LIBCUDACXX___UTILITY_IN_PLACE_H
 
 #include <__config>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 
-struct _LIBCPP_TYPE_VIS in_place_t {
+struct _LIBCUDACXX_TYPE_VIS in_place_t {
     explicit in_place_t() = default;
 };
 inline constexpr in_place_t in_place{};
 
 template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS in_place_type_t {
+struct _LIBCUDACXX_TEMPLATE_VIS in_place_type_t {
     explicit in_place_type_t() = default;
 };
 template <class _Tp>
 inline constexpr in_place_type_t<_Tp> in_place_type{};
 
 template <size_t _Idx>
-struct _LIBCPP_TEMPLATE_VIS in_place_index_t {
+struct _LIBCUDACXX_TEMPLATE_VIS in_place_index_t {
     explicit in_place_index_t() = default;
 };
 template <size_t _Idx>
@@ -51,8 +51,8 @@ template <size_t _Idx> struct __is_inplace_index_imp<in_place_index_t<_Idx>> : t
 template <class _Tp>
 using __is_inplace_index = __is_inplace_index_imp<__uncvref_t<_Tp>>;
 
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCUDACXX_STD_VER > 14
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___UTILITY_IN_PLACE_H
+#endif // _LIBCUDACXX___UTILITY_IN_PLACE_H

diff  --git a/libcxx/include/__utility/integer_sequence.h b/libcxx/include/__utility/integer_sequence.h
index 633f1333e247..91e8a3424764 100644
--- a/libcxx/include/__utility/integer_sequence.h
+++ b/libcxx/include/__utility/integer_sequence.h
@@ -6,28 +6,28 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___UTILITY_INTEGER_SEQUENCE_H
-#define _LIBCPP___UTILITY_INTEGER_SEQUENCE_H
+#ifndef _LIBCUDACXX___UTILITY_INTEGER_SEQUENCE_H
+#define _LIBCUDACXX___UTILITY_INTEGER_SEQUENCE_H
 
 #include <__config>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 
 template<class _Tp, _Tp... _Ip>
-struct _LIBCPP_TEMPLATE_VIS integer_sequence
+struct _LIBCUDACXX_TEMPLATE_VIS integer_sequence
 {
     typedef _Tp value_type;
     static_assert( is_integral<_Tp>::value,
                   "std::integer_sequence can only be instantiated with an integral type" );
     static
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr
     size_t
     size() noexcept { return sizeof...(_Ip); }
@@ -36,14 +36,14 @@ struct _LIBCPP_TEMPLATE_VIS integer_sequence
 template<size_t... _Ip>
     using index_sequence = integer_sequence<size_t, _Ip...>;
 
-#if __has_builtin(__make_integer_seq) && !defined(_LIBCPP_TESTING_FALLBACK_MAKE_INTEGER_SEQUENCE)
+#if __has_builtin(__make_integer_seq) && !defined(_LIBCUDACXX_TESTING_FALLBACK_MAKE_INTEGER_SEQUENCE)
 
 template <class _Tp, _Tp _Ep>
-using __make_integer_sequence _LIBCPP_NODEBUG = __make_integer_seq<integer_sequence, _Tp, _Ep>;
+using __make_integer_sequence _LIBCUDACXX_NODEBUG = __make_integer_seq<integer_sequence, _Tp, _Ep>;
 
 #else
 
-template<typename _Tp, _Tp _Np> using __make_integer_sequence_unchecked _LIBCPP_NODEBUG =
+template<typename _Tp, _Tp _Np> using __make_integer_sequence_unchecked _LIBCUDACXX_NODEBUG =
   typename __detail::__make<_Np>::type::template __convert<integer_sequence, _Tp>;
 
 template <class _Tp, _Tp _Ep>
@@ -54,11 +54,11 @@ struct __make_integer_sequence_checked
     static_assert(0 <= _Ep, "std::make_integer_sequence must have a non-negative sequence length");
     // Workaround GCC bug by preventing bad installations when 0 <= _Ep
     // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68929
-    typedef _LIBCPP_NODEBUG __make_integer_sequence_unchecked<_Tp, 0 <= _Ep ? _Ep : 0> type;
+    typedef _LIBCUDACXX_NODEBUG __make_integer_sequence_unchecked<_Tp, 0 <= _Ep ? _Ep : 0> type;
 };
 
 template <class _Tp, _Tp _Ep>
-using __make_integer_sequence _LIBCPP_NODEBUG = typename __make_integer_sequence_checked<_Tp, _Ep>::type;
+using __make_integer_sequence _LIBCUDACXX_NODEBUG = typename __make_integer_sequence_checked<_Tp, _Ep>::type;
 
 #endif
 
@@ -71,8 +71,8 @@ template<size_t _Np>
 template<class... _Tp>
     using index_sequence_for = make_index_sequence<sizeof...(_Tp)>;
 
-#endif // _LIBCPP_STD_VER > 11
+#endif // _LIBCUDACXX_STD_VER > 11
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___UTILITY_INTEGER_SEQUENCE_H
+#endif // _LIBCUDACXX___UTILITY_INTEGER_SEQUENCE_H

diff  --git a/libcxx/include/__utility/move.h b/libcxx/include/__utility/move.h
index da0d986093d6..1e597cbf7fb5 100644
--- a/libcxx/include/__utility/move.h
+++ b/libcxx/include/__utility/move.h
@@ -7,22 +7,22 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___UTILITY_MOVE_H
-#define _LIBCPP___UTILITY_MOVE_H
+#ifndef _LIBCUDACXX___UTILITY_MOVE_H
+#define _LIBCUDACXX___UTILITY_MOVE_H
 
 #include <__config>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Tp>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR typename remove_reference<_Tp>::type&&
+_LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR typename remove_reference<_Tp>::type&&
 move(_Tp&& __t) _NOEXCEPT {
-  typedef _LIBCPP_NODEBUG typename remove_reference<_Tp>::type _Up;
+  typedef _LIBCUDACXX_NODEBUG typename remove_reference<_Tp>::type _Up;
   return static_cast<_Up&&>(__t);
 }
 
@@ -32,11 +32,11 @@ using __move_if_noexcept_result_t =
                          _Tp&&>::type;
 
 template <class _Tp>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 __move_if_noexcept_result_t<_Tp>
+_LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 __move_if_noexcept_result_t<_Tp>
 move_if_noexcept(_Tp& __x) _NOEXCEPT {
-  return _VSTD::move(__x);
+  return _CUDA_VSTD::move(__x);
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___UTILITY_MOVE_H
+#endif // _LIBCUDACXX___UTILITY_MOVE_H

diff  --git a/libcxx/include/__utility/pair.h b/libcxx/include/__utility/pair.h
index 97635c2e61b5..b6c5a8f11317 100644
--- a/libcxx/include/__utility/pair.h
+++ b/libcxx/include/__utility/pair.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___UTILITY_PAIR_H
-#define _LIBCPP___UTILITY_PAIR_H
+#ifndef _LIBCUDACXX___UTILITY_PAIR_H
+#define _LIBCUDACXX___UTILITY_PAIR_H
 
 #include <__compare/common_comparison_category.h>
 #include <__compare/synth_three_way.h>
@@ -20,25 +20,25 @@
 #include <cstddef>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if defined(_LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR)
+#if defined(_LIBCUDACXX_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR)
 template <class, class>
 struct __non_trivially_copyable_base {
-  _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_CONSTEXPR _LIBCUDACXX_INLINE_VISIBILITY
   __non_trivially_copyable_base() _NOEXCEPT {}
-  _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _LIBCUDACXX_INLINE_VISIBILITY
   __non_trivially_copyable_base(__non_trivially_copyable_base const&) _NOEXCEPT {}
 };
 #endif
 
 template <class _T1, class _T2>
-struct _LIBCPP_TEMPLATE_VIS pair
-#if defined(_LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR)
+struct _LIBCUDACXX_TEMPLATE_VIS pair
+#if defined(_LIBCUDACXX_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR)
 : private __non_trivially_copyable_base<_T1, _T2>
 #endif
 {
@@ -48,25 +48,25 @@ struct _LIBCPP_TEMPLATE_VIS pair
     _T1 first;
     _T2 second;
 
-#if !defined(_LIBCPP_CXX03_LANG)
+#if !defined(_LIBCUDACXX_CXX03_LANG)
     pair(pair const&) = default;
     pair(pair&&) = default;
 #else
   // Use the implicitly declared copy constructor in C++03
 #endif
 
-#ifdef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+#ifdef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     pair() : first(), second() {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     pair(_T1 const& __t1, _T2 const& __t2) : first(__t1), second(__t2) {}
 
     template <class _U1, class _U2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     pair(const pair<_U1, _U2>& __p) : first(__p.first), second(__p.second) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     pair& operator=(pair const& __p) {
         first = __p.first;
         second = __p.second;
@@ -105,7 +105,7 @@ struct _LIBCPP_TEMPLATE_VIS pair
     };
 
     template <bool _MaybeEnable>
-    using _CheckArgsDep _LIBCPP_NODEBUG = typename conditional<
+    using _CheckArgsDep _LIBCUDACXX_NODEBUG = typename conditional<
       _MaybeEnable, _CheckArgs, __check_tuple_constructor_fail>::type;
 
     struct _CheckTupleLikeConstructor {
@@ -127,7 +127,7 @@ struct _LIBCPP_TEMPLATE_VIS pair
     };
 
     template <class _Tuple>
-    using _CheckTLC _LIBCPP_NODEBUG = typename conditional<
+    using _CheckTLC _LIBCUDACXX_NODEBUG = typename conditional<
         __tuple_like_with_size<_Tuple, 2>::value
             && !is_same<typename decay<_Tuple>::type, pair>::value,
         _CheckTupleLikeConstructor,
@@ -137,7 +137,7 @@ struct _LIBCPP_TEMPLATE_VIS pair
     template<bool _Dummy = true, typename enable_if<
             _CheckArgsDep<_Dummy>::__enable_explicit_default()
     >::type* = nullptr>
-    explicit _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+    explicit _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR
     pair() _NOEXCEPT_(is_nothrow_default_constructible<first_type>::value &&
                       is_nothrow_default_constructible<second_type>::value)
         : first(), second() {}
@@ -145,7 +145,7 @@ struct _LIBCPP_TEMPLATE_VIS pair
     template<bool _Dummy = true, typename enable_if<
             _CheckArgsDep<_Dummy>::__enable_implicit_default()
     >::type* = nullptr>
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR
     pair() _NOEXCEPT_(is_nothrow_default_constructible<first_type>::value &&
                       is_nothrow_default_constructible<second_type>::value)
         : first(), second() {}
@@ -153,7 +153,7 @@ struct _LIBCPP_TEMPLATE_VIS pair
     template <bool _Dummy = true, typename enable_if<
              _CheckArgsDep<_Dummy>::template __enable_explicit<_T1 const&, _T2 const&>()
     >::type* = nullptr>
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
     explicit pair(_T1 const& __t1, _T2 const& __t2)
         _NOEXCEPT_(is_nothrow_copy_constructible<first_type>::value &&
                    is_nothrow_copy_constructible<second_type>::value)
@@ -162,44 +162,44 @@ struct _LIBCPP_TEMPLATE_VIS pair
     template<bool _Dummy = true, typename enable_if<
             _CheckArgsDep<_Dummy>::template __enable_implicit<_T1 const&, _T2 const&>()
     >::type* = nullptr>
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
     pair(_T1 const& __t1, _T2 const& __t2)
         _NOEXCEPT_(is_nothrow_copy_constructible<first_type>::value &&
                    is_nothrow_copy_constructible<second_type>::value)
         : first(__t1), second(__t2) {}
 
     template <
-#if _LIBCPP_STD_VER > 20 // http://wg21.link/P1951
+#if _LIBCUDACXX_STD_VER > 20 // http://wg21.link/P1951
         class _U1 = _T1, class _U2 = _T2,
 #else
         class _U1, class _U2,
 #endif
         typename enable_if<_CheckArgs::template __enable_explicit<_U1, _U2>()>::type* = nullptr
     >
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
     explicit pair(_U1&& __u1, _U2&& __u2)
         _NOEXCEPT_((is_nothrow_constructible<first_type, _U1>::value &&
                     is_nothrow_constructible<second_type, _U2>::value))
-        : first(_VSTD::forward<_U1>(__u1)), second(_VSTD::forward<_U2>(__u2)) {}
+        : first(_CUDA_VSTD::forward<_U1>(__u1)), second(_CUDA_VSTD::forward<_U2>(__u2)) {}
 
     template <
-#if _LIBCPP_STD_VER > 20 // http://wg21.link/P1951
+#if _LIBCUDACXX_STD_VER > 20 // http://wg21.link/P1951
         class _U1 = _T1, class _U2 = _T2,
 #else
         class _U1, class _U2,
 #endif
         typename enable_if<_CheckArgs::template __enable_implicit<_U1, _U2>()>::type* = nullptr
     >
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
     pair(_U1&& __u1, _U2&& __u2)
         _NOEXCEPT_((is_nothrow_constructible<first_type, _U1>::value &&
                     is_nothrow_constructible<second_type, _U2>::value))
-        : first(_VSTD::forward<_U1>(__u1)), second(_VSTD::forward<_U2>(__u2)) {}
+        : first(_CUDA_VSTD::forward<_U1>(__u1)), second(_CUDA_VSTD::forward<_U2>(__u2)) {}
 
     template<class _U1, class _U2, typename enable_if<
             _CheckArgs::template __enable_explicit<_U1 const&, _U2 const&>()
     >::type* = nullptr>
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
     explicit pair(pair<_U1, _U2> const& __p)
         _NOEXCEPT_((is_nothrow_constructible<first_type, _U1 const&>::value &&
                     is_nothrow_constructible<second_type, _U2 const&>::value))
@@ -208,7 +208,7 @@ struct _LIBCPP_TEMPLATE_VIS pair
     template<class _U1, class _U2, typename enable_if<
             _CheckArgs::template __enable_implicit<_U1 const&, _U2 const&>()
     >::type* = nullptr>
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
     pair(pair<_U1, _U2> const& __p)
         _NOEXCEPT_((is_nothrow_constructible<first_type, _U1 const&>::value &&
                     is_nothrow_constructible<second_type, _U2 const&>::value))
@@ -217,39 +217,39 @@ struct _LIBCPP_TEMPLATE_VIS pair
     template<class _U1, class _U2, typename enable_if<
             _CheckArgs::template __enable_explicit<_U1, _U2>()
     >::type* = nullptr>
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
     explicit pair(pair<_U1, _U2>&&__p)
         _NOEXCEPT_((is_nothrow_constructible<first_type, _U1&&>::value &&
                     is_nothrow_constructible<second_type, _U2&&>::value))
-        : first(_VSTD::forward<_U1>(__p.first)), second(_VSTD::forward<_U2>(__p.second)) {}
+        : first(_CUDA_VSTD::forward<_U1>(__p.first)), second(_CUDA_VSTD::forward<_U2>(__p.second)) {}
 
     template<class _U1, class _U2, typename enable_if<
             _CheckArgs::template __enable_implicit<_U1, _U2>()
     >::type* = nullptr>
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
     pair(pair<_U1, _U2>&& __p)
         _NOEXCEPT_((is_nothrow_constructible<first_type, _U1&&>::value &&
                     is_nothrow_constructible<second_type, _U2&&>::value))
-        : first(_VSTD::forward<_U1>(__p.first)), second(_VSTD::forward<_U2>(__p.second)) {}
+        : first(_CUDA_VSTD::forward<_U1>(__p.first)), second(_CUDA_VSTD::forward<_U2>(__p.second)) {}
 
     template<class _Tuple, typename enable_if<
             _CheckTLC<_Tuple>::template __enable_explicit<_Tuple>()
     >::type* = nullptr>
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
     explicit pair(_Tuple&& __p)
-        : first(_VSTD::get<0>(_VSTD::forward<_Tuple>(__p))),
-          second(_VSTD::get<1>(_VSTD::forward<_Tuple>(__p))) {}
+        : first(_CUDA_VSTD::get<0>(_CUDA_VSTD::forward<_Tuple>(__p))),
+          second(_CUDA_VSTD::get<1>(_CUDA_VSTD::forward<_Tuple>(__p))) {}
 
     template<class _Tuple, typename enable_if<
             _CheckTLC<_Tuple>::template __enable_implicit<_Tuple>()
     >::type* = nullptr>
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
     pair(_Tuple&& __p)
-        : first(_VSTD::get<0>(_VSTD::forward<_Tuple>(__p))),
-          second(_VSTD::get<1>(_VSTD::forward<_Tuple>(__p))) {}
+        : first(_CUDA_VSTD::get<0>(_CUDA_VSTD::forward<_Tuple>(__p))),
+          second(_CUDA_VSTD::get<1>(_CUDA_VSTD::forward<_Tuple>(__p))) {}
 
     template <class... _Args1, class... _Args2>
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     pair(piecewise_construct_t __pc,
          tuple<_Args1...> __first_args, tuple<_Args2...> __second_args)
         _NOEXCEPT_((is_nothrow_constructible<first_type, _Args1...>::value &&
@@ -258,7 +258,7 @@ struct _LIBCPP_TEMPLATE_VIS pair
                 typename __make_tuple_indices<sizeof...(_Args1)>::type(),
                 typename __make_tuple_indices<sizeof...(_Args2) >::type()) {}
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     pair& operator=(typename conditional<
                         is_copy_assignable<first_type>::value &&
                         is_copy_assignable<second_type>::value,
@@ -271,7 +271,7 @@ struct _LIBCPP_TEMPLATE_VIS pair
         return *this;
     }
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     pair& operator=(typename conditional<
                         is_move_assignable<first_type>::value &&
                         is_move_assignable<second_type>::value,
@@ -279,43 +279,43 @@ struct _LIBCPP_TEMPLATE_VIS pair
         _NOEXCEPT_(is_nothrow_move_assignable<first_type>::value &&
                    is_nothrow_move_assignable<second_type>::value)
     {
-        first = _VSTD::forward<first_type>(__p.first);
-        second = _VSTD::forward<second_type>(__p.second);
+        first = _CUDA_VSTD::forward<first_type>(__p.first);
+        second = _CUDA_VSTD::forward<second_type>(__p.second);
         return *this;
     }
 
     template <class _Tuple, typename enable_if<
             _CheckTLC<_Tuple>::template __enable_assign<_Tuple>()
      >::type* = nullptr>
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     pair& operator=(_Tuple&& __p) {
-        first = _VSTD::get<0>(_VSTD::forward<_Tuple>(__p));
-        second = _VSTD::get<1>(_VSTD::forward<_Tuple>(__p));
+        first = _CUDA_VSTD::get<0>(_CUDA_VSTD::forward<_Tuple>(__p));
+        second = _CUDA_VSTD::get<1>(_CUDA_VSTD::forward<_Tuple>(__p));
         return *this;
     }
 #endif
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     void
     swap(pair& __p) _NOEXCEPT_(__is_nothrow_swappable<first_type>::value &&
                                __is_nothrow_swappable<second_type>::value)
     {
-        using _VSTD::swap;
+        using _CUDA_VSTD::swap;
         swap(first,  __p.first);
         swap(second, __p.second);
     }
 private:
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
     template <class... _Args1, class... _Args2, size_t... _I1, size_t... _I2>
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     pair(piecewise_construct_t,
          tuple<_Args1...>& __first_args, tuple<_Args2...>& __second_args,
          __tuple_indices<_I1...>, __tuple_indices<_I2...>);
 #endif
 };
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template<class _T1, class _T2>
 pair(_T1, _T2) -> pair<_T1, _T2>;
 #endif
@@ -323,32 +323,32 @@ pair(_T1, _T2) -> pair<_T1, _T2>;
 // [pairs.spec], specialized algorithms
 
 template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 bool
 operator==(const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
 {
     return __x.first == __y.first && __x.second == __y.second;
 }
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 template <class _T1, class _T2>
-_LIBCPP_HIDE_FROM_ABI constexpr
+_LIBCUDACXX_HIDE_FROM_ABI constexpr
 common_comparison_category_t<
         __synth_three_way_result<_T1>,
         __synth_three_way_result<_T2> >
 operator<=>(const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
 {
-    if (auto __c = _VSTD::__synth_three_way(__x.first, __y.first); __c != 0) {
+    if (auto __c = _CUDA_VSTD::__synth_three_way(__x.first, __y.first); __c != 0) {
       return __c;
     }
-    return _VSTD::__synth_three_way(__x.second, __y.second);
+    return _CUDA_VSTD::__synth_three_way(__x.second, __y.second);
 }
 
-#else // _LIBCPP_STD_VER > 17
+#else // _LIBCUDACXX_STD_VER > 17
 
 template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 bool
 operator!=(const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
 {
@@ -356,7 +356,7 @@ operator!=(const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
 }
 
 template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 bool
 operator< (const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
 {
@@ -364,7 +364,7 @@ operator< (const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
 }
 
 template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 bool
 operator> (const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
 {
@@ -372,7 +372,7 @@ operator> (const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
 }
 
 template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 bool
 operator>=(const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
 {
@@ -380,16 +380,16 @@ operator>=(const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
 }
 
 template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 bool
 operator<=(const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
 {
     return !(__y < __x);
 }
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-#if _LIBCPP_STD_VER > 20
+#if _LIBCUDACXX_STD_VER > 20
 template <class _T1, class _T2, class _U1, class _U2, template<class> class _TQual, template<class> class _UQual>
     requires requires { typename pair<common_reference_t<_TQual<_T1>, _UQual<_U1>>,
                                       common_reference_t<_TQual<_T2>, _UQual<_U2>>>; }
@@ -403,10 +403,10 @@ template <class _T1, class _T2, class _U1, class _U2>
 struct common_type<pair<_T1, _T2>, pair<_U1, _U2>> {
     using type = pair<common_type_t<_T1, _U1>, common_type_t<_T2, _U2>>;
 };
-#endif // _LIBCPP_STD_VER > 20
+#endif // _LIBCUDACXX_STD_VER > 20
 
 template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 typename enable_if
 <
     __is_swappable<_T1>::value &&
@@ -420,49 +420,49 @@ swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y)
     __x.swap(__y);
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
 template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 pair<typename __unwrap_ref_decay<_T1>::type, typename __unwrap_ref_decay<_T2>::type>
 make_pair(_T1&& __t1, _T2&& __t2)
 {
     return pair<typename __unwrap_ref_decay<_T1>::type, typename __unwrap_ref_decay<_T2>::type>
-               (_VSTD::forward<_T1>(__t1), _VSTD::forward<_T2>(__t2));
+               (_CUDA_VSTD::forward<_T1>(__t1), _CUDA_VSTD::forward<_T2>(__t2));
 }
 
-#else  // _LIBCPP_CXX03_LANG
+#else  // _LIBCUDACXX_CXX03_LANG
 
 template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 pair<_T1,_T2>
 make_pair(_T1 __x, _T2 __y)
 {
     return pair<_T1, _T2>(__x, __y);
 }
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
 template <class _T1, class _T2>
-  struct _LIBCPP_TEMPLATE_VIS tuple_size<pair<_T1, _T2> >
+  struct _LIBCUDACXX_TEMPLATE_VIS tuple_size<pair<_T1, _T2> >
     : public integral_constant<size_t, 2> {};
 
 template <size_t _Ip, class _T1, class _T2>
-struct _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, pair<_T1, _T2> >
+struct _LIBCUDACXX_TEMPLATE_VIS tuple_element<_Ip, pair<_T1, _T2> >
 {
     static_assert(_Ip < 2, "Index out of bounds in std::tuple_element<std::pair<T1, T2>>");
 };
 
 template <class _T1, class _T2>
-struct _LIBCPP_TEMPLATE_VIS tuple_element<0, pair<_T1, _T2> >
+struct _LIBCUDACXX_TEMPLATE_VIS tuple_element<0, pair<_T1, _T2> >
 {
-    typedef _LIBCPP_NODEBUG _T1 type;
+    typedef _LIBCUDACXX_NODEBUG _T1 type;
 };
 
 template <class _T1, class _T2>
-struct _LIBCPP_TEMPLATE_VIS tuple_element<1, pair<_T1, _T2> >
+struct _LIBCUDACXX_TEMPLATE_VIS tuple_element<1, pair<_T1, _T2> >
 {
-    typedef _LIBCPP_NODEBUG _T2 type;
+    typedef _LIBCUDACXX_NODEBUG _T2 type;
 };
 
 template <size_t _Ip> struct __get_pair;
@@ -472,29 +472,29 @@ struct __get_pair<0>
 {
     template <class _T1, class _T2>
     static
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
     _T1&
     get(pair<_T1, _T2>& __p) _NOEXCEPT {return __p.first;}
 
     template <class _T1, class _T2>
     static
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
     const _T1&
     get(const pair<_T1, _T2>& __p) _NOEXCEPT {return __p.first;}
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
     template <class _T1, class _T2>
     static
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
     _T1&&
-    get(pair<_T1, _T2>&& __p) _NOEXCEPT {return _VSTD::forward<_T1>(__p.first);}
+    get(pair<_T1, _T2>&& __p) _NOEXCEPT {return _CUDA_VSTD::forward<_T1>(__p.first);}
 
     template <class _T1, class _T2>
     static
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
     const _T1&&
-    get(const pair<_T1, _T2>&& __p) _NOEXCEPT {return _VSTD::forward<const _T1>(__p.first);}
-#endif // _LIBCPP_CXX03_LANG
+    get(const pair<_T1, _T2>&& __p) _NOEXCEPT {return _CUDA_VSTD::forward<const _T1>(__p.first);}
+#endif // _LIBCUDACXX_CXX03_LANG
 };
 
 template <>
@@ -502,33 +502,33 @@ struct __get_pair<1>
 {
     template <class _T1, class _T2>
     static
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
     _T2&
     get(pair<_T1, _T2>& __p) _NOEXCEPT {return __p.second;}
 
     template <class _T1, class _T2>
     static
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
     const _T2&
     get(const pair<_T1, _T2>& __p) _NOEXCEPT {return __p.second;}
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
     template <class _T1, class _T2>
     static
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
     _T2&&
-    get(pair<_T1, _T2>&& __p) _NOEXCEPT {return _VSTD::forward<_T2>(__p.second);}
+    get(pair<_T1, _T2>&& __p) _NOEXCEPT {return _CUDA_VSTD::forward<_T2>(__p.second);}
 
     template <class _T1, class _T2>
     static
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
     const _T2&&
-    get(const pair<_T1, _T2>&& __p) _NOEXCEPT {return _VSTD::forward<const _T2>(__p.second);}
-#endif // _LIBCPP_CXX03_LANG
+    get(const pair<_T1, _T2>&& __p) _NOEXCEPT {return _CUDA_VSTD::forward<const _T2>(__p.second);}
+#endif // _LIBCUDACXX_CXX03_LANG
 };
 
 template <size_t _Ip, class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 typename tuple_element<_Ip, pair<_T1, _T2> >::type&
 get(pair<_T1, _T2>& __p) _NOEXCEPT
 {
@@ -536,90 +536,90 @@ get(pair<_T1, _T2>& __p) _NOEXCEPT
 }
 
 template <size_t _Ip, class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 const typename tuple_element<_Ip, pair<_T1, _T2> >::type&
 get(const pair<_T1, _T2>& __p) _NOEXCEPT
 {
     return __get_pair<_Ip>::get(__p);
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 template <size_t _Ip, class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 typename tuple_element<_Ip, pair<_T1, _T2> >::type&&
 get(pair<_T1, _T2>&& __p) _NOEXCEPT
 {
-    return __get_pair<_Ip>::get(_VSTD::move(__p));
+    return __get_pair<_Ip>::get(_CUDA_VSTD::move(__p));
 }
 
 template <size_t _Ip, class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 const typename tuple_element<_Ip, pair<_T1, _T2> >::type&&
 get(const pair<_T1, _T2>&& __p) _NOEXCEPT
 {
-    return __get_pair<_Ip>::get(_VSTD::move(__p));
+    return __get_pair<_Ip>::get(_CUDA_VSTD::move(__p));
 }
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 constexpr _T1 & get(pair<_T1, _T2>& __p) _NOEXCEPT
 {
     return __get_pair<0>::get(__p);
 }
 
 template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 constexpr _T1 const & get(pair<_T1, _T2> const& __p) _NOEXCEPT
 {
     return __get_pair<0>::get(__p);
 }
 
 template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 constexpr _T1 && get(pair<_T1, _T2>&& __p) _NOEXCEPT
 {
-    return __get_pair<0>::get(_VSTD::move(__p));
+    return __get_pair<0>::get(_CUDA_VSTD::move(__p));
 }
 
 template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 constexpr _T1 const && get(pair<_T1, _T2> const&& __p) _NOEXCEPT
 {
-    return __get_pair<0>::get(_VSTD::move(__p));
+    return __get_pair<0>::get(_CUDA_VSTD::move(__p));
 }
 
 template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 constexpr _T1 & get(pair<_T2, _T1>& __p) _NOEXCEPT
 {
     return __get_pair<1>::get(__p);
 }
 
 template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 constexpr _T1 const & get(pair<_T2, _T1> const& __p) _NOEXCEPT
 {
     return __get_pair<1>::get(__p);
 }
 
 template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 constexpr _T1 && get(pair<_T2, _T1>&& __p) _NOEXCEPT
 {
-    return __get_pair<1>::get(_VSTD::move(__p));
+    return __get_pair<1>::get(_CUDA_VSTD::move(__p));
 }
 
 template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 constexpr _T1 const && get(pair<_T2, _T1> const&& __p) _NOEXCEPT
 {
-    return __get_pair<1>::get(_VSTD::move(__p));
+    return __get_pair<1>::get(_CUDA_VSTD::move(__p));
 }
 
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___UTILITY_PAIR_H
+#endif // _LIBCUDACXX___UTILITY_PAIR_H

diff  --git a/libcxx/include/__utility/piecewise_construct.h b/libcxx/include/__utility/piecewise_construct.h
index 3cc86fef2a0f..b8b861032594 100644
--- a/libcxx/include/__utility/piecewise_construct.h
+++ b/libcxx/include/__utility/piecewise_construct.h
@@ -6,24 +6,24 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___UTILITY_PIECEWISE_CONSTRUCT_H
-#define _LIBCPP___UTILITY_PIECEWISE_CONSTRUCT_H
+#ifndef _LIBCUDACXX___UTILITY_PIECEWISE_CONSTRUCT_H
+#define _LIBCUDACXX___UTILITY_PIECEWISE_CONSTRUCT_H
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-struct _LIBCPP_TEMPLATE_VIS piecewise_construct_t { explicit piecewise_construct_t() = default; };
-#if defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_LIBRARY)
-extern _LIBCPP_EXPORTED_FROM_ABI const piecewise_construct_t piecewise_construct;// = piecewise_construct_t();
+struct _LIBCUDACXX_TEMPLATE_VIS piecewise_construct_t { explicit piecewise_construct_t() = default; };
+#if defined(_LIBCUDACXX_CXX03_LANG) || defined(_LIBCUDACXX_BUILDING_LIBRARY)
+extern _LIBCUDACXX_EXPORTED_FROM_ABI const piecewise_construct_t piecewise_construct;// = piecewise_construct_t();
 #else
 /* inline */ constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t();
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___UTILITY_PIECEWISE_CONSTRUCT_H
+#endif // _LIBCUDACXX___UTILITY_PIECEWISE_CONSTRUCT_H

diff  --git a/libcxx/include/__utility/priority_tag.h b/libcxx/include/__utility/priority_tag.h
index e51ba6bfcc05..1eab017ba7f6 100644
--- a/libcxx/include/__utility/priority_tag.h
+++ b/libcxx/include/__utility/priority_tag.h
@@ -6,21 +6,21 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___UTILITY_PRIORITY_TAG_H
-#define _LIBCPP___UTILITY_PRIORITY_TAG_H
+#ifndef _LIBCUDACXX___UTILITY_PRIORITY_TAG_H
+#define _LIBCUDACXX___UTILITY_PRIORITY_TAG_H
 
 #include <__config>
 #include <cstddef>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template<size_t _Ip> struct __priority_tag : __priority_tag<_Ip - 1> {};
 template<> struct __priority_tag<0> {};
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___UTILITY_PRIORITY_TAG_H
+#endif // _LIBCUDACXX___UTILITY_PRIORITY_TAG_H

diff  --git a/libcxx/include/__utility/rel_ops.h b/libcxx/include/__utility/rel_ops.h
index 2577e94e91f6..e71705de7ba5 100644
--- a/libcxx/include/__utility/rel_ops.h
+++ b/libcxx/include/__utility/rel_ops.h
@@ -6,25 +6,25 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___UTILITY_REL_OPS_H
-#define _LIBCPP___UTILITY_REL_OPS_H
+#ifndef _LIBCUDACXX___UTILITY_REL_OPS_H
+#define _LIBCUDACXX___UTILITY_REL_OPS_H
 
 #include <__config>
 #include <__utility/forward.h>
 #include <__utility/move.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace rel_ops
 {
 
 template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator!=(const _Tp& __x, const _Tp& __y)
 {
@@ -32,7 +32,7 @@ operator!=(const _Tp& __x, const _Tp& __y)
 }
 
 template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator> (const _Tp& __x, const _Tp& __y)
 {
@@ -40,7 +40,7 @@ operator> (const _Tp& __x, const _Tp& __y)
 }
 
 template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator<=(const _Tp& __x, const _Tp& __y)
 {
@@ -48,7 +48,7 @@ operator<=(const _Tp& __x, const _Tp& __y)
 }
 
 template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator>=(const _Tp& __x, const _Tp& __y)
 {
@@ -57,6 +57,6 @@ operator>=(const _Tp& __x, const _Tp& __y)
 
 } // namespace rel_ops
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___UTILITY_REL_OPS_H
+#endif // _LIBCUDACXX___UTILITY_REL_OPS_H

diff  --git a/libcxx/include/__utility/swap.h b/libcxx/include/__utility/swap.h
index f9e7f36678ba..bd17b4c192a2 100644
--- a/libcxx/include/__utility/swap.h
+++ b/libcxx/include/__utility/swap.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___UTILITY_SWAP_H
-#define _LIBCPP___UTILITY_SWAP_H
+#ifndef _LIBCUDACXX___UTILITY_SWAP_H
+#define _LIBCUDACXX___UTILITY_SWAP_H
 
 #include <__config>
 #include <__utility/declval.h>
@@ -15,13 +15,13 @@
 #include <cstddef>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 template <class _Tp>
 using __swap_result_t = typename enable_if<is_move_constructible<_Tp>::value && is_move_assignable<_Tp>::value>::type;
 #else
@@ -30,21 +30,21 @@ using __swap_result_t = void;
 #endif
 
 template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY __swap_result_t<_Tp> _LIBCPP_CONSTEXPR_AFTER_CXX17 swap(_Tp& __x, _Tp& __y)
+inline _LIBCUDACXX_INLINE_VISIBILITY __swap_result_t<_Tp> _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 swap(_Tp& __x, _Tp& __y)
     _NOEXCEPT_(is_nothrow_move_constructible<_Tp>::value&& is_nothrow_move_assignable<_Tp>::value) {
-  _Tp __t(_VSTD::move(__x));
-  __x = _VSTD::move(__y);
-  __y = _VSTD::move(__t);
+  _Tp __t(_CUDA_VSTD::move(__x));
+  __x = _CUDA_VSTD::move(__y);
+  __y = _CUDA_VSTD::move(__t);
 }
 
 template <class _Tp, size_t _Np>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 typename enable_if<__is_swappable<_Tp>::value>::type
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 typename enable_if<__is_swappable<_Tp>::value>::type
 swap(_Tp (&__a)[_Np], _Tp (&__b)[_Np]) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value) {
   for (size_t __i = 0; __i != _Np; ++__i) {
     swap(__a[__i], __b[__i]);
   }
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___UTILITY_SWAP_H
+#endif // _LIBCUDACXX___UTILITY_SWAP_H

diff  --git a/libcxx/include/__utility/to_underlying.h b/libcxx/include/__utility/to_underlying.h
index 3428406e8d3a..669c1662c9f7 100644
--- a/libcxx/include/__utility/to_underlying.h
+++ b/libcxx/include/__utility/to_underlying.h
@@ -7,34 +7,34 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___UTILITY_TO_UNDERLYING_H
-#define _LIBCPP___UTILITY_TO_UNDERLYING_H
+#ifndef _LIBCUDACXX___UTILITY_TO_UNDERLYING_H
+#define _LIBCUDACXX___UTILITY_TO_UNDERLYING_H
 
 #include <__config>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY constexpr typename underlying_type<_Tp>::type
+_LIBCUDACXX_INLINE_VISIBILITY constexpr typename underlying_type<_Tp>::type
 __to_underlying(_Tp __val) noexcept {
   return static_cast<typename underlying_type<_Tp>::type>(__val);
 }
-#endif // !_LIBCPP_CXX03_LANG
+#endif // !_LIBCUDACXX_CXX03_LANG
 
-#if _LIBCPP_STD_VER > 20
+#if _LIBCUDACXX_STD_VER > 20
 template <class _Tp>
-_LIBCPP_NODISCARD_EXT _LIBCPP_INLINE_VISIBILITY constexpr underlying_type_t<_Tp>
+_LIBCUDACXX_NODISCARD_EXT _LIBCUDACXX_INLINE_VISIBILITY constexpr underlying_type_t<_Tp>
 to_underlying(_Tp __val) noexcept {
-  return _VSTD::__to_underlying(__val);
+  return _CUDA_VSTD::__to_underlying(__val);
 }
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___UTILITY_TO_UNDERLYING_H
+#endif // _LIBCUDACXX___UTILITY_TO_UNDERLYING_H

diff  --git a/libcxx/include/__utility/transaction.h b/libcxx/include/__utility/transaction.h
index e2cc43820845..c0fb02cb69d9 100644
--- a/libcxx/include/__utility/transaction.h
+++ b/libcxx/include/__utility/transaction.h
@@ -6,19 +6,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___UTILITY_TRANSACTION_H
-#define _LIBCPP___UTILITY_TRANSACTION_H
+#ifndef _LIBCUDACXX___UTILITY_TRANSACTION_H
+#define _LIBCUDACXX___UTILITY_TRANSACTION_H
 
 #include <__config>
 #include <__utility/exchange.h>
 #include <__utility/move.h>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 // __transaction is a helper class for writing code with the strong exception guarantee.
 //
@@ -31,7 +31,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 // they can be moved around for convenience.
 //
 // __transaction can help greatly simplify code that would normally be cluttered by
-// `#if _LIBCPP_NO_EXCEPTIONS`. For example:
+// `#if _LIBCUDACXX_NO_EXCEPTIONS`. For example:
 //
 //    template <class Iterator, class Size, class OutputIterator>
 //    Iterator uninitialized_copy_n(Iterator iter, Size n, OutputIterator out) {
@@ -51,16 +51,16 @@ template <class _Rollback>
 struct __transaction {
     __transaction() = delete;
 
-    _LIBCPP_HIDE_FROM_ABI
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 explicit __transaction(_Rollback __rollback)
-        : __rollback_(_VSTD::move(__rollback))
+    _LIBCUDACXX_HIDE_FROM_ABI
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 explicit __transaction(_Rollback __rollback)
+        : __rollback_(_CUDA_VSTD::move(__rollback))
         , __completed_(false)
     { }
 
-    _LIBCPP_HIDE_FROM_ABI
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 __transaction(__transaction&& __other)
+    _LIBCUDACXX_HIDE_FROM_ABI
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 __transaction(__transaction&& __other)
         _NOEXCEPT_(is_nothrow_move_constructible<_Rollback>::value)
-        : __rollback_(_VSTD::move(__other.__rollback_))
+        : __rollback_(_CUDA_VSTD::move(__other.__rollback_))
         , __completed_(__other.__completed_)
     {
         __other.__completed_ = true;
@@ -70,13 +70,13 @@ struct __transaction {
     __transaction& operator=(__transaction const&) = delete;
     __transaction& operator=(__transaction&&) = delete;
 
-    _LIBCPP_HIDE_FROM_ABI
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 void __complete() _NOEXCEPT {
+    _LIBCUDACXX_HIDE_FROM_ABI
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 void __complete() _NOEXCEPT {
         __completed_ = true;
     }
 
-    _LIBCPP_HIDE_FROM_ABI
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 ~__transaction() {
+    _LIBCUDACXX_HIDE_FROM_ABI
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 ~__transaction() {
         if (!__completed_)
             __rollback_();
     }
@@ -87,10 +87,10 @@ struct __transaction {
 };
 
 template <class _Rollback>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR __transaction<_Rollback> __make_transaction(_Rollback __rollback) {
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR __transaction<_Rollback> __make_transaction(_Rollback __rollback) {
   return __transaction<_Rollback>(std::move(__rollback));
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___UTILITY_TRANSACTION_H
+#endif // _LIBCUDACXX___UTILITY_TRANSACTION_H

diff  --git a/libcxx/include/__utility/unreachable.h b/libcxx/include/__utility/unreachable.h
index 485edb227c92..666a358e5d26 100644
--- a/libcxx/include/__utility/unreachable.h
+++ b/libcxx/include/__utility/unreachable.h
@@ -6,19 +6,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___UTILITY_UNREACHABLE_H
-#define _LIBCPP___UTILITY_UNREACHABLE_H
+#ifndef _LIBCUDACXX___UTILITY_UNREACHABLE_H
+#define _LIBCUDACXX___UTILITY_UNREACHABLE_H
 
 #include <__config>
 #include <cstdlib>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-_LIBCPP_NORETURN _LIBCPP_HIDE_FROM_ABI inline void __libcpp_unreachable()
+_LIBCUDACXX_NORETURN _LIBCUDACXX_HIDE_FROM_ABI inline void __LIBCUDACXX_unreachable()
 {
 #if __has_builtin(__builtin_unreachable)
   __builtin_unreachable();
@@ -27,12 +27,12 @@ _LIBCPP_NORETURN _LIBCPP_HIDE_FROM_ABI inline void __libcpp_unreachable()
 #endif
 }
 
-#if _LIBCPP_STD_VER > 20
+#if _LIBCUDACXX_STD_VER > 20
 
-[[noreturn]] _LIBCPP_HIDE_FROM_ABI inline void unreachable() { __libcpp_unreachable(); }
+[[noreturn]] _LIBCUDACXX_HIDE_FROM_ABI inline void unreachable() { __LIBCUDACXX_unreachable(); }
 
-#endif // _LIBCPP_STD_VER > 20
+#endif // _LIBCUDACXX_STD_VER > 20
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
 #endif

diff  --git a/libcxx/include/__variant/monostate.h b/libcxx/include/__variant/monostate.h
index b389c3b56b36..6c1b871241fe 100644
--- a/libcxx/include/__variant/monostate.h
+++ b/libcxx/include/__variant/monostate.h
@@ -7,54 +7,54 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___VARIANT_MONOSTATE_H
-#define _LIBCPP___VARIANT_MONOSTATE_H
+#ifndef _LIBCUDACXX___VARIANT_MONOSTATE_H
+#define _LIBCUDACXX___VARIANT_MONOSTATE_H
 
 #include <__config>
 #include <__functional/hash.h>
 #include <cstddef>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 
-struct _LIBCPP_TEMPLATE_VIS monostate {};
+struct _LIBCUDACXX_TEMPLATE_VIS monostate {};
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 constexpr bool operator<(monostate, monostate) noexcept { return false; }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 constexpr bool operator>(monostate, monostate) noexcept { return false; }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 constexpr bool operator<=(monostate, monostate) noexcept { return true; }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 constexpr bool operator>=(monostate, monostate) noexcept { return true; }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 constexpr bool operator==(monostate, monostate) noexcept { return true; }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 constexpr bool operator!=(monostate, monostate) noexcept { return false; }
 
 template <>
-struct _LIBCPP_TEMPLATE_VIS hash<monostate> {
+struct _LIBCUDACXX_TEMPLATE_VIS hash<monostate> {
   using argument_type = monostate;
   using result_type = size_t;
 
-  inline _LIBCPP_INLINE_VISIBILITY
+  inline _LIBCUDACXX_INLINE_VISIBILITY
   result_type operator()(const argument_type&) const _NOEXCEPT {
     return 66740831; // return a fundamentally attractive random value.
   }
 };
 
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCUDACXX_STD_VER > 14
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP___VARIANT_MONOSTATE_H
+#endif // _LIBCUDACXX___VARIANT_MONOSTATE_H

diff  --git a/libcxx/include/__verbose_abort b/libcxx/include/__verbose_abort
index 3c9cba824ce0..cb0daccd4768 100644
--- a/libcxx/include/__verbose_abort
+++ b/libcxx/include/__verbose_abort
@@ -7,45 +7,45 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP___VERBOSE_ABORT
-#define _LIBCPP___VERBOSE_ABORT
+#ifndef _LIBCUDACXX___VERBOSE_ABORT
+#define _LIBCUDACXX___VERBOSE_ABORT
 
 #include <__availability>
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-// Provide a default implementation of __libcpp_verbose_abort if we know that neither the built
+// Provide a default implementation of __LIBCUDACXX_verbose_abort if we know that neither the built
 // library not the user is providing one. Otherwise, just declare it and use the one from the
 // built library or the one provided by the user.
 //
 // We can't provide a great implementation because it needs to be pretty much
 // dependency-free (this is included everywhere else in the library).
-#if defined(_LIBCPP_HAS_NO_VERBOSE_ABORT_IN_LIBRARY) && !defined(_LIBCPP_AVAILABILITY_CUSTOM_VERBOSE_ABORT_PROVIDED)
+#if defined(_LIBCUDACXX_HAS_NO_VERBOSE_ABORT_IN_LIBRARY) && !defined(_LIBCUDACXX_AVAILABILITY_CUSTOM_VERBOSE_ABORT_PROVIDED)
 
 extern "C" void abort();
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-_LIBCPP_NORETURN _LIBCPP_ATTRIBUTE_FORMAT(__printf__, 1, 2) _LIBCPP_HIDE_FROM_ABI inline
-void __libcpp_verbose_abort(const char *, ...) {
+_LIBCUDACXX_NORETURN _LIBCUDACXX_ATTRIBUTE_FORMAT(__printf__, 1, 2) _LIBCUDACXX_HIDE_FROM_ABI inline
+void __LIBCUDACXX_verbose_abort(const char *, ...) {
   ::abort();
   __builtin_unreachable(); // never reached, but needed to tell the compiler that the function never returns
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
 #else
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-_LIBCPP_NORETURN _LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_ATTRIBUTE_FORMAT(__printf__, 1, 2)
-void __libcpp_verbose_abort(const char *__format, ...);
+_LIBCUDACXX_NORETURN _LIBCUDACXX_OVERRIDABLE_FUNC_VIS _LIBCUDACXX_ATTRIBUTE_FORMAT(__printf__, 1, 2)
+void __LIBCUDACXX_verbose_abort(const char *__format, ...);
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
 #endif
 
-#endif // _LIBCPP___VERBOSE_ABORT
+#endif // _LIBCUDACXX___VERBOSE_ABORT

diff  --git a/libcxx/include/algorithm b/libcxx/include/algorithm
index 69ada038747c..d9c3be8ab084 100644
--- a/libcxx/include/algorithm
+++ b/libcxx/include/algorithm
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_ALGORITHM
-#define _LIBCPP_ALGORITHM
+#ifndef _LIBCUDACXX_ALGORITHM
+#define _LIBCUDACXX_ALGORITHM
 
 /*
     algorithm synopsis
@@ -1899,7 +1899,7 @@ template <class BidirectionalIterator, class Compare>
 #include <__algorithm/unwrap_iter.h>
 #include <__algorithm/upper_bound.h>
 
-#ifndef _LIBCPP_REMOVE_TRANSITIVE_INCLUDES
+#ifndef _LIBCUDACXX_REMOVE_TRANSITIVE_INCLUDES
 #  include <chrono>
 #  include <iterator>
 #  include <utility>
@@ -1908,12 +1908,12 @@ template <class BidirectionalIterator, class Compare>
 // standard-mandated includes
 #include <initializer_list>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if defined(_LIBCPP_HAS_PARALLEL_ALGORITHMS) && _LIBCPP_STD_VER >= 17
+#if defined(_LIBCUDACXX_HAS_PARALLEL_ALGORITHMS) && _LIBCUDACXX_STD_VER >= 17
 #   include <__pstl_algorithm>
 #endif
 
-#endif // _LIBCPP_ALGORITHM
+#endif // _LIBCUDACXX_ALGORITHM

diff  --git a/libcxx/include/any b/libcxx/include/any
index 66f7488e5441..2280d0d748b4 100644
--- a/libcxx/include/any
+++ b/libcxx/include/any
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_ANY
-#define _LIBCPP_ANY
+#ifndef _LIBCUDACXX_ANY
+#define _LIBCUDACXX_ANY
 
 /*
    any synopsis
@@ -94,47 +94,47 @@ namespace std {
 #include <typeinfo>
 #include <version>
 
-#ifndef _LIBCPP_REMOVE_TRANSITIVE_INCLUDES
+#ifndef _LIBCUDACXX_REMOVE_TRANSITIVE_INCLUDES
 #  include <chrono>
 #endif
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
 namespace std {
-class _LIBCPP_EXCEPTION_ABI _LIBCPP_AVAILABILITY_BAD_ANY_CAST bad_any_cast : public bad_cast
+class _LIBCUDACXX_EXCEPTION_ABI _LIBCUDACXX_AVAILABILITY_BAD_ANY_CAST bad_any_cast : public bad_cast
 {
 public:
     virtual const char* what() const _NOEXCEPT;
 };
 } // namespace std
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 
-_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
+_LIBCUDACXX_NORETURN inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_AVAILABILITY_THROW_BAD_ANY_CAST
 void __throw_bad_any_cast()
 {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     throw bad_any_cast();
 #else
-    _VSTD::abort();
+    _CUDA_VSTD::abort();
 #endif
 }
 
 // Forward declarations
-class _LIBCPP_TEMPLATE_VIS any;
+class _LIBCUDACXX_TEMPLATE_VIS any;
 
 template <class _ValueType>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 add_pointer_t<add_const_t<_ValueType>>
 any_cast(any const *) _NOEXCEPT;
 
 template <class _ValueType>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 add_pointer_t<_ValueType> any_cast(any *) _NOEXCEPT;
 
 namespace __any_imp
@@ -161,20 +161,20 @@ namespace __any_imp
   template <class _Tp> struct _LargeHandler;
 
   template <class _Tp>
-  struct  _LIBCPP_TEMPLATE_VIS __unique_typeinfo { static constexpr int __id = 0; };
+  struct  _LIBCUDACXX_TEMPLATE_VIS __unique_typeinfo { static constexpr int __id = 0; };
   template <class _Tp> constexpr int __unique_typeinfo<_Tp>::__id;
 
   template <class _Tp>
-  inline _LIBCPP_INLINE_VISIBILITY
+  inline _LIBCUDACXX_INLINE_VISIBILITY
   constexpr const void* __get_fallback_typeid() {
       return &__unique_typeinfo<remove_cv_t<remove_reference_t<_Tp>>>::__id;
   }
 
   template <class _Tp>
-  inline _LIBCPP_INLINE_VISIBILITY
+  inline _LIBCUDACXX_INLINE_VISIBILITY
   bool __compare_typeid(type_info const* __id, const void* __fallback_id)
   {
-#if !defined(_LIBCPP_NO_RTTI)
+#if !defined(_LIBCUDACXX_NO_RTTI)
       if (__id && *__id == typeid(_Tp))
           return true;
 #endif
@@ -189,20 +189,20 @@ namespace __any_imp
 
 } // namespace __any_imp
 
-class _LIBCPP_TEMPLATE_VIS any
+class _LIBCUDACXX_TEMPLATE_VIS any
 {
 public:
   // construct/destruct
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   constexpr any() _NOEXCEPT : __h(nullptr) {}
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   any(any const & __other) : __h(nullptr)
   {
     if (__other.__h) __other.__call(_Action::_Copy, this);
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   any(any && __other) _NOEXCEPT : __h(nullptr)
   {
     if (__other.__h) __other.__call(_Action::_Move, this);
@@ -216,7 +216,7 @@ public:
         !__is_inplace_type<_ValueType>::value &&
         is_copy_constructible<_Tp>::value>
     >
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   any(_ValueType && __value);
 
   template <class _ValueType, class ..._Args,
@@ -226,7 +226,7 @@ public:
         is_copy_constructible<_Tp>::value
     >
   >
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   explicit any(in_place_type_t<_ValueType>, _Args&&... __args);
 
   template <class _ValueType, class _Up, class ..._Args,
@@ -235,22 +235,22 @@ public:
         is_constructible<_Tp, initializer_list<_Up>&, _Args...>::value &&
         is_copy_constructible<_Tp>::value>
   >
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   explicit any(in_place_type_t<_ValueType>, initializer_list<_Up>, _Args&&... __args);
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   ~any() { this->reset(); }
 
   // assignments
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   any & operator=(any const & __rhs) {
     any(__rhs).swap(*this);
     return *this;
   }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   any & operator=(any && __rhs) _NOEXCEPT {
-    any(_VSTD::move(__rhs)).swap(*this);
+    any(_CUDA_VSTD::move(__rhs)).swap(*this);
     return *this;
   }
 
@@ -261,7 +261,7 @@ public:
           !is_same<_Tp, any>::value
           && is_copy_constructible<_Tp>::value>
     >
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   any & operator=(_ValueType && __rhs);
 
   template <class _ValueType, class ..._Args,
@@ -270,7 +270,7 @@ public:
         is_constructible<_Tp, _Args...>::value &&
         is_copy_constructible<_Tp>::value>
     >
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   _Tp& emplace(_Args&&...);
 
   template <class _ValueType, class _Up, class ..._Args,
@@ -279,22 +279,22 @@ public:
         is_constructible<_Tp, initializer_list<_Up>&, _Args...>::value &&
         is_copy_constructible<_Tp>::value>
   >
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   _Tp& emplace(initializer_list<_Up>, _Args&&...);
 
   // 6.3.3 any modifiers
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   void reset() _NOEXCEPT { if (__h) this->__call(_Action::_Destroy); }
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   void swap(any & __rhs) _NOEXCEPT;
 
   // 6.3.4 any observers
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   bool has_value() const _NOEXCEPT { return __h != nullptr; }
 
-#if !defined(_LIBCPP_NO_RTTI)
-  _LIBCPP_INLINE_VISIBILITY
+#if !defined(_LIBCUDACXX_NO_RTTI)
+  _LIBCUDACXX_INLINE_VISIBILITY
   const type_info & type() const _NOEXCEPT {
     if (__h) {
         return *static_cast<type_info const *>(this->__call(_Action::_TypeInfo));
@@ -315,7 +315,7 @@ private:
         __any_imp::_Buffer __buf;
     };
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void * __call(_Action __a, any * __other = nullptr,
                   type_info const * __info = nullptr,
                    const void* __fallback_info = nullptr) const
@@ -323,7 +323,7 @@ private:
         return __h(__a, this, __other, __info, __fallback_info);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void * __call(_Action __a, any * __other = nullptr,
                   type_info const * __info = nullptr,
                   const void* __fallback_info = nullptr)
@@ -351,9 +351,9 @@ private:
 namespace __any_imp
 {
   template <class _Tp>
-  struct _LIBCPP_TEMPLATE_VIS _SmallHandler
+  struct _LIBCUDACXX_TEMPLATE_VIS _SmallHandler
   {
-     _LIBCPP_INLINE_VISIBILITY
+     _LIBCUDACXX_INLINE_VISIBILITY
      static void* __handle(_Action __act, any const * __this, any * __other,
                            type_info const * __info, const void* __fallback_info)
      {
@@ -373,23 +373,23 @@ namespace __any_imp
         case _Action::_TypeInfo:
           return __type_info();
         }
-        __libcpp_unreachable();
+        __LIBCUDACXX_unreachable();
     }
 
     template <class ..._Args>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     static _Tp& __create(any & __dest, _Args&&... __args) {
         typedef allocator<_Tp> _Alloc;
         typedef allocator_traits<_Alloc> _ATraits;
         _Alloc __a;
         _Tp * __ret = static_cast<_Tp*>(static_cast<void*>(&__dest.__s.__buf));
-        _ATraits::construct(__a, __ret, _VSTD::forward<_Args>(__args)...);
+        _ATraits::construct(__a, __ret, _CUDA_VSTD::forward<_Args>(__args)...);
         __dest.__h = &_SmallHandler::__handle;
         return *__ret;
     }
 
   private:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     static void __destroy(any & __this) {
         typedef allocator<_Tp> _Alloc;
         typedef allocator_traits<_Alloc> _ATraits;
@@ -399,20 +399,20 @@ namespace __any_imp
         __this.__h = nullptr;
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     static void __copy(any const & __this, any & __dest) {
         _SmallHandler::__create(__dest, *static_cast<_Tp const *>(
             static_cast<void const *>(&__this.__s.__buf)));
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     static void __move(any & __this, any & __dest) {
-        _SmallHandler::__create(__dest, _VSTD::move(
+        _SmallHandler::__create(__dest, _CUDA_VSTD::move(
             *static_cast<_Tp*>(static_cast<void*>(&__this.__s.__buf))));
         __destroy(__this);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     static void* __get(any & __this,
                        type_info const * __info,
                        const void* __fallback_id)
@@ -422,10 +422,10 @@ namespace __any_imp
         return nullptr;
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     static void* __type_info()
     {
-#if !defined(_LIBCPP_NO_RTTI)
+#if !defined(_LIBCUDACXX_NO_RTTI)
         return const_cast<void*>(static_cast<void const *>(&typeid(_Tp)));
 #else
         return nullptr;
@@ -434,9 +434,9 @@ namespace __any_imp
   };
 
   template <class _Tp>
-  struct _LIBCPP_TEMPLATE_VIS _LargeHandler
+  struct _LIBCUDACXX_TEMPLATE_VIS _LargeHandler
   {
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     static void* __handle(_Action __act, any const * __this,
                           any * __other, type_info const * __info,
                           void const* __fallback_info)
@@ -457,11 +457,11 @@ namespace __any_imp
         case _Action::_TypeInfo:
           return __type_info();
         }
-        __libcpp_unreachable();
+        __LIBCUDACXX_unreachable();
     }
 
     template <class ..._Args>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     static _Tp& __create(any & __dest, _Args&&... __args) {
         typedef allocator<_Tp> _Alloc;
         typedef allocator_traits<_Alloc> _ATraits;
@@ -469,7 +469,7 @@ namespace __any_imp
         _Alloc __a;
         unique_ptr<_Tp, _Dp> __hold(_ATraits::allocate(__a, 1), _Dp(__a, 1));
         _Tp * __ret = __hold.get();
-        _ATraits::construct(__a, __ret, _VSTD::forward<_Args>(__args)...);
+        _ATraits::construct(__a, __ret, _CUDA_VSTD::forward<_Args>(__args)...);
         __dest.__s.__ptr = __hold.release();
         __dest.__h = &_LargeHandler::__handle;
         return *__ret;
@@ -477,7 +477,7 @@ namespace __any_imp
 
   private:
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     static void __destroy(any & __this){
         typedef allocator<_Tp> _Alloc;
         typedef allocator_traits<_Alloc> _ATraits;
@@ -488,19 +488,19 @@ namespace __any_imp
         __this.__h = nullptr;
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     static void __copy(any const & __this, any & __dest) {
         _LargeHandler::__create(__dest, *static_cast<_Tp const *>(__this.__s.__ptr));
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     static void __move(any & __this, any & __dest) {
       __dest.__s.__ptr = __this.__s.__ptr;
       __dest.__h = &_LargeHandler::__handle;
       __this.__h = nullptr;
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     static void* __get(any & __this, type_info const * __info,
                        void const* __fallback_info)
     {
@@ -510,10 +510,10 @@ namespace __any_imp
 
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     static void* __type_info()
     {
-#if !defined(_LIBCPP_NO_RTTI)
+#if !defined(_LIBCUDACXX_NO_RTTI)
         return const_cast<void*>(static_cast<void const *>(&typeid(_Tp)));
 #else
         return nullptr;
@@ -527,42 +527,42 @@ namespace __any_imp
 template <class _ValueType, class _Tp, class>
 any::any(_ValueType && __v) : __h(nullptr)
 {
-  __any_imp::_Handler<_Tp>::__create(*this, _VSTD::forward<_ValueType>(__v));
+  __any_imp::_Handler<_Tp>::__create(*this, _CUDA_VSTD::forward<_ValueType>(__v));
 }
 
 template <class _ValueType, class ..._Args, class _Tp, class>
 any::any(in_place_type_t<_ValueType>, _Args&&... __args) {
-  __any_imp::_Handler<_Tp>::__create(*this, _VSTD::forward<_Args>(__args)...);
+  __any_imp::_Handler<_Tp>::__create(*this, _CUDA_VSTD::forward<_Args>(__args)...);
 }
 
 template <class _ValueType, class _Up, class ..._Args, class _Tp, class>
 any::any(in_place_type_t<_ValueType>, initializer_list<_Up> __il, _Args&&... __args) {
-  __any_imp::_Handler<_Tp>::__create(*this, __il, _VSTD::forward<_Args>(__args)...);
+  __any_imp::_Handler<_Tp>::__create(*this, __il, _CUDA_VSTD::forward<_Args>(__args)...);
 }
 
 template <class _ValueType, class, class>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 any & any::operator=(_ValueType && __v)
 {
-  any(_VSTD::forward<_ValueType>(__v)).swap(*this);
+  any(_CUDA_VSTD::forward<_ValueType>(__v)).swap(*this);
   return *this;
 }
 
 template <class _ValueType, class ..._Args, class _Tp, class>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 _Tp& any::emplace(_Args&&... __args) {
   reset();
-  return __any_imp::_Handler<_Tp>::__create(*this, _VSTD::forward<_Args>(__args)...);
+  return __any_imp::_Handler<_Tp>::__create(*this, _CUDA_VSTD::forward<_Args>(__args)...);
 }
 
 template <class _ValueType, class _Up, class ..._Args, class _Tp, class>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 _Tp& any::emplace(initializer_list<_Up> __il, _Args&&... __args) {
   reset();
-  return __any_imp::_Handler<_Tp>::__create(*this, __il, _VSTD::forward<_Args>(__args)...);
+  return __any_imp::_Handler<_Tp>::__create(*this, __il, _CUDA_VSTD::forward<_Args>(__args)...);
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void any::swap(any & __rhs) _NOEXCEPT
 {
     if (this == &__rhs)
@@ -583,93 +583,93 @@ void any::swap(any & __rhs) _NOEXCEPT
 
 // 6.4 Non-member functions
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void swap(any & __lhs, any & __rhs) _NOEXCEPT
 {
     __lhs.swap(__rhs);
 }
 
 template <class _Tp, class ..._Args>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 any make_any(_Args&&... __args) {
-    return any(in_place_type<_Tp>, _VSTD::forward<_Args>(__args)...);
+    return any(in_place_type<_Tp>, _CUDA_VSTD::forward<_Args>(__args)...);
 }
 
 template <class _Tp, class _Up, class ..._Args>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 any make_any(initializer_list<_Up> __il, _Args&&... __args) {
-    return any(in_place_type<_Tp>, __il, _VSTD::forward<_Args>(__args)...);
+    return any(in_place_type<_Tp>, __il, _CUDA_VSTD::forward<_Args>(__args)...);
 }
 
 template <class _ValueType>
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_AVAILABILITY_THROW_BAD_ANY_CAST
 _ValueType any_cast(any const & __v)
 {
     using _RawValueType = __uncvref_t<_ValueType>;
     static_assert(is_constructible<_ValueType, _RawValueType const &>::value,
                   "ValueType is required to be a const lvalue reference "
                   "or a CopyConstructible type");
-    auto __tmp = _VSTD::any_cast<add_const_t<_RawValueType>>(&__v);
+    auto __tmp = _CUDA_VSTD::any_cast<add_const_t<_RawValueType>>(&__v);
     if (__tmp == nullptr)
         __throw_bad_any_cast();
     return static_cast<_ValueType>(*__tmp);
 }
 
 template <class _ValueType>
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_AVAILABILITY_THROW_BAD_ANY_CAST
 _ValueType any_cast(any & __v)
 {
     using _RawValueType = __uncvref_t<_ValueType>;
     static_assert(is_constructible<_ValueType, _RawValueType &>::value,
                   "ValueType is required to be an lvalue reference "
                   "or a CopyConstructible type");
-    auto __tmp = _VSTD::any_cast<_RawValueType>(&__v);
+    auto __tmp = _CUDA_VSTD::any_cast<_RawValueType>(&__v);
     if (__tmp == nullptr)
         __throw_bad_any_cast();
     return static_cast<_ValueType>(*__tmp);
 }
 
 template <class _ValueType>
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_AVAILABILITY_THROW_BAD_ANY_CAST
 _ValueType any_cast(any && __v)
 {
     using _RawValueType = __uncvref_t<_ValueType>;
     static_assert(is_constructible<_ValueType, _RawValueType>::value,
                   "ValueType is required to be an rvalue reference "
                   "or a CopyConstructible type");
-    auto __tmp = _VSTD::any_cast<_RawValueType>(&__v);
+    auto __tmp = _CUDA_VSTD::any_cast<_RawValueType>(&__v);
     if (__tmp == nullptr)
         __throw_bad_any_cast();
-    return static_cast<_ValueType>(_VSTD::move(*__tmp));
+    return static_cast<_ValueType>(_CUDA_VSTD::move(*__tmp));
 }
 
 template <class _ValueType>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 add_pointer_t<add_const_t<_ValueType>>
 any_cast(any const * __any) _NOEXCEPT
 {
     static_assert(!is_reference<_ValueType>::value,
                   "_ValueType may not be a reference.");
-    return _VSTD::any_cast<_ValueType>(const_cast<any *>(__any));
+    return _CUDA_VSTD::any_cast<_ValueType>(const_cast<any *>(__any));
 }
 
 template <class _RetType>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 _RetType __pointer_or_func_cast(void* __p, /*IsFunction*/false_type) noexcept {
   return static_cast<_RetType>(__p);
 }
 
 template <class _RetType>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 _RetType __pointer_or_func_cast(void*, /*IsFunction*/true_type) noexcept {
   return nullptr;
 }
 
 template <class _ValueType>
-_LIBCPP_HIDE_FROM_ABI
+_LIBCUDACXX_HIDE_FROM_ABI
 add_pointer_t<_ValueType>
 any_cast(any * __any) _NOEXCEPT
 {
@@ -679,20 +679,20 @@ any_cast(any * __any) _NOEXCEPT
     typedef typename add_pointer<_ValueType>::type _ReturnType;
     if (__any && __any->__h) {
       void *__p = __any->__call(_Action::_Get, nullptr,
-#if !defined(_LIBCPP_NO_RTTI)
+#if !defined(_LIBCUDACXX_NO_RTTI)
                           &typeid(_ValueType),
 #else
                           nullptr,
 #endif
                           __any_imp::__get_fallback_typeid<_ValueType>());
-        return _VSTD::__pointer_or_func_cast<_ReturnType>(
+        return _CUDA_VSTD::__pointer_or_func_cast<_ReturnType>(
             __p, is_function<_ValueType>{});
     }
     return nullptr;
 }
 
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCUDACXX_STD_VER > 14
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_ANY
+#endif // _LIBCUDACXX_ANY

diff  --git a/libcxx/include/array b/libcxx/include/array
index 867dd6b1bcc6..291779b64bfc 100644
--- a/libcxx/include/array
+++ b/libcxx/include/array
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_ARRAY
-#define _LIBCPP_ARRAY
+#ifndef _LIBCUDACXX_ARRAY
+#define _LIBCUDACXX_ARRAY
 
 /*
     array synopsis
@@ -123,7 +123,7 @@ template <size_t I, class T, size_t N> const T&& get(const array<T, N>&&) noexce
 #include <type_traits>
 #include <version>
 
-#ifndef _LIBCPP_REMOVE_TRANSITIVE_INCLUDES
+#ifndef _LIBCUDACXX_REMOVE_TRANSITIVE_INCLUDES
 #  include <algorithm>
 #  include <iterator>
 #  include <utility>
@@ -142,14 +142,14 @@ template <size_t I, class T, size_t N> const T&& get(const array<T, N>&&) noexce
 #include <compare>
 #include <initializer_list>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Tp, size_t _Size>
-struct _LIBCPP_TEMPLATE_VIS array
+struct _LIBCUDACXX_TEMPLATE_VIS array
 {
     // types:
     typedef array __self;
@@ -162,97 +162,97 @@ struct _LIBCPP_TEMPLATE_VIS array
     typedef const value_type*                     const_pointer;
     typedef size_t                                size_type;
     typedef ptr
diff _t                             
diff erence_type;
-    typedef _VSTD::reverse_iterator<iterator>       reverse_iterator;
-    typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
+    typedef _CUDA_VSTD::reverse_iterator<iterator>       reverse_iterator;
+    typedef _CUDA_VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
 
     _Tp __elems_[_Size];
 
     // No explicit construct/copy/destroy for aggregate type
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     void fill(const value_type& __u) {
-        _VSTD::fill_n(data(), _Size, __u);
+        _CUDA_VSTD::fill_n(data(), _Size, __u);
     }
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     void swap(array& __a) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value) {
-        _VSTD::swap_ranges(data(), data() + _Size, __a.data());
+        _CUDA_VSTD::swap_ranges(data(), data() + _Size, __a.data());
     }
 
     // iterators:
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     iterator begin() _NOEXCEPT {return iterator(data());}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     const_iterator begin() const _NOEXCEPT {return const_iterator(data());}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     iterator end() _NOEXCEPT {return iterator(data() + _Size);}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     const_iterator end() const _NOEXCEPT {return const_iterator(data() + _Size);}
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     reverse_iterator rbegin() _NOEXCEPT {return reverse_iterator(end());}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     const_reverse_iterator rbegin() const _NOEXCEPT {return const_reverse_iterator(end());}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     reverse_iterator rend() _NOEXCEPT {return reverse_iterator(begin());}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     const_reverse_iterator rend() const _NOEXCEPT {return const_reverse_iterator(begin());}
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     const_iterator cbegin() const _NOEXCEPT {return begin();}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     const_iterator cend() const _NOEXCEPT {return end();}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     const_reverse_iterator crbegin() const _NOEXCEPT {return rbegin();}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     const_reverse_iterator crend() const _NOEXCEPT {return rend();}
 
     // capacity:
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR size_type size() const _NOEXCEPT {return _Size;}
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR size_type max_size() const _NOEXCEPT {return _Size;}
-    _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR bool empty() const _NOEXCEPT {return _Size == 0;}
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR size_type size() const _NOEXCEPT {return _Size;}
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR size_type max_size() const _NOEXCEPT {return _Size;}
+    _LIBCUDACXX_NODISCARD_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR bool empty() const _NOEXCEPT {return _Size == 0;}
 
     // element access:
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     reference operator[](size_type __n) _NOEXCEPT {
-        _LIBCPP_ASSERT(__n < _Size, "out-of-bounds access in std::array<T, N>");
+        _LIBCUDACXX_ASSERT(__n < _Size, "out-of-bounds access in std::array<T, N>");
         return __elems_[__n];
     }
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
     const_reference operator[](size_type __n) const _NOEXCEPT {
-        _LIBCPP_ASSERT(__n < _Size, "out-of-bounds access in std::array<T, N>");
+        _LIBCUDACXX_ASSERT(__n < _Size, "out-of-bounds access in std::array<T, N>");
         return __elems_[__n];
     }
 
-    _LIBCPP_CONSTEXPR_AFTER_CXX14 reference at(size_type __n)
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX14 reference at(size_type __n)
     {
         if (__n >= _Size)
             __throw_out_of_range("array::at");
         return __elems_[__n];
     }
 
-    _LIBCPP_CONSTEXPR_AFTER_CXX11 const_reference at(size_type __n) const
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 const_reference at(size_type __n) const
     {
         if (__n >= _Size)
             __throw_out_of_range("array::at");
         return __elems_[__n];
     }
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 reference front()             _NOEXCEPT {return (*this)[0];}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const_reference front() const _NOEXCEPT {return (*this)[0];}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 reference back()              _NOEXCEPT {return (*this)[_Size - 1];}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const_reference back() const  _NOEXCEPT {return (*this)[_Size - 1];}
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14 reference front()             _NOEXCEPT {return (*this)[0];}
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 const_reference front() const _NOEXCEPT {return (*this)[0];}
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14 reference back()              _NOEXCEPT {return (*this)[_Size - 1];}
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 const_reference back() const  _NOEXCEPT {return (*this)[_Size - 1];}
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     value_type* data() _NOEXCEPT {return __elems_;}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     const value_type* data() const _NOEXCEPT {return __elems_;}
 };
 
 template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS array<_Tp, 0>
+struct _LIBCUDACXX_TEMPLATE_VIS array<_Tp, 0>
 {
     // types:
     typedef array __self;
@@ -265,8 +265,8 @@ struct _LIBCPP_TEMPLATE_VIS array<_Tp, 0>
     typedef const value_type*                     const_pointer;
     typedef size_t                                size_type;
     typedef ptr
diff _t                             
diff erence_type;
-    typedef _VSTD::reverse_iterator<iterator>       reverse_iterator;
-    typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
+    typedef _CUDA_VSTD::reverse_iterator<iterator>       reverse_iterator;
+    typedef _CUDA_VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
 
     typedef typename conditional<is_const<_Tp>::value, const char,
                                 char>::type _CharType;
@@ -274,112 +274,112 @@ struct _LIBCPP_TEMPLATE_VIS array<_Tp, 0>
     struct  _ArrayInStructT { _Tp __data_[1]; };
     _ALIGNAS_TYPE(_ArrayInStructT) _CharType __elems_[sizeof(_ArrayInStructT)];
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     value_type* data() _NOEXCEPT {return nullptr;}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     const value_type* data() const _NOEXCEPT {return nullptr;}
 
     // No explicit construct/copy/destroy for aggregate type
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     void fill(const value_type&) {
       static_assert(!is_const<_Tp>::value,
                     "cannot fill zero-sized array of type 'const T'");
     }
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     void swap(array&) _NOEXCEPT {
       static_assert(!is_const<_Tp>::value,
                     "cannot swap zero-sized array of type 'const T'");
     }
 
     // iterators:
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     iterator begin() _NOEXCEPT {return iterator(data());}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     const_iterator begin() const _NOEXCEPT {return const_iterator(data());}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     iterator end() _NOEXCEPT {return iterator(data());}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     const_iterator end() const _NOEXCEPT {return const_iterator(data());}
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     reverse_iterator rbegin() _NOEXCEPT {return reverse_iterator(end());}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     const_reverse_iterator rbegin() const _NOEXCEPT {return const_reverse_iterator(end());}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     reverse_iterator rend() _NOEXCEPT {return reverse_iterator(begin());}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     const_reverse_iterator rend() const _NOEXCEPT {return const_reverse_iterator(begin());}
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     const_iterator cbegin() const _NOEXCEPT {return begin();}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     const_iterator cend() const _NOEXCEPT {return end();}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     const_reverse_iterator crbegin() const _NOEXCEPT {return rbegin();}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     const_reverse_iterator crend() const _NOEXCEPT {return rend();}
 
     // capacity:
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR size_type size() const _NOEXCEPT {return 0; }
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR size_type max_size() const _NOEXCEPT {return 0;}
-    _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR bool empty() const _NOEXCEPT {return true;}
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR size_type size() const _NOEXCEPT {return 0; }
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR size_type max_size() const _NOEXCEPT {return 0;}
+    _LIBCUDACXX_NODISCARD_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR bool empty() const _NOEXCEPT {return true;}
 
     // element access:
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     reference operator[](size_type) _NOEXCEPT {
-      _LIBCPP_ASSERT(false, "cannot call array<T, 0>::operator[] on a zero-sized array");
-      __libcpp_unreachable();
+      _LIBCUDACXX_ASSERT(false, "cannot call array<T, 0>::operator[] on a zero-sized array");
+      __LIBCUDACXX_unreachable();
     }
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
     const_reference operator[](size_type) const _NOEXCEPT {
-      _LIBCPP_ASSERT(false, "cannot call array<T, 0>::operator[] on a zero-sized array");
-      __libcpp_unreachable();
+      _LIBCUDACXX_ASSERT(false, "cannot call array<T, 0>::operator[] on a zero-sized array");
+      __LIBCUDACXX_unreachable();
     }
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     reference at(size_type) {
       __throw_out_of_range("array<T, 0>::at");
-      __libcpp_unreachable();
+      __LIBCUDACXX_unreachable();
     }
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
     const_reference at(size_type) const {
       __throw_out_of_range("array<T, 0>::at");
-      __libcpp_unreachable();
+      __LIBCUDACXX_unreachable();
     }
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     reference front() _NOEXCEPT {
-      _LIBCPP_ASSERT(false, "cannot call array<T, 0>::front() on a zero-sized array");
-      __libcpp_unreachable();
+      _LIBCUDACXX_ASSERT(false, "cannot call array<T, 0>::front() on a zero-sized array");
+      __LIBCUDACXX_unreachable();
     }
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
     const_reference front() const _NOEXCEPT {
-      _LIBCPP_ASSERT(false, "cannot call array<T, 0>::front() on a zero-sized array");
-      __libcpp_unreachable();
+      _LIBCUDACXX_ASSERT(false, "cannot call array<T, 0>::front() on a zero-sized array");
+      __LIBCUDACXX_unreachable();
     }
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
     reference back() _NOEXCEPT {
-      _LIBCPP_ASSERT(false, "cannot call array<T, 0>::back() on a zero-sized array");
-      __libcpp_unreachable();
+      _LIBCUDACXX_ASSERT(false, "cannot call array<T, 0>::back() on a zero-sized array");
+      __LIBCUDACXX_unreachable();
     }
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
     const_reference back() const _NOEXCEPT {
-      _LIBCPP_ASSERT(false, "cannot call array<T, 0>::back() on a zero-sized array");
-      __libcpp_unreachable();
+      _LIBCUDACXX_ASSERT(false, "cannot call array<T, 0>::back() on a zero-sized array");
+      __LIBCUDACXX_unreachable();
     }
 };
 
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template<class _Tp, class... _Args,
          class = enable_if_t<__all<_IsSame<_Tp, _Args>::value...>::value>
          >
@@ -388,56 +388,56 @@ array(_Tp, _Args...)
 #endif
 
 template <class _Tp, size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR_AFTER_CXX17 bool
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17 bool
 operator==(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y)
 {
-    return _VSTD::equal(__x.begin(), __x.end(), __y.begin());
+    return _CUDA_VSTD::equal(__x.begin(), __x.end(), __y.begin());
 }
 
 template <class _Tp, size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR_AFTER_CXX17 bool
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17 bool
 operator!=(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y)
 {
     return !(__x == __y);
 }
 
 template <class _Tp, size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR_AFTER_CXX17 bool
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17 bool
 operator<(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y)
 {
-    return _VSTD::lexicographical_compare(__x.begin(), __x.end(),
+    return _CUDA_VSTD::lexicographical_compare(__x.begin(), __x.end(),
                                           __y.begin(), __y.end());
 }
 
 template <class _Tp, size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR_AFTER_CXX17 bool
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17 bool
 operator>(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y)
 {
     return __y < __x;
 }
 
 template <class _Tp, size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR_AFTER_CXX17 bool
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17 bool
 operator<=(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y)
 {
     return !(__y < __x);
 }
 
 template <class _Tp, size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR_AFTER_CXX17 bool
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17 bool
 operator>=(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y)
 {
     return !(__x < __y);
 }
 
 template <class _Tp, size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 __enable_if_t<_Size == 0 || __is_swappable<_Tp>::value, void>
 swap(array<_Tp, _Size>& __x, array<_Tp, _Size>& __y)
                                   _NOEXCEPT_(noexcept(__x.swap(__y)))
@@ -446,18 +446,18 @@ swap(array<_Tp, _Size>& __x, array<_Tp, _Size>& __y)
 }
 
 template <class _Tp, size_t _Size>
-struct _LIBCPP_TEMPLATE_VIS tuple_size<array<_Tp, _Size> >
+struct _LIBCUDACXX_TEMPLATE_VIS tuple_size<array<_Tp, _Size> >
     : public integral_constant<size_t, _Size> {};
 
 template <size_t _Ip, class _Tp, size_t _Size>
-struct _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, array<_Tp, _Size> >
+struct _LIBCUDACXX_TEMPLATE_VIS tuple_element<_Ip, array<_Tp, _Size> >
 {
     static_assert(_Ip < _Size, "Index out of bounds in std::tuple_element<> (std::array)");
     typedef _Tp type;
 };
 
 template <size_t _Ip, class _Tp, size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 _Tp&
 get(array<_Tp, _Size>& __a) _NOEXCEPT
 {
@@ -466,7 +466,7 @@ get(array<_Tp, _Size>& __a) _NOEXCEPT
 }
 
 template <size_t _Ip, class _Tp, size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 const _Tp&
 get(const array<_Tp, _Size>& __a) _NOEXCEPT
 {
@@ -475,39 +475,39 @@ get(const array<_Tp, _Size>& __a) _NOEXCEPT
 }
 
 template <size_t _Ip, class _Tp, size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 _Tp&&
 get(array<_Tp, _Size>&& __a) _NOEXCEPT
 {
     static_assert(_Ip < _Size, "Index out of bounds in std::get<> (std::array &&)");
-    return _VSTD::move(__a.__elems_[_Ip]);
+    return _CUDA_VSTD::move(__a.__elems_[_Ip]);
 }
 
 template <size_t _Ip, class _Tp, size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 const _Tp&&
 get(const array<_Tp, _Size>&& __a) _NOEXCEPT
 {
     static_assert(_Ip < _Size, "Index out of bounds in std::get<> (const std::array &&)");
-    return _VSTD::move(__a.__elems_[_Ip]);
+    return _CUDA_VSTD::move(__a.__elems_[_Ip]);
 }
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 template <typename _Tp, size_t _Size, size_t... _Index>
-_LIBCPP_INLINE_VISIBILITY constexpr array<remove_cv_t<_Tp>, _Size>
+_LIBCUDACXX_INLINE_VISIBILITY constexpr array<remove_cv_t<_Tp>, _Size>
 __to_array_lvalue_impl(_Tp (&__arr)[_Size], index_sequence<_Index...>) {
   return {{__arr[_Index]...}};
 }
 
 template <typename _Tp, size_t _Size, size_t... _Index>
-_LIBCPP_INLINE_VISIBILITY constexpr array<remove_cv_t<_Tp>, _Size>
+_LIBCUDACXX_INLINE_VISIBILITY constexpr array<remove_cv_t<_Tp>, _Size>
 __to_array_rvalue_impl(_Tp(&&__arr)[_Size], index_sequence<_Index...>) {
-  return {{_VSTD::move(__arr[_Index])...}};
+  return {{_CUDA_VSTD::move(__arr[_Index])...}};
 }
 
 template <typename _Tp, size_t _Size>
-_LIBCPP_INLINE_VISIBILITY constexpr array<remove_cv_t<_Tp>, _Size>
+_LIBCUDACXX_INLINE_VISIBILITY constexpr array<remove_cv_t<_Tp>, _Size>
 to_array(_Tp (&__arr)[_Size]) noexcept(is_nothrow_constructible_v<_Tp, _Tp&>) {
   static_assert(
       !is_array_v<_Tp>,
@@ -515,11 +515,11 @@ to_array(_Tp (&__arr)[_Size]) noexcept(is_nothrow_constructible_v<_Tp, _Tp&>) {
   static_assert(
       is_constructible_v<_Tp, _Tp&>,
       "[array.creation]/1: to_array requires copy constructible elements.");
-  return _VSTD::__to_array_lvalue_impl(__arr, make_index_sequence<_Size>());
+  return _CUDA_VSTD::__to_array_lvalue_impl(__arr, make_index_sequence<_Size>());
 }
 
 template <typename _Tp, size_t _Size>
-_LIBCPP_INLINE_VISIBILITY constexpr array<remove_cv_t<_Tp>, _Size>
+_LIBCUDACXX_INLINE_VISIBILITY constexpr array<remove_cv_t<_Tp>, _Size>
 to_array(_Tp(&&__arr)[_Size]) noexcept(is_nothrow_move_constructible_v<_Tp>) {
   static_assert(
       !is_array_v<_Tp>,
@@ -527,12 +527,12 @@ to_array(_Tp(&&__arr)[_Size]) noexcept(is_nothrow_move_constructible_v<_Tp>) {
   static_assert(
       is_move_constructible_v<_Tp>,
       "[array.creation]/4: to_array requires move constructible elements.");
-  return _VSTD::__to_array_rvalue_impl(_VSTD::move(__arr),
+  return _CUDA_VSTD::__to_array_rvalue_impl(_CUDA_VSTD::move(__arr),
                                        make_index_sequence<_Size>());
 }
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_ARRAY
+#endif // _LIBCUDACXX_ARRAY

diff  --git a/libcxx/include/atomic b/libcxx/include/atomic
index 92da4820e928..d536c9138c05 100644
--- a/libcxx/include/atomic
+++ b/libcxx/include/atomic
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_ATOMIC
-#define _LIBCPP_ATOMIC
+#ifndef _LIBCUDACXX_ATOMIC
+#define _LIBCUDACXX_ATOMIC
 
 /*
     atomic synopsis
@@ -530,42 +530,42 @@ template <class T>
 #include <type_traits>
 #include <version>
 
-#ifndef _LIBCPP_HAS_NO_THREADS
+#ifndef _LIBCUDACXX_HAS_NO_THREADS
 # include <__threading_support>
 #endif
 
-#ifndef _LIBCPP_REMOVE_TRANSITIVE_INCLUDES
+#ifndef _LIBCUDACXX_REMOVE_TRANSITIVE_INCLUDES
 #  include <chrono>
 #endif
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#ifdef _LIBCPP_HAS_NO_ATOMIC_HEADER
+#ifdef _LIBCUDACXX_HAS_NO_ATOMIC_HEADER
 # error <atomic> is not implemented
 #endif
 #ifdef kill_dependency
 # error <atomic> is incompatible with <stdatomic.h> before C++23. Please compile with -std=c++23.
 #endif
 
-#define _LIBCPP_CHECK_STORE_MEMORY_ORDER(__m) \
-  _LIBCPP_DIAGNOSE_WARNING(__m == memory_order_consume || \
+#define _LIBCUDACXX_CHECK_STORE_MEMORY_ORDER(__m) \
+  _LIBCUDACXX_DIAGNOSE_WARNING(__m == memory_order_consume || \
                            __m == memory_order_acquire || \
                            __m == memory_order_acq_rel,   \
                         "memory order argument to atomic operation is invalid")
 
-#define _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m) \
-  _LIBCPP_DIAGNOSE_WARNING(__m == memory_order_release || \
+#define _LIBCUDACXX_CHECK_LOAD_MEMORY_ORDER(__m) \
+  _LIBCUDACXX_DIAGNOSE_WARNING(__m == memory_order_release || \
                            __m == memory_order_acq_rel,   \
                         "memory order argument to atomic operation is invalid")
 
-#define _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__m, __f) \
-  _LIBCPP_DIAGNOSE_WARNING(__f == memory_order_release || \
+#define _LIBCUDACXX_CHECK_EXCHANGE_MEMORY_ORDER(__m, __f) \
+  _LIBCUDACXX_DIAGNOSE_WARNING(__f == memory_order_release || \
                            __f == memory_order_acq_rel,   \
                         "memory order argument to atomic operation is invalid")
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 // Figure out what the underlying type for `memory_order` would be if it were
 // declared as an unscoped enum (accounting for -fshort-enums). Use this result
@@ -581,7 +581,7 @@ enum __legacy_memory_order {
 
 typedef underlying_type<__legacy_memory_order>::type __memory_order_underlying_t;
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 enum class memory_order : __memory_order_underlying_t {
   relaxed = __mo_relaxed,
@@ -610,28 +610,28 @@ typedef enum memory_order {
   memory_order_seq_cst = __mo_seq_cst,
 } memory_order;
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-template <typename _Tp> _LIBCPP_INLINE_VISIBILITY
+template <typename _Tp> _LIBCUDACXX_INLINE_VISIBILITY
 bool __cxx_nonatomic_compare_equal(_Tp const& __lhs, _Tp const& __rhs) {
-    return _VSTD::memcmp(&__lhs, &__rhs, sizeof(_Tp)) == 0;
+    return _CUDA_VSTD::memcmp(&__lhs, &__rhs, sizeof(_Tp)) == 0;
 }
 
 static_assert((is_same<underlying_type<memory_order>::type, __memory_order_underlying_t>::value),
   "unexpected underlying type for std::memory_order");
 
-#if defined(_LIBCPP_HAS_GCC_ATOMIC_IMP) || \
-    defined(_LIBCPP_ATOMIC_ONLY_USE_BUILTINS)
+#if defined(_LIBCUDACXX_HAS_GCC_ATOMIC_IMP) || \
+    defined(_LIBCUDACXX_ATOMIC_ONLY_USE_BUILTINS)
 
 // [atomics.types.generic]p1 guarantees _Tp is trivially copyable. Because
 // the default operator= in an object is not volatile, a byte-by-byte copy
 // is required.
-template <typename _Tp, typename _Tv> _LIBCPP_INLINE_VISIBILITY
+template <typename _Tp, typename _Tv> _LIBCUDACXX_INLINE_VISIBILITY
 typename enable_if<is_assignable<_Tp&, _Tv>::value>::type
 __cxx_atomic_assign_volatile(_Tp& __a_value, _Tv const& __val) {
   __a_value = __val;
 }
-template <typename _Tp, typename _Tv> _LIBCPP_INLINE_VISIBILITY
+template <typename _Tp, typename _Tv> _LIBCUDACXX_INLINE_VISIBILITY
 typename enable_if<is_assignable<_Tp&, _Tv>::value>::type
 __cxx_atomic_assign_volatile(_Tp volatile& __a_value, _Tv volatile const& __val) {
   volatile char* __to = reinterpret_cast<volatile char*>(&__a_value);
@@ -643,23 +643,23 @@ __cxx_atomic_assign_volatile(_Tp volatile& __a_value, _Tv volatile const& __val)
 
 #endif
 
-#if defined(_LIBCPP_HAS_GCC_ATOMIC_IMP)
+#if defined(_LIBCUDACXX_HAS_GCC_ATOMIC_IMP)
 
 template <typename _Tp>
 struct __cxx_atomic_base_impl {
 
-  _LIBCPP_INLINE_VISIBILITY
-#ifndef _LIBCPP_CXX03_LANG
+  _LIBCUDACXX_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_CXX03_LANG
     __cxx_atomic_base_impl() _NOEXCEPT = default;
 #else
     __cxx_atomic_base_impl() _NOEXCEPT : __a_value() {}
-#endif // _LIBCPP_CXX03_LANG
-  _LIBCPP_CONSTEXPR explicit __cxx_atomic_base_impl(_Tp value) _NOEXCEPT
+#endif // _LIBCUDACXX_CXX03_LANG
+  _LIBCUDACXX_CONSTEXPR explicit __cxx_atomic_base_impl(_Tp value) _NOEXCEPT
     : __a_value(value) {}
   _Tp __a_value;
 };
 
-_LIBCPP_INLINE_VISIBILITY inline _LIBCPP_CONSTEXPR int __to_gcc_order(memory_order __order) {
+_LIBCUDACXX_INLINE_VISIBILITY inline _LIBCUDACXX_CONSTEXPR int __to_gcc_order(memory_order __order) {
   // Avoid switch statement to make this a constexpr.
   return __order == memory_order_relaxed ? __ATOMIC_RELAXED:
          (__order == memory_order_acquire ? __ATOMIC_ACQUIRE:
@@ -669,7 +669,7 @@ _LIBCPP_INLINE_VISIBILITY inline _LIBCPP_CONSTEXPR int __to_gcc_order(memory_ord
               __ATOMIC_CONSUME))));
 }
 
-_LIBCPP_INLINE_VISIBILITY inline _LIBCPP_CONSTEXPR int __to_gcc_failure_order(memory_order __order) {
+_LIBCUDACXX_INLINE_VISIBILITY inline _LIBCUDACXX_CONSTEXPR int __to_gcc_failure_order(memory_order __order) {
   // Avoid switch statement to make this a constexpr.
   return __order == memory_order_relaxed ? __ATOMIC_RELAXED:
          (__order == memory_order_acquire ? __ATOMIC_ACQUIRE:
@@ -680,29 +680,29 @@ _LIBCPP_INLINE_VISIBILITY inline _LIBCPP_CONSTEXPR int __to_gcc_failure_order(me
 }
 
 template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 void __cxx_atomic_init(volatile __cxx_atomic_base_impl<_Tp>* __a,  _Tp __val) {
   __cxx_atomic_assign_volatile(__a->__a_value, __val);
 }
 
 template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 void __cxx_atomic_init(__cxx_atomic_base_impl<_Tp>* __a,  _Tp __val) {
   __a->__a_value = __val;
 }
 
-_LIBCPP_INLINE_VISIBILITY inline
+_LIBCUDACXX_INLINE_VISIBILITY inline
 void __cxx_atomic_thread_fence(memory_order __order) {
   __atomic_thread_fence(__to_gcc_order(__order));
 }
 
-_LIBCPP_INLINE_VISIBILITY inline
+_LIBCUDACXX_INLINE_VISIBILITY inline
 void __cxx_atomic_signal_fence(memory_order __order) {
   __atomic_signal_fence(__to_gcc_order(__order));
 }
 
 template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 void __cxx_atomic_store(volatile __cxx_atomic_base_impl<_Tp>* __a,  _Tp __val,
                         memory_order __order) {
   __atomic_store(&__a->__a_value, &__val,
@@ -710,7 +710,7 @@ void __cxx_atomic_store(volatile __cxx_atomic_base_impl<_Tp>* __a,  _Tp __val,
 }
 
 template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 void __cxx_atomic_store(__cxx_atomic_base_impl<_Tp>* __a,  _Tp __val,
                         memory_order __order) {
   __atomic_store(&__a->__a_value, &__val,
@@ -718,7 +718,7 @@ void __cxx_atomic_store(__cxx_atomic_base_impl<_Tp>* __a,  _Tp __val,
 }
 
 template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp __cxx_atomic_load(const volatile __cxx_atomic_base_impl<_Tp>* __a,
                       memory_order __order) {
   _Tp __ret;
@@ -728,7 +728,7 @@ _Tp __cxx_atomic_load(const volatile __cxx_atomic_base_impl<_Tp>* __a,
 }
 
 template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp __cxx_atomic_load(const __cxx_atomic_base_impl<_Tp>* __a, memory_order __order) {
   _Tp __ret;
   __atomic_load(&__a->__a_value, &__ret,
@@ -737,7 +737,7 @@ _Tp __cxx_atomic_load(const __cxx_atomic_base_impl<_Tp>* __a, memory_order __ord
 }
 
 template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp __cxx_atomic_exchange(volatile __cxx_atomic_base_impl<_Tp>* __a,
                           _Tp __value, memory_order __order) {
   _Tp __ret;
@@ -747,7 +747,7 @@ _Tp __cxx_atomic_exchange(volatile __cxx_atomic_base_impl<_Tp>* __a,
 }
 
 template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp __cxx_atomic_exchange(__cxx_atomic_base_impl<_Tp>* __a, _Tp __value,
                           memory_order __order) {
   _Tp __ret;
@@ -757,7 +757,7 @@ _Tp __cxx_atomic_exchange(__cxx_atomic_base_impl<_Tp>* __a, _Tp __value,
 }
 
 template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 bool __cxx_atomic_compare_exchange_strong(
     volatile __cxx_atomic_base_impl<_Tp>* __a, _Tp* __expected, _Tp __value,
     memory_order __success, memory_order __failure) {
@@ -768,7 +768,7 @@ bool __cxx_atomic_compare_exchange_strong(
 }
 
 template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 bool __cxx_atomic_compare_exchange_strong(
     __cxx_atomic_base_impl<_Tp>* __a, _Tp* __expected, _Tp __value, memory_order __success,
     memory_order __failure) {
@@ -779,7 +779,7 @@ bool __cxx_atomic_compare_exchange_strong(
 }
 
 template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 bool __cxx_atomic_compare_exchange_weak(
     volatile __cxx_atomic_base_impl<_Tp>* __a, _Tp* __expected, _Tp __value,
     memory_order __success, memory_order __failure) {
@@ -790,7 +790,7 @@ bool __cxx_atomic_compare_exchange_weak(
 }
 
 template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 bool __cxx_atomic_compare_exchange_weak(
     __cxx_atomic_base_impl<_Tp>* __a, _Tp* __expected, _Tp __value, memory_order __success,
     memory_order __failure) {
@@ -814,7 +814,7 @@ template <typename _Tp, int n>
 struct __skip_amt<_Tp[n]> { };
 
 template <typename _Tp, typename _Td>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp __cxx_atomic_fetch_add(volatile __cxx_atomic_base_impl<_Tp>* __a,
                            _Td __delta, memory_order __order) {
   return __atomic_fetch_add(&__a->__a_value, __delta * __skip_amt<_Tp>::value,
@@ -822,7 +822,7 @@ _Tp __cxx_atomic_fetch_add(volatile __cxx_atomic_base_impl<_Tp>* __a,
 }
 
 template <typename _Tp, typename _Td>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp __cxx_atomic_fetch_add(__cxx_atomic_base_impl<_Tp>* __a, _Td __delta,
                            memory_order __order) {
   return __atomic_fetch_add(&__a->__a_value, __delta * __skip_amt<_Tp>::value,
@@ -830,7 +830,7 @@ _Tp __cxx_atomic_fetch_add(__cxx_atomic_base_impl<_Tp>* __a, _Td __delta,
 }
 
 template <typename _Tp, typename _Td>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp __cxx_atomic_fetch_sub(volatile __cxx_atomic_base_impl<_Tp>* __a,
                            _Td __delta, memory_order __order) {
   return __atomic_fetch_sub(&__a->__a_value, __delta * __skip_amt<_Tp>::value,
@@ -838,7 +838,7 @@ _Tp __cxx_atomic_fetch_sub(volatile __cxx_atomic_base_impl<_Tp>* __a,
 }
 
 template <typename _Tp, typename _Td>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp __cxx_atomic_fetch_sub(__cxx_atomic_base_impl<_Tp>* __a, _Td __delta,
                            memory_order __order) {
   return __atomic_fetch_sub(&__a->__a_value, __delta * __skip_amt<_Tp>::value,
@@ -846,7 +846,7 @@ _Tp __cxx_atomic_fetch_sub(__cxx_atomic_base_impl<_Tp>* __a, _Td __delta,
 }
 
 template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp __cxx_atomic_fetch_and(volatile __cxx_atomic_base_impl<_Tp>* __a,
                            _Tp __pattern, memory_order __order) {
   return __atomic_fetch_and(&__a->__a_value, __pattern,
@@ -854,7 +854,7 @@ _Tp __cxx_atomic_fetch_and(volatile __cxx_atomic_base_impl<_Tp>* __a,
 }
 
 template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp __cxx_atomic_fetch_and(__cxx_atomic_base_impl<_Tp>* __a,
                            _Tp __pattern, memory_order __order) {
   return __atomic_fetch_and(&__a->__a_value, __pattern,
@@ -862,7 +862,7 @@ _Tp __cxx_atomic_fetch_and(__cxx_atomic_base_impl<_Tp>* __a,
 }
 
 template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp __cxx_atomic_fetch_or(volatile __cxx_atomic_base_impl<_Tp>* __a,
                           _Tp __pattern, memory_order __order) {
   return __atomic_fetch_or(&__a->__a_value, __pattern,
@@ -870,7 +870,7 @@ _Tp __cxx_atomic_fetch_or(volatile __cxx_atomic_base_impl<_Tp>* __a,
 }
 
 template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp __cxx_atomic_fetch_or(__cxx_atomic_base_impl<_Tp>* __a, _Tp __pattern,
                           memory_order __order) {
   return __atomic_fetch_or(&__a->__a_value, __pattern,
@@ -878,7 +878,7 @@ _Tp __cxx_atomic_fetch_or(__cxx_atomic_base_impl<_Tp>* __a, _Tp __pattern,
 }
 
 template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp __cxx_atomic_fetch_xor(volatile __cxx_atomic_base_impl<_Tp>* __a,
                            _Tp __pattern, memory_order __order) {
   return __atomic_fetch_xor(&__a->__a_value, __pattern,
@@ -886,7 +886,7 @@ _Tp __cxx_atomic_fetch_xor(volatile __cxx_atomic_base_impl<_Tp>* __a,
 }
 
 template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp __cxx_atomic_fetch_xor(__cxx_atomic_base_impl<_Tp>* __a, _Tp __pattern,
                            memory_order __order) {
   return __atomic_fetch_xor(&__a->__a_value, __pattern,
@@ -895,81 +895,81 @@ _Tp __cxx_atomic_fetch_xor(__cxx_atomic_base_impl<_Tp>* __a, _Tp __pattern,
 
 #define __cxx_atomic_is_lock_free(__s) __atomic_is_lock_free(__s, 0)
 
-#elif defined(_LIBCPP_HAS_C_ATOMIC_IMP)
+#elif defined(_LIBCUDACXX_HAS_C_ATOMIC_IMP)
 
 template <typename _Tp>
 struct __cxx_atomic_base_impl {
 
-  _LIBCPP_INLINE_VISIBILITY
-#ifndef _LIBCPP_CXX03_LANG
+  _LIBCUDACXX_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_CXX03_LANG
     __cxx_atomic_base_impl() _NOEXCEPT = default;
 #else
     __cxx_atomic_base_impl() _NOEXCEPT : __a_value() {}
-#endif // _LIBCPP_CXX03_LANG
-  _LIBCPP_CONSTEXPR explicit __cxx_atomic_base_impl(_Tp __value) _NOEXCEPT
+#endif // _LIBCUDACXX_CXX03_LANG
+  _LIBCUDACXX_CONSTEXPR explicit __cxx_atomic_base_impl(_Tp __value) _NOEXCEPT
     : __a_value(__value) {}
-  _LIBCPP_DISABLE_EXTENSION_WARNING _Atomic(_Tp) __a_value;
+  _LIBCUDACXX_DISABLE_EXTENSION_WARNING _Atomic(_Tp) __a_value;
 };
 
 #define __cxx_atomic_is_lock_free(__s) __c11_atomic_is_lock_free(__s)
 
-_LIBCPP_INLINE_VISIBILITY inline
+_LIBCUDACXX_INLINE_VISIBILITY inline
 void __cxx_atomic_thread_fence(memory_order __order) _NOEXCEPT {
     __c11_atomic_thread_fence(static_cast<__memory_order_underlying_t>(__order));
 }
 
-_LIBCPP_INLINE_VISIBILITY inline
+_LIBCUDACXX_INLINE_VISIBILITY inline
 void __cxx_atomic_signal_fence(memory_order __order) _NOEXCEPT {
     __c11_atomic_signal_fence(static_cast<__memory_order_underlying_t>(__order));
 }
 
 template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 void __cxx_atomic_init(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __val) _NOEXCEPT {
     __c11_atomic_init(&__a->__a_value, __val);
 }
 template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 void __cxx_atomic_init(__cxx_atomic_base_impl<_Tp> * __a, _Tp __val) _NOEXCEPT {
     __c11_atomic_init(&__a->__a_value, __val);
 }
 
 template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 void __cxx_atomic_store(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __val, memory_order __order) _NOEXCEPT {
     __c11_atomic_store(&__a->__a_value, __val, static_cast<__memory_order_underlying_t>(__order));
 }
 template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 void __cxx_atomic_store(__cxx_atomic_base_impl<_Tp> * __a, _Tp __val, memory_order __order) _NOEXCEPT {
     __c11_atomic_store(&__a->__a_value, __val, static_cast<__memory_order_underlying_t>(__order));
 }
 
 template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp __cxx_atomic_load(__cxx_atomic_base_impl<_Tp> const volatile* __a, memory_order __order) _NOEXCEPT {
     using __ptr_type = typename remove_const<decltype(__a->__a_value)>::type*;
     return __c11_atomic_load(const_cast<__ptr_type>(&__a->__a_value), static_cast<__memory_order_underlying_t>(__order));
 }
 template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp __cxx_atomic_load(__cxx_atomic_base_impl<_Tp> const* __a, memory_order __order) _NOEXCEPT {
     using __ptr_type = typename remove_const<decltype(__a->__a_value)>::type*;
     return __c11_atomic_load(const_cast<__ptr_type>(&__a->__a_value), static_cast<__memory_order_underlying_t>(__order));
 }
 
 template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp __cxx_atomic_exchange(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __value, memory_order __order) _NOEXCEPT {
     return __c11_atomic_exchange(&__a->__a_value, __value, static_cast<__memory_order_underlying_t>(__order));
 }
 template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp __cxx_atomic_exchange(__cxx_atomic_base_impl<_Tp> * __a, _Tp __value, memory_order __order) _NOEXCEPT {
     return __c11_atomic_exchange(&__a->__a_value, __value, static_cast<__memory_order_underlying_t>(__order));
 }
 
-_LIBCPP_INLINE_VISIBILITY inline _LIBCPP_CONSTEXPR memory_order __to_failure_order(memory_order __order) {
+_LIBCUDACXX_INLINE_VISIBILITY inline _LIBCUDACXX_CONSTEXPR memory_order __to_failure_order(memory_order __order) {
   // Avoid switch statement to make this a constexpr.
   return __order == memory_order_release ? memory_order_relaxed:
          (__order == memory_order_acq_rel ? memory_order_acquire:
@@ -977,107 +977,107 @@ _LIBCPP_INLINE_VISIBILITY inline _LIBCPP_CONSTEXPR memory_order __to_failure_ord
 }
 
 template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 bool __cxx_atomic_compare_exchange_strong(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp* __expected, _Tp __value, memory_order __success, memory_order __failure) _NOEXCEPT {
     return __c11_atomic_compare_exchange_strong(&__a->__a_value, __expected, __value, static_cast<__memory_order_underlying_t>(__success), static_cast<__memory_order_underlying_t>(__to_failure_order(__failure)));
 }
 template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 bool __cxx_atomic_compare_exchange_strong(__cxx_atomic_base_impl<_Tp> * __a, _Tp* __expected, _Tp __value, memory_order __success, memory_order __failure) _NOEXCEPT {
     return __c11_atomic_compare_exchange_strong(&__a->__a_value, __expected, __value, static_cast<__memory_order_underlying_t>(__success), static_cast<__memory_order_underlying_t>(__to_failure_order(__failure)));
 }
 
 template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 bool __cxx_atomic_compare_exchange_weak(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp* __expected, _Tp __value, memory_order __success, memory_order __failure) _NOEXCEPT {
     return __c11_atomic_compare_exchange_weak(&__a->__a_value, __expected, __value, static_cast<__memory_order_underlying_t>(__success), static_cast<__memory_order_underlying_t>(__to_failure_order(__failure)));
 }
 template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 bool __cxx_atomic_compare_exchange_weak(__cxx_atomic_base_impl<_Tp> * __a, _Tp* __expected, _Tp __value, memory_order __success, memory_order __failure) _NOEXCEPT {
     return __c11_atomic_compare_exchange_weak(&__a->__a_value, __expected, __value,  static_cast<__memory_order_underlying_t>(__success), static_cast<__memory_order_underlying_t>(__to_failure_order(__failure)));
 }
 
 template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp __cxx_atomic_fetch_add(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __delta, memory_order __order) _NOEXCEPT {
     return __c11_atomic_fetch_add(&__a->__a_value, __delta, static_cast<__memory_order_underlying_t>(__order));
 }
 template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp __cxx_atomic_fetch_add(__cxx_atomic_base_impl<_Tp> * __a, _Tp __delta, memory_order __order) _NOEXCEPT {
     return __c11_atomic_fetch_add(&__a->__a_value, __delta, static_cast<__memory_order_underlying_t>(__order));
 }
 
 template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp* __cxx_atomic_fetch_add(__cxx_atomic_base_impl<_Tp*> volatile* __a, ptr
diff _t __delta, memory_order __order) _NOEXCEPT {
     return __c11_atomic_fetch_add(&__a->__a_value, __delta, static_cast<__memory_order_underlying_t>(__order));
 }
 template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp* __cxx_atomic_fetch_add(__cxx_atomic_base_impl<_Tp*> * __a, ptr
diff _t __delta, memory_order __order) _NOEXCEPT {
     return __c11_atomic_fetch_add(&__a->__a_value, __delta, static_cast<__memory_order_underlying_t>(__order));
 }
 
 template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp __cxx_atomic_fetch_sub(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __delta, memory_order __order) _NOEXCEPT {
     return __c11_atomic_fetch_sub(&__a->__a_value, __delta, static_cast<__memory_order_underlying_t>(__order));
 }
 template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp __cxx_atomic_fetch_sub(__cxx_atomic_base_impl<_Tp> * __a, _Tp __delta, memory_order __order) _NOEXCEPT {
     return __c11_atomic_fetch_sub(&__a->__a_value, __delta, static_cast<__memory_order_underlying_t>(__order));
 }
 template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp* __cxx_atomic_fetch_sub(__cxx_atomic_base_impl<_Tp*> volatile* __a, ptr
diff _t __delta, memory_order __order) _NOEXCEPT {
     return __c11_atomic_fetch_sub(&__a->__a_value, __delta, static_cast<__memory_order_underlying_t>(__order));
 }
 template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp* __cxx_atomic_fetch_sub(__cxx_atomic_base_impl<_Tp*> * __a, ptr
diff _t __delta, memory_order __order) _NOEXCEPT {
     return __c11_atomic_fetch_sub(&__a->__a_value, __delta, static_cast<__memory_order_underlying_t>(__order));
 }
 
 template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp __cxx_atomic_fetch_and(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __pattern, memory_order __order) _NOEXCEPT {
     return __c11_atomic_fetch_and(&__a->__a_value, __pattern, static_cast<__memory_order_underlying_t>(__order));
 }
 template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp __cxx_atomic_fetch_and(__cxx_atomic_base_impl<_Tp> * __a, _Tp __pattern, memory_order __order) _NOEXCEPT {
     return __c11_atomic_fetch_and(&__a->__a_value, __pattern, static_cast<__memory_order_underlying_t>(__order));
 }
 
 template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp __cxx_atomic_fetch_or(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __pattern, memory_order __order) _NOEXCEPT {
     return __c11_atomic_fetch_or(&__a->__a_value, __pattern, static_cast<__memory_order_underlying_t>(__order));
 }
 template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp __cxx_atomic_fetch_or(__cxx_atomic_base_impl<_Tp> * __a, _Tp __pattern, memory_order __order) _NOEXCEPT {
     return __c11_atomic_fetch_or(&__a->__a_value, __pattern, static_cast<__memory_order_underlying_t>(__order));
 }
 
 template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp __cxx_atomic_fetch_xor(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __pattern, memory_order __order) _NOEXCEPT {
     return __c11_atomic_fetch_xor(&__a->__a_value, __pattern, static_cast<__memory_order_underlying_t>(__order));
 }
 template<class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp __cxx_atomic_fetch_xor(__cxx_atomic_base_impl<_Tp> * __a, _Tp __pattern, memory_order __order) _NOEXCEPT {
     return __c11_atomic_fetch_xor(&__a->__a_value, __pattern, static_cast<__memory_order_underlying_t>(__order));
 }
 
-#endif // _LIBCPP_HAS_GCC_ATOMIC_IMP, _LIBCPP_HAS_C_ATOMIC_IMP
+#endif // _LIBCUDACXX_HAS_GCC_ATOMIC_IMP, _LIBCUDACXX_HAS_C_ATOMIC_IMP
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp kill_dependency(_Tp __y) _NOEXCEPT
 {
     return __y;
@@ -1086,7 +1086,7 @@ _Tp kill_dependency(_Tp __y) _NOEXCEPT
 #if defined(__CLANG_ATOMIC_BOOL_LOCK_FREE)
 # define ATOMIC_BOOL_LOCK_FREE      __CLANG_ATOMIC_BOOL_LOCK_FREE
 # define ATOMIC_CHAR_LOCK_FREE      __CLANG_ATOMIC_CHAR_LOCK_FREE
-#ifndef _LIBCPP_HAS_NO_CHAR8_T
+#ifndef _LIBCUDACXX_HAS_NO_CHAR8_T
 # define ATOMIC_CHAR8_T_LOCK_FREE   __CLANG_ATOMIC_CHAR8_T_LOCK_FREE
 #endif
 # define ATOMIC_CHAR16_T_LOCK_FREE  __CLANG_ATOMIC_CHAR16_T_LOCK_FREE
@@ -1100,7 +1100,7 @@ _Tp kill_dependency(_Tp __y) _NOEXCEPT
 #elif defined(__GCC_ATOMIC_BOOL_LOCK_FREE)
 # define ATOMIC_BOOL_LOCK_FREE      __GCC_ATOMIC_BOOL_LOCK_FREE
 # define ATOMIC_CHAR_LOCK_FREE      __GCC_ATOMIC_CHAR_LOCK_FREE
-#ifndef _LIBCPP_HAS_NO_CHAR8_T
+#ifndef _LIBCUDACXX_HAS_NO_CHAR8_T
 # define ATOMIC_CHAR8_T_LOCK_FREE   __GCC_ATOMIC_CHAR8_T_LOCK_FREE
 #endif
 # define ATOMIC_CHAR16_T_LOCK_FREE  __GCC_ATOMIC_CHAR16_T_LOCK_FREE
@@ -1113,43 +1113,43 @@ _Tp kill_dependency(_Tp __y) _NOEXCEPT
 # define ATOMIC_POINTER_LOCK_FREE   __GCC_ATOMIC_POINTER_LOCK_FREE
 #endif
 
-#ifdef _LIBCPP_ATOMIC_ONLY_USE_BUILTINS
+#ifdef _LIBCUDACXX_ATOMIC_ONLY_USE_BUILTINS
 
 template<typename _Tp>
 struct __cxx_atomic_lock_impl {
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   __cxx_atomic_lock_impl() _NOEXCEPT
     : __a_value(), __a_lock(0) {}
-  _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR explicit
+  _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR explicit
   __cxx_atomic_lock_impl(_Tp value) _NOEXCEPT
     : __a_value(value), __a_lock(0) {}
 
   _Tp __a_value;
-  mutable __cxx_atomic_base_impl<_LIBCPP_ATOMIC_FLAG_TYPE> __a_lock;
+  mutable __cxx_atomic_base_impl<_LIBCUDACXX_ATOMIC_FLAG_TYPE> __a_lock;
 
-  _LIBCPP_INLINE_VISIBILITY void __lock() const volatile {
-    while(1 == __cxx_atomic_exchange(&__a_lock, _LIBCPP_ATOMIC_FLAG_TYPE(true), memory_order_acquire))
+  _LIBCUDACXX_INLINE_VISIBILITY void __lock() const volatile {
+    while(1 == __cxx_atomic_exchange(&__a_lock, _LIBCUDACXX_ATOMIC_FLAG_TYPE(true), memory_order_acquire))
         /*spin*/;
   }
-  _LIBCPP_INLINE_VISIBILITY void __lock() const {
-    while(1 == __cxx_atomic_exchange(&__a_lock, _LIBCPP_ATOMIC_FLAG_TYPE(true), memory_order_acquire))
+  _LIBCUDACXX_INLINE_VISIBILITY void __lock() const {
+    while(1 == __cxx_atomic_exchange(&__a_lock, _LIBCUDACXX_ATOMIC_FLAG_TYPE(true), memory_order_acquire))
         /*spin*/;
   }
-  _LIBCPP_INLINE_VISIBILITY void __unlock() const volatile {
-    __cxx_atomic_store(&__a_lock, _LIBCPP_ATOMIC_FLAG_TYPE(false), memory_order_release);
+  _LIBCUDACXX_INLINE_VISIBILITY void __unlock() const volatile {
+    __cxx_atomic_store(&__a_lock, _LIBCUDACXX_ATOMIC_FLAG_TYPE(false), memory_order_release);
   }
-  _LIBCPP_INLINE_VISIBILITY void __unlock() const {
-    __cxx_atomic_store(&__a_lock, _LIBCPP_ATOMIC_FLAG_TYPE(false), memory_order_release);
+  _LIBCUDACXX_INLINE_VISIBILITY void __unlock() const {
+    __cxx_atomic_store(&__a_lock, _LIBCUDACXX_ATOMIC_FLAG_TYPE(false), memory_order_release);
   }
-  _LIBCPP_INLINE_VISIBILITY _Tp __read() const volatile {
+  _LIBCUDACXX_INLINE_VISIBILITY _Tp __read() const volatile {
     __lock();
     _Tp __old;
     __cxx_atomic_assign_volatile(__old, __a_value);
     __unlock();
     return __old;
   }
-  _LIBCPP_INLINE_VISIBILITY _Tp __read() const {
+  _LIBCUDACXX_INLINE_VISIBILITY _Tp __read() const {
     __lock();
     _Tp __old = __a_value;
     __unlock();
@@ -1158,25 +1158,25 @@ struct __cxx_atomic_lock_impl {
 };
 
 template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 void __cxx_atomic_init(volatile __cxx_atomic_lock_impl<_Tp>* __a,  _Tp __val) {
   __cxx_atomic_assign_volatile(__a->__a_value, __val);
 }
 template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 void __cxx_atomic_init(__cxx_atomic_lock_impl<_Tp>* __a,  _Tp __val) {
   __a->__a_value = __val;
 }
 
 template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 void __cxx_atomic_store(volatile __cxx_atomic_lock_impl<_Tp>* __a,  _Tp __val, memory_order) {
   __a->__lock();
   __cxx_atomic_assign_volatile(__a->__a_value, __val);
   __a->__unlock();
 }
 template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 void __cxx_atomic_store(__cxx_atomic_lock_impl<_Tp>* __a,  _Tp __val, memory_order) {
   __a->__lock();
   __a->__a_value = __val;
@@ -1184,18 +1184,18 @@ void __cxx_atomic_store(__cxx_atomic_lock_impl<_Tp>* __a,  _Tp __val, memory_ord
 }
 
 template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp __cxx_atomic_load(const volatile __cxx_atomic_lock_impl<_Tp>* __a, memory_order) {
   return __a->__read();
 }
 template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp __cxx_atomic_load(const __cxx_atomic_lock_impl<_Tp>* __a, memory_order) {
   return __a->__read();
 }
 
 template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp __cxx_atomic_exchange(volatile __cxx_atomic_lock_impl<_Tp>* __a, _Tp __value, memory_order) {
   __a->__lock();
   _Tp __old;
@@ -1205,7 +1205,7 @@ _Tp __cxx_atomic_exchange(volatile __cxx_atomic_lock_impl<_Tp>* __a, _Tp __value
   return __old;
 }
 template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp __cxx_atomic_exchange(__cxx_atomic_lock_impl<_Tp>* __a, _Tp __value, memory_order) {
   __a->__lock();
   _Tp __old = __a->__a_value;
@@ -1215,13 +1215,13 @@ _Tp __cxx_atomic_exchange(__cxx_atomic_lock_impl<_Tp>* __a, _Tp __value, memory_
 }
 
 template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 bool __cxx_atomic_compare_exchange_strong(volatile __cxx_atomic_lock_impl<_Tp>* __a,
                                           _Tp* __expected, _Tp __value, memory_order, memory_order) {
   _Tp __temp;
   __a->__lock();
   __cxx_atomic_assign_volatile(__temp, __a->__a_value);
-  bool __ret = (_VSTD::memcmp(&__temp, __expected, sizeof(_Tp)) == 0);
+  bool __ret = (_CUDA_VSTD::memcmp(&__temp, __expected, sizeof(_Tp)) == 0);
   if(__ret)
     __cxx_atomic_assign_volatile(__a->__a_value, __value);
   else
@@ -1230,27 +1230,27 @@ bool __cxx_atomic_compare_exchange_strong(volatile __cxx_atomic_lock_impl<_Tp>*
   return __ret;
 }
 template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 bool __cxx_atomic_compare_exchange_strong(__cxx_atomic_lock_impl<_Tp>* __a,
                                           _Tp* __expected, _Tp __value, memory_order, memory_order) {
   __a->__lock();
-  bool __ret = (_VSTD::memcmp(&__a->__a_value, __expected, sizeof(_Tp)) == 0);
+  bool __ret = (_CUDA_VSTD::memcmp(&__a->__a_value, __expected, sizeof(_Tp)) == 0);
   if(__ret)
-    _VSTD::memcpy(&__a->__a_value, &__value, sizeof(_Tp));
+    _CUDA_VSTD::memcpy(&__a->__a_value, &__value, sizeof(_Tp));
   else
-    _VSTD::memcpy(__expected, &__a->__a_value, sizeof(_Tp));
+    _CUDA_VSTD::memcpy(__expected, &__a->__a_value, sizeof(_Tp));
   __a->__unlock();
   return __ret;
 }
 
 template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 bool __cxx_atomic_compare_exchange_weak(volatile __cxx_atomic_lock_impl<_Tp>* __a,
                                         _Tp* __expected, _Tp __value, memory_order, memory_order) {
   _Tp __temp;
   __a->__lock();
   __cxx_atomic_assign_volatile(__temp, __a->__a_value);
-  bool __ret = (_VSTD::memcmp(&__temp, __expected, sizeof(_Tp)) == 0);
+  bool __ret = (_CUDA_VSTD::memcmp(&__temp, __expected, sizeof(_Tp)) == 0);
   if(__ret)
     __cxx_atomic_assign_volatile(__a->__a_value, __value);
   else
@@ -1259,21 +1259,21 @@ bool __cxx_atomic_compare_exchange_weak(volatile __cxx_atomic_lock_impl<_Tp>* __
   return __ret;
 }
 template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 bool __cxx_atomic_compare_exchange_weak(__cxx_atomic_lock_impl<_Tp>* __a,
                                         _Tp* __expected, _Tp __value, memory_order, memory_order) {
   __a->__lock();
-  bool __ret = (_VSTD::memcmp(&__a->__a_value, __expected, sizeof(_Tp)) == 0);
+  bool __ret = (_CUDA_VSTD::memcmp(&__a->__a_value, __expected, sizeof(_Tp)) == 0);
   if(__ret)
-    _VSTD::memcpy(&__a->__a_value, &__value, sizeof(_Tp));
+    _CUDA_VSTD::memcpy(&__a->__a_value, &__value, sizeof(_Tp));
   else
-    _VSTD::memcpy(__expected, &__a->__a_value, sizeof(_Tp));
+    _CUDA_VSTD::memcpy(__expected, &__a->__a_value, sizeof(_Tp));
   __a->__unlock();
   return __ret;
 }
 
 template <typename _Tp, typename _Td>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp __cxx_atomic_fetch_add(volatile __cxx_atomic_lock_impl<_Tp>* __a,
                            _Td __delta, memory_order) {
   __a->__lock();
@@ -1284,7 +1284,7 @@ _Tp __cxx_atomic_fetch_add(volatile __cxx_atomic_lock_impl<_Tp>* __a,
   return __old;
 }
 template <typename _Tp, typename _Td>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp __cxx_atomic_fetch_add(__cxx_atomic_lock_impl<_Tp>* __a,
                            _Td __delta, memory_order) {
   __a->__lock();
@@ -1295,7 +1295,7 @@ _Tp __cxx_atomic_fetch_add(__cxx_atomic_lock_impl<_Tp>* __a,
 }
 
 template <typename _Tp, typename _Td>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp* __cxx_atomic_fetch_add(volatile __cxx_atomic_lock_impl<_Tp*>* __a,
                            ptr
diff _t __delta, memory_order) {
   __a->__lock();
@@ -1306,7 +1306,7 @@ _Tp* __cxx_atomic_fetch_add(volatile __cxx_atomic_lock_impl<_Tp*>* __a,
   return __old;
 }
 template <typename _Tp, typename _Td>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp* __cxx_atomic_fetch_add(__cxx_atomic_lock_impl<_Tp*>* __a,
                            ptr
diff _t __delta, memory_order) {
   __a->__lock();
@@ -1317,7 +1317,7 @@ _Tp* __cxx_atomic_fetch_add(__cxx_atomic_lock_impl<_Tp*>* __a,
 }
 
 template <typename _Tp, typename _Td>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp __cxx_atomic_fetch_sub(volatile __cxx_atomic_lock_impl<_Tp>* __a,
                            _Td __delta, memory_order) {
   __a->__lock();
@@ -1328,7 +1328,7 @@ _Tp __cxx_atomic_fetch_sub(volatile __cxx_atomic_lock_impl<_Tp>* __a,
   return __old;
 }
 template <typename _Tp, typename _Td>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp __cxx_atomic_fetch_sub(__cxx_atomic_lock_impl<_Tp>* __a,
                            _Td __delta, memory_order) {
   __a->__lock();
@@ -1339,7 +1339,7 @@ _Tp __cxx_atomic_fetch_sub(__cxx_atomic_lock_impl<_Tp>* __a,
 }
 
 template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp __cxx_atomic_fetch_and(volatile __cxx_atomic_lock_impl<_Tp>* __a,
                            _Tp __pattern, memory_order) {
   __a->__lock();
@@ -1350,7 +1350,7 @@ _Tp __cxx_atomic_fetch_and(volatile __cxx_atomic_lock_impl<_Tp>* __a,
   return __old;
 }
 template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp __cxx_atomic_fetch_and(__cxx_atomic_lock_impl<_Tp>* __a,
                            _Tp __pattern, memory_order) {
   __a->__lock();
@@ -1361,7 +1361,7 @@ _Tp __cxx_atomic_fetch_and(__cxx_atomic_lock_impl<_Tp>* __a,
 }
 
 template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp __cxx_atomic_fetch_or(volatile __cxx_atomic_lock_impl<_Tp>* __a,
                           _Tp __pattern, memory_order) {
   __a->__lock();
@@ -1372,7 +1372,7 @@ _Tp __cxx_atomic_fetch_or(volatile __cxx_atomic_lock_impl<_Tp>* __a,
   return __old;
 }
 template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp __cxx_atomic_fetch_or(__cxx_atomic_lock_impl<_Tp>* __a,
                           _Tp __pattern, memory_order) {
   __a->__lock();
@@ -1383,7 +1383,7 @@ _Tp __cxx_atomic_fetch_or(__cxx_atomic_lock_impl<_Tp>* __a,
 }
 
 template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp __cxx_atomic_fetch_xor(volatile __cxx_atomic_lock_impl<_Tp>* __a,
                            _Tp __pattern, memory_order) {
   __a->__lock();
@@ -1394,7 +1394,7 @@ _Tp __cxx_atomic_fetch_xor(volatile __cxx_atomic_lock_impl<_Tp>* __a,
   return __old;
 }
 template <typename _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp __cxx_atomic_fetch_xor(__cxx_atomic_lock_impl<_Tp>* __a,
                            _Tp __pattern, memory_order) {
   __a->__lock();
@@ -1417,12 +1417,12 @@ template<> struct __cxx_is_always_lock_free<bool> { enum { __value = 2 == ATOMIC
 template<> struct __cxx_is_always_lock_free<char> { enum { __value = 2 == ATOMIC_CHAR_LOCK_FREE }; };
 template<> struct __cxx_is_always_lock_free<signed char> { enum { __value = 2 == ATOMIC_CHAR_LOCK_FREE }; };
 template<> struct __cxx_is_always_lock_free<unsigned char> { enum { __value = 2 == ATOMIC_CHAR_LOCK_FREE }; };
-#ifndef _LIBCPP_HAS_NO_CHAR8_T
+#ifndef _LIBCUDACXX_HAS_NO_CHAR8_T
 template<> struct __cxx_is_always_lock_free<char8_t> { enum { __value = 2 == ATOMIC_CHAR8_T_LOCK_FREE }; };
 #endif
 template<> struct __cxx_is_always_lock_free<char16_t> { enum { __value = 2 == ATOMIC_CHAR16_T_LOCK_FREE }; };
 template<> struct __cxx_is_always_lock_free<char32_t> { enum { __value = 2 == ATOMIC_CHAR32_T_LOCK_FREE }; };
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 template<> struct __cxx_is_always_lock_free<wchar_t> { enum { __value = 2 == ATOMIC_WCHAR_T_LOCK_FREE }; };
 #endif
 template<> struct __cxx_is_always_lock_free<short> { enum { __value = 2 == ATOMIC_SHORT_LOCK_FREE }; };
@@ -1445,13 +1445,13 @@ template <typename _Tp,
 #else
 template <typename _Tp,
           typename _Base = __cxx_atomic_base_impl<_Tp> >
-#endif //_LIBCPP_ATOMIC_ONLY_USE_BUILTINS
+#endif //_LIBCUDACXX_ATOMIC_ONLY_USE_BUILTINS
 struct __cxx_atomic_impl : public _Base {
     static_assert(is_trivially_copyable<_Tp>::value,
       "std::atomic<T> requires that 'T' be a trivially copyable type");
 
-  _LIBCPP_INLINE_VISIBILITY __cxx_atomic_impl() _NOEXCEPT = default;
-  _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR explicit __cxx_atomic_impl(_Tp __value) _NOEXCEPT
+  _LIBCUDACXX_INLINE_VISIBILITY __cxx_atomic_impl() _NOEXCEPT = default;
+  _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR explicit __cxx_atomic_impl(_Tp __value) _NOEXCEPT
     : _Base(__value) {}
 };
 
@@ -1463,44 +1463,44 @@ struct __cxx_atomic_impl : public _Base {
 
 using __cxx_atomic_contention_t = __cxx_atomic_impl<__cxx_contention_t>;
 
-#if defined(_LIBCPP_HAS_NO_THREADS)
-#   define _LIBCPP_HAS_NO_PLATFORM_WAIT
+#if defined(_LIBCUDACXX_HAS_NO_THREADS)
+#   define _LIBCUDACXX_HAS_NO_PLATFORM_WAIT
 #endif
 
 // TODO:
-// _LIBCPP_HAS_NO_PLATFORM_WAIT is currently a "dead" macro, in the sense that
+// _LIBCUDACXX_HAS_NO_PLATFORM_WAIT is currently a "dead" macro, in the sense that
 // it is not tied anywhere into the build system or even documented. We should
 // clean it up because it is technically never defined except when threads are
 // disabled. We should clean it up in its own changeset in case we break "bad"
 // users.
-#ifndef _LIBCPP_HAS_NO_PLATFORM_WAIT
+#ifndef _LIBCUDACXX_HAS_NO_PLATFORM_WAIT
 
-_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_one(void const volatile*);
-_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_all(void const volatile*);
-_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI __cxx_contention_t __libcpp_atomic_monitor(void const volatile*);
-_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void __libcpp_atomic_wait(void const volatile*, __cxx_contention_t);
+_LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_EXPORTED_FROM_ABI void __cxx_atomic_notify_one(void const volatile*);
+_LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_EXPORTED_FROM_ABI void __cxx_atomic_notify_all(void const volatile*);
+_LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_EXPORTED_FROM_ABI __cxx_contention_t __LIBCUDACXX_atomic_monitor(void const volatile*);
+_LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_EXPORTED_FROM_ABI void __LIBCUDACXX_atomic_wait(void const volatile*, __cxx_contention_t);
 
-_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_one(__cxx_atomic_contention_t const volatile*);
-_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_all(__cxx_atomic_contention_t const volatile*);
-_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI __cxx_contention_t __libcpp_atomic_monitor(__cxx_atomic_contention_t const volatile*);
-_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void __libcpp_atomic_wait(__cxx_atomic_contention_t const volatile*, __cxx_contention_t);
+_LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_EXPORTED_FROM_ABI void __cxx_atomic_notify_one(__cxx_atomic_contention_t const volatile*);
+_LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_EXPORTED_FROM_ABI void __cxx_atomic_notify_all(__cxx_atomic_contention_t const volatile*);
+_LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_EXPORTED_FROM_ABI __cxx_contention_t __LIBCUDACXX_atomic_monitor(__cxx_atomic_contention_t const volatile*);
+_LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_EXPORTED_FROM_ABI void __LIBCUDACXX_atomic_wait(__cxx_atomic_contention_t const volatile*, __cxx_contention_t);
 
 template <class _Atp, class _Fn>
-struct __libcpp_atomic_wait_backoff_impl {
+struct __LIBCUDACXX_atomic_wait_backoff_impl {
     _Atp* __a;
     _Fn __test_fn;
-    _LIBCPP_AVAILABILITY_SYNC
-    _LIBCPP_INLINE_VISIBILITY bool operator()(chrono::nanoseconds __elapsed) const
+    _LIBCUDACXX_AVAILABILITY_SYNC
+    _LIBCUDACXX_INLINE_VISIBILITY bool operator()(chrono::nanoseconds __elapsed) const
     {
         if(__elapsed > chrono::microseconds(64))
         {
-            auto const __monitor = __libcpp_atomic_monitor(__a);
+            auto const __monitor = __LIBCUDACXX_atomic_monitor(__a);
             if(__test_fn())
                 return true;
-            __libcpp_atomic_wait(__a, __monitor);
+            __LIBCUDACXX_atomic_wait(__a, __monitor);
         }
         else if(__elapsed > chrono::microseconds(4))
-            __libcpp_thread_yield();
+            __LIBCUDACXX_thread_yield();
         else
             {} // poll
         return false;
@@ -1508,46 +1508,46 @@ struct __libcpp_atomic_wait_backoff_impl {
 };
 
 template <class _Atp, class _Fn>
-_LIBCPP_AVAILABILITY_SYNC
-_LIBCPP_INLINE_VISIBILITY bool __cxx_atomic_wait(_Atp* __a, _Fn && __test_fn)
+_LIBCUDACXX_AVAILABILITY_SYNC
+_LIBCUDACXX_INLINE_VISIBILITY bool __cxx_atomic_wait(_Atp* __a, _Fn && __test_fn)
 {
-    __libcpp_atomic_wait_backoff_impl<_Atp, typename decay<_Fn>::type> __backoff_fn = {__a, __test_fn};
-    return __libcpp_thread_poll_with_backoff(__test_fn, __backoff_fn);
+    __LIBCUDACXX_atomic_wait_backoff_impl<_Atp, typename decay<_Fn>::type> __backoff_fn = {__a, __test_fn};
+    return __LIBCUDACXX_thread_poll_with_backoff(__test_fn, __backoff_fn);
 }
 
-#else // _LIBCPP_HAS_NO_PLATFORM_WAIT
+#else // _LIBCUDACXX_HAS_NO_PLATFORM_WAIT
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY void __cxx_atomic_notify_all(__cxx_atomic_impl<_Tp> const volatile*) { }
+_LIBCUDACXX_INLINE_VISIBILITY void __cxx_atomic_notify_all(__cxx_atomic_impl<_Tp> const volatile*) { }
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY void __cxx_atomic_notify_one(__cxx_atomic_impl<_Tp> const volatile*) { }
+_LIBCUDACXX_INLINE_VISIBILITY void __cxx_atomic_notify_one(__cxx_atomic_impl<_Tp> const volatile*) { }
 template <class _Atp, class _Fn>
-_LIBCPP_INLINE_VISIBILITY bool __cxx_atomic_wait(_Atp*, _Fn && __test_fn)
+_LIBCUDACXX_INLINE_VISIBILITY bool __cxx_atomic_wait(_Atp*, _Fn && __test_fn)
 {
-#if defined(_LIBCPP_HAS_NO_THREADS)
+#if defined(_LIBCUDACXX_HAS_NO_THREADS)
     using _Policy = __spinning_backoff_policy;
 #else
-    using _Policy = __libcpp_timed_backoff_policy;
+    using _Policy = __LIBCUDACXX_timed_backoff_policy;
 #endif
-    return __libcpp_thread_poll_with_backoff(__test_fn, _Policy());
+    return __LIBCUDACXX_thread_poll_with_backoff(__test_fn, _Policy());
 }
 
-#endif // _LIBCPP_HAS_NO_PLATFORM_WAIT
+#endif // _LIBCUDACXX_HAS_NO_PLATFORM_WAIT
 
 template <class _Atp, class _Tp>
 struct __cxx_atomic_wait_test_fn_impl {
     _Atp* __a;
     _Tp __val;
     memory_order __order;
-    _LIBCPP_INLINE_VISIBILITY bool operator()() const
+    _LIBCUDACXX_INLINE_VISIBILITY bool operator()() const
     {
         return !__cxx_nonatomic_compare_equal(__cxx_atomic_load(__a, __order), __val);
     }
 };
 
 template <class _Atp, class _Tp>
-_LIBCPP_AVAILABILITY_SYNC
-_LIBCPP_INLINE_VISIBILITY bool __cxx_atomic_wait(_Atp* __a, _Tp const __val, memory_order __order)
+_LIBCUDACXX_AVAILABILITY_SYNC
+_LIBCUDACXX_INLINE_VISIBILITY bool __cxx_atomic_wait(_Atp* __a, _Tp const __val, memory_order __order)
 {
     __cxx_atomic_wait_test_fn_impl<_Atp, _Tp> __test_fn = {__a, __val, __order};
     return __cxx_atomic_wait(__a, __test_fn);
@@ -1561,100 +1561,100 @@ struct __atomic_base  // false
     mutable __cxx_atomic_impl<_Tp> __a_;
 
 #if defined(__cpp_lib_atomic_is_always_lock_free)
-  static _LIBCPP_CONSTEXPR bool is_always_lock_free = __atomic_always_lock_free(sizeof(__a_), 0);
+  static _LIBCUDACXX_CONSTEXPR bool is_always_lock_free = __atomic_always_lock_free(sizeof(__a_), 0);
 #endif
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool is_lock_free() const volatile _NOEXCEPT
         {return __cxx_atomic_is_lock_free(sizeof(_Tp));}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool is_lock_free() const _NOEXCEPT
         {return static_cast<__atomic_base const volatile*>(this)->is_lock_free();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void store(_Tp __d, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
-      _LIBCPP_CHECK_STORE_MEMORY_ORDER(__m)
+      _LIBCUDACXX_CHECK_STORE_MEMORY_ORDER(__m)
         {__cxx_atomic_store(&__a_, __d, __m);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void store(_Tp __d, memory_order __m = memory_order_seq_cst) _NOEXCEPT
-      _LIBCPP_CHECK_STORE_MEMORY_ORDER(__m)
+      _LIBCUDACXX_CHECK_STORE_MEMORY_ORDER(__m)
         {__cxx_atomic_store(&__a_, __d, __m);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Tp load(memory_order __m = memory_order_seq_cst) const volatile _NOEXCEPT
-      _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m)
+      _LIBCUDACXX_CHECK_LOAD_MEMORY_ORDER(__m)
         {return __cxx_atomic_load(&__a_, __m);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Tp load(memory_order __m = memory_order_seq_cst) const _NOEXCEPT
-      _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m)
+      _LIBCUDACXX_CHECK_LOAD_MEMORY_ORDER(__m)
         {return __cxx_atomic_load(&__a_, __m);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     operator _Tp() const volatile _NOEXCEPT {return load();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     operator _Tp() const _NOEXCEPT          {return load();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Tp exchange(_Tp __d, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
         {return __cxx_atomic_exchange(&__a_, __d, __m);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Tp exchange(_Tp __d, memory_order __m = memory_order_seq_cst) _NOEXCEPT
         {return __cxx_atomic_exchange(&__a_, __d, __m);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool compare_exchange_weak(_Tp& __e, _Tp __d,
                                memory_order __s, memory_order __f) volatile _NOEXCEPT
-      _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
+      _LIBCUDACXX_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
         {return __cxx_atomic_compare_exchange_weak(&__a_, &__e, __d, __s, __f);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool compare_exchange_weak(_Tp& __e, _Tp __d,
                                memory_order __s, memory_order __f) _NOEXCEPT
-      _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
+      _LIBCUDACXX_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
         {return __cxx_atomic_compare_exchange_weak(&__a_, &__e, __d, __s, __f);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool compare_exchange_strong(_Tp& __e, _Tp __d,
                                  memory_order __s, memory_order __f) volatile _NOEXCEPT
-      _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
+      _LIBCUDACXX_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
         {return __cxx_atomic_compare_exchange_strong(&__a_, &__e, __d, __s, __f);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool compare_exchange_strong(_Tp& __e, _Tp __d,
                                  memory_order __s, memory_order __f) _NOEXCEPT
-      _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
+      _LIBCUDACXX_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
         {return __cxx_atomic_compare_exchange_strong(&__a_, &__e, __d, __s, __f);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool compare_exchange_weak(_Tp& __e, _Tp __d,
                               memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
         {return __cxx_atomic_compare_exchange_weak(&__a_, &__e, __d, __m, __m);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool compare_exchange_weak(_Tp& __e, _Tp __d,
                                memory_order __m = memory_order_seq_cst) _NOEXCEPT
         {return __cxx_atomic_compare_exchange_weak(&__a_, &__e, __d, __m, __m);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool compare_exchange_strong(_Tp& __e, _Tp __d,
                               memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
         {return __cxx_atomic_compare_exchange_strong(&__a_, &__e, __d, __m, __m);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool compare_exchange_strong(_Tp& __e, _Tp __d,
                                  memory_order __m = memory_order_seq_cst) _NOEXCEPT
         {return __cxx_atomic_compare_exchange_strong(&__a_, &__e, __d, __m, __m);}
 
-    _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY void wait(_Tp __v, memory_order __m = memory_order_seq_cst) const volatile _NOEXCEPT
+    _LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_INLINE_VISIBILITY void wait(_Tp __v, memory_order __m = memory_order_seq_cst) const volatile _NOEXCEPT
         {__cxx_atomic_wait(&__a_, __v, __m);}
-    _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY void wait(_Tp __v, memory_order __m = memory_order_seq_cst) const _NOEXCEPT
+    _LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_INLINE_VISIBILITY void wait(_Tp __v, memory_order __m = memory_order_seq_cst) const _NOEXCEPT
         {__cxx_atomic_wait(&__a_, __v, __m);}
-    _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY void notify_one() volatile _NOEXCEPT
+    _LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_INLINE_VISIBILITY void notify_one() volatile _NOEXCEPT
         {__cxx_atomic_notify_one(&__a_);}
-    _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY void notify_one() _NOEXCEPT
+    _LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_INLINE_VISIBILITY void notify_one() _NOEXCEPT
         {__cxx_atomic_notify_one(&__a_);}
-    _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY void notify_all() volatile _NOEXCEPT
+    _LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_INLINE_VISIBILITY void notify_all() volatile _NOEXCEPT
         {__cxx_atomic_notify_all(&__a_);}
-    _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY void notify_all() _NOEXCEPT
+    _LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_INLINE_VISIBILITY void notify_all() _NOEXCEPT
         {__cxx_atomic_notify_all(&__a_);}
 
-#if _LIBCPP_STD_VER > 17
-    _LIBCPP_INLINE_VISIBILITY constexpr
+#if _LIBCUDACXX_STD_VER > 17
+    _LIBCUDACXX_INLINE_VISIBILITY constexpr
     __atomic_base() noexcept(is_nothrow_default_constructible_v<_Tp>) : __a_(_Tp()) {}
 #else
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __atomic_base() _NOEXCEPT = default;
 #endif
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR
     __atomic_base(_Tp __d) _NOEXCEPT : __a_(__d) {}
 
     __atomic_base(const __atomic_base&) = delete;
@@ -1662,7 +1662,7 @@ struct __atomic_base  // false
 
 #if defined(__cpp_lib_atomic_is_always_lock_free)
 template <class _Tp, bool __b>
-_LIBCPP_CONSTEXPR bool __atomic_base<_Tp, __b>::is_always_lock_free;
+_LIBCUDACXX_CONSTEXPR bool __atomic_base<_Tp, __b>::is_always_lock_free;
 #endif
 
 // atomic<Integral>
@@ -1673,78 +1673,78 @@ struct __atomic_base<_Tp, true>
 {
     typedef __atomic_base<_Tp, false> __base;
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     __atomic_base() _NOEXCEPT = default;
 
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR __atomic_base(_Tp __d) _NOEXCEPT : __base(__d) {}
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR __atomic_base(_Tp __d) _NOEXCEPT : __base(__d) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Tp fetch_add(_Tp __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
         {return __cxx_atomic_fetch_add(&this->__a_, __op, __m);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Tp fetch_add(_Tp __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT
         {return __cxx_atomic_fetch_add(&this->__a_, __op, __m);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Tp fetch_sub(_Tp __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
         {return __cxx_atomic_fetch_sub(&this->__a_, __op, __m);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Tp fetch_sub(_Tp __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT
         {return __cxx_atomic_fetch_sub(&this->__a_, __op, __m);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Tp fetch_and(_Tp __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
         {return __cxx_atomic_fetch_and(&this->__a_, __op, __m);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Tp fetch_and(_Tp __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT
         {return __cxx_atomic_fetch_and(&this->__a_, __op, __m);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Tp fetch_or(_Tp __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
         {return __cxx_atomic_fetch_or(&this->__a_, __op, __m);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Tp fetch_or(_Tp __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT
         {return __cxx_atomic_fetch_or(&this->__a_, __op, __m);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Tp fetch_xor(_Tp __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
         {return __cxx_atomic_fetch_xor(&this->__a_, __op, __m);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Tp fetch_xor(_Tp __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT
         {return __cxx_atomic_fetch_xor(&this->__a_, __op, __m);}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Tp operator++(int) volatile _NOEXCEPT      {return fetch_add(_Tp(1));}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Tp operator++(int) _NOEXCEPT               {return fetch_add(_Tp(1));}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Tp operator--(int) volatile _NOEXCEPT      {return fetch_sub(_Tp(1));}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Tp operator--(int) _NOEXCEPT               {return fetch_sub(_Tp(1));}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Tp operator++() volatile _NOEXCEPT         {return fetch_add(_Tp(1)) + _Tp(1);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Tp operator++() _NOEXCEPT                  {return fetch_add(_Tp(1)) + _Tp(1);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Tp operator--() volatile _NOEXCEPT         {return fetch_sub(_Tp(1)) - _Tp(1);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Tp operator--() _NOEXCEPT                  {return fetch_sub(_Tp(1)) - _Tp(1);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Tp operator+=(_Tp __op) volatile _NOEXCEPT {return fetch_add(__op) + __op;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Tp operator+=(_Tp __op) _NOEXCEPT          {return fetch_add(__op) + __op;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Tp operator-=(_Tp __op) volatile _NOEXCEPT {return fetch_sub(__op) - __op;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Tp operator-=(_Tp __op) _NOEXCEPT          {return fetch_sub(__op) - __op;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Tp operator&=(_Tp __op) volatile _NOEXCEPT {return fetch_and(__op) & __op;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Tp operator&=(_Tp __op) _NOEXCEPT          {return fetch_and(__op) & __op;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Tp operator|=(_Tp __op) volatile _NOEXCEPT {return fetch_or(__op) | __op;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Tp operator|=(_Tp __op) _NOEXCEPT          {return fetch_or(__op) | __op;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Tp operator^=(_Tp __op) volatile _NOEXCEPT {return fetch_xor(__op) ^ __op;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Tp operator^=(_Tp __op) _NOEXCEPT          {return fetch_xor(__op) ^ __op;}
 };
 
@@ -1758,21 +1758,21 @@ struct atomic
     typedef _Tp value_type;
     typedef value_type 
diff erence_type;
 
-#if _LIBCPP_STD_VER > 17
-    _LIBCPP_INLINE_VISIBILITY
+#if _LIBCUDACXX_STD_VER > 17
+    _LIBCUDACXX_INLINE_VISIBILITY
     atomic() = default;
 #else
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     atomic() _NOEXCEPT = default;
 #endif
 
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR atomic(_Tp __d) _NOEXCEPT : __base(__d) {}
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR atomic(_Tp __d) _NOEXCEPT : __base(__d) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Tp operator=(_Tp __d) volatile _NOEXCEPT
         {__base::store(__d); return __d;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Tp operator=(_Tp __d) _NOEXCEPT
         {__base::store(__d); return __d;}
 
@@ -1790,70 +1790,70 @@ struct atomic<_Tp*>
     typedef _Tp* value_type;
     typedef ptr
diff _t 
diff erence_type;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     atomic() _NOEXCEPT = default;
 
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR atomic(_Tp* __d) _NOEXCEPT : __base(__d) {}
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR atomic(_Tp* __d) _NOEXCEPT : __base(__d) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Tp* operator=(_Tp* __d) volatile _NOEXCEPT
         {__base::store(__d); return __d;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Tp* operator=(_Tp* __d) _NOEXCEPT
         {__base::store(__d); return __d;}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Tp* fetch_add(ptr
diff _t __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT {
         // __atomic_fetch_add accepts function pointers, guard against them.
         static_assert(!is_function<typename remove_pointer<_Tp>::type>::value, "Pointer to function isn't allowed");
         return __cxx_atomic_fetch_add(&this->__a_, __op, __m);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Tp* fetch_add(ptr
diff _t __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT {
         // __atomic_fetch_add accepts function pointers, guard against them.
         static_assert(!is_function<typename remove_pointer<_Tp>::type>::value, "Pointer to function isn't allowed");
         return __cxx_atomic_fetch_add(&this->__a_, __op, __m);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Tp* fetch_sub(ptr
diff _t __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT {
         // __atomic_fetch_add accepts function pointers, guard against them.
         static_assert(!is_function<typename remove_pointer<_Tp>::type>::value, "Pointer to function isn't allowed");
         return __cxx_atomic_fetch_sub(&this->__a_, __op, __m);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Tp* fetch_sub(ptr
diff _t __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT {
         // __atomic_fetch_add accepts function pointers, guard against them.
         static_assert(!is_function<typename remove_pointer<_Tp>::type>::value, "Pointer to function isn't allowed");
         return __cxx_atomic_fetch_sub(&this->__a_, __op, __m);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Tp* operator++(int) volatile _NOEXCEPT            {return fetch_add(1);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Tp* operator++(int) _NOEXCEPT                     {return fetch_add(1);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Tp* operator--(int) volatile _NOEXCEPT            {return fetch_sub(1);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Tp* operator--(int) _NOEXCEPT                     {return fetch_sub(1);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Tp* operator++() volatile _NOEXCEPT               {return fetch_add(1) + 1;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Tp* operator++() _NOEXCEPT                        {return fetch_add(1) + 1;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Tp* operator--() volatile _NOEXCEPT               {return fetch_sub(1) - 1;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Tp* operator--() _NOEXCEPT                        {return fetch_sub(1) - 1;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Tp* operator+=(ptr
diff _t __op) volatile _NOEXCEPT {return fetch_add(__op) + __op;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Tp* operator+=(ptr
diff _t __op) _NOEXCEPT          {return fetch_add(__op) + __op;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Tp* operator-=(ptr
diff _t __op) volatile _NOEXCEPT {return fetch_sub(__op) - __op;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Tp* operator-=(ptr
diff _t __op) _NOEXCEPT          {return fetch_sub(__op) - __op;}
 
     atomic& operator=(const atomic&) = delete;
@@ -1863,7 +1863,7 @@ struct atomic<_Tp*>
 // atomic_is_lock_free
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 bool
 atomic_is_lock_free(const volatile atomic<_Tp>* __o) _NOEXCEPT
 {
@@ -1871,7 +1871,7 @@ atomic_is_lock_free(const volatile atomic<_Tp>* __o) _NOEXCEPT
 }
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 bool
 atomic_is_lock_free(const atomic<_Tp>* __o) _NOEXCEPT
 {
@@ -1881,7 +1881,7 @@ atomic_is_lock_free(const atomic<_Tp>* __o) _NOEXCEPT
 // atomic_init
 
 template <class _Tp>
-_LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_DEPRECATED_IN_CXX20 _LIBCUDACXX_INLINE_VISIBILITY
 void
 atomic_init(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _NOEXCEPT
 {
@@ -1889,7 +1889,7 @@ atomic_init(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _NO
 }
 
 template <class _Tp>
-_LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_DEPRECATED_IN_CXX20 _LIBCUDACXX_INLINE_VISIBILITY
 void
 atomic_init(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _NOEXCEPT
 {
@@ -1899,7 +1899,7 @@ atomic_init(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _NOEXCEPT
 // atomic_store
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 void
 atomic_store(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _NOEXCEPT
 {
@@ -1907,7 +1907,7 @@ atomic_store(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _N
 }
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 void
 atomic_store(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _NOEXCEPT
 {
@@ -1917,19 +1917,19 @@ atomic_store(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _NOEXCEPT
 // atomic_store_explicit
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 void
 atomic_store_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d, memory_order __m) _NOEXCEPT
-  _LIBCPP_CHECK_STORE_MEMORY_ORDER(__m)
+  _LIBCUDACXX_CHECK_STORE_MEMORY_ORDER(__m)
 {
     __o->store(__d, __m);
 }
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 void
 atomic_store_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d, memory_order __m) _NOEXCEPT
-  _LIBCPP_CHECK_STORE_MEMORY_ORDER(__m)
+  _LIBCUDACXX_CHECK_STORE_MEMORY_ORDER(__m)
 {
     __o->store(__d, __m);
 }
@@ -1937,7 +1937,7 @@ atomic_store_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d, me
 // atomic_load
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp
 atomic_load(const volatile atomic<_Tp>* __o) _NOEXCEPT
 {
@@ -1945,7 +1945,7 @@ atomic_load(const volatile atomic<_Tp>* __o) _NOEXCEPT
 }
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp
 atomic_load(const atomic<_Tp>* __o) _NOEXCEPT
 {
@@ -1955,19 +1955,19 @@ atomic_load(const atomic<_Tp>* __o) _NOEXCEPT
 // atomic_load_explicit
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp
 atomic_load_explicit(const volatile atomic<_Tp>* __o, memory_order __m) _NOEXCEPT
-  _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m)
+  _LIBCUDACXX_CHECK_LOAD_MEMORY_ORDER(__m)
 {
     return __o->load(__m);
 }
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp
 atomic_load_explicit(const atomic<_Tp>* __o, memory_order __m) _NOEXCEPT
-  _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m)
+  _LIBCUDACXX_CHECK_LOAD_MEMORY_ORDER(__m)
 {
     return __o->load(__m);
 }
@@ -1975,7 +1975,7 @@ atomic_load_explicit(const atomic<_Tp>* __o, memory_order __m) _NOEXCEPT
 // atomic_exchange
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp
 atomic_exchange(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _NOEXCEPT
 {
@@ -1983,7 +1983,7 @@ atomic_exchange(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d)
 }
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp
 atomic_exchange(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _NOEXCEPT
 {
@@ -1993,7 +1993,7 @@ atomic_exchange(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _NOEXCEP
 // atomic_exchange_explicit
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp
 atomic_exchange_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d, memory_order __m) _NOEXCEPT
 {
@@ -2001,7 +2001,7 @@ atomic_exchange_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_
 }
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp
 atomic_exchange_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d, memory_order __m) _NOEXCEPT
 {
@@ -2011,7 +2011,7 @@ atomic_exchange_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d,
 // atomic_compare_exchange_weak
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 bool
 atomic_compare_exchange_weak(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e, typename atomic<_Tp>::value_type __d) _NOEXCEPT
 {
@@ -2019,7 +2019,7 @@ atomic_compare_exchange_weak(volatile atomic<_Tp>* __o, typename atomic<_Tp>::va
 }
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 bool
 atomic_compare_exchange_weak(atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e, typename atomic<_Tp>::value_type __d) _NOEXCEPT
 {
@@ -2029,7 +2029,7 @@ atomic_compare_exchange_weak(atomic<_Tp>* __o, typename atomic<_Tp>::value_type*
 // atomic_compare_exchange_strong
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 bool
 atomic_compare_exchange_strong(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e, typename atomic<_Tp>::value_type __d) _NOEXCEPT
 {
@@ -2037,7 +2037,7 @@ atomic_compare_exchange_strong(volatile atomic<_Tp>* __o, typename atomic<_Tp>::
 }
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 bool
 atomic_compare_exchange_strong(atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e, typename atomic<_Tp>::value_type __d) _NOEXCEPT
 {
@@ -2047,22 +2047,22 @@ atomic_compare_exchange_strong(atomic<_Tp>* __o, typename atomic<_Tp>::value_typ
 // atomic_compare_exchange_weak_explicit
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 bool
 atomic_compare_exchange_weak_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e,
                                       typename atomic<_Tp>::value_type __d,
                                       memory_order __s, memory_order __f) _NOEXCEPT
-  _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
+  _LIBCUDACXX_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
 {
     return __o->compare_exchange_weak(*__e, __d, __s, __f);
 }
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 bool
 atomic_compare_exchange_weak_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e, typename atomic<_Tp>::value_type __d,
                                       memory_order __s, memory_order __f) _NOEXCEPT
-  _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
+  _LIBCUDACXX_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
 {
     return __o->compare_exchange_weak(*__e, __d, __s, __f);
 }
@@ -2070,23 +2070,23 @@ atomic_compare_exchange_weak_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::va
 // atomic_compare_exchange_strong_explicit
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 bool
 atomic_compare_exchange_strong_explicit(volatile atomic<_Tp>* __o,
                                         typename atomic<_Tp>::value_type* __e, typename atomic<_Tp>::value_type __d,
                                         memory_order __s, memory_order __f) _NOEXCEPT
-  _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
+  _LIBCUDACXX_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
 {
     return __o->compare_exchange_strong(*__e, __d, __s, __f);
 }
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 bool
 atomic_compare_exchange_strong_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e,
                                         typename atomic<_Tp>::value_type __d,
                                         memory_order __s, memory_order __f) _NOEXCEPT
-  _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
+  _LIBCUDACXX_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
 {
     return __o->compare_exchange_strong(*__e, __d, __s, __f);
 }
@@ -2094,7 +2094,7 @@ atomic_compare_exchange_strong_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::
 // atomic_wait
 
 template <class _Tp>
-_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_INLINE_VISIBILITY
 void atomic_wait(const volatile atomic<_Tp>* __o,
                  typename atomic<_Tp>::value_type __v) _NOEXCEPT
 {
@@ -2102,7 +2102,7 @@ void atomic_wait(const volatile atomic<_Tp>* __o,
 }
 
 template <class _Tp>
-_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_INLINE_VISIBILITY
 void atomic_wait(const atomic<_Tp>* __o,
                  typename atomic<_Tp>::value_type __v) _NOEXCEPT
 {
@@ -2112,21 +2112,21 @@ void atomic_wait(const atomic<_Tp>* __o,
 // atomic_wait_explicit
 
 template <class _Tp>
-_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_INLINE_VISIBILITY
 void atomic_wait_explicit(const volatile atomic<_Tp>* __o,
                           typename atomic<_Tp>::value_type __v,
                           memory_order __m) _NOEXCEPT
-  _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m)
+  _LIBCUDACXX_CHECK_LOAD_MEMORY_ORDER(__m)
 {
     return __o->wait(__v, __m);
 }
 
 template <class _Tp>
-_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_INLINE_VISIBILITY
 void atomic_wait_explicit(const atomic<_Tp>* __o,
                           typename atomic<_Tp>::value_type __v,
                           memory_order __m) _NOEXCEPT
-  _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m)
+  _LIBCUDACXX_CHECK_LOAD_MEMORY_ORDER(__m)
 {
     return __o->wait(__v, __m);
 }
@@ -2134,13 +2134,13 @@ void atomic_wait_explicit(const atomic<_Tp>* __o,
 // atomic_notify_one
 
 template <class _Tp>
-_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_INLINE_VISIBILITY
 void atomic_notify_one(volatile atomic<_Tp>* __o) _NOEXCEPT
 {
     __o->notify_one();
 }
 template <class _Tp>
-_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_INLINE_VISIBILITY
 void atomic_notify_one(atomic<_Tp>* __o) _NOEXCEPT
 {
     __o->notify_one();
@@ -2149,13 +2149,13 @@ void atomic_notify_one(atomic<_Tp>* __o) _NOEXCEPT
 // atomic_notify_one
 
 template <class _Tp>
-_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_INLINE_VISIBILITY
 void atomic_notify_all(volatile atomic<_Tp>* __o) _NOEXCEPT
 {
     __o->notify_all();
 }
 template <class _Tp>
-_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_INLINE_VISIBILITY
 void atomic_notify_all(atomic<_Tp>* __o) _NOEXCEPT
 {
     __o->notify_all();
@@ -2164,7 +2164,7 @@ void atomic_notify_all(atomic<_Tp>* __o) _NOEXCEPT
 // atomic_fetch_add
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp
 atomic_fetch_add(volatile atomic<_Tp>* __o, typename atomic<_Tp>::
diff erence_type __op) _NOEXCEPT
 {
@@ -2172,7 +2172,7 @@ atomic_fetch_add(volatile atomic<_Tp>* __o, typename atomic<_Tp>::
diff erence_typ
 }
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp
 atomic_fetch_add(atomic<_Tp>* __o, typename atomic<_Tp>::
diff erence_type __op) _NOEXCEPT
 {
@@ -2182,14 +2182,14 @@ atomic_fetch_add(atomic<_Tp>* __o, typename atomic<_Tp>::
diff erence_type __op) _
 // atomic_fetch_add_explicit
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp atomic_fetch_add_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::
diff erence_type __op, memory_order __m) _NOEXCEPT
 {
     return __o->fetch_add(__op, __m);
 }
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp atomic_fetch_add_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::
diff erence_type __op, memory_order __m) _NOEXCEPT
 {
     return __o->fetch_add(__op, __m);
@@ -2198,14 +2198,14 @@ _Tp atomic_fetch_add_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::
diff erence
 // atomic_fetch_sub
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp atomic_fetch_sub(volatile atomic<_Tp>* __o, typename atomic<_Tp>::
diff erence_type __op) _NOEXCEPT
 {
     return __o->fetch_sub(__op);
 }
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp atomic_fetch_sub(atomic<_Tp>* __o, typename atomic<_Tp>::
diff erence_type __op) _NOEXCEPT
 {
     return __o->fetch_sub(__op);
@@ -2214,14 +2214,14 @@ _Tp atomic_fetch_sub(atomic<_Tp>* __o, typename atomic<_Tp>::
diff erence_type __o
 // atomic_fetch_sub_explicit
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp atomic_fetch_sub_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::
diff erence_type __op, memory_order __m) _NOEXCEPT
 {
     return __o->fetch_sub(__op, __m);
 }
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp atomic_fetch_sub_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::
diff erence_type __op, memory_order __m) _NOEXCEPT
 {
     return __o->fetch_sub(__op, __m);
@@ -2230,7 +2230,7 @@ _Tp atomic_fetch_sub_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::
diff erence
 // atomic_fetch_and
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 typename enable_if
 <
     is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
@@ -2242,7 +2242,7 @@ atomic_fetch_and(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __o
 }
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 typename enable_if
 <
     is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
@@ -2256,7 +2256,7 @@ atomic_fetch_and(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXC
 // atomic_fetch_and_explicit
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 typename enable_if
 <
     is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
@@ -2268,7 +2268,7 @@ atomic_fetch_and_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value
 }
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 typename enable_if
 <
     is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
@@ -2282,7 +2282,7 @@ atomic_fetch_and_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __o
 // atomic_fetch_or
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 typename enable_if
 <
     is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
@@ -2294,7 +2294,7 @@ atomic_fetch_or(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op
 }
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 typename enable_if
 <
     is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
@@ -2308,7 +2308,7 @@ atomic_fetch_or(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCE
 // atomic_fetch_or_explicit
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 typename enable_if
 <
     is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
@@ -2320,7 +2320,7 @@ atomic_fetch_or_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_
 }
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 typename enable_if
 <
     is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
@@ -2334,7 +2334,7 @@ atomic_fetch_or_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op
 // atomic_fetch_xor
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 typename enable_if
 <
     is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
@@ -2346,7 +2346,7 @@ atomic_fetch_xor(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __o
 }
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 typename enable_if
 <
     is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
@@ -2360,7 +2360,7 @@ atomic_fetch_xor(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXC
 // atomic_fetch_xor_explicit
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 typename enable_if
 <
     is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
@@ -2372,7 +2372,7 @@ atomic_fetch_xor_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value
 }
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 typename enable_if
 <
     is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
@@ -2387,56 +2387,56 @@ atomic_fetch_xor_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __o
 
 typedef struct atomic_flag
 {
-    __cxx_atomic_impl<_LIBCPP_ATOMIC_FLAG_TYPE> __a_;
+    __cxx_atomic_impl<_LIBCUDACXX_ATOMIC_FLAG_TYPE> __a_;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool test(memory_order __m = memory_order_seq_cst) const volatile _NOEXCEPT
-        {return _LIBCPP_ATOMIC_FLAG_TYPE(true) == __cxx_atomic_load(&__a_, __m);}
-    _LIBCPP_INLINE_VISIBILITY
+        {return _LIBCUDACXX_ATOMIC_FLAG_TYPE(true) == __cxx_atomic_load(&__a_, __m);}
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool test(memory_order __m = memory_order_seq_cst) const _NOEXCEPT
-        {return _LIBCPP_ATOMIC_FLAG_TYPE(true) == __cxx_atomic_load(&__a_, __m);}
+        {return _LIBCUDACXX_ATOMIC_FLAG_TYPE(true) == __cxx_atomic_load(&__a_, __m);}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool test_and_set(memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
-        {return __cxx_atomic_exchange(&__a_, _LIBCPP_ATOMIC_FLAG_TYPE(true), __m);}
-    _LIBCPP_INLINE_VISIBILITY
+        {return __cxx_atomic_exchange(&__a_, _LIBCUDACXX_ATOMIC_FLAG_TYPE(true), __m);}
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool test_and_set(memory_order __m = memory_order_seq_cst) _NOEXCEPT
-        {return __cxx_atomic_exchange(&__a_, _LIBCPP_ATOMIC_FLAG_TYPE(true), __m);}
-    _LIBCPP_INLINE_VISIBILITY
+        {return __cxx_atomic_exchange(&__a_, _LIBCUDACXX_ATOMIC_FLAG_TYPE(true), __m);}
+    _LIBCUDACXX_INLINE_VISIBILITY
     void clear(memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
-        {__cxx_atomic_store(&__a_, _LIBCPP_ATOMIC_FLAG_TYPE(false), __m);}
-    _LIBCPP_INLINE_VISIBILITY
+        {__cxx_atomic_store(&__a_, _LIBCUDACXX_ATOMIC_FLAG_TYPE(false), __m);}
+    _LIBCUDACXX_INLINE_VISIBILITY
     void clear(memory_order __m = memory_order_seq_cst) _NOEXCEPT
-        {__cxx_atomic_store(&__a_, _LIBCPP_ATOMIC_FLAG_TYPE(false), __m);}
+        {__cxx_atomic_store(&__a_, _LIBCUDACXX_ATOMIC_FLAG_TYPE(false), __m);}
 
-    _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_INLINE_VISIBILITY
     void wait(bool __v, memory_order __m = memory_order_seq_cst) const volatile _NOEXCEPT
-        {__cxx_atomic_wait(&__a_, _LIBCPP_ATOMIC_FLAG_TYPE(__v), __m);}
-    _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
+        {__cxx_atomic_wait(&__a_, _LIBCUDACXX_ATOMIC_FLAG_TYPE(__v), __m);}
+    _LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_INLINE_VISIBILITY
     void wait(bool __v, memory_order __m = memory_order_seq_cst) const _NOEXCEPT
-        {__cxx_atomic_wait(&__a_, _LIBCPP_ATOMIC_FLAG_TYPE(__v), __m);}
-    _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
+        {__cxx_atomic_wait(&__a_, _LIBCUDACXX_ATOMIC_FLAG_TYPE(__v), __m);}
+    _LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_INLINE_VISIBILITY
     void notify_one() volatile _NOEXCEPT
         {__cxx_atomic_notify_one(&__a_);}
-    _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_INLINE_VISIBILITY
     void notify_one() _NOEXCEPT
         {__cxx_atomic_notify_one(&__a_);}
-    _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_INLINE_VISIBILITY
     void notify_all() volatile _NOEXCEPT
         {__cxx_atomic_notify_all(&__a_);}
-    _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_INLINE_VISIBILITY
     void notify_all() _NOEXCEPT
         {__cxx_atomic_notify_all(&__a_);}
 
-#if _LIBCPP_STD_VER > 17
-    _LIBCPP_INLINE_VISIBILITY constexpr
+#if _LIBCUDACXX_STD_VER > 17
+    _LIBCUDACXX_INLINE_VISIBILITY constexpr
     atomic_flag() _NOEXCEPT : __a_(false) {}
 #else
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     atomic_flag() _NOEXCEPT = default;
 #endif
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR
     atomic_flag(bool __b) _NOEXCEPT : __a_(__b) {} // EXTENSION
 
     atomic_flag(const atomic_flag&) = delete;
@@ -2446,105 +2446,105 @@ typedef struct atomic_flag
 } atomic_flag;
 
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 atomic_flag_test(const volatile atomic_flag* __o) _NOEXCEPT
 {
     return __o->test();
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 atomic_flag_test(const atomic_flag* __o) _NOEXCEPT
 {
     return __o->test();
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 atomic_flag_test_explicit(const volatile atomic_flag* __o, memory_order __m) _NOEXCEPT
 {
     return __o->test(__m);
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 atomic_flag_test_explicit(const atomic_flag* __o, memory_order __m) _NOEXCEPT
 {
     return __o->test(__m);
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 atomic_flag_test_and_set(volatile atomic_flag* __o) _NOEXCEPT
 {
     return __o->test_and_set();
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 atomic_flag_test_and_set(atomic_flag* __o) _NOEXCEPT
 {
     return __o->test_and_set();
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 atomic_flag_test_and_set_explicit(volatile atomic_flag* __o, memory_order __m) _NOEXCEPT
 {
     return __o->test_and_set(__m);
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 atomic_flag_test_and_set_explicit(atomic_flag* __o, memory_order __m) _NOEXCEPT
 {
     return __o->test_and_set(__m);
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 atomic_flag_clear(volatile atomic_flag* __o) _NOEXCEPT
 {
     __o->clear();
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 atomic_flag_clear(atomic_flag* __o) _NOEXCEPT
 {
     __o->clear();
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 atomic_flag_clear_explicit(volatile atomic_flag* __o, memory_order __m) _NOEXCEPT
 {
     __o->clear(__m);
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 atomic_flag_clear_explicit(atomic_flag* __o, memory_order __m) _NOEXCEPT
 {
     __o->clear(__m);
 }
 
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_AVAILABILITY_SYNC
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_AVAILABILITY_SYNC
 void
 atomic_flag_wait(const volatile atomic_flag* __o, bool __v) _NOEXCEPT
 {
     __o->wait(__v);
 }
 
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_AVAILABILITY_SYNC
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_AVAILABILITY_SYNC
 void
 atomic_flag_wait(const atomic_flag* __o, bool __v) _NOEXCEPT
 {
     __o->wait(__v);
 }
 
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_AVAILABILITY_SYNC
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_AVAILABILITY_SYNC
 void
 atomic_flag_wait_explicit(const volatile atomic_flag* __o,
                           bool __v, memory_order __m) _NOEXCEPT
@@ -2552,7 +2552,7 @@ atomic_flag_wait_explicit(const volatile atomic_flag* __o,
     __o->wait(__v, __m);
 }
 
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_AVAILABILITY_SYNC
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_AVAILABILITY_SYNC
 void
 atomic_flag_wait_explicit(const atomic_flag* __o,
                           bool __v, memory_order __m) _NOEXCEPT
@@ -2560,28 +2560,28 @@ atomic_flag_wait_explicit(const atomic_flag* __o,
     __o->wait(__v, __m);
 }
 
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_AVAILABILITY_SYNC
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_AVAILABILITY_SYNC
 void
 atomic_flag_notify_one(volatile atomic_flag* __o) _NOEXCEPT
 {
     __o->notify_one();
 }
 
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_AVAILABILITY_SYNC
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_AVAILABILITY_SYNC
 void
 atomic_flag_notify_one(atomic_flag* __o) _NOEXCEPT
 {
     __o->notify_one();
 }
 
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_AVAILABILITY_SYNC
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_AVAILABILITY_SYNC
 void
 atomic_flag_notify_all(volatile atomic_flag* __o) _NOEXCEPT
 {
     __o->notify_all();
 }
 
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_AVAILABILITY_SYNC
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_AVAILABILITY_SYNC
 void
 atomic_flag_notify_all(atomic_flag* __o) _NOEXCEPT
 {
@@ -2590,14 +2590,14 @@ atomic_flag_notify_all(atomic_flag* __o) _NOEXCEPT
 
 // fences
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 atomic_thread_fence(memory_order __m) _NOEXCEPT
 {
     __cxx_atomic_thread_fence(__m);
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 atomic_signal_fence(memory_order __m) _NOEXCEPT
 {
@@ -2618,12 +2618,12 @@ typedef atomic<long>               atomic_long;
 typedef atomic<unsigned long>      atomic_ulong;
 typedef atomic<long long>          atomic_llong;
 typedef atomic<unsigned long long> atomic_ullong;
-#ifndef _LIBCPP_HAS_NO_CHAR8_T
+#ifndef _LIBCUDACXX_HAS_NO_CHAR8_T
 typedef atomic<char8_t>            atomic_char8_t;
 #endif
 typedef atomic<char16_t>           atomic_char16_t;
 typedef atomic<char32_t>           atomic_char32_t;
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 typedef atomic<wchar_t>            atomic_wchar_t;
 #endif
 
@@ -2664,42 +2664,42 @@ typedef atomic<uintmax_t> atomic_uintmax_t;
 // atomic_*_lock_free : prefer the contention type most highly, then the largest lock-free type
 
 #ifdef __cpp_lib_atomic_is_always_lock_free
-# define _LIBCPP_CONTENTION_LOCK_FREE __atomic_always_lock_free(sizeof(__cxx_contention_t), 0)
+# define _LIBCUDACXX_CONTENTION_LOCK_FREE __atomic_always_lock_free(sizeof(__cxx_contention_t), 0)
 #else
-# define _LIBCPP_CONTENTION_LOCK_FREE false
+# define _LIBCUDACXX_CONTENTION_LOCK_FREE false
 #endif
 
 #if ATOMIC_LLONG_LOCK_FREE == 2
-typedef conditional<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, long long>::type          __libcpp_signed_lock_free;
-typedef conditional<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, unsigned long long>::type __libcpp_unsigned_lock_free;
+typedef conditional<_LIBCUDACXX_CONTENTION_LOCK_FREE, __cxx_contention_t, long long>::type          __LIBCUDACXX_signed_lock_free;
+typedef conditional<_LIBCUDACXX_CONTENTION_LOCK_FREE, __cxx_contention_t, unsigned long long>::type __LIBCUDACXX_unsigned_lock_free;
 #elif ATOMIC_INT_LOCK_FREE == 2
-typedef conditional<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, int>::type                __libcpp_signed_lock_free;
-typedef conditional<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, unsigned int>::type       __libcpp_unsigned_lock_free;
+typedef conditional<_LIBCUDACXX_CONTENTION_LOCK_FREE, __cxx_contention_t, int>::type                __LIBCUDACXX_signed_lock_free;
+typedef conditional<_LIBCUDACXX_CONTENTION_LOCK_FREE, __cxx_contention_t, unsigned int>::type       __LIBCUDACXX_unsigned_lock_free;
 #elif ATOMIC_SHORT_LOCK_FREE == 2
-typedef conditional<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, short>::type              __libcpp_signed_lock_free;
-typedef conditional<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, unsigned short>::type     __libcpp_unsigned_lock_free;
+typedef conditional<_LIBCUDACXX_CONTENTION_LOCK_FREE, __cxx_contention_t, short>::type              __LIBCUDACXX_signed_lock_free;
+typedef conditional<_LIBCUDACXX_CONTENTION_LOCK_FREE, __cxx_contention_t, unsigned short>::type     __LIBCUDACXX_unsigned_lock_free;
 #elif ATOMIC_CHAR_LOCK_FREE == 2
-typedef conditional<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, char>::type               __libcpp_signed_lock_free;
-typedef conditional<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, unsigned char>::type      __libcpp_unsigned_lock_free;
+typedef conditional<_LIBCUDACXX_CONTENTION_LOCK_FREE, __cxx_contention_t, char>::type               __LIBCUDACXX_signed_lock_free;
+typedef conditional<_LIBCUDACXX_CONTENTION_LOCK_FREE, __cxx_contention_t, unsigned char>::type      __LIBCUDACXX_unsigned_lock_free;
 #else
     // No signed/unsigned lock-free types
-#define _LIBCPP_NO_LOCK_FREE_TYPES
+#define _LIBCUDACXX_NO_LOCK_FREE_TYPES
 #endif
 
-#if !defined(_LIBCPP_NO_LOCK_FREE_TYPES)
-typedef atomic<__libcpp_signed_lock_free> atomic_signed_lock_free;
-typedef atomic<__libcpp_unsigned_lock_free> atomic_unsigned_lock_free;
+#if !defined(_LIBCUDACXX_NO_LOCK_FREE_TYPES)
+typedef atomic<__LIBCUDACXX_signed_lock_free> atomic_signed_lock_free;
+typedef atomic<__LIBCUDACXX_unsigned_lock_free> atomic_unsigned_lock_free;
 #endif
 
 #define ATOMIC_FLAG_INIT {false}
 #define ATOMIC_VAR_INIT(__v) {__v}
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_DISABLE_DEPRECATION_WARNINGS)
-# if defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER >= 1400
+#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_DISABLE_DEPRECATION_WARNINGS)
+# if defined(_LIBCUDACXX_CLANG_VER) && _LIBCUDACXX_CLANG_VER >= 1400
 #  pragma clang deprecated(ATOMIC_VAR_INIT)
 # endif
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_DISABLE_DEPRECATION_WARNINGS)
+#endif // _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_DISABLE_DEPRECATION_WARNINGS)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_ATOMIC
+#endif // _LIBCUDACXX_ATOMIC

diff  --git a/libcxx/include/barrier b/libcxx/include/barrier
index 00518035283f..c269d07de541 100644
--- a/libcxx/include/barrier
+++ b/libcxx/include/barrier
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_BARRIER
-#define _LIBCPP_BARRIER
+#ifndef _LIBCUDACXX_BARRIER
+#define _LIBCUDACXX_BARRIER
 
 /*
     barrier synopsis
@@ -53,30 +53,30 @@ namespace std
 #include <limits>
 #include <memory>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#ifdef _LIBCPP_HAS_NO_THREADS
+#ifdef _LIBCUDACXX_HAS_NO_THREADS
 # error "<barrier> is not supported since libc++ has been configured without support for threads."
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-#if _LIBCPP_STD_VER >= 14
+#if _LIBCUDACXX_STD_VER >= 14
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 struct __empty_completion
 {
-    inline _LIBCPP_INLINE_VISIBILITY
+    inline _LIBCUDACXX_INLINE_VISIBILITY
     void operator()() noexcept
     {
     }
 };
 
-#ifndef _LIBCPP_HAS_NO_TREE_BARRIER
+#ifndef _LIBCUDACXX_HAS_NO_TREE_BARRIER
 
 /*
 
@@ -96,14 +96,14 @@ using __barrier_phase_t = uint8_t;
 
 class __barrier_algorithm_base;
 
-_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI
+_LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_EXPORTED_FROM_ABI
 __barrier_algorithm_base* __construct_barrier_algorithm_base(ptr
diff _t& __expected);
 
-_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI
+_LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_EXPORTED_FROM_ABI
 bool __arrive_barrier_algorithm_base(__barrier_algorithm_base* __barrier,
                                      __barrier_phase_t __old_phase);
 
-_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI
+_LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_EXPORTED_FROM_ABI
 void __destroy_barrier_algorithm_base(__barrier_algorithm_base* __barrier);
 
 template<class _CompletionF>
@@ -122,14 +122,14 @@ public:
         return numeric_limits<ptr
diff _t>::max();
     }
 
-    _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_INLINE_VISIBILITY
     __barrier_base(ptr
diff _t __expected, _CompletionF __completion = _CompletionF())
             : __expected_(__expected), __base_(__construct_barrier_algorithm_base(this->__expected_),
                                                &__destroy_barrier_algorithm_base),
               __expected_adjustment_(0), __completion_(std::move(__completion)), __phase_(0)
     {
     }
-    [[nodiscard]] _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
+    [[nodiscard]] _LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_INLINE_VISIBILITY
     arrival_token arrive(ptr
diff _t __update)
     {
         auto const __old_phase = __phase_.load(memory_order_relaxed);
@@ -143,15 +143,15 @@ public:
             }
         return __old_phase;
     }
-    _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_INLINE_VISIBILITY
     void wait(arrival_token&& __old_phase) const
     {
         auto const __test_fn = [this, __old_phase]() -> bool {
             return __phase_.load(memory_order_acquire) != __old_phase;
         };
-        __libcpp_thread_poll_with_backoff(__test_fn, __libcpp_timed_backoff_policy());
+        __LIBCUDACXX_thread_poll_with_backoff(__test_fn, __LIBCUDACXX_timed_backoff_policy());
     }
-    _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_INLINE_VISIBILITY
     void arrive_and_drop()
     {
         __expected_adjustment_.fetch_sub(1, memory_order_relaxed);
@@ -188,12 +188,12 @@ public:
         return numeric_limits<ptr
diff _t>::max();
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __barrier_base(ptr
diff _t __expected, _CompletionF __completion = _CompletionF())
         : __expected(__expected), __arrived(__expected), __completion(std::move(__completion)), __phase(false)
     {
     }
-    [[nodiscard]] _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
+    [[nodiscard]] _LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_INLINE_VISIBILITY
     arrival_token arrive(ptr
diff _t update)
     {
         auto const __old_phase = __phase.load(memory_order_relaxed);
@@ -207,12 +207,12 @@ public:
         }
         return __old_phase;
     }
-    _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_INLINE_VISIBILITY
     void wait(arrival_token&& __old_phase) const
     {
         __phase.wait(__old_phase, memory_order_acquire);
     }
-    _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_INLINE_VISIBILITY
     void arrive_and_drop()
     {
         __expected.fetch_sub(1, memory_order_relaxed);
@@ -231,7 +231,7 @@ class __barrier_base<__empty_completion> {
 
     __atomic_base<uint64_t>   __phase_arrived_expected;
 
-    static _LIBCPP_INLINE_VISIBILITY
+    static _LIBCUDACXX_INLINE_VISIBILITY
     constexpr uint64_t __init(ptr
diff _t __count) _NOEXCEPT
     {
         return ((uint64_t(1u << 31) - __count) << 32)
@@ -245,12 +245,12 @@ public:
         return ptr
diff _t(1u << 31) - 1;
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit inline __barrier_base(ptr
diff _t __count, __empty_completion = __empty_completion())
         : __phase_arrived_expected(__init(__count))
     {
     }
-    [[nodiscard]] inline _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
+    [[nodiscard]] inline _LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_INLINE_VISIBILITY
     arrival_token arrive(ptr
diff _t update)
     {
         auto const __inc = __arrived_unit * update;
@@ -261,16 +261,16 @@ public:
         }
         return __old & __phase_bit;
     }
-    inline _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
+    inline _LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_INLINE_VISIBILITY
     void wait(arrival_token&& __phase) const
     {
         auto const __test_fn = [=]() -> bool {
             uint64_t const __current = __phase_arrived_expected.load(memory_order_acquire);
             return ((__current & __phase_bit) != __phase);
         };
-        __libcpp_thread_poll_with_backoff(__test_fn, __libcpp_timed_backoff_policy());
+        __LIBCUDACXX_thread_poll_with_backoff(__test_fn, __LIBCUDACXX_timed_backoff_policy());
     }
-    inline _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
+    inline _LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_INLINE_VISIBILITY
     void arrive_and_drop()
     {
         __phase_arrived_expected.fetch_add(__expected_unit, memory_order_relaxed);
@@ -278,7 +278,7 @@ public:
     }
 };
 
-#endif // !_LIBCPP_HAS_NO_TREE_BARRIER
+#endif // !_LIBCUDACXX_HAS_NO_TREE_BARRIER
 
 template<class _CompletionF = __empty_completion>
 class barrier {
@@ -291,40 +291,40 @@ public:
         return __barrier_base<_CompletionF>::max();
     }
 
-    _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_INLINE_VISIBILITY
     barrier(ptr
diff _t __count, _CompletionF __completion = _CompletionF())
-        : __b(__count, _VSTD::move(__completion)) {
+        : __b(__count, _CUDA_VSTD::move(__completion)) {
     }
 
     barrier(barrier const&) = delete;
     barrier& operator=(barrier const&) = delete;
 
-    [[nodiscard]] _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
+    [[nodiscard]] _LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_INLINE_VISIBILITY
     arrival_token arrive(ptr
diff _t __update = 1)
     {
         return __b.arrive(__update);
     }
-    _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_INLINE_VISIBILITY
     void wait(arrival_token&& __phase) const
     {
-        __b.wait(_VSTD::move(__phase));
+        __b.wait(_CUDA_VSTD::move(__phase));
     }
-    _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_INLINE_VISIBILITY
     void arrive_and_wait()
     {
         wait(arrive());
     }
-    _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_INLINE_VISIBILITY
     void arrive_and_drop()
     {
         __b.arrive_and_drop();
     }
 };
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER >= 14
+#endif // _LIBCUDACXX_STD_VER >= 14
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif //_LIBCPP_BARRIER
+#endif //_LIBCUDACXX_BARRIER

diff  --git a/libcxx/include/bit b/libcxx/include/bit
index 15bc13a504b1..d8f9c50b8bba 100644
--- a/libcxx/include/bit
+++ b/libcxx/include/bit
@@ -7,8 +7,8 @@
 //
 //===---------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_BIT
-#define _LIBCPP_BIT
+#ifndef _LIBCUDACXX_BIT
+#define _LIBCUDACXX_BIT
 
 /*
     bit synopsis
@@ -64,35 +64,35 @@ namespace std {
 #include <__assert> // all public C++ headers provide the assertion handler
 #include <__bit/bit_cast.h>
 #include <__bit/byteswap.h>
-#include <__bits> // __libcpp_clz
+#include <__bits> // __LIBCUDACXX_clz
 #include <__concepts/arithmetic.h>
 #include <__config>
 #include <limits>
 #include <type_traits>
 #include <version>
 
-#ifndef _LIBCPP_REMOVE_TRANSITIVE_INCLUDES
+#ifndef _LIBCUDACXX_REMOVE_TRANSITIVE_INCLUDES
 #  include <iosfwd>
 #endif
 
-#if defined(_LIBCPP_COMPILER_MSVC)
+#if defined(_LIBCUDACXX_COMPILER_MSVC)
 #  include <intrin.h>
 #endif
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template<class _Tp>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 _Tp __rotr(_Tp __t, unsigned int __cnt) _NOEXCEPT
 {
-    static_assert(__libcpp_is_unsigned_integer<_Tp>::value, "__rotr requires an unsigned integer type");
+    static_assert(__LIBCUDACXX_is_unsigned_integer<_Tp>::value, "__rotr requires an unsigned integer type");
     const unsigned int __dig = numeric_limits<_Tp>::digits;
     if ((__cnt % __dig) == 0)
         return __t;
@@ -100,21 +100,21 @@ _Tp __rotr(_Tp __t, unsigned int __cnt) _NOEXCEPT
 }
 
 template<class _Tp>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 int __countl_zero(_Tp __t) _NOEXCEPT
 {
-    static_assert(__libcpp_is_unsigned_integer<_Tp>::value, "__countl_zero requires an unsigned integer type");
+    static_assert(__LIBCUDACXX_is_unsigned_integer<_Tp>::value, "__countl_zero requires an unsigned integer type");
     if (__t == 0)
         return numeric_limits<_Tp>::digits;
 
     if      (sizeof(_Tp) <= sizeof(unsigned int))
-        return std::__libcpp_clz(static_cast<unsigned int>(__t))
+        return std::__LIBCUDACXX_clz(static_cast<unsigned int>(__t))
               - (numeric_limits<unsigned int>::digits - numeric_limits<_Tp>::digits);
     else if (sizeof(_Tp) <= sizeof(unsigned long))
-        return std::__libcpp_clz(static_cast<unsigned long>(__t))
+        return std::__LIBCUDACXX_clz(static_cast<unsigned long>(__t))
               - (numeric_limits<unsigned long>::digits - numeric_limits<_Tp>::digits);
     else if (sizeof(_Tp) <= sizeof(unsigned long long))
-        return std::__libcpp_clz(static_cast<unsigned long long>(__t))
+        return std::__LIBCUDACXX_clz(static_cast<unsigned long long>(__t))
               - (numeric_limits<unsigned long long>::digits - numeric_limits<_Tp>::digits);
     else
     {
@@ -131,42 +131,42 @@ int __countl_zero(_Tp __t) _NOEXCEPT
     }
 }
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
-template <__libcpp_unsigned_integer _Tp>
-_LIBCPP_HIDE_FROM_ABI constexpr _Tp rotl(_Tp __t, unsigned int __cnt) noexcept {
+template <__LIBCUDACXX_unsigned_integer _Tp>
+_LIBCUDACXX_HIDE_FROM_ABI constexpr _Tp rotl(_Tp __t, unsigned int __cnt) noexcept {
   const unsigned int __dig = numeric_limits<_Tp>::digits;
   if ((__cnt % __dig) == 0)
     return __t;
   return (__t << (__cnt % __dig)) | (__t >> (__dig - (__cnt % __dig)));
 }
 
-template <__libcpp_unsigned_integer _Tp>
-_LIBCPP_HIDE_FROM_ABI constexpr _Tp rotr(_Tp __t, unsigned int __cnt) noexcept {
+template <__LIBCUDACXX_unsigned_integer _Tp>
+_LIBCUDACXX_HIDE_FROM_ABI constexpr _Tp rotr(_Tp __t, unsigned int __cnt) noexcept {
   return std::__rotr(__t, __cnt);
 }
 
-template <__libcpp_unsigned_integer _Tp>
-_LIBCPP_HIDE_FROM_ABI constexpr int countl_zero(_Tp __t) noexcept {
+template <__LIBCUDACXX_unsigned_integer _Tp>
+_LIBCUDACXX_HIDE_FROM_ABI constexpr int countl_zero(_Tp __t) noexcept {
   return std::__countl_zero(__t);
 }
 
-template <__libcpp_unsigned_integer _Tp>
-_LIBCPP_HIDE_FROM_ABI constexpr int countl_one(_Tp __t) noexcept {
+template <__LIBCUDACXX_unsigned_integer _Tp>
+_LIBCUDACXX_HIDE_FROM_ABI constexpr int countl_one(_Tp __t) noexcept {
   return __t != numeric_limits<_Tp>::max() ? std::countl_zero(static_cast<_Tp>(~__t)) : numeric_limits<_Tp>::digits;
 }
 
-template <__libcpp_unsigned_integer _Tp>
-_LIBCPP_HIDE_FROM_ABI constexpr int countr_zero(_Tp __t) noexcept {
+template <__LIBCUDACXX_unsigned_integer _Tp>
+_LIBCUDACXX_HIDE_FROM_ABI constexpr int countr_zero(_Tp __t) noexcept {
   if (__t == 0)
     return numeric_limits<_Tp>::digits;
 
   if (sizeof(_Tp) <= sizeof(unsigned int))
-    return std::__libcpp_ctz(static_cast<unsigned int>(__t));
+    return std::__LIBCUDACXX_ctz(static_cast<unsigned int>(__t));
   else if (sizeof(_Tp) <= sizeof(unsigned long))
-    return std::__libcpp_ctz(static_cast<unsigned long>(__t));
+    return std::__LIBCUDACXX_ctz(static_cast<unsigned long>(__t));
   else if (sizeof(_Tp) <= sizeof(unsigned long long))
-    return std::__libcpp_ctz(static_cast<unsigned long long>(__t));
+    return std::__LIBCUDACXX_ctz(static_cast<unsigned long long>(__t));
   else {
     int __ret = 0;
     const unsigned int __ulldigits = numeric_limits<unsigned long long>::digits;
@@ -174,55 +174,55 @@ _LIBCPP_HIDE_FROM_ABI constexpr int countr_zero(_Tp __t) noexcept {
       __ret += __ulldigits;
       __t >>= __ulldigits;
     }
-    return __ret + std::__libcpp_ctz(static_cast<unsigned long long>(__t));
+    return __ret + std::__LIBCUDACXX_ctz(static_cast<unsigned long long>(__t));
   }
 }
 
-template <__libcpp_unsigned_integer _Tp>
-_LIBCPP_HIDE_FROM_ABI constexpr int countr_one(_Tp __t) noexcept {
+template <__LIBCUDACXX_unsigned_integer _Tp>
+_LIBCUDACXX_HIDE_FROM_ABI constexpr int countr_one(_Tp __t) noexcept {
   return __t != numeric_limits<_Tp>::max() ? std::countr_zero(static_cast<_Tp>(~__t)) : numeric_limits<_Tp>::digits;
 }
 
-template <__libcpp_unsigned_integer _Tp>
-_LIBCPP_HIDE_FROM_ABI constexpr int popcount(_Tp __t) noexcept {
+template <__LIBCUDACXX_unsigned_integer _Tp>
+_LIBCUDACXX_HIDE_FROM_ABI constexpr int popcount(_Tp __t) noexcept {
   if (sizeof(_Tp) <= sizeof(unsigned int))
-    return std::__libcpp_popcount(static_cast<unsigned int>(__t));
+    return std::__LIBCUDACXX_popcount(static_cast<unsigned int>(__t));
   else if (sizeof(_Tp) <= sizeof(unsigned long))
-    return std::__libcpp_popcount(static_cast<unsigned long>(__t));
+    return std::__LIBCUDACXX_popcount(static_cast<unsigned long>(__t));
   else if (sizeof(_Tp) <= sizeof(unsigned long long))
-    return std::__libcpp_popcount(static_cast<unsigned long long>(__t));
+    return std::__LIBCUDACXX_popcount(static_cast<unsigned long long>(__t));
   else {
     int __ret = 0;
     while (__t != 0) {
-      __ret += std::__libcpp_popcount(static_cast<unsigned long long>(__t));
+      __ret += std::__LIBCUDACXX_popcount(static_cast<unsigned long long>(__t));
       __t >>= numeric_limits<unsigned long long>::digits;
     }
     return __ret;
   }
 }
 
-template <__libcpp_unsigned_integer _Tp>
-_LIBCPP_HIDE_FROM_ABI constexpr bool has_single_bit(_Tp __t) noexcept {
+template <__LIBCUDACXX_unsigned_integer _Tp>
+_LIBCUDACXX_HIDE_FROM_ABI constexpr bool has_single_bit(_Tp __t) noexcept {
   return __t != 0 && (((__t & (__t - 1)) == 0));
 }
 
 // integral log base 2
-template <__libcpp_unsigned_integer _Tp>
-_LIBCPP_HIDE_FROM_ABI constexpr _Tp __bit_log2(_Tp __t) noexcept {
+template <__LIBCUDACXX_unsigned_integer _Tp>
+_LIBCUDACXX_HIDE_FROM_ABI constexpr _Tp __bit_log2(_Tp __t) noexcept {
   return numeric_limits<_Tp>::digits - 1 - std::countl_zero(__t);
 }
 
-template <__libcpp_unsigned_integer _Tp>
-_LIBCPP_HIDE_FROM_ABI constexpr _Tp bit_floor(_Tp __t) noexcept {
+template <__LIBCUDACXX_unsigned_integer _Tp>
+_LIBCUDACXX_HIDE_FROM_ABI constexpr _Tp bit_floor(_Tp __t) noexcept {
   return __t == 0 ? 0 : _Tp{1} << std::__bit_log2(__t);
 }
 
-template <__libcpp_unsigned_integer _Tp>
-_LIBCPP_HIDE_FROM_ABI constexpr _Tp bit_ceil(_Tp __t) noexcept {
+template <__LIBCUDACXX_unsigned_integer _Tp>
+_LIBCUDACXX_HIDE_FROM_ABI constexpr _Tp bit_ceil(_Tp __t) noexcept {
   if (__t < 2)
     return 1;
   const unsigned __n = numeric_limits<_Tp>::digits - std::countl_zero((_Tp)(__t - 1u));
-  _LIBCPP_ASSERT(__n != numeric_limits<_Tp>::digits, "Bad input to bit_ceil");
+  _LIBCUDACXX_ASSERT(__n != numeric_limits<_Tp>::digits, "Bad input to bit_ceil");
 
   if constexpr (sizeof(_Tp) >= sizeof(unsigned))
     return _Tp{1} << __n;
@@ -233,27 +233,27 @@ _LIBCPP_HIDE_FROM_ABI constexpr _Tp bit_ceil(_Tp __t) noexcept {
   }
 }
 
-template <__libcpp_unsigned_integer _Tp>
-_LIBCPP_HIDE_FROM_ABI constexpr int bit_width(_Tp __t) noexcept {
+template <__LIBCUDACXX_unsigned_integer _Tp>
+_LIBCUDACXX_HIDE_FROM_ABI constexpr int bit_width(_Tp __t) noexcept {
   return __t == 0 ? 0 : std::__bit_log2(__t) + 1;
 }
 
 enum class endian {
   little = 0xDEAD,
   big = 0xFACE,
-#  if defined(_LIBCPP_LITTLE_ENDIAN)
+#  if defined(_LIBCUDACXX_LITTLE_ENDIAN)
   native = little
-#  elif defined(_LIBCPP_BIG_ENDIAN)
+#  elif defined(_LIBCUDACXX_BIG_ENDIAN)
   native = big
 #  else
   native = 0xCAFE
 #  endif
 };
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP_BIT
+#endif // _LIBCUDACXX_BIT

diff  --git a/libcxx/include/bitset b/libcxx/include/bitset
index 0f997cef8316..f8639322aa5a 100644
--- a/libcxx/include/bitset
+++ b/libcxx/include/bitset
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_BITSET
-#define _LIBCPP_BITSET
+#ifndef _LIBCUDACXX_BITSET
+#define _LIBCUDACXX_BITSET
 
 /*
     bitset synopsis
@@ -127,15 +127,15 @@ template <size_t N> struct hash<std::bitset<N>>;
 #include <iosfwd>
 #include <string>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <size_t _N_words, size_t _Size>
 class __bitset;
@@ -172,68 +172,68 @@ protected:
     typedef __bit_iterator<__bitset, false>            iterator;
     typedef __bit_iterator<__bitset, true>             const_iterator;
 
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR __bitset() _NOEXCEPT;
-    _LIBCPP_INLINE_VISIBILITY
-    explicit _LIBCPP_CONSTEXPR __bitset(unsigned long long __v) _NOEXCEPT;
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR __bitset() _NOEXCEPT;
+    _LIBCUDACXX_INLINE_VISIBILITY
+    explicit _LIBCUDACXX_CONSTEXPR __bitset(unsigned long long __v) _NOEXCEPT;
 
-    _LIBCPP_INLINE_VISIBILITY reference __make_ref(size_t __pos) _NOEXCEPT
+    _LIBCUDACXX_INLINE_VISIBILITY reference __make_ref(size_t __pos) _NOEXCEPT
         {return reference(__first_ + __pos / __bits_per_word, __storage_type(1) << __pos % __bits_per_word);}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR const_reference __make_ref(size_t __pos) const _NOEXCEPT
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR const_reference __make_ref(size_t __pos) const _NOEXCEPT
         {return const_reference(__first_ + __pos / __bits_per_word, __storage_type(1) << __pos % __bits_per_word);}
-    _LIBCPP_INLINE_VISIBILITY iterator __make_iter(size_t __pos) _NOEXCEPT
+    _LIBCUDACXX_INLINE_VISIBILITY iterator __make_iter(size_t __pos) _NOEXCEPT
         {return iterator(__first_ + __pos / __bits_per_word, __pos % __bits_per_word);}
-    _LIBCPP_INLINE_VISIBILITY const_iterator __make_iter(size_t __pos) const _NOEXCEPT
+    _LIBCUDACXX_INLINE_VISIBILITY const_iterator __make_iter(size_t __pos) const _NOEXCEPT
         {return const_iterator(__first_ + __pos / __bits_per_word, __pos % __bits_per_word);}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void operator&=(const __bitset& __v) _NOEXCEPT;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void operator|=(const __bitset& __v) _NOEXCEPT;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void operator^=(const __bitset& __v) _NOEXCEPT;
 
     void flip() _NOEXCEPT;
-    _LIBCPP_INLINE_VISIBILITY unsigned long to_ulong() const
+    _LIBCUDACXX_INLINE_VISIBILITY unsigned long to_ulong() const
         {return to_ulong(integral_constant<bool, _Size < sizeof(unsigned long) * CHAR_BIT>());}
-    _LIBCPP_INLINE_VISIBILITY unsigned long long to_ullong() const
+    _LIBCUDACXX_INLINE_VISIBILITY unsigned long long to_ullong() const
         {return to_ullong(integral_constant<bool, _Size < sizeof(unsigned long long) * CHAR_BIT>());}
 
     bool all() const _NOEXCEPT;
     bool any() const _NOEXCEPT;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t __hash_code() const _NOEXCEPT;
 private:
-#ifdef _LIBCPP_CXX03_LANG
+#ifdef _LIBCUDACXX_CXX03_LANG
     void __init(unsigned long long __v, false_type) _NOEXCEPT;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __init(unsigned long long __v, true_type) _NOEXCEPT;
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
     unsigned long to_ulong(false_type) const;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     unsigned long to_ulong(true_type) const;
     unsigned long long to_ullong(false_type) const;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     unsigned long long to_ullong(true_type) const;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     unsigned long long to_ullong(true_type, false_type) const;
     unsigned long long to_ullong(true_type, true_type) const;
 };
 
 template <size_t _N_words, size_t _Size>
 inline
-_LIBCPP_CONSTEXPR
+_LIBCUDACXX_CONSTEXPR
 __bitset<_N_words, _Size>::__bitset() _NOEXCEPT
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
     : __first_{0}
 #endif
 {
-#ifdef _LIBCPP_CXX03_LANG
-    _VSTD::fill_n(__first_, _N_words, __storage_type(0));
+#ifdef _LIBCUDACXX_CXX03_LANG
+    _CUDA_VSTD::fill_n(__first_, _N_words, __storage_type(0));
 #endif
 }
 
-#ifdef _LIBCPP_CXX03_LANG
+#ifdef _LIBCUDACXX_CXX03_LANG
 
 template <size_t _N_words, size_t _Size>
 void
@@ -247,13 +247,13 @@ __bitset<_N_words, _Size>::__init(unsigned long long __v, false_type) _NOEXCEPT
         else
             __t[__i] = static_cast<__storage_type>(__v);
 
-    _VSTD::copy(__t, __t + sizeof(__t)/sizeof(__t[0]), __first_);
-    _VSTD::fill(__first_ + sizeof(__t)/sizeof(__t[0]), __first_ + sizeof(__first_)/sizeof(__first_[0]),
+    _CUDA_VSTD::copy(__t, __t + sizeof(__t)/sizeof(__t[0]), __first_);
+    _CUDA_VSTD::fill(__first_ + sizeof(__t)/sizeof(__t[0]), __first_ + sizeof(__first_)/sizeof(__first_[0]),
                __storage_type(0));
 }
 
 template <size_t _N_words, size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 __bitset<_N_words, _Size>::__init(unsigned long long __v, true_type) _NOEXCEPT
 {
@@ -261,16 +261,16 @@ __bitset<_N_words, _Size>::__init(unsigned long long __v, true_type) _NOEXCEPT
     if (_Size < __bits_per_word)
         __first_[0] &= ( 1ULL << _Size ) - 1;
 
-    _VSTD::fill(__first_ + 1, __first_ + sizeof(__first_)/sizeof(__first_[0]), __storage_type(0));
+    _CUDA_VSTD::fill(__first_ + 1, __first_ + sizeof(__first_)/sizeof(__first_[0]), __storage_type(0));
 }
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
 template <size_t _N_words, size_t _Size>
 inline
-_LIBCPP_CONSTEXPR
+_LIBCUDACXX_CONSTEXPR
 __bitset<_N_words, _Size>::__bitset(unsigned long long __v) _NOEXCEPT
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 #if __SIZEOF_SIZE_T__ == 8
     : __first_{__v}
 #elif __SIZEOF_SIZE_T__ == 4
@@ -282,7 +282,7 @@ __bitset<_N_words, _Size>::__bitset(unsigned long long __v) _NOEXCEPT
 #endif
 #endif
 {
-#ifdef _LIBCPP_CXX03_LANG
+#ifdef _LIBCUDACXX_CXX03_LANG
     __init(__v, integral_constant<bool, sizeof(unsigned long long) == sizeof(__storage_type)>());
 #endif
 }
@@ -338,7 +338,7 @@ unsigned long
 __bitset<_N_words, _Size>::to_ulong(false_type) const
 {
     const_iterator __e = __make_iter(_Size);
-    const_iterator __i = _VSTD::find(__make_iter(sizeof(unsigned long) * CHAR_BIT), __e, true);
+    const_iterator __i = _CUDA_VSTD::find(__make_iter(sizeof(unsigned long) * CHAR_BIT), __e, true);
     if (__i != __e)
         __throw_overflow_error("bitset to_ulong overflow error");
 
@@ -358,7 +358,7 @@ unsigned long long
 __bitset<_N_words, _Size>::to_ullong(false_type) const
 {
     const_iterator __e = __make_iter(_Size);
-    const_iterator __i = _VSTD::find(__make_iter(sizeof(unsigned long long) * CHAR_BIT), __e, true);
+    const_iterator __i = _CUDA_VSTD::find(__make_iter(sizeof(unsigned long long) * CHAR_BIT), __e, true);
     if (__i != __e)
         __throw_overflow_error("bitset to_ullong overflow error");
 
@@ -468,47 +468,47 @@ protected:
     typedef __bit_iterator<__bitset, false>            iterator;
     typedef __bit_iterator<__bitset, true>             const_iterator;
 
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR __bitset() _NOEXCEPT;
-    _LIBCPP_INLINE_VISIBILITY
-    explicit _LIBCPP_CONSTEXPR __bitset(unsigned long long __v) _NOEXCEPT;
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR __bitset() _NOEXCEPT;
+    _LIBCUDACXX_INLINE_VISIBILITY
+    explicit _LIBCUDACXX_CONSTEXPR __bitset(unsigned long long __v) _NOEXCEPT;
 
-    _LIBCPP_INLINE_VISIBILITY reference __make_ref(size_t __pos) _NOEXCEPT
+    _LIBCUDACXX_INLINE_VISIBILITY reference __make_ref(size_t __pos) _NOEXCEPT
         {return reference(&__first_, __storage_type(1) << __pos);}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR const_reference __make_ref(size_t __pos) const _NOEXCEPT
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR const_reference __make_ref(size_t __pos) const _NOEXCEPT
         {return const_reference(&__first_, __storage_type(1) << __pos);}
-    _LIBCPP_INLINE_VISIBILITY iterator __make_iter(size_t __pos) _NOEXCEPT
+    _LIBCUDACXX_INLINE_VISIBILITY iterator __make_iter(size_t __pos) _NOEXCEPT
         {return iterator(&__first_ + __pos / __bits_per_word, __pos % __bits_per_word);}
-    _LIBCPP_INLINE_VISIBILITY const_iterator __make_iter(size_t __pos) const _NOEXCEPT
+    _LIBCUDACXX_INLINE_VISIBILITY const_iterator __make_iter(size_t __pos) const _NOEXCEPT
         {return const_iterator(&__first_ + __pos / __bits_per_word, __pos % __bits_per_word);}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void operator&=(const __bitset& __v) _NOEXCEPT;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void operator|=(const __bitset& __v) _NOEXCEPT;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void operator^=(const __bitset& __v) _NOEXCEPT;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void flip() _NOEXCEPT;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     unsigned long to_ulong() const;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     unsigned long long to_ullong() const;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool all() const _NOEXCEPT;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool any() const _NOEXCEPT;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t __hash_code() const _NOEXCEPT;
 };
 
 template <size_t _Size>
 inline
-_LIBCPP_CONSTEXPR
+_LIBCUDACXX_CONSTEXPR
 __bitset<1, _Size>::__bitset() _NOEXCEPT
     : __first_(0)
 {
@@ -516,7 +516,7 @@ __bitset<1, _Size>::__bitset() _NOEXCEPT
 
 template <size_t _Size>
 inline
-_LIBCPP_CONSTEXPR
+_LIBCUDACXX_CONSTEXPR
 __bitset<1, _Size>::__bitset(unsigned long long __v) _NOEXCEPT
     : __first_(
         _Size == __bits_per_word ? static_cast<__storage_type>(__v)
@@ -625,52 +625,52 @@ protected:
     typedef __bit_iterator<__bitset, false>            iterator;
     typedef __bit_iterator<__bitset, true>             const_iterator;
 
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR __bitset() _NOEXCEPT;
-    _LIBCPP_INLINE_VISIBILITY
-    explicit _LIBCPP_CONSTEXPR __bitset(unsigned long long) _NOEXCEPT;
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR __bitset() _NOEXCEPT;
+    _LIBCUDACXX_INLINE_VISIBILITY
+    explicit _LIBCUDACXX_CONSTEXPR __bitset(unsigned long long) _NOEXCEPT;
 
-    _LIBCPP_INLINE_VISIBILITY reference __make_ref(size_t) _NOEXCEPT
+    _LIBCUDACXX_INLINE_VISIBILITY reference __make_ref(size_t) _NOEXCEPT
         {return reference(nullptr, 1);}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR const_reference __make_ref(size_t) const _NOEXCEPT
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR const_reference __make_ref(size_t) const _NOEXCEPT
         {return const_reference(nullptr, 1);}
-    _LIBCPP_INLINE_VISIBILITY iterator __make_iter(size_t) _NOEXCEPT
+    _LIBCUDACXX_INLINE_VISIBILITY iterator __make_iter(size_t) _NOEXCEPT
         {return iterator(nullptr, 0);}
-    _LIBCPP_INLINE_VISIBILITY const_iterator __make_iter(size_t) const _NOEXCEPT
+    _LIBCUDACXX_INLINE_VISIBILITY const_iterator __make_iter(size_t) const _NOEXCEPT
         {return const_iterator(nullptr, 0);}
 
-    _LIBCPP_INLINE_VISIBILITY void operator&=(const __bitset&) _NOEXCEPT {}
-    _LIBCPP_INLINE_VISIBILITY void operator|=(const __bitset&) _NOEXCEPT {}
-    _LIBCPP_INLINE_VISIBILITY void operator^=(const __bitset&) _NOEXCEPT {}
+    _LIBCUDACXX_INLINE_VISIBILITY void operator&=(const __bitset&) _NOEXCEPT {}
+    _LIBCUDACXX_INLINE_VISIBILITY void operator|=(const __bitset&) _NOEXCEPT {}
+    _LIBCUDACXX_INLINE_VISIBILITY void operator^=(const __bitset&) _NOEXCEPT {}
 
-    _LIBCPP_INLINE_VISIBILITY void flip() _NOEXCEPT {}
+    _LIBCUDACXX_INLINE_VISIBILITY void flip() _NOEXCEPT {}
 
-    _LIBCPP_INLINE_VISIBILITY unsigned long to_ulong() const {return 0;}
-    _LIBCPP_INLINE_VISIBILITY unsigned long long to_ullong() const {return 0;}
+    _LIBCUDACXX_INLINE_VISIBILITY unsigned long to_ulong() const {return 0;}
+    _LIBCUDACXX_INLINE_VISIBILITY unsigned long long to_ullong() const {return 0;}
 
-    _LIBCPP_INLINE_VISIBILITY bool all() const _NOEXCEPT {return true;}
-    _LIBCPP_INLINE_VISIBILITY bool any() const _NOEXCEPT {return false;}
+    _LIBCUDACXX_INLINE_VISIBILITY bool all() const _NOEXCEPT {return true;}
+    _LIBCUDACXX_INLINE_VISIBILITY bool any() const _NOEXCEPT {return false;}
 
-    _LIBCPP_INLINE_VISIBILITY size_t __hash_code() const _NOEXCEPT {return 0;}
+    _LIBCUDACXX_INLINE_VISIBILITY size_t __hash_code() const _NOEXCEPT {return 0;}
 };
 
 inline
-_LIBCPP_CONSTEXPR
+_LIBCUDACXX_CONSTEXPR
 __bitset<0, 0>::__bitset() _NOEXCEPT
 {
 }
 
 inline
-_LIBCPP_CONSTEXPR
+_LIBCUDACXX_CONSTEXPR
 __bitset<0, 0>::__bitset(unsigned long long) _NOEXCEPT
 {
 }
 
-template <size_t _Size> class _LIBCPP_TEMPLATE_VIS bitset;
+template <size_t _Size> class _LIBCUDACXX_TEMPLATE_VIS bitset;
 template <size_t _Size> struct hash<bitset<_Size> >;
 
 template <size_t _Size>
-class _LIBCPP_TEMPLATE_VIS bitset
+class _LIBCUDACXX_TEMPLATE_VIS bitset
     : private __bitset<_Size == 0 ? 0 : (_Size - 1) / (sizeof(size_t) * CHAR_BIT) + 1, _Size>
 {
 public:
@@ -682,8 +682,8 @@ public:
     typedef typename base::const_reference const_reference;
 
     // 23.3.5.1 constructors:
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR bitset() _NOEXCEPT {}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR bitset() _NOEXCEPT {}
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR
         bitset(unsigned long long __v) _NOEXCEPT : base(__v) {}
     template<class _CharT, class = __enable_if_t<_IsCharLikeType<_CharT>::value> >
         explicit bitset(const _CharT* __str,
@@ -697,72 +697,72 @@ public:
                         _CharT __zero = _CharT('0'), _CharT __one = _CharT('1'));
 
     // 23.3.5.2 bitset operations:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bitset& operator&=(const bitset& __rhs) _NOEXCEPT;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bitset& operator|=(const bitset& __rhs) _NOEXCEPT;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bitset& operator^=(const bitset& __rhs) _NOEXCEPT;
     bitset& operator<<=(size_t __pos) _NOEXCEPT;
     bitset& operator>>=(size_t __pos) _NOEXCEPT;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bitset& set() _NOEXCEPT;
     bitset& set(size_t __pos, bool __val = true);
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bitset& reset() _NOEXCEPT;
     bitset& reset(size_t __pos);
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bitset  operator~() const _NOEXCEPT;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bitset& flip() _NOEXCEPT;
     bitset& flip(size_t __pos);
 
     // element access:
-#ifdef _LIBCPP_ABI_BITSET_VECTOR_BOOL_CONST_SUBSCRIPT_RETURN_BOOL
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR            bool operator[](size_t __p) const {return base::__make_ref(__p);}
+#ifdef _LIBCUDACXX_ABI_BITSET_VECTOR_BOOL_CONST_SUBSCRIPT_RETURN_BOOL
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR            bool operator[](size_t __p) const {return base::__make_ref(__p);}
 #else
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR const_reference operator[](size_t __p) const {return base::__make_ref(__p);}
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR const_reference operator[](size_t __p) const {return base::__make_ref(__p);}
 #endif
-    _LIBCPP_HIDE_FROM_ABI                         reference operator[](size_t __p)       {return base::__make_ref(__p);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_HIDE_FROM_ABI                         reference operator[](size_t __p)       {return base::__make_ref(__p);}
+    _LIBCUDACXX_INLINE_VISIBILITY
     unsigned long to_ulong() const;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     unsigned long long to_ullong() const;
     template <class _CharT, class _Traits, class _Allocator>
         basic_string<_CharT, _Traits, _Allocator> to_string(_CharT __zero = _CharT('0'),
                                                             _CharT __one = _CharT('1')) const;
     template <class _CharT, class _Traits>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         basic_string<_CharT, _Traits, allocator<_CharT> > to_string(_CharT __zero = _CharT('0'),
                                                                     _CharT __one = _CharT('1')) const;
     template <class _CharT>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         basic_string<_CharT, char_traits<_CharT>, allocator<_CharT> > to_string(_CharT __zero = _CharT('0'),
                                                                                 _CharT __one = _CharT('1')) const;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_string<char, char_traits<char>, allocator<char> > to_string(char __zero = '0',
                                                                       char __one = '1') const;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t count() const _NOEXCEPT;
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR size_t size() const _NOEXCEPT {return _Size;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR size_t size() const _NOEXCEPT {return _Size;}
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool operator==(const bitset& __rhs) const _NOEXCEPT;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool operator!=(const bitset& __rhs) const _NOEXCEPT;
     bool test(size_t __pos) const;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool all() const _NOEXCEPT;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool any() const _NOEXCEPT;
-    _LIBCPP_INLINE_VISIBILITY bool none() const _NOEXCEPT {return !any();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY bool none() const _NOEXCEPT {return !any();}
+    _LIBCUDACXX_INLINE_VISIBILITY
     bitset operator<<(size_t __pos) const _NOEXCEPT;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bitset operator>>(size_t __pos) const _NOEXCEPT;
 
 private:
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t __hash_code() const _NOEXCEPT {return base::__hash_code();}
 
     friend struct hash<bitset>;
@@ -774,19 +774,19 @@ bitset<_Size>::bitset(const _CharT* __str,
                       typename basic_string<_CharT>::size_type __n,
                       _CharT __zero, _CharT __one)
 {
-    size_t __rlen = _VSTD::min(__n, char_traits<_CharT>::length(__str));
+    size_t __rlen = _CUDA_VSTD::min(__n, char_traits<_CharT>::length(__str));
     for (size_t __i = 0; __i < __rlen; ++__i)
         if (__str[__i] != __zero && __str[__i] != __one)
             __throw_invalid_argument("bitset string ctor has invalid argument");
 
-    size_t _Mp = _VSTD::min(__rlen, _Size);
+    size_t _Mp = _CUDA_VSTD::min(__rlen, _Size);
     size_t __i = 0;
     for (; __i < _Mp; ++__i)
     {
         _CharT __c = __str[_Mp - 1 - __i];
         (*this)[__i] = (__c == __one);
     }
-    _VSTD::fill(base::__make_iter(__i), base::__make_iter(_Size), false);
+    _CUDA_VSTD::fill(base::__make_iter(__i), base::__make_iter(_Size), false);
 }
 
 template <size_t _Size>
@@ -799,19 +799,19 @@ bitset<_Size>::bitset(const basic_string<_CharT,_Traits,_Allocator>& __str,
     if (__pos > __str.size())
         __throw_out_of_range("bitset string pos out of range");
 
-    size_t __rlen = _VSTD::min(__n, __str.size() - __pos);
+    size_t __rlen = _CUDA_VSTD::min(__n, __str.size() - __pos);
     for (size_t __i = __pos; __i < __pos + __rlen; ++__i)
         if (!_Traits::eq(__str[__i], __zero) && !_Traits::eq(__str[__i], __one))
             __throw_invalid_argument("bitset string ctor has invalid argument");
 
-    size_t _Mp = _VSTD::min(__rlen, _Size);
+    size_t _Mp = _CUDA_VSTD::min(__rlen, _Size);
     size_t __i = 0;
     for (; __i < _Mp; ++__i)
     {
         _CharT __c = __str[__pos + _Mp - 1 - __i];
         (*this)[__i] = _Traits::eq(__c, __one);
     }
-    _VSTD::fill(base::__make_iter(__i), base::__make_iter(_Size), false);
+    _CUDA_VSTD::fill(base::__make_iter(__i), base::__make_iter(_Size), false);
 }
 
 template <size_t _Size>
@@ -845,9 +845,9 @@ template <size_t _Size>
 bitset<_Size>&
 bitset<_Size>::operator<<=(size_t __pos) _NOEXCEPT
 {
-    __pos = _VSTD::min(__pos, _Size);
-    _VSTD::copy_backward(base::__make_iter(0), base::__make_iter(_Size - __pos), base::__make_iter(_Size));
-    _VSTD::fill_n(base::__make_iter(0), __pos, false);
+    __pos = _CUDA_VSTD::min(__pos, _Size);
+    _CUDA_VSTD::copy_backward(base::__make_iter(0), base::__make_iter(_Size - __pos), base::__make_iter(_Size));
+    _CUDA_VSTD::fill_n(base::__make_iter(0), __pos, false);
     return *this;
 }
 
@@ -855,9 +855,9 @@ template <size_t _Size>
 bitset<_Size>&
 bitset<_Size>::operator>>=(size_t __pos) _NOEXCEPT
 {
-    __pos = _VSTD::min(__pos, _Size);
-    _VSTD::copy(base::__make_iter(__pos), base::__make_iter(_Size), base::__make_iter(0));
-    _VSTD::fill_n(base::__make_iter(_Size - __pos), __pos, false);
+    __pos = _CUDA_VSTD::min(__pos, _Size);
+    _CUDA_VSTD::copy(base::__make_iter(__pos), base::__make_iter(_Size), base::__make_iter(0));
+    _CUDA_VSTD::fill_n(base::__make_iter(_Size - __pos), __pos, false);
     return *this;
 }
 
@@ -866,7 +866,7 @@ inline
 bitset<_Size>&
 bitset<_Size>::set() _NOEXCEPT
 {
-    _VSTD::fill_n(base::__make_iter(0), _Size, true);
+    _CUDA_VSTD::fill_n(base::__make_iter(0), _Size, true);
     return *this;
 }
 
@@ -886,7 +886,7 @@ inline
 bitset<_Size>&
 bitset<_Size>::reset() _NOEXCEPT
 {
-    _VSTD::fill_n(base::__make_iter(0), _Size, false);
+    _CUDA_VSTD::fill_n(base::__make_iter(0), _Size, false);
     return *this;
 }
 
@@ -993,7 +993,7 @@ inline
 size_t
 bitset<_Size>::count() const _NOEXCEPT
 {
-    return static_cast<size_t>(_VSTD::__count_bool_true(base::__make_iter(0), _Size));
+    return static_cast<size_t>(_CUDA_VSTD::__count_bool_true(base::__make_iter(0), _Size));
 }
 
 template <size_t _Size>
@@ -1001,7 +1001,7 @@ inline
 bool
 bitset<_Size>::operator==(const bitset& __rhs) const _NOEXCEPT
 {
-    return _VSTD::equal(base::__make_iter(0), base::__make_iter(_Size), __rhs.__make_iter(0));
+    return _CUDA_VSTD::equal(base::__make_iter(0), base::__make_iter(_Size), __rhs.__make_iter(0));
 }
 
 template <size_t _Size>
@@ -1059,7 +1059,7 @@ bitset<_Size>::operator>>(size_t __pos) const _NOEXCEPT
 }
 
 template <size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bitset<_Size>
 operator&(const bitset<_Size>& __x, const bitset<_Size>& __y) _NOEXCEPT
 {
@@ -1069,7 +1069,7 @@ operator&(const bitset<_Size>& __x, const bitset<_Size>& __y) _NOEXCEPT
 }
 
 template <size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bitset<_Size>
 operator|(const bitset<_Size>& __x, const bitset<_Size>& __y) _NOEXCEPT
 {
@@ -1079,7 +1079,7 @@ operator|(const bitset<_Size>& __x, const bitset<_Size>& __y) _NOEXCEPT
 }
 
 template <size_t _Size>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bitset<_Size>
 operator^(const bitset<_Size>& __x, const bitset<_Size>& __y) _NOEXCEPT
 {
@@ -1089,10 +1089,10 @@ operator^(const bitset<_Size>& __x, const bitset<_Size>& __y) _NOEXCEPT
 }
 
 template <size_t _Size>
-struct _LIBCPP_TEMPLATE_VIS hash<bitset<_Size> >
+struct _LIBCUDACXX_TEMPLATE_VIS hash<bitset<_Size> >
     : public __unary_function<bitset<_Size>, size_t>
 {
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t operator()(const bitset<_Size>& __bs) const _NOEXCEPT
         {return __bs.__hash_code();}
 };
@@ -1105,8 +1105,8 @@ template <class _CharT, class _Traits, size_t _Size>
 basic_ostream<_CharT, _Traits>&
 operator<<(basic_ostream<_CharT, _Traits>& __os, const bitset<_Size>& __x);
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP_BITSET
+#endif // _LIBCUDACXX_BITSET

diff  --git a/libcxx/include/cassert b/libcxx/include/cassert
index 28fc0b10e9f4..acc56d05341e 100644
--- a/libcxx/include/cassert
+++ b/libcxx/include/cassert
@@ -20,6 +20,6 @@ Macros:
 #include <__config>
 #include <assert.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif

diff  --git a/libcxx/include/ccomplex b/libcxx/include/ccomplex
index cf05c7a91081..ee95c3e13988 100644
--- a/libcxx/include/ccomplex
+++ b/libcxx/include/ccomplex
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_CCOMPLEX
-#define _LIBCPP_CCOMPLEX
+#ifndef _LIBCUDACXX_CCOMPLEX
+#define _LIBCUDACXX_CCOMPLEX
 
 /*
     ccomplex synopsis
@@ -20,8 +20,8 @@
 #include <__assert> // all public C++ headers provide the assertion handler
 #include <complex>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#endif // _LIBCPP_CCOMPLEX
+#endif // _LIBCUDACXX_CCOMPLEX

diff  --git a/libcxx/include/cctype b/libcxx/include/cctype
index 248f8d98000f..6018d81ca16e 100644
--- a/libcxx/include/cctype
+++ b/libcxx/include/cctype
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_CCTYPE
-#define _LIBCPP_CCTYPE
+#ifndef _LIBCUDACXX_CCTYPE
+#define _LIBCUDACXX_CCTYPE
 
 /*
     cctype synopsis
@@ -38,11 +38,11 @@ int toupper(int c);
 #include <__config>
 #include <ctype.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 #ifdef isalnum
 #undef isalnum
@@ -101,21 +101,21 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 #endif
 
 
-using ::isalnum _LIBCPP_USING_IF_EXISTS;
-using ::isalpha _LIBCPP_USING_IF_EXISTS;
-using ::isblank _LIBCPP_USING_IF_EXISTS;
-using ::iscntrl _LIBCPP_USING_IF_EXISTS;
-using ::isdigit _LIBCPP_USING_IF_EXISTS;
-using ::isgraph _LIBCPP_USING_IF_EXISTS;
-using ::islower _LIBCPP_USING_IF_EXISTS;
-using ::isprint _LIBCPP_USING_IF_EXISTS;
-using ::ispunct _LIBCPP_USING_IF_EXISTS;
-using ::isspace _LIBCPP_USING_IF_EXISTS;
-using ::isupper _LIBCPP_USING_IF_EXISTS;
-using ::isxdigit _LIBCPP_USING_IF_EXISTS;
-using ::tolower _LIBCPP_USING_IF_EXISTS;
-using ::toupper _LIBCPP_USING_IF_EXISTS;
-
-_LIBCPP_END_NAMESPACE_STD
-
-#endif // _LIBCPP_CCTYPE
+using ::isalnum _LIBCUDACXX_USING_IF_EXISTS;
+using ::isalpha _LIBCUDACXX_USING_IF_EXISTS;
+using ::isblank _LIBCUDACXX_USING_IF_EXISTS;
+using ::iscntrl _LIBCUDACXX_USING_IF_EXISTS;
+using ::isdigit _LIBCUDACXX_USING_IF_EXISTS;
+using ::isgraph _LIBCUDACXX_USING_IF_EXISTS;
+using ::islower _LIBCUDACXX_USING_IF_EXISTS;
+using ::isprint _LIBCUDACXX_USING_IF_EXISTS;
+using ::ispunct _LIBCUDACXX_USING_IF_EXISTS;
+using ::isspace _LIBCUDACXX_USING_IF_EXISTS;
+using ::isupper _LIBCUDACXX_USING_IF_EXISTS;
+using ::isxdigit _LIBCUDACXX_USING_IF_EXISTS;
+using ::tolower _LIBCUDACXX_USING_IF_EXISTS;
+using ::toupper _LIBCUDACXX_USING_IF_EXISTS;
+
+_LIBCUDACXX_END_NAMESPACE_STD
+
+#endif // _LIBCUDACXX_CCTYPE

diff  --git a/libcxx/include/cerrno b/libcxx/include/cerrno
index e9eacd35effe..7a4e7c56ae22 100644
--- a/libcxx/include/cerrno
+++ b/libcxx/include/cerrno
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_CERRNO
-#define _LIBCPP_CERRNO
+#ifndef _LIBCUDACXX_CERRNO
+#define _LIBCUDACXX_CERRNO
 
 /*
     cerrno synopsis
@@ -26,8 +26,8 @@ Macros:
 #include <__config>
 #include <errno.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#endif // _LIBCPP_CERRNO
+#endif // _LIBCUDACXX_CERRNO

diff  --git a/libcxx/include/cfenv b/libcxx/include/cfenv
index e42b46680d15..bca525c0206e 100644
--- a/libcxx/include/cfenv
+++ b/libcxx/include/cfenv
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_CFENV
-#define _LIBCPP_CFENV
+#ifndef _LIBCUDACXX_CFENV
+#define _LIBCUDACXX_CFENV
 
 /*
     cfenv synopsis
@@ -56,27 +56,27 @@ int feupdateenv(const fenv_t* envp);
 #include <__config>
 #include <fenv.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-using ::fenv_t _LIBCPP_USING_IF_EXISTS;
-using ::fexcept_t _LIBCPP_USING_IF_EXISTS;
+using ::fenv_t _LIBCUDACXX_USING_IF_EXISTS;
+using ::fexcept_t _LIBCUDACXX_USING_IF_EXISTS;
 
-using ::feclearexcept _LIBCPP_USING_IF_EXISTS;
-using ::fegetexceptflag _LIBCPP_USING_IF_EXISTS;
-using ::feraiseexcept _LIBCPP_USING_IF_EXISTS;
-using ::fesetexceptflag _LIBCPP_USING_IF_EXISTS;
-using ::fetestexcept _LIBCPP_USING_IF_EXISTS;
-using ::fegetround _LIBCPP_USING_IF_EXISTS;
-using ::fesetround _LIBCPP_USING_IF_EXISTS;
-using ::fegetenv _LIBCPP_USING_IF_EXISTS;
-using ::feholdexcept _LIBCPP_USING_IF_EXISTS;
-using ::fesetenv _LIBCPP_USING_IF_EXISTS;
-using ::feupdateenv _LIBCPP_USING_IF_EXISTS;
+using ::feclearexcept _LIBCUDACXX_USING_IF_EXISTS;
+using ::fegetexceptflag _LIBCUDACXX_USING_IF_EXISTS;
+using ::feraiseexcept _LIBCUDACXX_USING_IF_EXISTS;
+using ::fesetexceptflag _LIBCUDACXX_USING_IF_EXISTS;
+using ::fetestexcept _LIBCUDACXX_USING_IF_EXISTS;
+using ::fegetround _LIBCUDACXX_USING_IF_EXISTS;
+using ::fesetround _LIBCUDACXX_USING_IF_EXISTS;
+using ::fegetenv _LIBCUDACXX_USING_IF_EXISTS;
+using ::feholdexcept _LIBCUDACXX_USING_IF_EXISTS;
+using ::fesetenv _LIBCUDACXX_USING_IF_EXISTS;
+using ::feupdateenv _LIBCUDACXX_USING_IF_EXISTS;
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_CFENV
+#endif // _LIBCUDACXX_CFENV

diff  --git a/libcxx/include/cfloat b/libcxx/include/cfloat
index 36a7c51cdda5..19eadff7e62e 100644
--- a/libcxx/include/cfloat
+++ b/libcxx/include/cfloat
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_CFLOAT
-#define _LIBCPP_CFLOAT
+#ifndef _LIBCUDACXX_CFLOAT
+#define _LIBCUDACXX_CFLOAT
 
 /*
     cfloat synopsis
@@ -73,8 +73,8 @@ Macros:
 #include <__config>
 #include <float.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#endif // _LIBCPP_CFLOAT
+#endif // _LIBCUDACXX_CFLOAT

diff  --git a/libcxx/include/charconv b/libcxx/include/charconv
index 4f00755a83bb..2cbdfd42da37 100644
--- a/libcxx/include/charconv
+++ b/libcxx/include/charconv
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_CHARCONV
-#define _LIBCPP_CHARCONV
+#ifndef _LIBCUDACXX_CHARCONV
+#define _LIBCUDACXX_CHARCONV
 
 /*
     charconv synopsis
@@ -97,20 +97,20 @@ namespace std {
 #include <limits>
 #include <type_traits>
 
-#ifndef _LIBCPP_REMOVE_TRANSITIVE_INCLUDES
+#ifndef _LIBCUDACXX_REMOVE_TRANSITIVE_INCLUDES
 #  include <iosfwd>
 #endif
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
 to_chars_result to_chars(char*, char*, bool, int = 10) = delete;
 from_chars_result from_chars(const char*, const char*, bool, int = 10) = delete;
@@ -119,10 +119,10 @@ namespace __itoa
 {
 
 template <typename _Tp, typename = void>
-struct _LIBCPP_HIDDEN __traits_base;
+struct _LIBCUDACXX_HIDDEN __traits_base;
 
 template <typename _Tp>
-struct _LIBCPP_HIDDEN __traits_base<_Tp, __enable_if_t<sizeof(_Tp) <= sizeof(uint32_t)>>
+struct _LIBCUDACXX_HIDDEN __traits_base<_Tp, __enable_if_t<sizeof(_Tp) <= sizeof(uint32_t)>>
 {
     using type = uint32_t;
 
@@ -130,26 +130,26 @@ struct _LIBCPP_HIDDEN __traits_base<_Tp, __enable_if_t<sizeof(_Tp) <= sizeof(uin
     ///
     /// The algorithm is based on
     /// http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog10
-    /// Instead of using IntegerLogBase2 it uses __libcpp_clz. Since that
+    /// Instead of using IntegerLogBase2 it uses __LIBCUDACXX_clz. Since that
     /// function requires its input to have at least one bit set the value of
     /// zero is set to one. This means the first element of the lookup table is
     /// zero.
-    static _LIBCPP_HIDE_FROM_ABI int __width(_Tp __v)
+    static _LIBCUDACXX_HIDE_FROM_ABI int __width(_Tp __v)
     {
-        auto __t = (32 - std::__libcpp_clz(static_cast<type>(__v | 1))) * 1233 >> 12;
+        auto __t = (32 - std::__LIBCUDACXX_clz(static_cast<type>(__v | 1))) * 1233 >> 12;
         return __t - (__v < __table<>::__pow10_32[__t]) + 1;
     }
 
-    static _LIBCPP_HIDE_FROM_ABI char* __convert(char* __p, _Tp __v)
+    static _LIBCUDACXX_HIDE_FROM_ABI char* __convert(char* __p, _Tp __v)
     {
         return __itoa::__base_10_u32(__p, __v);
     }
 
-    static _LIBCPP_HIDE_FROM_ABI decltype(__table<>::__pow10_32)& __pow() { return __table<>::__pow10_32; }
+    static _LIBCUDACXX_HIDE_FROM_ABI decltype(__table<>::__pow10_32)& __pow() { return __table<>::__pow10_32; }
 };
 
 template <typename _Tp>
-struct _LIBCPP_HIDDEN
+struct _LIBCUDACXX_HIDDEN
     __traits_base<_Tp, __enable_if_t<sizeof(_Tp) == sizeof(uint64_t)>> {
   using type = uint64_t;
 
@@ -157,24 +157,24 @@ struct _LIBCPP_HIDDEN
   ///
   /// The algorithm is based on
   /// http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog10
-  /// Instead of using IntegerLogBase2 it uses __libcpp_clz. Since that
+  /// Instead of using IntegerLogBase2 it uses __LIBCUDACXX_clz. Since that
   /// function requires its input to have at least one bit set the value of
   /// zero is set to one. This means the first element of the lookup table is
   /// zero.
-  static _LIBCPP_HIDE_FROM_ABI int __width(_Tp __v) {
-    auto __t = (64 - std::__libcpp_clz(static_cast<type>(__v | 1))) * 1233 >> 12;
+  static _LIBCUDACXX_HIDE_FROM_ABI int __width(_Tp __v) {
+    auto __t = (64 - std::__LIBCUDACXX_clz(static_cast<type>(__v | 1))) * 1233 >> 12;
     return __t - (__v < __table<>::__pow10_64[__t]) + 1;
   }
 
-  static _LIBCPP_HIDE_FROM_ABI char* __convert(char* __p, _Tp __v) { return __itoa::__base_10_u64(__p, __v); }
+  static _LIBCUDACXX_HIDE_FROM_ABI char* __convert(char* __p, _Tp __v) { return __itoa::__base_10_u64(__p, __v); }
 
-  static _LIBCPP_HIDE_FROM_ABI decltype(__table<>::__pow10_64)& __pow() { return __table<>::__pow10_64; }
+  static _LIBCUDACXX_HIDE_FROM_ABI decltype(__table<>::__pow10_64)& __pow() { return __table<>::__pow10_64; }
 };
 
 
-#  ifndef _LIBCPP_HAS_NO_INT128
+#  ifndef _LIBCUDACXX_HAS_NO_INT128
 template <typename _Tp>
-struct _LIBCPP_HIDDEN
+struct _LIBCUDACXX_HIDDEN
     __traits_base<_Tp, __enable_if_t<sizeof(_Tp) == sizeof(__uint128_t)> > {
   using type = __uint128_t;
 
@@ -182,29 +182,29 @@ struct _LIBCPP_HIDDEN
   ///
   /// The algorithm is based on
   /// http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog10
-  /// Instead of using IntegerLogBase2 it uses __libcpp_clz. Since that
+  /// Instead of using IntegerLogBase2 it uses __LIBCUDACXX_clz. Since that
   /// function requires its input to have at least one bit set the value of
   /// zero is set to one. This means the first element of the lookup table is
   /// zero.
-  static _LIBCPP_HIDE_FROM_ABI int __width(_Tp __v) {
-    _LIBCPP_ASSERT(__v > numeric_limits<uint64_t>::max(), "The optimizations for this algorithm fail when this isn't true.");
+  static _LIBCUDACXX_HIDE_FROM_ABI int __width(_Tp __v) {
+    _LIBCUDACXX_ASSERT(__v > numeric_limits<uint64_t>::max(), "The optimizations for this algorithm fail when this isn't true.");
     // There's always a bit set in the upper 64-bits.
-    auto __t = (128 - std::__libcpp_clz(static_cast<uint64_t>(__v >> 64))) * 1233 >> 12;
-    _LIBCPP_ASSERT(__t >= __table<>::__pow10_128_offset, "Index out of bounds");
+    auto __t = (128 - std::__LIBCUDACXX_clz(static_cast<uint64_t>(__v >> 64))) * 1233 >> 12;
+    _LIBCUDACXX_ASSERT(__t >= __table<>::__pow10_128_offset, "Index out of bounds");
     // __t is adjusted since the lookup table misses the lower entries.
     return __t - (__v < __table<>::__pow10_128[__t - __table<>::__pow10_128_offset]) + 1;
   }
 
-  static _LIBCPP_HIDE_FROM_ABI char* __convert(char* __p, _Tp __v) { return __itoa::__base_10_u128(__p, __v); }
+  static _LIBCUDACXX_HIDE_FROM_ABI char* __convert(char* __p, _Tp __v) { return __itoa::__base_10_u128(__p, __v); }
 
   // TODO FMT This pow function should get an index.
   // By moving this to its own header it can be reused by the pow function in to_chars_base_10.
-  static _LIBCPP_HIDE_FROM_ABI decltype(__table<>::__pow10_128)& __pow() { return __table<>::__pow10_128; }
+  static _LIBCUDACXX_HIDE_FROM_ABI decltype(__table<>::__pow10_128)& __pow() { return __table<>::__pow10_128; }
 };
 #endif
 
 template <typename _Tp>
-inline _LIBCPP_HIDE_FROM_ABI bool
+inline _LIBCUDACXX_HIDE_FROM_ABI bool
 __mul_overflowed(unsigned char __a, _Tp __b, unsigned char& __r)
 {
     auto __c = __a * __b;
@@ -213,7 +213,7 @@ __mul_overflowed(unsigned char __a, _Tp __b, unsigned char& __r)
 }
 
 template <typename _Tp>
-inline _LIBCPP_HIDE_FROM_ABI bool
+inline _LIBCUDACXX_HIDE_FROM_ABI bool
 __mul_overflowed(unsigned short __a, _Tp __b, unsigned short& __r)
 {
     auto __c = __a * __b;
@@ -222,11 +222,11 @@ __mul_overflowed(unsigned short __a, _Tp __b, unsigned short& __r)
 }
 
 template <typename _Tp>
-inline _LIBCPP_HIDE_FROM_ABI bool
+inline _LIBCUDACXX_HIDE_FROM_ABI bool
 __mul_overflowed(_Tp __a, _Tp __b, _Tp& __r)
 {
     static_assert(is_unsigned<_Tp>::value, "");
-#if !defined(_LIBCPP_COMPILER_MSVC)
+#if !defined(_LIBCUDACXX_COMPILER_MSVC)
     return __builtin_mul_overflow(__a, __b, &__r);
 #else
     bool __did = __b && (numeric_limits<_Tp>::max() / __b) < __a;
@@ -236,21 +236,21 @@ __mul_overflowed(_Tp __a, _Tp __b, _Tp& __r)
 }
 
 template <typename _Tp, typename _Up>
-inline _LIBCPP_HIDE_FROM_ABI bool
+inline _LIBCUDACXX_HIDE_FROM_ABI bool
 __mul_overflowed(_Tp __a, _Up __b, _Tp& __r)
 {
     return __mul_overflowed(__a, static_cast<_Tp>(__b), __r);
 }
 
 template <typename _Tp>
-struct _LIBCPP_HIDDEN __traits : __traits_base<_Tp>
+struct _LIBCUDACXX_HIDDEN __traits : __traits_base<_Tp>
 {
     static constexpr int digits = numeric_limits<_Tp>::digits10 + 1;
     using __traits_base<_Tp>::__pow;
     using typename __traits_base<_Tp>::type;
 
     // precondition: at least one non-zero character available
-    static _LIBCPP_HIDE_FROM_ABI char const*
+    static _LIBCUDACXX_HIDE_FROM_ABI char const*
     __read(char const* __p, char const* __ep, type& __a, type& __b)
     {
         type __cprod[digits];
@@ -271,7 +271,7 @@ struct _LIBCPP_HIDDEN __traits : __traits_base<_Tp>
     }
 
     template <typename _It1, typename _It2, class _Up>
-    static _LIBCPP_HIDE_FROM_ABI _Up
+    static _LIBCUDACXX_HIDE_FROM_ABI _Up
     __inner_product(_It1 __first1, _It1 __last1, _It2 __first2, _Up __init)
     {
         for (; __first1 < __last1; ++__first1, ++__first2)
@@ -283,7 +283,7 @@ struct _LIBCPP_HIDDEN __traits : __traits_base<_Tp>
 }  // namespace __itoa
 
 template <typename _Tp>
-inline _LIBCPP_HIDE_FROM_ABI _Tp
+inline _LIBCUDACXX_HIDE_FROM_ABI _Tp
 __complement(_Tp __x)
 {
     static_assert(is_unsigned<_Tp>::value, "cast to unsigned first");
@@ -291,7 +291,7 @@ __complement(_Tp __x)
 }
 
 template <typename _Tp>
-inline _LIBCPP_HIDE_FROM_ABI to_chars_result
+inline _LIBCUDACXX_HIDE_FROM_ABI to_chars_result
 __to_chars_itoa(char* __first, char* __last, _Tp __value, true_type)
 {
     auto __x = __to_unsigned_like(__value);
@@ -305,7 +305,7 @@ __to_chars_itoa(char* __first, char* __last, _Tp __value, true_type)
 }
 
 template <typename _Tp>
-inline _LIBCPP_HIDE_FROM_ABI to_chars_result
+inline _LIBCUDACXX_HIDE_FROM_ABI to_chars_result
 __to_chars_itoa(char* __first, char* __last, _Tp __value, false_type)
 {
     using __tx = __itoa::__traits<_Tp>;
@@ -317,9 +317,9 @@ __to_chars_itoa(char* __first, char* __last, _Tp __value, false_type)
         return {__last, errc::value_too_large};
 }
 
-#  ifndef _LIBCPP_HAS_NO_INT128
+#  ifndef _LIBCUDACXX_HAS_NO_INT128
 template <>
-inline _LIBCPP_HIDE_FROM_ABI to_chars_result
+inline _LIBCUDACXX_HIDE_FROM_ABI to_chars_result
 __to_chars_itoa(char* __first, char* __last, __uint128_t __value, false_type)
 {
     // When the value fits in 64-bits use the 64-bit code path. This reduces
@@ -340,7 +340,7 @@ __to_chars_itoa(char* __first, char* __last, __uint128_t __value, false_type)
 #endif
 
 template <typename _Tp>
-inline _LIBCPP_HIDE_FROM_ABI to_chars_result
+inline _LIBCUDACXX_HIDE_FROM_ABI to_chars_result
 __to_chars_integral(char* __first, char* __last, _Tp __value, int __base,
                     true_type)
 {
@@ -357,20 +357,20 @@ __to_chars_integral(char* __first, char* __last, _Tp __value, int __base,
 namespace __itoa {
 
 template <unsigned _Base>
-struct _LIBCPP_HIDDEN __integral;
+struct _LIBCUDACXX_HIDDEN __integral;
 
 template <>
-struct _LIBCPP_HIDDEN __integral<2> {
+struct _LIBCUDACXX_HIDDEN __integral<2> {
   template <typename _Tp>
-  _LIBCPP_HIDE_FROM_ABI static constexpr int __width(_Tp __value) noexcept {
+  _LIBCUDACXX_HIDE_FROM_ABI static constexpr int __width(_Tp __value) noexcept {
     // If value == 0 still need one digit. If the value != this has no
     // effect since the code scans for the most significant bit set. (Note
-    // that __libcpp_clz doesn't work for 0.)
-    return numeric_limits<_Tp>::digits - std::__libcpp_clz(__value | 1);
+    // that __LIBCUDACXX_clz doesn't work for 0.)
+    return numeric_limits<_Tp>::digits - std::__LIBCUDACXX_clz(__value | 1);
   }
 
   template <typename _Tp>
-  _LIBCPP_HIDE_FROM_ABI static to_chars_result __to_chars(char* __first, char* __last, _Tp __value) {
+  _LIBCUDACXX_HIDE_FROM_ABI static to_chars_result __to_chars(char* __first, char* __last, _Tp __value) {
     ptr
diff _t __cap = __last - __first;
     int __n = __width(__value);
     if (__n > __cap)
@@ -395,17 +395,17 @@ struct _LIBCPP_HIDDEN __integral<2> {
 };
 
 template <>
-struct _LIBCPP_HIDDEN __integral<8> {
+struct _LIBCUDACXX_HIDDEN __integral<8> {
   template <typename _Tp>
-  _LIBCPP_HIDE_FROM_ABI static constexpr int __width(_Tp __value) noexcept {
+  _LIBCUDACXX_HIDE_FROM_ABI static constexpr int __width(_Tp __value) noexcept {
     // If value == 0 still need one digit. If the value != this has no
     // effect since the code scans for the most significat bit set. (Note
-    // that __libcpp_clz doesn't work for 0.)
-    return ((numeric_limits<_Tp>::digits - std::__libcpp_clz(__value | 1)) + 2) / 3;
+    // that __LIBCUDACXX_clz doesn't work for 0.)
+    return ((numeric_limits<_Tp>::digits - std::__LIBCUDACXX_clz(__value | 1)) + 2) / 3;
   }
 
   template <typename _Tp>
-  _LIBCPP_HIDE_FROM_ABI static to_chars_result __to_chars(char* __first, char* __last, _Tp __value) {
+  _LIBCUDACXX_HIDE_FROM_ABI static to_chars_result __to_chars(char* __first, char* __last, _Tp __value) {
     ptr
diff _t __cap = __last - __first;
     int __n = __width(__value);
     if (__n > __cap)
@@ -431,17 +431,17 @@ struct _LIBCPP_HIDDEN __integral<8> {
 };
 
 template <>
-struct _LIBCPP_HIDDEN __integral<16> {
+struct _LIBCUDACXX_HIDDEN __integral<16> {
   template <typename _Tp>
-  _LIBCPP_HIDE_FROM_ABI static constexpr int __width(_Tp __value) noexcept {
+  _LIBCUDACXX_HIDE_FROM_ABI static constexpr int __width(_Tp __value) noexcept {
     // If value == 0 still need one digit. If the value != this has no
     // effect since the code scans for the most significat bit set. (Note
-    // that __libcpp_clz doesn't work for 0.)
-    return (numeric_limits<_Tp>::digits - std::__libcpp_clz(__value | 1) + 3) / 4;
+    // that __LIBCUDACXX_clz doesn't work for 0.)
+    return (numeric_limits<_Tp>::digits - std::__LIBCUDACXX_clz(__value | 1) + 3) / 4;
   }
 
   template <typename _Tp>
-  _LIBCPP_HIDE_FROM_ABI static to_chars_result __to_chars(char* __first, char* __last, _Tp __value) {
+  _LIBCUDACXX_HIDE_FROM_ABI static to_chars_result __to_chars(char* __first, char* __last, _Tp __value) {
     ptr
diff _t __cap = __last - __first;
     int __n = __width(__value);
     if (__n > __cap)
@@ -470,36 +470,36 @@ struct _LIBCPP_HIDDEN __integral<16> {
 
 template <unsigned _Base, typename _Tp,
           typename enable_if<(sizeof(_Tp) >= sizeof(unsigned)), int>::type = 0>
-_LIBCPP_HIDE_FROM_ABI int
+_LIBCUDACXX_HIDE_FROM_ABI int
 __to_chars_integral_width(_Tp __value) {
   return __itoa::__integral<_Base>::__width(__value);
 }
 
 template <unsigned _Base, typename _Tp,
           typename enable_if<(sizeof(_Tp) < sizeof(unsigned)), int>::type = 0>
-_LIBCPP_HIDE_FROM_ABI int
+_LIBCUDACXX_HIDE_FROM_ABI int
 __to_chars_integral_width(_Tp __value) {
   return std::__to_chars_integral_width<_Base>(static_cast<unsigned>(__value));
 }
 
 template <unsigned _Base, typename _Tp,
           typename enable_if<(sizeof(_Tp) >= sizeof(unsigned)), int>::type = 0>
-_LIBCPP_HIDE_FROM_ABI to_chars_result
+_LIBCUDACXX_HIDE_FROM_ABI to_chars_result
 __to_chars_integral(char* __first, char* __last, _Tp __value) {
   return __itoa::__integral<_Base>::__to_chars(__first, __last, __value);
 }
 
 template <unsigned _Base, typename _Tp,
           typename enable_if<(sizeof(_Tp) < sizeof(unsigned)), int>::type = 0>
-_LIBCPP_HIDE_FROM_ABI to_chars_result
+_LIBCUDACXX_HIDE_FROM_ABI to_chars_result
 __to_chars_integral(char* __first, char* __last, _Tp __value) {
   return std::__to_chars_integral<_Base>(__first, __last, static_cast<unsigned>(__value));
 }
 
 template <typename _Tp>
-_LIBCPP_HIDE_FROM_ABI int
+_LIBCUDACXX_HIDE_FROM_ABI int
 __to_chars_integral_width(_Tp __value, unsigned __base) {
-  _LIBCPP_ASSERT(__value >= 0, "The function requires a non-negative value.");
+  _LIBCUDACXX_ASSERT(__value >= 0, "The function requires a non-negative value.");
 
   unsigned __base_2 = __base * __base;
   unsigned __base_3 = __base_2 * __base;
@@ -520,11 +520,11 @@ __to_chars_integral_width(_Tp __value, unsigned __base) {
     __r += 4;
   }
 
-  __libcpp_unreachable();
+  __LIBCUDACXX_unreachable();
 }
 
 template <typename _Tp>
-inline _LIBCPP_HIDE_FROM_ABI to_chars_result
+inline _LIBCUDACXX_HIDE_FROM_ABI to_chars_result
 __to_chars_integral(char* __first, char* __last, _Tp __value, int __base,
                     false_type)
 {
@@ -556,7 +556,7 @@ __to_chars_integral(char* __first, char* __last, _Tp __value, int __base,
 }
 
 template <typename _Tp, typename enable_if<is_integral<_Tp>::value, int>::type = 0>
-inline _LIBCPP_HIDE_FROM_ABI to_chars_result
+inline _LIBCUDACXX_HIDE_FROM_ABI to_chars_result
 to_chars(char* __first, char* __last, _Tp __value)
 {
   using _Type = __make_32_64_or_128_bit_t<_Tp>;
@@ -565,17 +565,17 @@ to_chars(char* __first, char* __last, _Tp __value)
 }
 
 template <typename _Tp, typename enable_if<is_integral<_Tp>::value, int>::type = 0>
-inline _LIBCPP_HIDE_FROM_ABI to_chars_result
+inline _LIBCUDACXX_HIDE_FROM_ABI to_chars_result
 to_chars(char* __first, char* __last, _Tp __value, int __base)
 {
-  _LIBCPP_ASSERT(2 <= __base && __base <= 36, "base not in [2, 36]");
+  _LIBCUDACXX_ASSERT(2 <= __base && __base <= 36, "base not in [2, 36]");
 
   using _Type = __make_32_64_or_128_bit_t<_Tp>;
   return std::__to_chars_integral(__first, __last, static_cast<_Type>(__value), __base, is_signed<_Tp>());
 }
 
 template <typename _It, typename _Tp, typename _Fn, typename... _Ts>
-inline _LIBCPP_HIDE_FROM_ABI from_chars_result
+inline _LIBCUDACXX_HIDE_FROM_ABI from_chars_result
 __sign_combinator(_It __first, _It __last, _Tp& __value, _Fn __f, _Ts... __args)
 {
     using __tl = numeric_limits<_Tp>;
@@ -615,22 +615,22 @@ __sign_combinator(_It __first, _It __last, _Tp& __value, _Fn __f, _Ts... __args)
 }
 
 template <typename _Tp>
-inline _LIBCPP_HIDE_FROM_ABI bool
+inline _LIBCUDACXX_HIDE_FROM_ABI bool
 __in_pattern(_Tp __c)
 {
     return '0' <= __c && __c <= '9';
 }
 
-struct _LIBCPP_HIDDEN __in_pattern_result
+struct _LIBCUDACXX_HIDDEN __in_pattern_result
 {
     bool __ok;
     int __val;
 
-    explicit _LIBCPP_HIDE_FROM_ABI operator bool() const { return __ok; }
+    explicit _LIBCUDACXX_HIDE_FROM_ABI operator bool() const { return __ok; }
 };
 
 template <typename _Tp>
-inline _LIBCPP_HIDE_FROM_ABI __in_pattern_result
+inline _LIBCUDACXX_HIDE_FROM_ABI __in_pattern_result
 __in_pattern(_Tp __c, int __base)
 {
     if (__base <= 10)
@@ -644,7 +644,7 @@ __in_pattern(_Tp __c, int __base)
 }
 
 template <typename _It, typename _Tp, typename _Fn, typename... _Ts>
-inline _LIBCPP_HIDE_FROM_ABI from_chars_result
+inline _LIBCUDACXX_HIDE_FROM_ABI from_chars_result
 __subject_seq_combinator(_It __first, _It __last, _Tp& __value, _Fn __f,
                          _Ts... __args)
 {
@@ -681,7 +681,7 @@ __subject_seq_combinator(_It __first, _It __last, _Tp& __value, _Fn __f,
 }
 
 template <typename _Tp, typename enable_if<is_unsigned<_Tp>::value, int>::type = 0>
-inline _LIBCPP_HIDE_FROM_ABI from_chars_result
+inline _LIBCUDACXX_HIDE_FROM_ABI from_chars_result
 __from_chars_atoi(const char* __first, const char* __last, _Tp& __value)
 {
     using __tx = __itoa::__traits<_Tp>;
@@ -707,7 +707,7 @@ __from_chars_atoi(const char* __first, const char* __last, _Tp& __value)
 }
 
 template <typename _Tp, typename enable_if<is_signed<_Tp>::value, int>::type = 0>
-inline _LIBCPP_HIDE_FROM_ABI from_chars_result
+inline _LIBCUDACXX_HIDE_FROM_ABI from_chars_result
 __from_chars_atoi(const char* __first, const char* __last, _Tp& __value)
 {
     using __t = decltype(__to_unsigned_like(__value));
@@ -715,7 +715,7 @@ __from_chars_atoi(const char* __first, const char* __last, _Tp& __value)
 }
 
 template <typename _Tp, typename enable_if<is_unsigned<_Tp>::value, int>::type = 0>
-inline _LIBCPP_HIDE_FROM_ABI from_chars_result
+inline _LIBCUDACXX_HIDE_FROM_ABI from_chars_result
 __from_chars_integral(const char* __first, const char* __last, _Tp& __value,
                       int __base)
 {
@@ -762,7 +762,7 @@ __from_chars_integral(const char* __first, const char* __last, _Tp& __value,
 }
 
 template <typename _Tp, typename enable_if<is_signed<_Tp>::value, int>::type = 0>
-inline _LIBCPP_HIDE_FROM_ABI from_chars_result
+inline _LIBCUDACXX_HIDE_FROM_ABI from_chars_result
 __from_chars_integral(const char* __first, const char* __last, _Tp& __value,
                       int __base)
 {
@@ -772,56 +772,56 @@ __from_chars_integral(const char* __first, const char* __last, _Tp& __value,
 }
 
 template <typename _Tp, typename enable_if<is_integral<_Tp>::value, int>::type = 0>
-inline _LIBCPP_HIDE_FROM_ABI from_chars_result
+inline _LIBCUDACXX_HIDE_FROM_ABI from_chars_result
 from_chars(const char* __first, const char* __last, _Tp& __value)
 {
     return __from_chars_atoi(__first, __last, __value);
 }
 
 template <typename _Tp, typename enable_if<is_integral<_Tp>::value, int>::type = 0>
-inline _LIBCPP_HIDE_FROM_ABI from_chars_result
+inline _LIBCUDACXX_HIDE_FROM_ABI from_chars_result
 from_chars(const char* __first, const char* __last, _Tp& __value, int __base)
 {
-    _LIBCPP_ASSERT(2 <= __base && __base <= 36, "base not in [2, 36]");
+    _LIBCUDACXX_ASSERT(2 <= __base && __base <= 36, "base not in [2, 36]");
     return __from_chars_integral(__first, __last, __value, __base);
 }
 
 // Floating-point implementation starts here.
 // Unlike the other parts of charconv this is only available in C++17 and newer.
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 
-_LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_FUNC_VIS
+_LIBCUDACXX_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCUDACXX_FUNC_VIS
 to_chars_result to_chars(char* __first, char* __last, float __value);
 
-_LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_FUNC_VIS
+_LIBCUDACXX_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCUDACXX_FUNC_VIS
 to_chars_result to_chars(char* __first, char* __last, double __value);
 
-_LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_FUNC_VIS
+_LIBCUDACXX_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCUDACXX_FUNC_VIS
 to_chars_result to_chars(char* __first, char* __last, long double __value);
 
-_LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_FUNC_VIS
+_LIBCUDACXX_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCUDACXX_FUNC_VIS
 to_chars_result to_chars(char* __first, char* __last, float __value, chars_format __fmt);
 
-_LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_FUNC_VIS
+_LIBCUDACXX_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCUDACXX_FUNC_VIS
 to_chars_result to_chars(char* __first, char* __last, double __value, chars_format __fmt);
 
-_LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_FUNC_VIS
+_LIBCUDACXX_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCUDACXX_FUNC_VIS
 to_chars_result to_chars(char* __first, char* __last, long double __value, chars_format __fmt);
 
-_LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_FUNC_VIS
+_LIBCUDACXX_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCUDACXX_FUNC_VIS
 to_chars_result to_chars(char* __first, char* __last, float __value, chars_format __fmt, int __precision);
 
-_LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_FUNC_VIS
+_LIBCUDACXX_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCUDACXX_FUNC_VIS
 to_chars_result to_chars(char* __first, char* __last, double __value, chars_format __fmt, int __precision);
 
-_LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_FUNC_VIS
+_LIBCUDACXX_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCUDACXX_FUNC_VIS
 to_chars_result to_chars(char* __first, char* __last, long double __value, chars_format __fmt, int __precision);
 
-#  endif // _LIBCPP_STD_VER > 14
-#endif // _LIBCPP_CXX03_LANG
+#  endif // _LIBCUDACXX_STD_VER > 14
+#endif // _LIBCUDACXX_CXX03_LANG
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP_CHARCONV
+#endif // _LIBCUDACXX_CHARCONV

diff  --git a/libcxx/include/chrono b/libcxx/include/chrono
index 2af5fbcc5165..fef84abce769 100644
--- a/libcxx/include/chrono
+++ b/libcxx/include/chrono
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_CHRONO
-#define _LIBCPP_CHRONO
+#ifndef _LIBCUDACXX_CHRONO
+#define _LIBCUDACXX_CHRONO
 
 /*
     chrono synopsis
@@ -718,8 +718,8 @@ constexpr chrono::year                                  operator ""y(unsigned lo
 // standard-mandated includes
 #include <compare>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#endif // _LIBCPP_CHRONO
+#endif // _LIBCUDACXX_CHRONO

diff  --git a/libcxx/include/cinttypes b/libcxx/include/cinttypes
index a4cfe961cc55..aa646257314d 100644
--- a/libcxx/include/cinttypes
+++ b/libcxx/include/cinttypes
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_CINTTYPES
-#define _LIBCPP_CINTTYPES
+#ifndef _LIBCUDACXX_CINTTYPES
+#define _LIBCUDACXX_CINTTYPES
 
 /*
     cinttypes synopsis
@@ -239,20 +239,20 @@ uintmax_t wcstoumax(const wchar_t* restrict nptr, wchar_t** restrict endptr, int
 #include <cstdint>
 #include <inttypes.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-using ::imaxdiv_t _LIBCPP_USING_IF_EXISTS;
-using ::imaxabs _LIBCPP_USING_IF_EXISTS;
-using ::imaxdiv _LIBCPP_USING_IF_EXISTS;
-using ::strtoimax _LIBCPP_USING_IF_EXISTS;
-using ::strtoumax _LIBCPP_USING_IF_EXISTS;
-using ::wcstoimax _LIBCPP_USING_IF_EXISTS;
-using ::wcstoumax _LIBCPP_USING_IF_EXISTS;
+using ::imaxdiv_t _LIBCUDACXX_USING_IF_EXISTS;
+using ::imaxabs _LIBCUDACXX_USING_IF_EXISTS;
+using ::imaxdiv _LIBCUDACXX_USING_IF_EXISTS;
+using ::strtoimax _LIBCUDACXX_USING_IF_EXISTS;
+using ::strtoumax _LIBCUDACXX_USING_IF_EXISTS;
+using ::wcstoimax _LIBCUDACXX_USING_IF_EXISTS;
+using ::wcstoumax _LIBCUDACXX_USING_IF_EXISTS;
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_CINTTYPES
+#endif // _LIBCUDACXX_CINTTYPES

diff  --git a/libcxx/include/ciso646 b/libcxx/include/ciso646
index e0cd722495ed..cccae3dbac8f 100644
--- a/libcxx/include/ciso646
+++ b/libcxx/include/ciso646
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_CISO646
-#define _LIBCPP_CISO646
+#ifndef _LIBCUDACXX_CISO646
+#define _LIBCUDACXX_CISO646
 
 /*
     ciso646 synopsis
@@ -18,8 +18,8 @@
 #include <__assert> // all public C++ headers provide the assertion handler
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#endif // _LIBCPP_CISO646
+#endif // _LIBCUDACXX_CISO646

diff  --git a/libcxx/include/climits b/libcxx/include/climits
index 16800a652f6d..874293658509 100644
--- a/libcxx/include/climits
+++ b/libcxx/include/climits
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_CLIMITS
-#define _LIBCPP_CLIMITS
+#ifndef _LIBCUDACXX_CLIMITS
+#define _LIBCUDACXX_CLIMITS
 
 /*
     climits synopsis
@@ -41,8 +41,8 @@ Macros:
 #include <__config>
 #include <limits.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#endif // _LIBCPP_CLIMITS
+#endif // _LIBCUDACXX_CLIMITS

diff  --git a/libcxx/include/clocale b/libcxx/include/clocale
index 892604207532..8783085dc110 100644
--- a/libcxx/include/clocale
+++ b/libcxx/include/clocale
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_CLOCALE
-#define _LIBCPP_CLOCALE
+#ifndef _LIBCUDACXX_CLOCALE
+#define _LIBCUDACXX_CLOCALE
 
 /*
     clocale synopsis
@@ -38,16 +38,16 @@ lconv* localeconv();
 #include <__config>
 #include <locale.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-using ::lconv _LIBCPP_USING_IF_EXISTS;
-using ::setlocale _LIBCPP_USING_IF_EXISTS;
-using ::localeconv _LIBCPP_USING_IF_EXISTS;
+using ::lconv _LIBCUDACXX_USING_IF_EXISTS;
+using ::setlocale _LIBCUDACXX_USING_IF_EXISTS;
+using ::localeconv _LIBCUDACXX_USING_IF_EXISTS;
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_CLOCALE
+#endif // _LIBCUDACXX_CLOCALE

diff  --git a/libcxx/include/cmath b/libcxx/include/cmath
index 4d81eed339d8..1d091afa653f 100644
--- a/libcxx/include/cmath
+++ b/libcxx/include/cmath
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_CMATH
-#define _LIBCPP_CMATH
+#ifndef _LIBCUDACXX_CMATH
+#define _LIBCUDACXX_CMATH
 
 /*
     cmath synopsis
@@ -310,232 +310,232 @@ constexpr long double lerp(long double a, long double b, long double t) noexcept
 #include <type_traits>
 #include <version>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-using ::signbit _LIBCPP_USING_IF_EXISTS;
-using ::fpclassify _LIBCPP_USING_IF_EXISTS;
-using ::isfinite _LIBCPP_USING_IF_EXISTS;
-using ::isinf _LIBCPP_USING_IF_EXISTS;
-using ::isnan _LIBCPP_USING_IF_EXISTS;
-using ::isnormal _LIBCPP_USING_IF_EXISTS;
-using ::isgreater _LIBCPP_USING_IF_EXISTS;
-using ::isgreaterequal _LIBCPP_USING_IF_EXISTS;
-using ::isless _LIBCPP_USING_IF_EXISTS;
-using ::islessequal _LIBCPP_USING_IF_EXISTS;
-using ::islessgreater _LIBCPP_USING_IF_EXISTS;
-using ::isunordered _LIBCPP_USING_IF_EXISTS;
-using ::isunordered _LIBCPP_USING_IF_EXISTS;
-
-using ::float_t _LIBCPP_USING_IF_EXISTS;
-using ::double_t _LIBCPP_USING_IF_EXISTS;
-
-using ::abs _LIBCPP_USING_IF_EXISTS;
-
-using ::acos _LIBCPP_USING_IF_EXISTS;
-using ::acosf _LIBCPP_USING_IF_EXISTS;
-using ::asin _LIBCPP_USING_IF_EXISTS;
-using ::asinf _LIBCPP_USING_IF_EXISTS;
-using ::atan _LIBCPP_USING_IF_EXISTS;
-using ::atanf _LIBCPP_USING_IF_EXISTS;
-using ::atan2 _LIBCPP_USING_IF_EXISTS;
-using ::atan2f _LIBCPP_USING_IF_EXISTS;
-using ::ceil _LIBCPP_USING_IF_EXISTS;
-using ::ceilf _LIBCPP_USING_IF_EXISTS;
-using ::cos _LIBCPP_USING_IF_EXISTS;
-using ::cosf _LIBCPP_USING_IF_EXISTS;
-using ::cosh _LIBCPP_USING_IF_EXISTS;
-using ::coshf _LIBCPP_USING_IF_EXISTS;
-
-using ::exp _LIBCPP_USING_IF_EXISTS;
-using ::expf _LIBCPP_USING_IF_EXISTS;
-
-using ::fabs _LIBCPP_USING_IF_EXISTS;
-using ::fabsf _LIBCPP_USING_IF_EXISTS;
-using ::floor _LIBCPP_USING_IF_EXISTS;
-using ::floorf _LIBCPP_USING_IF_EXISTS;
-
-using ::fmod _LIBCPP_USING_IF_EXISTS;
-using ::fmodf _LIBCPP_USING_IF_EXISTS;
-
-using ::frexp _LIBCPP_USING_IF_EXISTS;
-using ::frexpf _LIBCPP_USING_IF_EXISTS;
-using ::ldexp _LIBCPP_USING_IF_EXISTS;
-using ::ldexpf _LIBCPP_USING_IF_EXISTS;
-
-using ::log _LIBCPP_USING_IF_EXISTS;
-using ::logf _LIBCPP_USING_IF_EXISTS;
-
-using ::log10 _LIBCPP_USING_IF_EXISTS;
-using ::log10f _LIBCPP_USING_IF_EXISTS;
-using ::modf _LIBCPP_USING_IF_EXISTS;
-using ::modff _LIBCPP_USING_IF_EXISTS;
-
-using ::pow _LIBCPP_USING_IF_EXISTS;
-using ::powf _LIBCPP_USING_IF_EXISTS;
-
-using ::sin _LIBCPP_USING_IF_EXISTS;
-using ::sinf _LIBCPP_USING_IF_EXISTS;
-using ::sinh _LIBCPP_USING_IF_EXISTS;
-using ::sinhf _LIBCPP_USING_IF_EXISTS;
-
-using ::sqrt _LIBCPP_USING_IF_EXISTS;
-using ::sqrtf _LIBCPP_USING_IF_EXISTS;
-using ::tan _LIBCPP_USING_IF_EXISTS;
-using ::tanf _LIBCPP_USING_IF_EXISTS;
-
-using ::tanh _LIBCPP_USING_IF_EXISTS;
-using ::tanhf _LIBCPP_USING_IF_EXISTS;
-
-using ::acosh _LIBCPP_USING_IF_EXISTS;
-using ::acoshf _LIBCPP_USING_IF_EXISTS;
-using ::asinh _LIBCPP_USING_IF_EXISTS;
-using ::asinhf _LIBCPP_USING_IF_EXISTS;
-using ::atanh _LIBCPP_USING_IF_EXISTS;
-using ::atanhf _LIBCPP_USING_IF_EXISTS;
-using ::cbrt _LIBCPP_USING_IF_EXISTS;
-using ::cbrtf _LIBCPP_USING_IF_EXISTS;
-
-using ::copysign _LIBCPP_USING_IF_EXISTS;
-using ::copysignf _LIBCPP_USING_IF_EXISTS;
-
-using ::erf _LIBCPP_USING_IF_EXISTS;
-using ::erff _LIBCPP_USING_IF_EXISTS;
-using ::erfc _LIBCPP_USING_IF_EXISTS;
-using ::erfcf _LIBCPP_USING_IF_EXISTS;
-using ::exp2 _LIBCPP_USING_IF_EXISTS;
-using ::exp2f _LIBCPP_USING_IF_EXISTS;
-using ::expm1 _LIBCPP_USING_IF_EXISTS;
-using ::expm1f _LIBCPP_USING_IF_EXISTS;
-using ::fdim _LIBCPP_USING_IF_EXISTS;
-using ::fdimf _LIBCPP_USING_IF_EXISTS;
-using ::fmaf _LIBCPP_USING_IF_EXISTS;
-using ::fma _LIBCPP_USING_IF_EXISTS;
-using ::fmax _LIBCPP_USING_IF_EXISTS;
-using ::fmaxf _LIBCPP_USING_IF_EXISTS;
-using ::fmin _LIBCPP_USING_IF_EXISTS;
-using ::fminf _LIBCPP_USING_IF_EXISTS;
-using ::hypot _LIBCPP_USING_IF_EXISTS;
-using ::hypotf _LIBCPP_USING_IF_EXISTS;
-using ::ilogb _LIBCPP_USING_IF_EXISTS;
-using ::ilogbf _LIBCPP_USING_IF_EXISTS;
-using ::lgamma _LIBCPP_USING_IF_EXISTS;
-using ::lgammaf _LIBCPP_USING_IF_EXISTS;
-using ::llrint _LIBCPP_USING_IF_EXISTS;
-using ::llrintf _LIBCPP_USING_IF_EXISTS;
-using ::llround _LIBCPP_USING_IF_EXISTS;
-using ::llroundf _LIBCPP_USING_IF_EXISTS;
-using ::log1p _LIBCPP_USING_IF_EXISTS;
-using ::log1pf _LIBCPP_USING_IF_EXISTS;
-using ::log2 _LIBCPP_USING_IF_EXISTS;
-using ::log2f _LIBCPP_USING_IF_EXISTS;
-using ::logb _LIBCPP_USING_IF_EXISTS;
-using ::logbf _LIBCPP_USING_IF_EXISTS;
-using ::lrint _LIBCPP_USING_IF_EXISTS;
-using ::lrintf _LIBCPP_USING_IF_EXISTS;
-using ::lround _LIBCPP_USING_IF_EXISTS;
-using ::lroundf _LIBCPP_USING_IF_EXISTS;
-
-using ::nan _LIBCPP_USING_IF_EXISTS;
-using ::nanf _LIBCPP_USING_IF_EXISTS;
-
-using ::nearbyint _LIBCPP_USING_IF_EXISTS;
-using ::nearbyintf _LIBCPP_USING_IF_EXISTS;
-using ::nextafter _LIBCPP_USING_IF_EXISTS;
-using ::nextafterf _LIBCPP_USING_IF_EXISTS;
-using ::nexttoward _LIBCPP_USING_IF_EXISTS;
-using ::nexttowardf _LIBCPP_USING_IF_EXISTS;
-using ::remainder _LIBCPP_USING_IF_EXISTS;
-using ::remainderf _LIBCPP_USING_IF_EXISTS;
-using ::remquo _LIBCPP_USING_IF_EXISTS;
-using ::remquof _LIBCPP_USING_IF_EXISTS;
-using ::rint _LIBCPP_USING_IF_EXISTS;
-using ::rintf _LIBCPP_USING_IF_EXISTS;
-using ::round _LIBCPP_USING_IF_EXISTS;
-using ::roundf _LIBCPP_USING_IF_EXISTS;
-using ::scalbln _LIBCPP_USING_IF_EXISTS;
-using ::scalblnf _LIBCPP_USING_IF_EXISTS;
-using ::scalbn _LIBCPP_USING_IF_EXISTS;
-using ::scalbnf _LIBCPP_USING_IF_EXISTS;
-using ::tgamma _LIBCPP_USING_IF_EXISTS;
-using ::tgammaf _LIBCPP_USING_IF_EXISTS;
-using ::trunc _LIBCPP_USING_IF_EXISTS;
-using ::truncf _LIBCPP_USING_IF_EXISTS;
-
-using ::acosl _LIBCPP_USING_IF_EXISTS;
-using ::asinl _LIBCPP_USING_IF_EXISTS;
-using ::atanl _LIBCPP_USING_IF_EXISTS;
-using ::atan2l _LIBCPP_USING_IF_EXISTS;
-using ::ceill _LIBCPP_USING_IF_EXISTS;
-using ::cosl _LIBCPP_USING_IF_EXISTS;
-using ::coshl _LIBCPP_USING_IF_EXISTS;
-using ::expl _LIBCPP_USING_IF_EXISTS;
-using ::fabsl _LIBCPP_USING_IF_EXISTS;
-using ::floorl _LIBCPP_USING_IF_EXISTS;
-using ::fmodl _LIBCPP_USING_IF_EXISTS;
-using ::frexpl _LIBCPP_USING_IF_EXISTS;
-using ::ldexpl _LIBCPP_USING_IF_EXISTS;
-using ::logl _LIBCPP_USING_IF_EXISTS;
-using ::log10l _LIBCPP_USING_IF_EXISTS;
-using ::modfl _LIBCPP_USING_IF_EXISTS;
-using ::powl _LIBCPP_USING_IF_EXISTS;
-using ::sinl _LIBCPP_USING_IF_EXISTS;
-using ::sinhl _LIBCPP_USING_IF_EXISTS;
-using ::sqrtl _LIBCPP_USING_IF_EXISTS;
-using ::tanl _LIBCPP_USING_IF_EXISTS;
-
-using ::tanhl _LIBCPP_USING_IF_EXISTS;
-using ::acoshl _LIBCPP_USING_IF_EXISTS;
-using ::asinhl _LIBCPP_USING_IF_EXISTS;
-using ::atanhl _LIBCPP_USING_IF_EXISTS;
-using ::cbrtl _LIBCPP_USING_IF_EXISTS;
-
-using ::copysignl _LIBCPP_USING_IF_EXISTS;
-
-using ::erfl _LIBCPP_USING_IF_EXISTS;
-using ::erfcl _LIBCPP_USING_IF_EXISTS;
-using ::exp2l _LIBCPP_USING_IF_EXISTS;
-using ::expm1l _LIBCPP_USING_IF_EXISTS;
-using ::fdiml _LIBCPP_USING_IF_EXISTS;
-using ::fmal _LIBCPP_USING_IF_EXISTS;
-using ::fmaxl _LIBCPP_USING_IF_EXISTS;
-using ::fminl _LIBCPP_USING_IF_EXISTS;
-using ::hypotl _LIBCPP_USING_IF_EXISTS;
-using ::ilogbl _LIBCPP_USING_IF_EXISTS;
-using ::lgammal _LIBCPP_USING_IF_EXISTS;
-using ::llrintl _LIBCPP_USING_IF_EXISTS;
-using ::llroundl _LIBCPP_USING_IF_EXISTS;
-using ::log1pl _LIBCPP_USING_IF_EXISTS;
-using ::log2l _LIBCPP_USING_IF_EXISTS;
-using ::logbl _LIBCPP_USING_IF_EXISTS;
-using ::lrintl _LIBCPP_USING_IF_EXISTS;
-using ::lroundl _LIBCPP_USING_IF_EXISTS;
-using ::nanl _LIBCPP_USING_IF_EXISTS;
-using ::nearbyintl _LIBCPP_USING_IF_EXISTS;
-using ::nextafterl _LIBCPP_USING_IF_EXISTS;
-using ::nexttowardl _LIBCPP_USING_IF_EXISTS;
-using ::remainderl _LIBCPP_USING_IF_EXISTS;
-using ::remquol _LIBCPP_USING_IF_EXISTS;
-using ::rintl _LIBCPP_USING_IF_EXISTS;
-using ::roundl _LIBCPP_USING_IF_EXISTS;
-using ::scalblnl _LIBCPP_USING_IF_EXISTS;
-using ::scalbnl _LIBCPP_USING_IF_EXISTS;
-using ::tgammal _LIBCPP_USING_IF_EXISTS;
-using ::truncl _LIBCPP_USING_IF_EXISTS;
-
-#if _LIBCPP_STD_VER > 14
-inline _LIBCPP_INLINE_VISIBILITY float       hypot(       float __x,       float __y,       float __z ) { return sqrt(__x*__x + __y*__y + __z*__z); }
-inline _LIBCPP_INLINE_VISIBILITY double      hypot(      double __x,      double __y,      double __z ) { return sqrt(__x*__x + __y*__y + __z*__z); }
-inline _LIBCPP_INLINE_VISIBILITY long double hypot( long double __x, long double __y, long double __z ) { return sqrt(__x*__x + __y*__y + __z*__z); }
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
+
+using ::signbit _LIBCUDACXX_USING_IF_EXISTS;
+using ::fpclassify _LIBCUDACXX_USING_IF_EXISTS;
+using ::isfinite _LIBCUDACXX_USING_IF_EXISTS;
+using ::isinf _LIBCUDACXX_USING_IF_EXISTS;
+using ::isnan _LIBCUDACXX_USING_IF_EXISTS;
+using ::isnormal _LIBCUDACXX_USING_IF_EXISTS;
+using ::isgreater _LIBCUDACXX_USING_IF_EXISTS;
+using ::isgreaterequal _LIBCUDACXX_USING_IF_EXISTS;
+using ::isless _LIBCUDACXX_USING_IF_EXISTS;
+using ::islessequal _LIBCUDACXX_USING_IF_EXISTS;
+using ::islessgreater _LIBCUDACXX_USING_IF_EXISTS;
+using ::isunordered _LIBCUDACXX_USING_IF_EXISTS;
+using ::isunordered _LIBCUDACXX_USING_IF_EXISTS;
+
+using ::float_t _LIBCUDACXX_USING_IF_EXISTS;
+using ::double_t _LIBCUDACXX_USING_IF_EXISTS;
+
+using ::abs _LIBCUDACXX_USING_IF_EXISTS;
+
+using ::acos _LIBCUDACXX_USING_IF_EXISTS;
+using ::acosf _LIBCUDACXX_USING_IF_EXISTS;
+using ::asin _LIBCUDACXX_USING_IF_EXISTS;
+using ::asinf _LIBCUDACXX_USING_IF_EXISTS;
+using ::atan _LIBCUDACXX_USING_IF_EXISTS;
+using ::atanf _LIBCUDACXX_USING_IF_EXISTS;
+using ::atan2 _LIBCUDACXX_USING_IF_EXISTS;
+using ::atan2f _LIBCUDACXX_USING_IF_EXISTS;
+using ::ceil _LIBCUDACXX_USING_IF_EXISTS;
+using ::ceilf _LIBCUDACXX_USING_IF_EXISTS;
+using ::cos _LIBCUDACXX_USING_IF_EXISTS;
+using ::cosf _LIBCUDACXX_USING_IF_EXISTS;
+using ::cosh _LIBCUDACXX_USING_IF_EXISTS;
+using ::coshf _LIBCUDACXX_USING_IF_EXISTS;
+
+using ::exp _LIBCUDACXX_USING_IF_EXISTS;
+using ::expf _LIBCUDACXX_USING_IF_EXISTS;
+
+using ::fabs _LIBCUDACXX_USING_IF_EXISTS;
+using ::fabsf _LIBCUDACXX_USING_IF_EXISTS;
+using ::floor _LIBCUDACXX_USING_IF_EXISTS;
+using ::floorf _LIBCUDACXX_USING_IF_EXISTS;
+
+using ::fmod _LIBCUDACXX_USING_IF_EXISTS;
+using ::fmodf _LIBCUDACXX_USING_IF_EXISTS;
+
+using ::frexp _LIBCUDACXX_USING_IF_EXISTS;
+using ::frexpf _LIBCUDACXX_USING_IF_EXISTS;
+using ::ldexp _LIBCUDACXX_USING_IF_EXISTS;
+using ::ldexpf _LIBCUDACXX_USING_IF_EXISTS;
+
+using ::log _LIBCUDACXX_USING_IF_EXISTS;
+using ::logf _LIBCUDACXX_USING_IF_EXISTS;
+
+using ::log10 _LIBCUDACXX_USING_IF_EXISTS;
+using ::log10f _LIBCUDACXX_USING_IF_EXISTS;
+using ::modf _LIBCUDACXX_USING_IF_EXISTS;
+using ::modff _LIBCUDACXX_USING_IF_EXISTS;
+
+using ::pow _LIBCUDACXX_USING_IF_EXISTS;
+using ::powf _LIBCUDACXX_USING_IF_EXISTS;
+
+using ::sin _LIBCUDACXX_USING_IF_EXISTS;
+using ::sinf _LIBCUDACXX_USING_IF_EXISTS;
+using ::sinh _LIBCUDACXX_USING_IF_EXISTS;
+using ::sinhf _LIBCUDACXX_USING_IF_EXISTS;
+
+using ::sqrt _LIBCUDACXX_USING_IF_EXISTS;
+using ::sqrtf _LIBCUDACXX_USING_IF_EXISTS;
+using ::tan _LIBCUDACXX_USING_IF_EXISTS;
+using ::tanf _LIBCUDACXX_USING_IF_EXISTS;
+
+using ::tanh _LIBCUDACXX_USING_IF_EXISTS;
+using ::tanhf _LIBCUDACXX_USING_IF_EXISTS;
+
+using ::acosh _LIBCUDACXX_USING_IF_EXISTS;
+using ::acoshf _LIBCUDACXX_USING_IF_EXISTS;
+using ::asinh _LIBCUDACXX_USING_IF_EXISTS;
+using ::asinhf _LIBCUDACXX_USING_IF_EXISTS;
+using ::atanh _LIBCUDACXX_USING_IF_EXISTS;
+using ::atanhf _LIBCUDACXX_USING_IF_EXISTS;
+using ::cbrt _LIBCUDACXX_USING_IF_EXISTS;
+using ::cbrtf _LIBCUDACXX_USING_IF_EXISTS;
+
+using ::copysign _LIBCUDACXX_USING_IF_EXISTS;
+using ::copysignf _LIBCUDACXX_USING_IF_EXISTS;
+
+using ::erf _LIBCUDACXX_USING_IF_EXISTS;
+using ::erff _LIBCUDACXX_USING_IF_EXISTS;
+using ::erfc _LIBCUDACXX_USING_IF_EXISTS;
+using ::erfcf _LIBCUDACXX_USING_IF_EXISTS;
+using ::exp2 _LIBCUDACXX_USING_IF_EXISTS;
+using ::exp2f _LIBCUDACXX_USING_IF_EXISTS;
+using ::expm1 _LIBCUDACXX_USING_IF_EXISTS;
+using ::expm1f _LIBCUDACXX_USING_IF_EXISTS;
+using ::fdim _LIBCUDACXX_USING_IF_EXISTS;
+using ::fdimf _LIBCUDACXX_USING_IF_EXISTS;
+using ::fmaf _LIBCUDACXX_USING_IF_EXISTS;
+using ::fma _LIBCUDACXX_USING_IF_EXISTS;
+using ::fmax _LIBCUDACXX_USING_IF_EXISTS;
+using ::fmaxf _LIBCUDACXX_USING_IF_EXISTS;
+using ::fmin _LIBCUDACXX_USING_IF_EXISTS;
+using ::fminf _LIBCUDACXX_USING_IF_EXISTS;
+using ::hypot _LIBCUDACXX_USING_IF_EXISTS;
+using ::hypotf _LIBCUDACXX_USING_IF_EXISTS;
+using ::ilogb _LIBCUDACXX_USING_IF_EXISTS;
+using ::ilogbf _LIBCUDACXX_USING_IF_EXISTS;
+using ::lgamma _LIBCUDACXX_USING_IF_EXISTS;
+using ::lgammaf _LIBCUDACXX_USING_IF_EXISTS;
+using ::llrint _LIBCUDACXX_USING_IF_EXISTS;
+using ::llrintf _LIBCUDACXX_USING_IF_EXISTS;
+using ::llround _LIBCUDACXX_USING_IF_EXISTS;
+using ::llroundf _LIBCUDACXX_USING_IF_EXISTS;
+using ::log1p _LIBCUDACXX_USING_IF_EXISTS;
+using ::log1pf _LIBCUDACXX_USING_IF_EXISTS;
+using ::log2 _LIBCUDACXX_USING_IF_EXISTS;
+using ::log2f _LIBCUDACXX_USING_IF_EXISTS;
+using ::logb _LIBCUDACXX_USING_IF_EXISTS;
+using ::logbf _LIBCUDACXX_USING_IF_EXISTS;
+using ::lrint _LIBCUDACXX_USING_IF_EXISTS;
+using ::lrintf _LIBCUDACXX_USING_IF_EXISTS;
+using ::lround _LIBCUDACXX_USING_IF_EXISTS;
+using ::lroundf _LIBCUDACXX_USING_IF_EXISTS;
+
+using ::nan _LIBCUDACXX_USING_IF_EXISTS;
+using ::nanf _LIBCUDACXX_USING_IF_EXISTS;
+
+using ::nearbyint _LIBCUDACXX_USING_IF_EXISTS;
+using ::nearbyintf _LIBCUDACXX_USING_IF_EXISTS;
+using ::nextafter _LIBCUDACXX_USING_IF_EXISTS;
+using ::nextafterf _LIBCUDACXX_USING_IF_EXISTS;
+using ::nexttoward _LIBCUDACXX_USING_IF_EXISTS;
+using ::nexttowardf _LIBCUDACXX_USING_IF_EXISTS;
+using ::remainder _LIBCUDACXX_USING_IF_EXISTS;
+using ::remainderf _LIBCUDACXX_USING_IF_EXISTS;
+using ::remquo _LIBCUDACXX_USING_IF_EXISTS;
+using ::remquof _LIBCUDACXX_USING_IF_EXISTS;
+using ::rint _LIBCUDACXX_USING_IF_EXISTS;
+using ::rintf _LIBCUDACXX_USING_IF_EXISTS;
+using ::round _LIBCUDACXX_USING_IF_EXISTS;
+using ::roundf _LIBCUDACXX_USING_IF_EXISTS;
+using ::scalbln _LIBCUDACXX_USING_IF_EXISTS;
+using ::scalblnf _LIBCUDACXX_USING_IF_EXISTS;
+using ::scalbn _LIBCUDACXX_USING_IF_EXISTS;
+using ::scalbnf _LIBCUDACXX_USING_IF_EXISTS;
+using ::tgamma _LIBCUDACXX_USING_IF_EXISTS;
+using ::tgammaf _LIBCUDACXX_USING_IF_EXISTS;
+using ::trunc _LIBCUDACXX_USING_IF_EXISTS;
+using ::truncf _LIBCUDACXX_USING_IF_EXISTS;
+
+using ::acosl _LIBCUDACXX_USING_IF_EXISTS;
+using ::asinl _LIBCUDACXX_USING_IF_EXISTS;
+using ::atanl _LIBCUDACXX_USING_IF_EXISTS;
+using ::atan2l _LIBCUDACXX_USING_IF_EXISTS;
+using ::ceill _LIBCUDACXX_USING_IF_EXISTS;
+using ::cosl _LIBCUDACXX_USING_IF_EXISTS;
+using ::coshl _LIBCUDACXX_USING_IF_EXISTS;
+using ::expl _LIBCUDACXX_USING_IF_EXISTS;
+using ::fabsl _LIBCUDACXX_USING_IF_EXISTS;
+using ::floorl _LIBCUDACXX_USING_IF_EXISTS;
+using ::fmodl _LIBCUDACXX_USING_IF_EXISTS;
+using ::frexpl _LIBCUDACXX_USING_IF_EXISTS;
+using ::ldexpl _LIBCUDACXX_USING_IF_EXISTS;
+using ::logl _LIBCUDACXX_USING_IF_EXISTS;
+using ::log10l _LIBCUDACXX_USING_IF_EXISTS;
+using ::modfl _LIBCUDACXX_USING_IF_EXISTS;
+using ::powl _LIBCUDACXX_USING_IF_EXISTS;
+using ::sinl _LIBCUDACXX_USING_IF_EXISTS;
+using ::sinhl _LIBCUDACXX_USING_IF_EXISTS;
+using ::sqrtl _LIBCUDACXX_USING_IF_EXISTS;
+using ::tanl _LIBCUDACXX_USING_IF_EXISTS;
+
+using ::tanhl _LIBCUDACXX_USING_IF_EXISTS;
+using ::acoshl _LIBCUDACXX_USING_IF_EXISTS;
+using ::asinhl _LIBCUDACXX_USING_IF_EXISTS;
+using ::atanhl _LIBCUDACXX_USING_IF_EXISTS;
+using ::cbrtl _LIBCUDACXX_USING_IF_EXISTS;
+
+using ::copysignl _LIBCUDACXX_USING_IF_EXISTS;
+
+using ::erfl _LIBCUDACXX_USING_IF_EXISTS;
+using ::erfcl _LIBCUDACXX_USING_IF_EXISTS;
+using ::exp2l _LIBCUDACXX_USING_IF_EXISTS;
+using ::expm1l _LIBCUDACXX_USING_IF_EXISTS;
+using ::fdiml _LIBCUDACXX_USING_IF_EXISTS;
+using ::fmal _LIBCUDACXX_USING_IF_EXISTS;
+using ::fmaxl _LIBCUDACXX_USING_IF_EXISTS;
+using ::fminl _LIBCUDACXX_USING_IF_EXISTS;
+using ::hypotl _LIBCUDACXX_USING_IF_EXISTS;
+using ::ilogbl _LIBCUDACXX_USING_IF_EXISTS;
+using ::lgammal _LIBCUDACXX_USING_IF_EXISTS;
+using ::llrintl _LIBCUDACXX_USING_IF_EXISTS;
+using ::llroundl _LIBCUDACXX_USING_IF_EXISTS;
+using ::log1pl _LIBCUDACXX_USING_IF_EXISTS;
+using ::log2l _LIBCUDACXX_USING_IF_EXISTS;
+using ::logbl _LIBCUDACXX_USING_IF_EXISTS;
+using ::lrintl _LIBCUDACXX_USING_IF_EXISTS;
+using ::lroundl _LIBCUDACXX_USING_IF_EXISTS;
+using ::nanl _LIBCUDACXX_USING_IF_EXISTS;
+using ::nearbyintl _LIBCUDACXX_USING_IF_EXISTS;
+using ::nextafterl _LIBCUDACXX_USING_IF_EXISTS;
+using ::nexttowardl _LIBCUDACXX_USING_IF_EXISTS;
+using ::remainderl _LIBCUDACXX_USING_IF_EXISTS;
+using ::remquol _LIBCUDACXX_USING_IF_EXISTS;
+using ::rintl _LIBCUDACXX_USING_IF_EXISTS;
+using ::roundl _LIBCUDACXX_USING_IF_EXISTS;
+using ::scalblnl _LIBCUDACXX_USING_IF_EXISTS;
+using ::scalbnl _LIBCUDACXX_USING_IF_EXISTS;
+using ::tgammal _LIBCUDACXX_USING_IF_EXISTS;
+using ::truncl _LIBCUDACXX_USING_IF_EXISTS;
+
+#if _LIBCUDACXX_STD_VER > 14
+inline _LIBCUDACXX_INLINE_VISIBILITY float       hypot(       float __x,       float __y,       float __z ) { return sqrt(__x*__x + __y*__y + __z*__z); }
+inline _LIBCUDACXX_INLINE_VISIBILITY double      hypot(      double __x,      double __y,      double __z ) { return sqrt(__x*__x + __y*__y + __z*__z); }
+inline _LIBCUDACXX_INLINE_VISIBILITY long double hypot( long double __x, long double __y, long double __z ) { return sqrt(__x*__x + __y*__y + __z*__z); }
 
 template <class _A1, class _A2, class _A3>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename enable_if_t
 <
     is_arithmetic<_A1>::value &&
@@ -554,9 +554,9 @@ hypot(_A1 __lcpp_x, _A2 __lcpp_y, _A3 __lcpp_z) _NOEXCEPT
 #endif
 
 template <class _A1>
-_LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR typename enable_if<is_floating_point<_A1>::value, bool>::type
-__libcpp_isnan_or_builtin(_A1 __lcpp_x) _NOEXCEPT
+_LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR typename enable_if<is_floating_point<_A1>::value, bool>::type
+__LIBCUDACXX_isnan_or_builtin(_A1 __lcpp_x) _NOEXCEPT
 {
 #if __has_builtin(__builtin_isnan)
     return __builtin_isnan(__lcpp_x);
@@ -566,17 +566,17 @@ __libcpp_isnan_or_builtin(_A1 __lcpp_x) _NOEXCEPT
 }
 
 template <class _A1>
-_LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR typename enable_if<!is_floating_point<_A1>::value, bool>::type
-__libcpp_isnan_or_builtin(_A1 __lcpp_x) _NOEXCEPT
+_LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR typename enable_if<!is_floating_point<_A1>::value, bool>::type
+__LIBCUDACXX_isnan_or_builtin(_A1 __lcpp_x) _NOEXCEPT
 {
     return isnan(__lcpp_x);
 }
 
 template <class _A1>
-_LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR typename enable_if<is_floating_point<_A1>::value, bool>::type
-__libcpp_isinf_or_builtin(_A1 __lcpp_x) _NOEXCEPT
+_LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR typename enable_if<is_floating_point<_A1>::value, bool>::type
+__LIBCUDACXX_isinf_or_builtin(_A1 __lcpp_x) _NOEXCEPT
 {
 #if __has_builtin(__builtin_isinf)
     return __builtin_isinf(__lcpp_x);
@@ -586,17 +586,17 @@ __libcpp_isinf_or_builtin(_A1 __lcpp_x) _NOEXCEPT
 }
 
 template <class _A1>
-_LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR typename enable_if<!is_floating_point<_A1>::value, bool>::type
-__libcpp_isinf_or_builtin(_A1 __lcpp_x) _NOEXCEPT
+_LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR typename enable_if<!is_floating_point<_A1>::value, bool>::type
+__LIBCUDACXX_isinf_or_builtin(_A1 __lcpp_x) _NOEXCEPT
 {
     return isinf(__lcpp_x);
 }
 
 template <class _A1>
-_LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR typename enable_if<is_floating_point<_A1>::value, bool>::type
-__libcpp_isfinite_or_builtin(_A1 __lcpp_x) _NOEXCEPT
+_LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR typename enable_if<is_floating_point<_A1>::value, bool>::type
+__LIBCUDACXX_isfinite_or_builtin(_A1 __lcpp_x) _NOEXCEPT
 {
 #if __has_builtin(__builtin_isfinite)
     return __builtin_isfinite(__lcpp_x);
@@ -606,14 +606,14 @@ __libcpp_isfinite_or_builtin(_A1 __lcpp_x) _NOEXCEPT
 }
 
 template <class _A1>
-_LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR typename enable_if<!is_floating_point<_A1>::value, bool>::type
-__libcpp_isfinite_or_builtin(_A1 __lcpp_x) _NOEXCEPT
+_LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR typename enable_if<!is_floating_point<_A1>::value, bool>::type
+__LIBCUDACXX_isfinite_or_builtin(_A1 __lcpp_x) _NOEXCEPT
 {
     return isfinite(__lcpp_x);
 }
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 template <typename _Fp>
 constexpr
 _Fp __lerp(_Fp __a, _Fp __b, _Fp __t) noexcept {
@@ -638,7 +638,7 @@ constexpr long double
 lerp(long double __a, long double __b, long double __t) _NOEXCEPT { return __lerp(__a, __b, __t); }
 
 template <class _A1, class _A2, class _A3>
-inline _LIBCPP_HIDE_FROM_ABI
+inline _LIBCUDACXX_HIDE_FROM_ABI
 constexpr typename enable_if_t
 <
     is_arithmetic<_A1>::value &&
@@ -654,10 +654,10 @@ lerp(_A1 __a, _A2 __b, _A3 __t) noexcept
                     _IsSame<_A3, __result_type>::value));
     return __lerp((__result_type)__a, (__result_type)__b, (__result_type)__t);
 }
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP_CMATH
+#endif // _LIBCUDACXX_CMATH

diff  --git a/libcxx/include/codecvt b/libcxx/include/codecvt
index 9f18a7b1a989..1b85270a0842 100644
--- a/libcxx/include/codecvt
+++ b/libcxx/include/codecvt
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_CODECVT
-#define _LIBCPP_CODECVT
+#ifndef _LIBCUDACXX_CODECVT
+#define _LIBCUDACXX_CODECVT
 
 /*
     codecvt synopsis
@@ -59,13 +59,13 @@ class codecvt_utf8_utf16
 #include <__locale>
 #include <version>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-enum _LIBCPP_DEPRECATED_IN_CXX17 codecvt_mode
+enum _LIBCUDACXX_DEPRECATED_IN_CXX17 codecvt_mode
 {
     consume_header = 4,
     generate_header = 2,
@@ -76,27 +76,27 @@ enum _LIBCPP_DEPRECATED_IN_CXX17 codecvt_mode
 
 template <class _Elem> class __codecvt_utf8;
 
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 template <>
-class _LIBCPP_TYPE_VIS __codecvt_utf8<wchar_t>
+class _LIBCUDACXX_TYPE_VIS __codecvt_utf8<wchar_t>
     : public codecvt<wchar_t, char, mbstate_t>
 {
     unsigned long _Maxcode_;
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+_LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
     codecvt_mode _Mode_;
-_LIBCPP_SUPPRESS_DEPRECATED_POP
+_LIBCUDACXX_SUPPRESS_DEPRECATED_POP
 public:
     typedef wchar_t   intern_type;
     typedef char      extern_type;
     typedef mbstate_t state_type;
 
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
-    _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __codecvt_utf8(size_t __refs, unsigned long __maxcode,
                             codecvt_mode __mode)
         : codecvt<wchar_t, char, mbstate_t>(__refs), _Maxcode_(__maxcode),
           _Mode_(__mode) {}
-_LIBCPP_SUPPRESS_DEPRECATED_POP
+_LIBCUDACXX_SUPPRESS_DEPRECATED_POP
 protected:
     virtual result
         do_out(state_type& __st,
@@ -115,11 +115,11 @@ protected:
                           size_t __mx) const;
     virtual int do_max_length() const _NOEXCEPT;
 };
-#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#endif // _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+_LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
 template <>
-class _LIBCPP_TYPE_VIS __codecvt_utf8<char16_t>
+class _LIBCUDACXX_TYPE_VIS __codecvt_utf8<char16_t>
     : public codecvt<char16_t, char, mbstate_t>
 {
     unsigned long _Maxcode_;
@@ -129,12 +129,12 @@ public:
     typedef char      extern_type;
     typedef mbstate_t state_type;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __codecvt_utf8(size_t __refs, unsigned long __maxcode,
                             codecvt_mode __mode)
         : codecvt<char16_t, char, mbstate_t>(__refs), _Maxcode_(__maxcode),
           _Mode_(__mode) {}
-_LIBCPP_SUPPRESS_DEPRECATED_POP
+_LIBCUDACXX_SUPPRESS_DEPRECATED_POP
 
 protected:
     virtual result
@@ -155,9 +155,9 @@ protected:
     virtual int do_max_length() const _NOEXCEPT;
 };
 
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+_LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
 template <>
-class _LIBCPP_TYPE_VIS __codecvt_utf8<char32_t>
+class _LIBCUDACXX_TYPE_VIS __codecvt_utf8<char32_t>
     : public codecvt<char32_t, char, mbstate_t>
 {
     unsigned long _Maxcode_;
@@ -167,12 +167,12 @@ public:
     typedef char      extern_type;
     typedef mbstate_t state_type;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __codecvt_utf8(size_t __refs, unsigned long __maxcode,
                             codecvt_mode __mode)
         : codecvt<char32_t, char, mbstate_t>(__refs), _Maxcode_(__maxcode),
           _Mode_(__mode) {}
-_LIBCPP_SUPPRESS_DEPRECATED_POP
+_LIBCUDACXX_SUPPRESS_DEPRECATED_POP
 
 protected:
     virtual result
@@ -193,47 +193,47 @@ protected:
     virtual int do_max_length() const _NOEXCEPT;
 };
 
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+_LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
 template <class _Elem, unsigned long _Maxcode = 0x10ffff,
           codecvt_mode _Mode = (codecvt_mode)0>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 codecvt_utf8
+class _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_DEPRECATED_IN_CXX17 codecvt_utf8
     : public __codecvt_utf8<_Elem>
 {
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit codecvt_utf8(size_t __refs = 0)
         : __codecvt_utf8<_Elem>(__refs, _Maxcode, _Mode) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     ~codecvt_utf8() {}
 };
-_LIBCPP_SUPPRESS_DEPRECATED_POP
+_LIBCUDACXX_SUPPRESS_DEPRECATED_POP
 
 // codecvt_utf16
 
 template <class _Elem, bool _LittleEndian> class __codecvt_utf16;
 
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 template <>
-class _LIBCPP_TYPE_VIS __codecvt_utf16<wchar_t, false>
+class _LIBCUDACXX_TYPE_VIS __codecvt_utf16<wchar_t, false>
     : public codecvt<wchar_t, char, mbstate_t>
 {
     unsigned long _Maxcode_;
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+_LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
     codecvt_mode _Mode_;
-_LIBCPP_SUPPRESS_DEPRECATED_POP
+_LIBCUDACXX_SUPPRESS_DEPRECATED_POP
 public:
     typedef wchar_t   intern_type;
     typedef char      extern_type;
     typedef mbstate_t state_type;
 
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
-    _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __codecvt_utf16(size_t __refs, unsigned long __maxcode,
                             codecvt_mode __mode)
         : codecvt<wchar_t, char, mbstate_t>(__refs), _Maxcode_(__maxcode),
           _Mode_(__mode) {}
-_LIBCPP_SUPPRESS_DEPRECATED_POP
+_LIBCUDACXX_SUPPRESS_DEPRECATED_POP
 protected:
     virtual result
         do_out(state_type& __st,
@@ -254,25 +254,25 @@ protected:
 };
 
 template <>
-class _LIBCPP_TYPE_VIS __codecvt_utf16<wchar_t, true>
+class _LIBCUDACXX_TYPE_VIS __codecvt_utf16<wchar_t, true>
     : public codecvt<wchar_t, char, mbstate_t>
 {
     unsigned long _Maxcode_;
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+_LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
     codecvt_mode _Mode_;
-_LIBCPP_SUPPRESS_DEPRECATED_POP
+_LIBCUDACXX_SUPPRESS_DEPRECATED_POP
 public:
     typedef wchar_t   intern_type;
     typedef char      extern_type;
     typedef mbstate_t state_type;
 
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
-    _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __codecvt_utf16(size_t __refs, unsigned long __maxcode,
                             codecvt_mode __mode)
         : codecvt<wchar_t, char, mbstate_t>(__refs), _Maxcode_(__maxcode),
           _Mode_(__mode) {}
-_LIBCPP_SUPPRESS_DEPRECATED_POP
+_LIBCUDACXX_SUPPRESS_DEPRECATED_POP
 protected:
     virtual result
         do_out(state_type& __st,
@@ -291,11 +291,11 @@ protected:
                           size_t __mx) const;
     virtual int do_max_length() const _NOEXCEPT;
 };
-#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#endif // _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+_LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
 template <>
-class _LIBCPP_TYPE_VIS __codecvt_utf16<char16_t, false>
+class _LIBCUDACXX_TYPE_VIS __codecvt_utf16<char16_t, false>
     : public codecvt<char16_t, char, mbstate_t>
 {
     unsigned long _Maxcode_;
@@ -305,12 +305,12 @@ public:
     typedef char      extern_type;
     typedef mbstate_t state_type;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __codecvt_utf16(size_t __refs, unsigned long __maxcode,
                             codecvt_mode __mode)
         : codecvt<char16_t, char, mbstate_t>(__refs), _Maxcode_(__maxcode),
           _Mode_(__mode) {}
-_LIBCPP_SUPPRESS_DEPRECATED_POP
+_LIBCUDACXX_SUPPRESS_DEPRECATED_POP
 
 protected:
     virtual result
@@ -331,9 +331,9 @@ protected:
     virtual int do_max_length() const _NOEXCEPT;
 };
 
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+_LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
 template <>
-class _LIBCPP_TYPE_VIS __codecvt_utf16<char16_t, true>
+class _LIBCUDACXX_TYPE_VIS __codecvt_utf16<char16_t, true>
     : public codecvt<char16_t, char, mbstate_t>
 {
     unsigned long _Maxcode_;
@@ -343,12 +343,12 @@ public:
     typedef char      extern_type;
     typedef mbstate_t state_type;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __codecvt_utf16(size_t __refs, unsigned long __maxcode,
                             codecvt_mode __mode)
         : codecvt<char16_t, char, mbstate_t>(__refs), _Maxcode_(__maxcode),
           _Mode_(__mode) {}
-_LIBCPP_SUPPRESS_DEPRECATED_POP
+_LIBCUDACXX_SUPPRESS_DEPRECATED_POP
 
 protected:
     virtual result
@@ -369,9 +369,9 @@ protected:
     virtual int do_max_length() const _NOEXCEPT;
 };
 
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+_LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
 template <>
-class _LIBCPP_TYPE_VIS __codecvt_utf16<char32_t, false>
+class _LIBCUDACXX_TYPE_VIS __codecvt_utf16<char32_t, false>
     : public codecvt<char32_t, char, mbstate_t>
 {
     unsigned long _Maxcode_;
@@ -381,12 +381,12 @@ public:
     typedef char      extern_type;
     typedef mbstate_t state_type;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __codecvt_utf16(size_t __refs, unsigned long __maxcode,
                             codecvt_mode __mode)
         : codecvt<char32_t, char, mbstate_t>(__refs), _Maxcode_(__maxcode),
           _Mode_(__mode) {}
-_LIBCPP_SUPPRESS_DEPRECATED_POP
+_LIBCUDACXX_SUPPRESS_DEPRECATED_POP
 
 protected:
     virtual result
@@ -407,9 +407,9 @@ protected:
     virtual int do_max_length() const _NOEXCEPT;
 };
 
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+_LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
 template <>
-class _LIBCPP_TYPE_VIS __codecvt_utf16<char32_t, true>
+class _LIBCUDACXX_TYPE_VIS __codecvt_utf16<char32_t, true>
     : public codecvt<char32_t, char, mbstate_t>
 {
     unsigned long _Maxcode_;
@@ -419,12 +419,12 @@ public:
     typedef char      extern_type;
     typedef mbstate_t state_type;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __codecvt_utf16(size_t __refs, unsigned long __maxcode,
                             codecvt_mode __mode)
         : codecvt<char32_t, char, mbstate_t>(__refs), _Maxcode_(__maxcode),
           _Mode_(__mode) {}
-_LIBCPP_SUPPRESS_DEPRECATED_POP
+_LIBCUDACXX_SUPPRESS_DEPRECATED_POP
 
 protected:
     virtual result
@@ -445,47 +445,47 @@ protected:
     virtual int do_max_length() const _NOEXCEPT;
 };
 
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+_LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
 template <class _Elem, unsigned long _Maxcode = 0x10ffff,
           codecvt_mode _Mode = (codecvt_mode)0>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 codecvt_utf16
+class _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_DEPRECATED_IN_CXX17 codecvt_utf16
     : public __codecvt_utf16<_Elem, _Mode & little_endian>
 {
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit codecvt_utf16(size_t __refs = 0)
         : __codecvt_utf16<_Elem, _Mode & little_endian>(__refs, _Maxcode, _Mode) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     ~codecvt_utf16() {}
 };
-_LIBCPP_SUPPRESS_DEPRECATED_POP
+_LIBCUDACXX_SUPPRESS_DEPRECATED_POP
 
 // codecvt_utf8_utf16
 
 template <class _Elem> class __codecvt_utf8_utf16;
 
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 template <>
-class _LIBCPP_TYPE_VIS __codecvt_utf8_utf16<wchar_t>
+class _LIBCUDACXX_TYPE_VIS __codecvt_utf8_utf16<wchar_t>
     : public codecvt<wchar_t, char, mbstate_t>
 {
     unsigned long _Maxcode_;
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+_LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
     codecvt_mode _Mode_;
-_LIBCPP_SUPPRESS_DEPRECATED_POP
+_LIBCUDACXX_SUPPRESS_DEPRECATED_POP
 public:
     typedef wchar_t   intern_type;
     typedef char      extern_type;
     typedef mbstate_t state_type;
 
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
-    _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __codecvt_utf8_utf16(size_t __refs, unsigned long __maxcode,
                             codecvt_mode __mode)
         : codecvt<wchar_t, char, mbstate_t>(__refs), _Maxcode_(__maxcode),
           _Mode_(__mode) {}
-_LIBCPP_SUPPRESS_DEPRECATED_POP
+_LIBCUDACXX_SUPPRESS_DEPRECATED_POP
 protected:
     virtual result
         do_out(state_type& __st,
@@ -504,11 +504,11 @@ protected:
                           size_t __mx) const;
     virtual int do_max_length() const _NOEXCEPT;
 };
-#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#endif // _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+_LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
 template <>
-class _LIBCPP_TYPE_VIS __codecvt_utf8_utf16<char32_t>
+class _LIBCUDACXX_TYPE_VIS __codecvt_utf8_utf16<char32_t>
     : public codecvt<char32_t, char, mbstate_t>
 {
     unsigned long _Maxcode_;
@@ -518,12 +518,12 @@ public:
     typedef char      extern_type;
     typedef mbstate_t state_type;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __codecvt_utf8_utf16(size_t __refs, unsigned long __maxcode,
                             codecvt_mode __mode)
         : codecvt<char32_t, char, mbstate_t>(__refs), _Maxcode_(__maxcode),
           _Mode_(__mode) {}
-_LIBCPP_SUPPRESS_DEPRECATED_POP
+_LIBCUDACXX_SUPPRESS_DEPRECATED_POP
 
 protected:
     virtual result
@@ -544,9 +544,9 @@ protected:
     virtual int do_max_length() const _NOEXCEPT;
 };
 
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+_LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
 template <>
-class _LIBCPP_TYPE_VIS __codecvt_utf8_utf16<char16_t>
+class _LIBCUDACXX_TYPE_VIS __codecvt_utf8_utf16<char16_t>
     : public codecvt<char16_t, char, mbstate_t>
 {
     unsigned long _Maxcode_;
@@ -556,12 +556,12 @@ public:
     typedef char      extern_type;
     typedef mbstate_t state_type;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __codecvt_utf8_utf16(size_t __refs, unsigned long __maxcode,
                             codecvt_mode __mode)
         : codecvt<char16_t, char, mbstate_t>(__refs), _Maxcode_(__maxcode),
           _Mode_(__mode) {}
-_LIBCPP_SUPPRESS_DEPRECATED_POP
+_LIBCUDACXX_SUPPRESS_DEPRECATED_POP
 
 protected:
     virtual result
@@ -582,22 +582,22 @@ protected:
     virtual int do_max_length() const _NOEXCEPT;
 };
 
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+_LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
 template <class _Elem, unsigned long _Maxcode = 0x10ffff,
           codecvt_mode _Mode = (codecvt_mode)0>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 codecvt_utf8_utf16
+class _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_DEPRECATED_IN_CXX17 codecvt_utf8_utf16
     : public __codecvt_utf8_utf16<_Elem>
 {
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit codecvt_utf8_utf16(size_t __refs = 0)
         : __codecvt_utf8_utf16<_Elem>(__refs, _Maxcode, _Mode) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     ~codecvt_utf8_utf16() {}
 };
-_LIBCPP_SUPPRESS_DEPRECATED_POP
+_LIBCUDACXX_SUPPRESS_DEPRECATED_POP
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_CODECVT
+#endif // _LIBCUDACXX_CODECVT

diff  --git a/libcxx/include/compare b/libcxx/include/compare
index 6aa1abefd3ef..c34b24df50eb 100644
--- a/libcxx/include/compare
+++ b/libcxx/include/compare
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_COMPARE
-#define _LIBCPP_COMPARE
+#ifndef _LIBCUDACXX_COMPARE
+#define _LIBCUDACXX_COMPARE
 
 /*
     compare synopsis
@@ -156,8 +156,8 @@ namespace std {
 #include <__config>
 #include <version>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#endif // _LIBCPP_COMPARE
+#endif // _LIBCUDACXX_COMPARE

diff  --git a/libcxx/include/complex b/libcxx/include/complex
index 87a4e5872497..8dc97d880389 100644
--- a/libcxx/include/complex
+++ b/libcxx/include/complex
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_COMPLEX
-#define _LIBCPP_COMPLEX
+#ifndef _LIBCUDACXX_COMPLEX
+#define _LIBCUDACXX_COMPLEX
 
 /*
     complex synopsis
@@ -239,23 +239,23 @@ template<class T> complex<T> tanh (const complex<T>&);
 #include <type_traits>
 #include <version>
 
-#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
+#if !defined(_LIBCUDACXX_HAS_NO_LOCALIZATION)
 #   include <sstream> // for std::basic_ostringstream
 #endif
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-template<class _Tp> class _LIBCPP_TEMPLATE_VIS complex;
+template<class _Tp> class _LIBCUDACXX_TEMPLATE_VIS complex;
 
 template<class _Tp> complex<_Tp> operator*(const complex<_Tp>& __z, const complex<_Tp>& __w);
 template<class _Tp> complex<_Tp> operator/(const complex<_Tp>& __x, const complex<_Tp>& __y);
 
 template<class _Tp>
-class _LIBCPP_TEMPLATE_VIS complex
+class _LIBCUDACXX_TEMPLATE_VIS complex
 {
 public:
     typedef _Tp value_type;
@@ -263,111 +263,111 @@ private:
     value_type __re_;
     value_type __im_;
 public:
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
     complex(const value_type& __re = value_type(), const value_type& __im = value_type())
         : __re_(__re), __im_(__im) {}
-    template<class _Xp> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+    template<class _Xp> _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
     complex(const complex<_Xp>& __c)
         : __re_(__c.real()), __im_(__c.imag()) {}
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 value_type real() const {return __re_;}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 value_type imag() const {return __im_;}
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 value_type real() const {return __re_;}
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 value_type imag() const {return __im_;}
 
-    _LIBCPP_INLINE_VISIBILITY void real(value_type __re) {__re_ = __re;}
-    _LIBCPP_INLINE_VISIBILITY void imag(value_type __im) {__im_ = __im;}
+    _LIBCUDACXX_INLINE_VISIBILITY void real(value_type __re) {__re_ = __re;}
+    _LIBCUDACXX_INLINE_VISIBILITY void imag(value_type __im) {__im_ = __im;}
 
-    _LIBCPP_INLINE_VISIBILITY complex& operator= (const value_type& __re)
+    _LIBCUDACXX_INLINE_VISIBILITY complex& operator= (const value_type& __re)
         {__re_ = __re; __im_ = value_type(); return *this;}
-    _LIBCPP_INLINE_VISIBILITY complex& operator+=(const value_type& __re) {__re_ += __re; return *this;}
-    _LIBCPP_INLINE_VISIBILITY complex& operator-=(const value_type& __re) {__re_ -= __re; return *this;}
-    _LIBCPP_INLINE_VISIBILITY complex& operator*=(const value_type& __re) {__re_ *= __re; __im_ *= __re; return *this;}
-    _LIBCPP_INLINE_VISIBILITY complex& operator/=(const value_type& __re) {__re_ /= __re; __im_ /= __re; return *this;}
+    _LIBCUDACXX_INLINE_VISIBILITY complex& operator+=(const value_type& __re) {__re_ += __re; return *this;}
+    _LIBCUDACXX_INLINE_VISIBILITY complex& operator-=(const value_type& __re) {__re_ -= __re; return *this;}
+    _LIBCUDACXX_INLINE_VISIBILITY complex& operator*=(const value_type& __re) {__re_ *= __re; __im_ *= __re; return *this;}
+    _LIBCUDACXX_INLINE_VISIBILITY complex& operator/=(const value_type& __re) {__re_ /= __re; __im_ /= __re; return *this;}
 
-    template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator= (const complex<_Xp>& __c)
+    template<class _Xp> _LIBCUDACXX_INLINE_VISIBILITY complex& operator= (const complex<_Xp>& __c)
         {
             __re_ = __c.real();
             __im_ = __c.imag();
             return *this;
         }
-    template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator+=(const complex<_Xp>& __c)
+    template<class _Xp> _LIBCUDACXX_INLINE_VISIBILITY complex& operator+=(const complex<_Xp>& __c)
         {
             __re_ += __c.real();
             __im_ += __c.imag();
             return *this;
         }
-    template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator-=(const complex<_Xp>& __c)
+    template<class _Xp> _LIBCUDACXX_INLINE_VISIBILITY complex& operator-=(const complex<_Xp>& __c)
         {
             __re_ -= __c.real();
             __im_ -= __c.imag();
             return *this;
         }
-    template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator*=(const complex<_Xp>& __c)
+    template<class _Xp> _LIBCUDACXX_INLINE_VISIBILITY complex& operator*=(const complex<_Xp>& __c)
         {
             *this = *this * complex(__c.real(), __c.imag());
             return *this;
         }
-    template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator/=(const complex<_Xp>& __c)
+    template<class _Xp> _LIBCUDACXX_INLINE_VISIBILITY complex& operator/=(const complex<_Xp>& __c)
         {
             *this = *this / complex(__c.real(), __c.imag());
             return *this;
         }
 };
 
-template<> class _LIBCPP_TEMPLATE_VIS complex<double>;
-template<> class _LIBCPP_TEMPLATE_VIS complex<long double>;
+template<> class _LIBCUDACXX_TEMPLATE_VIS complex<double>;
+template<> class _LIBCUDACXX_TEMPLATE_VIS complex<long double>;
 
 template<>
-class _LIBCPP_TEMPLATE_VIS complex<float>
+class _LIBCUDACXX_TEMPLATE_VIS complex<float>
 {
     float __re_;
     float __im_;
 public:
     typedef float value_type;
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR complex(float __re = 0.0f, float __im = 0.0f)
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR complex(float __re = 0.0f, float __im = 0.0f)
         : __re_(__re), __im_(__im) {}
-    _LIBCPP_INLINE_VISIBILITY
-    explicit _LIBCPP_CONSTEXPR complex(const complex<double>& __c);
-    _LIBCPP_INLINE_VISIBILITY
-    explicit _LIBCPP_CONSTEXPR complex(const complex<long double>& __c);
+    _LIBCUDACXX_INLINE_VISIBILITY
+    explicit _LIBCUDACXX_CONSTEXPR complex(const complex<double>& __c);
+    _LIBCUDACXX_INLINE_VISIBILITY
+    explicit _LIBCUDACXX_CONSTEXPR complex(const complex<long double>& __c);
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR float real() const {return __re_;}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR float imag() const {return __im_;}
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR float real() const {return __re_;}
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR float imag() const {return __im_;}
 
-    _LIBCPP_INLINE_VISIBILITY void real(value_type __re) {__re_ = __re;}
-    _LIBCPP_INLINE_VISIBILITY void imag(value_type __im) {__im_ = __im;}
+    _LIBCUDACXX_INLINE_VISIBILITY void real(value_type __re) {__re_ = __re;}
+    _LIBCUDACXX_INLINE_VISIBILITY void imag(value_type __im) {__im_ = __im;}
 
-    _LIBCPP_INLINE_VISIBILITY complex& operator= (float __re)
+    _LIBCUDACXX_INLINE_VISIBILITY complex& operator= (float __re)
         {__re_ = __re; __im_ = value_type(); return *this;}
-    _LIBCPP_INLINE_VISIBILITY complex& operator+=(float __re) {__re_ += __re; return *this;}
-    _LIBCPP_INLINE_VISIBILITY complex& operator-=(float __re) {__re_ -= __re; return *this;}
-    _LIBCPP_INLINE_VISIBILITY complex& operator*=(float __re) {__re_ *= __re; __im_ *= __re; return *this;}
-    _LIBCPP_INLINE_VISIBILITY complex& operator/=(float __re) {__re_ /= __re; __im_ /= __re; return *this;}
+    _LIBCUDACXX_INLINE_VISIBILITY complex& operator+=(float __re) {__re_ += __re; return *this;}
+    _LIBCUDACXX_INLINE_VISIBILITY complex& operator-=(float __re) {__re_ -= __re; return *this;}
+    _LIBCUDACXX_INLINE_VISIBILITY complex& operator*=(float __re) {__re_ *= __re; __im_ *= __re; return *this;}
+    _LIBCUDACXX_INLINE_VISIBILITY complex& operator/=(float __re) {__re_ /= __re; __im_ /= __re; return *this;}
 
-    template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator= (const complex<_Xp>& __c)
+    template<class _Xp> _LIBCUDACXX_INLINE_VISIBILITY complex& operator= (const complex<_Xp>& __c)
         {
             __re_ = __c.real();
             __im_ = __c.imag();
             return *this;
         }
-    template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator+=(const complex<_Xp>& __c)
+    template<class _Xp> _LIBCUDACXX_INLINE_VISIBILITY complex& operator+=(const complex<_Xp>& __c)
         {
             __re_ += __c.real();
             __im_ += __c.imag();
             return *this;
         }
-    template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator-=(const complex<_Xp>& __c)
+    template<class _Xp> _LIBCUDACXX_INLINE_VISIBILITY complex& operator-=(const complex<_Xp>& __c)
         {
             __re_ -= __c.real();
             __im_ -= __c.imag();
             return *this;
         }
-    template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator*=(const complex<_Xp>& __c)
+    template<class _Xp> _LIBCUDACXX_INLINE_VISIBILITY complex& operator*=(const complex<_Xp>& __c)
         {
             *this = *this * complex(__c.real(), __c.imag());
             return *this;
         }
-    template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator/=(const complex<_Xp>& __c)
+    template<class _Xp> _LIBCUDACXX_INLINE_VISIBILITY complex& operator/=(const complex<_Xp>& __c)
         {
             *this = *this / complex(__c.real(), __c.imag());
             return *this;
@@ -375,57 +375,57 @@ public:
 };
 
 template<>
-class _LIBCPP_TEMPLATE_VIS complex<double>
+class _LIBCUDACXX_TEMPLATE_VIS complex<double>
 {
     double __re_;
     double __im_;
 public:
     typedef double value_type;
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR complex(double __re = 0.0, double __im = 0.0)
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR complex(double __re = 0.0, double __im = 0.0)
         : __re_(__re), __im_(__im) {}
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR complex(const complex<float>& __c);
-    _LIBCPP_INLINE_VISIBILITY
-    explicit _LIBCPP_CONSTEXPR complex(const complex<long double>& __c);
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR complex(const complex<float>& __c);
+    _LIBCUDACXX_INLINE_VISIBILITY
+    explicit _LIBCUDACXX_CONSTEXPR complex(const complex<long double>& __c);
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR double real() const {return __re_;}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR double imag() const {return __im_;}
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR double real() const {return __re_;}
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR double imag() const {return __im_;}
 
-    _LIBCPP_INLINE_VISIBILITY void real(value_type __re) {__re_ = __re;}
-    _LIBCPP_INLINE_VISIBILITY void imag(value_type __im) {__im_ = __im;}
+    _LIBCUDACXX_INLINE_VISIBILITY void real(value_type __re) {__re_ = __re;}
+    _LIBCUDACXX_INLINE_VISIBILITY void imag(value_type __im) {__im_ = __im;}
 
-    _LIBCPP_INLINE_VISIBILITY complex& operator= (double __re)
+    _LIBCUDACXX_INLINE_VISIBILITY complex& operator= (double __re)
         {__re_ = __re; __im_ = value_type(); return *this;}
-    _LIBCPP_INLINE_VISIBILITY complex& operator+=(double __re) {__re_ += __re; return *this;}
-    _LIBCPP_INLINE_VISIBILITY complex& operator-=(double __re) {__re_ -= __re; return *this;}
-    _LIBCPP_INLINE_VISIBILITY complex& operator*=(double __re) {__re_ *= __re; __im_ *= __re; return *this;}
-    _LIBCPP_INLINE_VISIBILITY complex& operator/=(double __re) {__re_ /= __re; __im_ /= __re; return *this;}
+    _LIBCUDACXX_INLINE_VISIBILITY complex& operator+=(double __re) {__re_ += __re; return *this;}
+    _LIBCUDACXX_INLINE_VISIBILITY complex& operator-=(double __re) {__re_ -= __re; return *this;}
+    _LIBCUDACXX_INLINE_VISIBILITY complex& operator*=(double __re) {__re_ *= __re; __im_ *= __re; return *this;}
+    _LIBCUDACXX_INLINE_VISIBILITY complex& operator/=(double __re) {__re_ /= __re; __im_ /= __re; return *this;}
 
-    template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator= (const complex<_Xp>& __c)
+    template<class _Xp> _LIBCUDACXX_INLINE_VISIBILITY complex& operator= (const complex<_Xp>& __c)
         {
             __re_ = __c.real();
             __im_ = __c.imag();
             return *this;
         }
-    template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator+=(const complex<_Xp>& __c)
+    template<class _Xp> _LIBCUDACXX_INLINE_VISIBILITY complex& operator+=(const complex<_Xp>& __c)
         {
             __re_ += __c.real();
             __im_ += __c.imag();
             return *this;
         }
-    template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator-=(const complex<_Xp>& __c)
+    template<class _Xp> _LIBCUDACXX_INLINE_VISIBILITY complex& operator-=(const complex<_Xp>& __c)
         {
             __re_ -= __c.real();
             __im_ -= __c.imag();
             return *this;
         }
-    template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator*=(const complex<_Xp>& __c)
+    template<class _Xp> _LIBCUDACXX_INLINE_VISIBILITY complex& operator*=(const complex<_Xp>& __c)
         {
             *this = *this * complex(__c.real(), __c.imag());
             return *this;
         }
-    template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator/=(const complex<_Xp>& __c)
+    template<class _Xp> _LIBCUDACXX_INLINE_VISIBILITY complex& operator/=(const complex<_Xp>& __c)
         {
             *this = *this / complex(__c.real(), __c.imag());
             return *this;
@@ -433,57 +433,57 @@ public:
 };
 
 template<>
-class _LIBCPP_TEMPLATE_VIS complex<long double>
+class _LIBCUDACXX_TEMPLATE_VIS complex<long double>
 {
     long double __re_;
     long double __im_;
 public:
     typedef long double value_type;
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR complex(long double __re = 0.0L, long double __im = 0.0L)
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR complex(long double __re = 0.0L, long double __im = 0.0L)
         : __re_(__re), __im_(__im) {}
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR complex(const complex<float>& __c);
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR complex(const complex<double>& __c);
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR complex(const complex<float>& __c);
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR complex(const complex<double>& __c);
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR long double real() const {return __re_;}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR long double imag() const {return __im_;}
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR long double real() const {return __re_;}
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR long double imag() const {return __im_;}
 
-    _LIBCPP_INLINE_VISIBILITY void real(value_type __re) {__re_ = __re;}
-    _LIBCPP_INLINE_VISIBILITY void imag(value_type __im) {__im_ = __im;}
+    _LIBCUDACXX_INLINE_VISIBILITY void real(value_type __re) {__re_ = __re;}
+    _LIBCUDACXX_INLINE_VISIBILITY void imag(value_type __im) {__im_ = __im;}
 
-    _LIBCPP_INLINE_VISIBILITY complex& operator= (long double __re)
+    _LIBCUDACXX_INLINE_VISIBILITY complex& operator= (long double __re)
         {__re_ = __re; __im_ = value_type(); return *this;}
-    _LIBCPP_INLINE_VISIBILITY complex& operator+=(long double __re) {__re_ += __re; return *this;}
-    _LIBCPP_INLINE_VISIBILITY complex& operator-=(long double __re) {__re_ -= __re; return *this;}
-    _LIBCPP_INLINE_VISIBILITY complex& operator*=(long double __re) {__re_ *= __re; __im_ *= __re; return *this;}
-    _LIBCPP_INLINE_VISIBILITY complex& operator/=(long double __re) {__re_ /= __re; __im_ /= __re; return *this;}
+    _LIBCUDACXX_INLINE_VISIBILITY complex& operator+=(long double __re) {__re_ += __re; return *this;}
+    _LIBCUDACXX_INLINE_VISIBILITY complex& operator-=(long double __re) {__re_ -= __re; return *this;}
+    _LIBCUDACXX_INLINE_VISIBILITY complex& operator*=(long double __re) {__re_ *= __re; __im_ *= __re; return *this;}
+    _LIBCUDACXX_INLINE_VISIBILITY complex& operator/=(long double __re) {__re_ /= __re; __im_ /= __re; return *this;}
 
-    template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator= (const complex<_Xp>& __c)
+    template<class _Xp> _LIBCUDACXX_INLINE_VISIBILITY complex& operator= (const complex<_Xp>& __c)
         {
             __re_ = __c.real();
             __im_ = __c.imag();
             return *this;
         }
-    template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator+=(const complex<_Xp>& __c)
+    template<class _Xp> _LIBCUDACXX_INLINE_VISIBILITY complex& operator+=(const complex<_Xp>& __c)
         {
             __re_ += __c.real();
             __im_ += __c.imag();
             return *this;
         }
-    template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator-=(const complex<_Xp>& __c)
+    template<class _Xp> _LIBCUDACXX_INLINE_VISIBILITY complex& operator-=(const complex<_Xp>& __c)
         {
             __re_ -= __c.real();
             __im_ -= __c.imag();
             return *this;
         }
-    template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator*=(const complex<_Xp>& __c)
+    template<class _Xp> _LIBCUDACXX_INLINE_VISIBILITY complex& operator*=(const complex<_Xp>& __c)
         {
             *this = *this * complex(__c.real(), __c.imag());
             return *this;
         }
-    template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator/=(const complex<_Xp>& __c)
+    template<class _Xp> _LIBCUDACXX_INLINE_VISIBILITY complex& operator/=(const complex<_Xp>& __c)
         {
             *this = *this / complex(__c.real(), __c.imag());
             return *this;
@@ -491,39 +491,39 @@ public:
 };
 
 inline
-_LIBCPP_CONSTEXPR
+_LIBCUDACXX_CONSTEXPR
 complex<float>::complex(const complex<double>& __c)
     : __re_(__c.real()), __im_(__c.imag()) {}
 
 inline
-_LIBCPP_CONSTEXPR
+_LIBCUDACXX_CONSTEXPR
 complex<float>::complex(const complex<long double>& __c)
     : __re_(__c.real()), __im_(__c.imag()) {}
 
 inline
-_LIBCPP_CONSTEXPR
+_LIBCUDACXX_CONSTEXPR
 complex<double>::complex(const complex<float>& __c)
     : __re_(__c.real()), __im_(__c.imag()) {}
 
 inline
-_LIBCPP_CONSTEXPR
+_LIBCUDACXX_CONSTEXPR
 complex<double>::complex(const complex<long double>& __c)
     : __re_(__c.real()), __im_(__c.imag()) {}
 
 inline
-_LIBCPP_CONSTEXPR
+_LIBCUDACXX_CONSTEXPR
 complex<long double>::complex(const complex<float>& __c)
     : __re_(__c.real()), __im_(__c.imag()) {}
 
 inline
-_LIBCPP_CONSTEXPR
+_LIBCUDACXX_CONSTEXPR
 complex<long double>::complex(const complex<double>& __c)
     : __re_(__c.real()), __im_(__c.imag()) {}
 
 // 26.3.6 operators:
 
 template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 complex<_Tp>
 operator+(const complex<_Tp>& __x, const complex<_Tp>& __y)
 {
@@ -533,7 +533,7 @@ operator+(const complex<_Tp>& __x, const complex<_Tp>& __y)
 }
 
 template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 complex<_Tp>
 operator+(const complex<_Tp>& __x, const _Tp& __y)
 {
@@ -543,7 +543,7 @@ operator+(const complex<_Tp>& __x, const _Tp& __y)
 }
 
 template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 complex<_Tp>
 operator+(const _Tp& __x, const complex<_Tp>& __y)
 {
@@ -553,7 +553,7 @@ operator+(const _Tp& __x, const complex<_Tp>& __y)
 }
 
 template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 complex<_Tp>
 operator-(const complex<_Tp>& __x, const complex<_Tp>& __y)
 {
@@ -563,7 +563,7 @@ operator-(const complex<_Tp>& __x, const complex<_Tp>& __y)
 }
 
 template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 complex<_Tp>
 operator-(const complex<_Tp>& __x, const _Tp& __y)
 {
@@ -573,7 +573,7 @@ operator-(const complex<_Tp>& __x, const _Tp& __y)
 }
 
 template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 complex<_Tp>
 operator-(const _Tp& __x, const complex<_Tp>& __y)
 {
@@ -596,39 +596,39 @@ operator*(const complex<_Tp>& __z, const complex<_Tp>& __w)
     _Tp __bc = __b * __c;
     _Tp __x = __ac - __bd;
     _Tp __y = __ad + __bc;
-    if (__libcpp_isnan_or_builtin(__x) && __libcpp_isnan_or_builtin(__y))
+    if (__LIBCUDACXX_isnan_or_builtin(__x) && __LIBCUDACXX_isnan_or_builtin(__y))
     {
         bool __recalc = false;
-        if (__libcpp_isinf_or_builtin(__a) || __libcpp_isinf_or_builtin(__b))
+        if (__LIBCUDACXX_isinf_or_builtin(__a) || __LIBCUDACXX_isinf_or_builtin(__b))
         {
-            __a = copysign(__libcpp_isinf_or_builtin(__a) ? _Tp(1) : _Tp(0), __a);
-            __b = copysign(__libcpp_isinf_or_builtin(__b) ? _Tp(1) : _Tp(0), __b);
-            if (__libcpp_isnan_or_builtin(__c))
+            __a = copysign(__LIBCUDACXX_isinf_or_builtin(__a) ? _Tp(1) : _Tp(0), __a);
+            __b = copysign(__LIBCUDACXX_isinf_or_builtin(__b) ? _Tp(1) : _Tp(0), __b);
+            if (__LIBCUDACXX_isnan_or_builtin(__c))
                 __c = copysign(_Tp(0), __c);
-            if (__libcpp_isnan_or_builtin(__d))
+            if (__LIBCUDACXX_isnan_or_builtin(__d))
                 __d = copysign(_Tp(0), __d);
             __recalc = true;
         }
-        if (__libcpp_isinf_or_builtin(__c) || __libcpp_isinf_or_builtin(__d))
+        if (__LIBCUDACXX_isinf_or_builtin(__c) || __LIBCUDACXX_isinf_or_builtin(__d))
         {
-            __c = copysign(__libcpp_isinf_or_builtin(__c) ? _Tp(1) : _Tp(0), __c);
-            __d = copysign(__libcpp_isinf_or_builtin(__d) ? _Tp(1) : _Tp(0), __d);
-            if (__libcpp_isnan_or_builtin(__a))
+            __c = copysign(__LIBCUDACXX_isinf_or_builtin(__c) ? _Tp(1) : _Tp(0), __c);
+            __d = copysign(__LIBCUDACXX_isinf_or_builtin(__d) ? _Tp(1) : _Tp(0), __d);
+            if (__LIBCUDACXX_isnan_or_builtin(__a))
                 __a = copysign(_Tp(0), __a);
-            if (__libcpp_isnan_or_builtin(__b))
+            if (__LIBCUDACXX_isnan_or_builtin(__b))
                 __b = copysign(_Tp(0), __b);
             __recalc = true;
         }
-        if (!__recalc && (__libcpp_isinf_or_builtin(__ac) || __libcpp_isinf_or_builtin(__bd) ||
-                          __libcpp_isinf_or_builtin(__ad) || __libcpp_isinf_or_builtin(__bc)))
+        if (!__recalc && (__LIBCUDACXX_isinf_or_builtin(__ac) || __LIBCUDACXX_isinf_or_builtin(__bd) ||
+                          __LIBCUDACXX_isinf_or_builtin(__ad) || __LIBCUDACXX_isinf_or_builtin(__bc)))
         {
-            if (__libcpp_isnan_or_builtin(__a))
+            if (__LIBCUDACXX_isnan_or_builtin(__a))
                 __a = copysign(_Tp(0), __a);
-            if (__libcpp_isnan_or_builtin(__b))
+            if (__LIBCUDACXX_isnan_or_builtin(__b))
                 __b = copysign(_Tp(0), __b);
-            if (__libcpp_isnan_or_builtin(__c))
+            if (__LIBCUDACXX_isnan_or_builtin(__c))
                 __c = copysign(_Tp(0), __c);
-            if (__libcpp_isnan_or_builtin(__d))
+            if (__LIBCUDACXX_isnan_or_builtin(__d))
                 __d = copysign(_Tp(0), __d);
             __recalc = true;
         }
@@ -642,7 +642,7 @@ operator*(const complex<_Tp>& __z, const complex<_Tp>& __w)
 }
 
 template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 complex<_Tp>
 operator*(const complex<_Tp>& __x, const _Tp& __y)
 {
@@ -652,7 +652,7 @@ operator*(const complex<_Tp>& __x, const _Tp& __y)
 }
 
 template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 complex<_Tp>
 operator*(const _Tp& __x, const complex<_Tp>& __y)
 {
@@ -671,7 +671,7 @@ operator/(const complex<_Tp>& __z, const complex<_Tp>& __w)
     _Tp __c = __w.real();
     _Tp __d = __w.imag();
     _Tp __logbw = logb(fmax(fabs(__c), fabs(__d)));
-    if (__libcpp_isfinite_or_builtin(__logbw))
+    if (__LIBCUDACXX_isfinite_or_builtin(__logbw))
     {
         __ilogbw = static_cast<int>(__logbw);
         __c = scalbn(__c, -__ilogbw);
@@ -680,24 +680,24 @@ operator/(const complex<_Tp>& __z, const complex<_Tp>& __w)
     _Tp __denom = __c * __c + __d * __d;
     _Tp __x = scalbn((__a * __c + __b * __d) / __denom, -__ilogbw);
     _Tp __y = scalbn((__b * __c - __a * __d) / __denom, -__ilogbw);
-    if (__libcpp_isnan_or_builtin(__x) && __libcpp_isnan_or_builtin(__y))
+    if (__LIBCUDACXX_isnan_or_builtin(__x) && __LIBCUDACXX_isnan_or_builtin(__y))
     {
-        if ((__denom == _Tp(0)) && (!__libcpp_isnan_or_builtin(__a) || !__libcpp_isnan_or_builtin(__b)))
+        if ((__denom == _Tp(0)) && (!__LIBCUDACXX_isnan_or_builtin(__a) || !__LIBCUDACXX_isnan_or_builtin(__b)))
         {
             __x = copysign(_Tp(INFINITY), __c) * __a;
             __y = copysign(_Tp(INFINITY), __c) * __b;
         }
-        else if ((__libcpp_isinf_or_builtin(__a) || __libcpp_isinf_or_builtin(__b)) && __libcpp_isfinite_or_builtin(__c) && __libcpp_isfinite_or_builtin(__d))
+        else if ((__LIBCUDACXX_isinf_or_builtin(__a) || __LIBCUDACXX_isinf_or_builtin(__b)) && __LIBCUDACXX_isfinite_or_builtin(__c) && __LIBCUDACXX_isfinite_or_builtin(__d))
         {
-            __a = copysign(__libcpp_isinf_or_builtin(__a) ? _Tp(1) : _Tp(0), __a);
-            __b = copysign(__libcpp_isinf_or_builtin(__b) ? _Tp(1) : _Tp(0), __b);
+            __a = copysign(__LIBCUDACXX_isinf_or_builtin(__a) ? _Tp(1) : _Tp(0), __a);
+            __b = copysign(__LIBCUDACXX_isinf_or_builtin(__b) ? _Tp(1) : _Tp(0), __b);
             __x = _Tp(INFINITY) * (__a * __c + __b * __d);
             __y = _Tp(INFINITY) * (__b * __c - __a * __d);
         }
-        else if (__libcpp_isinf_or_builtin(__logbw) && __logbw > _Tp(0) && __libcpp_isfinite_or_builtin(__a) && __libcpp_isfinite_or_builtin(__b))
+        else if (__LIBCUDACXX_isinf_or_builtin(__logbw) && __logbw > _Tp(0) && __LIBCUDACXX_isfinite_or_builtin(__a) && __LIBCUDACXX_isfinite_or_builtin(__b))
         {
-            __c = copysign(__libcpp_isinf_or_builtin(__c) ? _Tp(1) : _Tp(0), __c);
-            __d = copysign(__libcpp_isinf_or_builtin(__d) ? _Tp(1) : _Tp(0), __d);
+            __c = copysign(__LIBCUDACXX_isinf_or_builtin(__c) ? _Tp(1) : _Tp(0), __c);
+            __d = copysign(__LIBCUDACXX_isinf_or_builtin(__d) ? _Tp(1) : _Tp(0), __d);
             __x = _Tp(0) * (__a * __c + __b * __d);
             __y = _Tp(0) * (__b * __c - __a * __d);
         }
@@ -706,7 +706,7 @@ operator/(const complex<_Tp>& __z, const complex<_Tp>& __w)
 }
 
 template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 complex<_Tp>
 operator/(const complex<_Tp>& __x, const _Tp& __y)
 {
@@ -714,7 +714,7 @@ operator/(const complex<_Tp>& __x, const _Tp& __y)
 }
 
 template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 complex<_Tp>
 operator/(const _Tp& __x, const complex<_Tp>& __y)
 {
@@ -724,7 +724,7 @@ operator/(const _Tp& __x, const complex<_Tp>& __y)
 }
 
 template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 complex<_Tp>
 operator+(const complex<_Tp>& __x)
 {
@@ -732,7 +732,7 @@ operator+(const complex<_Tp>& __x)
 }
 
 template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 complex<_Tp>
 operator-(const complex<_Tp>& __x)
 {
@@ -740,7 +740,7 @@ operator-(const complex<_Tp>& __x)
 }
 
 template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 bool
 operator==(const complex<_Tp>& __x, const complex<_Tp>& __y)
 {
@@ -748,7 +748,7 @@ operator==(const complex<_Tp>& __x, const complex<_Tp>& __y)
 }
 
 template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 bool
 operator==(const complex<_Tp>& __x, const _Tp& __y)
 {
@@ -756,7 +756,7 @@ operator==(const complex<_Tp>& __x, const _Tp& __y)
 }
 
 template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 bool
 operator==(const _Tp& __x, const complex<_Tp>& __y)
 {
@@ -764,7 +764,7 @@ operator==(const _Tp& __x, const complex<_Tp>& __y)
 }
 
 template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 bool
 operator!=(const complex<_Tp>& __x, const complex<_Tp>& __y)
 {
@@ -772,7 +772,7 @@ operator!=(const complex<_Tp>& __x, const complex<_Tp>& __y)
 }
 
 template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 bool
 operator!=(const complex<_Tp>& __x, const _Tp& __y)
 {
@@ -780,7 +780,7 @@ operator!=(const complex<_Tp>& __x, const _Tp& __y)
 }
 
 template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 bool
 operator!=(const _Tp& __x, const complex<_Tp>& __y)
 {
@@ -792,11 +792,11 @@ operator!=(const _Tp& __x, const complex<_Tp>& __y)
 template <class _Tp, bool = is_integral<_Tp>::value,
                      bool = is_floating_point<_Tp>::value
                      >
-struct __libcpp_complex_overload_traits {};
+struct __LIBCUDACXX_complex_overload_traits {};
 
 // Integral Types
 template <class _Tp>
-struct __libcpp_complex_overload_traits<_Tp, true, false>
+struct __LIBCUDACXX_complex_overload_traits<_Tp, true, false>
 {
     typedef double _ValueType;
     typedef complex<double> _ComplexType;
@@ -804,7 +804,7 @@ struct __libcpp_complex_overload_traits<_Tp, true, false>
 
 // Floating point types
 template <class _Tp>
-struct __libcpp_complex_overload_traits<_Tp, false, true>
+struct __LIBCUDACXX_complex_overload_traits<_Tp, false, true>
 {
     typedef _Tp _ValueType;
     typedef complex<_Tp> _ComplexType;
@@ -813,7 +813,7 @@ struct __libcpp_complex_overload_traits<_Tp, false, true>
 // real
 
 template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 _Tp
 real(const complex<_Tp>& __c)
 {
@@ -821,8 +821,8 @@ real(const complex<_Tp>& __c)
 }
 
 template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-typename __libcpp_complex_overload_traits<_Tp>::_ValueType
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
+typename __LIBCUDACXX_complex_overload_traits<_Tp>::_ValueType
 real(_Tp __re)
 {
     return __re;
@@ -831,7 +831,7 @@ real(_Tp __re)
 // imag
 
 template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 _Tp
 imag(const complex<_Tp>& __c)
 {
@@ -839,8 +839,8 @@ imag(const complex<_Tp>& __c)
 }
 
 template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-typename __libcpp_complex_overload_traits<_Tp>::_ValueType
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
+typename __LIBCUDACXX_complex_overload_traits<_Tp>::_ValueType
 imag(_Tp)
 {
     return 0;
@@ -849,7 +849,7 @@ imag(_Tp)
 // abs
 
 template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 _Tp
 abs(const complex<_Tp>& __c)
 {
@@ -859,7 +859,7 @@ abs(const complex<_Tp>& __c)
 // arg
 
 template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 _Tp
 arg(const complex<_Tp>& __c)
 {
@@ -867,7 +867,7 @@ arg(const complex<_Tp>& __c)
 }
 
 template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename enable_if<
     is_same<_Tp, long double>::value,
     long double
@@ -878,7 +878,7 @@ arg(_Tp __re)
 }
 
 template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename enable_if
 <
     is_integral<_Tp>::value || is_same<_Tp, double>::value,
@@ -890,7 +890,7 @@ arg(_Tp __re)
 }
 
 template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename enable_if<
     is_same<_Tp, float>::value,
     float
@@ -903,30 +903,30 @@ arg(_Tp __re)
 // norm
 
 template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 _Tp
 norm(const complex<_Tp>& __c)
 {
-    if (__libcpp_isinf_or_builtin(__c.real()))
+    if (__LIBCUDACXX_isinf_or_builtin(__c.real()))
         return abs(__c.real());
-    if (__libcpp_isinf_or_builtin(__c.imag()))
+    if (__LIBCUDACXX_isinf_or_builtin(__c.imag()))
         return abs(__c.imag());
     return __c.real() * __c.real() + __c.imag() * __c.imag();
 }
 
 template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-typename __libcpp_complex_overload_traits<_Tp>::_ValueType
+inline _LIBCUDACXX_INLINE_VISIBILITY
+typename __LIBCUDACXX_complex_overload_traits<_Tp>::_ValueType
 norm(_Tp __re)
 {
-    typedef typename __libcpp_complex_overload_traits<_Tp>::_ValueType _ValueType;
+    typedef typename __LIBCUDACXX_complex_overload_traits<_Tp>::_ValueType _ValueType;
     return static_cast<_ValueType>(__re) * __re;
 }
 
 // conj
 
 template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 complex<_Tp>
 conj(const complex<_Tp>& __c)
 {
@@ -934,11 +934,11 @@ conj(const complex<_Tp>& __c)
 }
 
 template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-typename __libcpp_complex_overload_traits<_Tp>::_ComplexType
+inline _LIBCUDACXX_INLINE_VISIBILITY
+typename __LIBCUDACXX_complex_overload_traits<_Tp>::_ComplexType
 conj(_Tp __re)
 {
-    typedef typename __libcpp_complex_overload_traits<_Tp>::_ComplexType _ComplexType;
+    typedef typename __LIBCUDACXX_complex_overload_traits<_Tp>::_ComplexType _ComplexType;
     return _ComplexType(__re);
 }
 
@@ -947,40 +947,40 @@ conj(_Tp __re)
 // proj
 
 template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 complex<_Tp>
 proj(const complex<_Tp>& __c)
 {
     complex<_Tp> __r = __c;
-    if (__libcpp_isinf_or_builtin(__c.real()) || __libcpp_isinf_or_builtin(__c.imag()))
+    if (__LIBCUDACXX_isinf_or_builtin(__c.real()) || __LIBCUDACXX_isinf_or_builtin(__c.imag()))
         __r = complex<_Tp>(INFINITY, copysign(_Tp(0), __c.imag()));
     return __r;
 }
 
 template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename enable_if
 <
     is_floating_point<_Tp>::value,
-    typename __libcpp_complex_overload_traits<_Tp>::_ComplexType
+    typename __LIBCUDACXX_complex_overload_traits<_Tp>::_ComplexType
 >::type
 proj(_Tp __re)
 {
-    if (__libcpp_isinf_or_builtin(__re))
+    if (__LIBCUDACXX_isinf_or_builtin(__re))
         __re = abs(__re);
     return complex<_Tp>(__re);
 }
 
 template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename enable_if
 <
     is_integral<_Tp>::value,
-    typename __libcpp_complex_overload_traits<_Tp>::_ComplexType
+    typename __LIBCUDACXX_complex_overload_traits<_Tp>::_ComplexType
 >::type
 proj(_Tp __re)
 {
-    typedef typename __libcpp_complex_overload_traits<_Tp>::_ComplexType _ComplexType;
+    typedef typename __LIBCUDACXX_complex_overload_traits<_Tp>::_ComplexType _ComplexType;
     return _ComplexType(__re);
 }
 
@@ -990,25 +990,25 @@ template<class _Tp>
 complex<_Tp>
 polar(const _Tp& __rho, const _Tp& __theta = _Tp())
 {
-    if (__libcpp_isnan_or_builtin(__rho) || signbit(__rho))
+    if (__LIBCUDACXX_isnan_or_builtin(__rho) || signbit(__rho))
         return complex<_Tp>(_Tp(NAN), _Tp(NAN));
-    if (__libcpp_isnan_or_builtin(__theta))
+    if (__LIBCUDACXX_isnan_or_builtin(__theta))
     {
-        if (__libcpp_isinf_or_builtin(__rho))
+        if (__LIBCUDACXX_isinf_or_builtin(__rho))
             return complex<_Tp>(__rho, __theta);
         return complex<_Tp>(__theta, __theta);
     }
-    if (__libcpp_isinf_or_builtin(__theta))
+    if (__LIBCUDACXX_isinf_or_builtin(__theta))
     {
-        if (__libcpp_isinf_or_builtin(__rho))
+        if (__LIBCUDACXX_isinf_or_builtin(__rho))
             return complex<_Tp>(__rho, _Tp(NAN));
         return complex<_Tp>(_Tp(NAN), _Tp(NAN));
     }
     _Tp __x = __rho * cos(__theta);
-    if (__libcpp_isnan_or_builtin(__x))
+    if (__LIBCUDACXX_isnan_or_builtin(__x))
         __x = 0;
     _Tp __y = __rho * sin(__theta);
-    if (__libcpp_isnan_or_builtin(__y))
+    if (__LIBCUDACXX_isnan_or_builtin(__y))
         __y = 0;
     return complex<_Tp>(__x, __y);
 }
@@ -1016,7 +1016,7 @@ polar(const _Tp& __rho, const _Tp& __theta = _Tp())
 // log
 
 template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 complex<_Tp>
 log(const complex<_Tp>& __x)
 {
@@ -1026,7 +1026,7 @@ log(const complex<_Tp>& __x)
 // log10
 
 template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 complex<_Tp>
 log10(const complex<_Tp>& __x)
 {
@@ -1039,13 +1039,13 @@ template<class _Tp>
 complex<_Tp>
 sqrt(const complex<_Tp>& __x)
 {
-    if (__libcpp_isinf_or_builtin(__x.imag()))
+    if (__LIBCUDACXX_isinf_or_builtin(__x.imag()))
         return complex<_Tp>(_Tp(INFINITY), __x.imag());
-    if (__libcpp_isinf_or_builtin(__x.real()))
+    if (__LIBCUDACXX_isinf_or_builtin(__x.real()))
     {
         if (__x.real() > _Tp(0))
-            return complex<_Tp>(__x.real(), __libcpp_isnan_or_builtin(__x.imag()) ? __x.imag() : copysign(_Tp(0), __x.imag()));
-        return complex<_Tp>(__libcpp_isnan_or_builtin(__x.imag()) ? __x.imag() : _Tp(0), copysign(__x.real(), __x.imag()));
+            return complex<_Tp>(__x.real(), __LIBCUDACXX_isnan_or_builtin(__x.imag()) ? __x.imag() : copysign(_Tp(0), __x.imag()));
+        return complex<_Tp>(__LIBCUDACXX_isnan_or_builtin(__x.imag()) ? __x.imag() : _Tp(0), copysign(__x.real(), __x.imag()));
     }
     return polar(sqrt(abs(__x)), arg(__x) / _Tp(2));
 }
@@ -1060,16 +1060,16 @@ exp(const complex<_Tp>& __x)
     if (__i == 0) {
         return complex<_Tp>(exp(__x.real()), copysign(_Tp(0), __x.imag()));
     }
-    if (__libcpp_isinf_or_builtin(__x.real()))
+    if (__LIBCUDACXX_isinf_or_builtin(__x.real()))
     {
         if (__x.real() < _Tp(0))
         {
-            if (!__libcpp_isfinite_or_builtin(__i))
+            if (!__LIBCUDACXX_isfinite_or_builtin(__i))
                 __i = _Tp(1);
         }
-        else if (__i == 0 || !__libcpp_isfinite_or_builtin(__i))
+        else if (__i == 0 || !__LIBCUDACXX_isfinite_or_builtin(__i))
         {
-            if (__libcpp_isinf_or_builtin(__i))
+            if (__LIBCUDACXX_isinf_or_builtin(__i))
                 __i = _Tp(NAN);
             return complex<_Tp>(__x.real(), __i);
         }
@@ -1081,7 +1081,7 @@ exp(const complex<_Tp>& __x)
 // pow
 
 template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 complex<_Tp>
 pow(const complex<_Tp>& __x, const complex<_Tp>& __y)
 {
@@ -1089,16 +1089,16 @@ pow(const complex<_Tp>& __x, const complex<_Tp>& __y)
 }
 
 template<class _Tp, class _Up>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 complex<typename __promote<_Tp, _Up>::type>
 pow(const complex<_Tp>& __x, const complex<_Up>& __y)
 {
     typedef complex<typename __promote<_Tp, _Up>::type> result_type;
-    return _VSTD::pow(result_type(__x), result_type(__y));
+    return _CUDA_VSTD::pow(result_type(__x), result_type(__y));
 }
 
 template<class _Tp, class _Up>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename enable_if
 <
     is_arithmetic<_Up>::value,
@@ -1107,11 +1107,11 @@ typename enable_if
 pow(const complex<_Tp>& __x, const _Up& __y)
 {
     typedef complex<typename __promote<_Tp, _Up>::type> result_type;
-    return _VSTD::pow(result_type(__x), result_type(__y));
+    return _CUDA_VSTD::pow(result_type(__x), result_type(__y));
 }
 
 template<class _Tp, class _Up>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename enable_if
 <
     is_arithmetic<_Tp>::value,
@@ -1120,13 +1120,13 @@ typename enable_if
 pow(const _Tp& __x, const complex<_Up>& __y)
 {
     typedef complex<typename __promote<_Tp, _Up>::type> result_type;
-    return _VSTD::pow(result_type(__x), result_type(__y));
+    return _CUDA_VSTD::pow(result_type(__x), result_type(__y));
 }
 
 // __sqr, computes pow(x, 2)
 
 template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 complex<_Tp>
 __sqr(const complex<_Tp>& __x)
 {
@@ -1141,23 +1141,23 @@ complex<_Tp>
 asinh(const complex<_Tp>& __x)
 {
     const _Tp __pi(atan2(+0., -0.));
-    if (__libcpp_isinf_or_builtin(__x.real()))
+    if (__LIBCUDACXX_isinf_or_builtin(__x.real()))
     {
-        if (__libcpp_isnan_or_builtin(__x.imag()))
+        if (__LIBCUDACXX_isnan_or_builtin(__x.imag()))
             return __x;
-        if (__libcpp_isinf_or_builtin(__x.imag()))
+        if (__LIBCUDACXX_isinf_or_builtin(__x.imag()))
             return complex<_Tp>(__x.real(), copysign(__pi * _Tp(0.25), __x.imag()));
         return complex<_Tp>(__x.real(), copysign(_Tp(0), __x.imag()));
     }
-    if (__libcpp_isnan_or_builtin(__x.real()))
+    if (__LIBCUDACXX_isnan_or_builtin(__x.real()))
     {
-        if (__libcpp_isinf_or_builtin(__x.imag()))
+        if (__LIBCUDACXX_isinf_or_builtin(__x.imag()))
             return complex<_Tp>(__x.imag(), __x.real());
         if (__x.imag() == 0)
             return __x;
         return complex<_Tp>(__x.real(), __x.real());
     }
-    if (__libcpp_isinf_or_builtin(__x.imag()))
+    if (__LIBCUDACXX_isinf_or_builtin(__x.imag()))
         return complex<_Tp>(copysign(__x.imag(), __x.real()), copysign(__pi/_Tp(2), __x.imag()));
     complex<_Tp> __z = log(__x + sqrt(__sqr(__x) + _Tp(1)));
     return complex<_Tp>(copysign(__z.real(), __x.real()), copysign(__z.imag(), __x.imag()));
@@ -1170,11 +1170,11 @@ complex<_Tp>
 acosh(const complex<_Tp>& __x)
 {
     const _Tp __pi(atan2(+0., -0.));
-    if (__libcpp_isinf_or_builtin(__x.real()))
+    if (__LIBCUDACXX_isinf_or_builtin(__x.real()))
     {
-        if (__libcpp_isnan_or_builtin(__x.imag()))
+        if (__LIBCUDACXX_isnan_or_builtin(__x.imag()))
             return complex<_Tp>(abs(__x.real()), __x.imag());
-        if (__libcpp_isinf_or_builtin(__x.imag()))
+        if (__LIBCUDACXX_isinf_or_builtin(__x.imag()))
         {
             if (__x.real() > 0)
                 return complex<_Tp>(__x.real(), copysign(__pi * _Tp(0.25), __x.imag()));
@@ -1185,13 +1185,13 @@ acosh(const complex<_Tp>& __x)
             return complex<_Tp>(-__x.real(), copysign(__pi, __x.imag()));
         return complex<_Tp>(__x.real(), copysign(_Tp(0), __x.imag()));
     }
-    if (__libcpp_isnan_or_builtin(__x.real()))
+    if (__LIBCUDACXX_isnan_or_builtin(__x.real()))
     {
-        if (__libcpp_isinf_or_builtin(__x.imag()))
+        if (__LIBCUDACXX_isinf_or_builtin(__x.imag()))
             return complex<_Tp>(abs(__x.imag()), __x.real());
         return complex<_Tp>(__x.real(), __x.real());
     }
-    if (__libcpp_isinf_or_builtin(__x.imag()))
+    if (__LIBCUDACXX_isinf_or_builtin(__x.imag()))
         return complex<_Tp>(abs(__x.imag()), copysign(__pi/_Tp(2), __x.imag()));
     complex<_Tp> __z = log(__x + sqrt(__sqr(__x) - _Tp(1)));
     return complex<_Tp>(copysign(__z.real(), _Tp(0)), copysign(__z.imag(), __x.imag()));
@@ -1204,21 +1204,21 @@ complex<_Tp>
 atanh(const complex<_Tp>& __x)
 {
     const _Tp __pi(atan2(+0., -0.));
-    if (__libcpp_isinf_or_builtin(__x.imag()))
+    if (__LIBCUDACXX_isinf_or_builtin(__x.imag()))
     {
         return complex<_Tp>(copysign(_Tp(0), __x.real()), copysign(__pi/_Tp(2), __x.imag()));
     }
-    if (__libcpp_isnan_or_builtin(__x.imag()))
+    if (__LIBCUDACXX_isnan_or_builtin(__x.imag()))
     {
-        if (__libcpp_isinf_or_builtin(__x.real()) || __x.real() == 0)
+        if (__LIBCUDACXX_isinf_or_builtin(__x.real()) || __x.real() == 0)
             return complex<_Tp>(copysign(_Tp(0), __x.real()), __x.imag());
         return complex<_Tp>(__x.imag(), __x.imag());
     }
-    if (__libcpp_isnan_or_builtin(__x.real()))
+    if (__LIBCUDACXX_isnan_or_builtin(__x.real()))
     {
         return complex<_Tp>(__x.real(), __x.real());
     }
-    if (__libcpp_isinf_or_builtin(__x.real()))
+    if (__LIBCUDACXX_isinf_or_builtin(__x.real()))
     {
         return complex<_Tp>(copysign(_Tp(0), __x.real()), copysign(__pi/_Tp(2), __x.imag()));
     }
@@ -1236,11 +1236,11 @@ template<class _Tp>
 complex<_Tp>
 sinh(const complex<_Tp>& __x)
 {
-    if (__libcpp_isinf_or_builtin(__x.real()) && !__libcpp_isfinite_or_builtin(__x.imag()))
+    if (__LIBCUDACXX_isinf_or_builtin(__x.real()) && !__LIBCUDACXX_isfinite_or_builtin(__x.imag()))
         return complex<_Tp>(__x.real(), _Tp(NAN));
-    if (__x.real() == 0 && !__libcpp_isfinite_or_builtin(__x.imag()))
+    if (__x.real() == 0 && !__LIBCUDACXX_isfinite_or_builtin(__x.imag()))
         return complex<_Tp>(__x.real(), _Tp(NAN));
-    if (__x.imag() == 0 && !__libcpp_isfinite_or_builtin(__x.real()))
+    if (__x.imag() == 0 && !__LIBCUDACXX_isfinite_or_builtin(__x.real()))
         return __x;
     return complex<_Tp>(sinh(__x.real()) * cos(__x.imag()), cosh(__x.real()) * sin(__x.imag()));
 }
@@ -1251,13 +1251,13 @@ template<class _Tp>
 complex<_Tp>
 cosh(const complex<_Tp>& __x)
 {
-    if (__libcpp_isinf_or_builtin(__x.real()) && !__libcpp_isfinite_or_builtin(__x.imag()))
+    if (__LIBCUDACXX_isinf_or_builtin(__x.real()) && !__LIBCUDACXX_isfinite_or_builtin(__x.imag()))
         return complex<_Tp>(abs(__x.real()), _Tp(NAN));
-    if (__x.real() == 0 && !__libcpp_isfinite_or_builtin(__x.imag()))
+    if (__x.real() == 0 && !__LIBCUDACXX_isfinite_or_builtin(__x.imag()))
         return complex<_Tp>(_Tp(NAN), __x.real());
     if (__x.real() == 0 && __x.imag() == 0)
         return complex<_Tp>(_Tp(1), __x.imag());
-    if (__x.imag() == 0 && !__libcpp_isfinite_or_builtin(__x.real()))
+    if (__x.imag() == 0 && !__LIBCUDACXX_isfinite_or_builtin(__x.real()))
         return complex<_Tp>(abs(__x.real()), __x.imag());
     return complex<_Tp>(cosh(__x.real()) * cos(__x.imag()), sinh(__x.real()) * sin(__x.imag()));
 }
@@ -1268,19 +1268,19 @@ template<class _Tp>
 complex<_Tp>
 tanh(const complex<_Tp>& __x)
 {
-    if (__libcpp_isinf_or_builtin(__x.real()))
+    if (__LIBCUDACXX_isinf_or_builtin(__x.real()))
     {
-        if (!__libcpp_isfinite_or_builtin(__x.imag()))
+        if (!__LIBCUDACXX_isfinite_or_builtin(__x.imag()))
             return complex<_Tp>(copysign(_Tp(1), __x.real()), _Tp(0));
         return complex<_Tp>(copysign(_Tp(1), __x.real()), copysign(_Tp(0), sin(_Tp(2) * __x.imag())));
     }
-    if (__libcpp_isnan_or_builtin(__x.real()) && __x.imag() == 0)
+    if (__LIBCUDACXX_isnan_or_builtin(__x.real()) && __x.imag() == 0)
         return __x;
     _Tp __2r(_Tp(2) * __x.real());
     _Tp __2i(_Tp(2) * __x.imag());
     _Tp __d(cosh(__2r) + cos(__2i));
     _Tp __2rsh(sinh(__2r));
-    if (__libcpp_isinf_or_builtin(__2rsh) && __libcpp_isinf_or_builtin(__d))
+    if (__LIBCUDACXX_isinf_or_builtin(__2rsh) && __LIBCUDACXX_isinf_or_builtin(__d))
         return complex<_Tp>(__2rsh > _Tp(0) ? _Tp(1) : _Tp(-1),
                             __2i > _Tp(0) ? _Tp(0) : _Tp(-0.));
     return  complex<_Tp>(__2rsh/__d, sin(__2i)/__d);
@@ -1303,11 +1303,11 @@ complex<_Tp>
 acos(const complex<_Tp>& __x)
 {
     const _Tp __pi(atan2(+0., -0.));
-    if (__libcpp_isinf_or_builtin(__x.real()))
+    if (__LIBCUDACXX_isinf_or_builtin(__x.real()))
     {
-        if (__libcpp_isnan_or_builtin(__x.imag()))
+        if (__LIBCUDACXX_isnan_or_builtin(__x.imag()))
             return complex<_Tp>(__x.imag(), __x.real());
-        if (__libcpp_isinf_or_builtin(__x.imag()))
+        if (__LIBCUDACXX_isinf_or_builtin(__x.imag()))
         {
             if (__x.real() < _Tp(0))
                 return complex<_Tp>(_Tp(0.75) * __pi, -__x.imag());
@@ -1317,13 +1317,13 @@ acos(const complex<_Tp>& __x)
             return complex<_Tp>(__pi, signbit(__x.imag()) ? -__x.real() : __x.real());
         return complex<_Tp>(_Tp(0), signbit(__x.imag()) ? __x.real() : -__x.real());
     }
-    if (__libcpp_isnan_or_builtin(__x.real()))
+    if (__LIBCUDACXX_isnan_or_builtin(__x.real()))
     {
-        if (__libcpp_isinf_or_builtin(__x.imag()))
+        if (__LIBCUDACXX_isinf_or_builtin(__x.imag()))
             return complex<_Tp>(__x.real(), -__x.imag());
         return complex<_Tp>(__x.real(), __x.real());
     }
-    if (__libcpp_isinf_or_builtin(__x.imag()))
+    if (__LIBCUDACXX_isinf_or_builtin(__x.imag()))
         return complex<_Tp>(__pi/_Tp(2), -__x.imag());
     if (__x.real() == 0 && (__x.imag() == 0 || isnan(__x.imag())))
         return complex<_Tp>(__pi/_Tp(2), -__x.imag());
@@ -1356,7 +1356,7 @@ sin(const complex<_Tp>& __x)
 // cos
 
 template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 complex<_Tp>
 cos(const complex<_Tp>& __x)
 {
@@ -1435,7 +1435,7 @@ operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x)
     return __is;
 }
 
-#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
+#if !defined(_LIBCUDACXX_HAS_NO_LOCALIZATION)
 template<class _Tp, class _CharT, class _Traits>
 basic_ostream<_CharT, _Traits>&
 operator<<(basic_ostream<_CharT, _Traits>& __os, const complex<_Tp>& __x)
@@ -1447,9 +1447,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const complex<_Tp>& __x)
     __s << '(' << __x.real() << ',' << __x.imag() << ')';
     return __os << __s.str();
 }
-#endif // !_LIBCPP_HAS_NO_LOCALIZATION
+#endif // !_LIBCUDACXX_HAS_NO_LOCALIZATION
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 // Literal suffix for complex number literals [complex.literals]
 inline namespace literals
 {
@@ -1490,6 +1490,6 @@ inline namespace literals
 } // namespace literals
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_COMPLEX
+#endif // _LIBCUDACXX_COMPLEX

diff  --git a/libcxx/include/complex.h b/libcxx/include/complex.h
index a2814669c7d4..1071e4a6733c 100644
--- a/libcxx/include/complex.h
+++ b/libcxx/include/complex.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_COMPLEX_H
-#define _LIBCPP_COMPLEX_H
+#ifndef _LIBCUDACXX_COMPLEX_H
+#define _LIBCUDACXX_COMPLEX_H
 
 /*
     complex.h synopsis
@@ -19,7 +19,7 @@
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
@@ -33,4 +33,4 @@
 
 #endif // __cplusplus
 
-#endif // _LIBCPP_COMPLEX_H
+#endif // _LIBCUDACXX_COMPLEX_H

diff  --git a/libcxx/include/concepts b/libcxx/include/concepts
index 301256ca7ef7..060a09efaad0 100644
--- a/libcxx/include/concepts
+++ b/libcxx/include/concepts
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_CONCEPTS
-#define _LIBCPP_CONCEPTS
+#ifndef _LIBCUDACXX_CONCEPTS
+#define _LIBCUDACXX_CONCEPTS
 
 /*
     concepts synopsis
@@ -155,8 +155,8 @@ namespace std {
 #include <__config>
 #include <version>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#endif // _LIBCPP_CONCEPTS
+#endif // _LIBCUDACXX_CONCEPTS

diff  --git a/libcxx/include/condition_variable b/libcxx/include/condition_variable
index 92088f3e1b22..f8998e5ae8df 100644
--- a/libcxx/include/condition_variable
+++ b/libcxx/include/condition_variable
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_CONDITION_VARIABLE
-#define _LIBCPP_CONDITION_VARIABLE
+#ifndef _LIBCUDACXX_CONDITION_VARIABLE
+#define _LIBCUDACXX_CONDITION_VARIABLE
 
 /*
     condition_variable synopsis
@@ -112,56 +112,56 @@ public:
 #include <memory>
 #include <version>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#ifndef _LIBCPP_HAS_NO_THREADS
+#ifndef _LIBCUDACXX_HAS_NO_THREADS
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-class _LIBCPP_TYPE_VIS condition_variable_any
+class _LIBCUDACXX_TYPE_VIS condition_variable_any
 {
     condition_variable __cv_;
     shared_ptr<mutex>  __mut_;
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     condition_variable_any();
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void notify_one() _NOEXCEPT;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void notify_all() _NOEXCEPT;
 
     template <class _Lock>
-        _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
+        _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
         void wait(_Lock& __lock);
     template <class _Lock, class _Predicate>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         void wait(_Lock& __lock, _Predicate __pred);
 
     template <class _Lock, class _Clock, class _Duration>
-        _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
+        _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
         cv_status
         wait_until(_Lock& __lock,
                    const chrono::time_point<_Clock, _Duration>& __t);
 
     template <class _Lock, class _Clock, class _Duration, class _Predicate>
         bool
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         wait_until(_Lock& __lock,
                    const chrono::time_point<_Clock, _Duration>& __t,
                    _Predicate __pred);
 
     template <class _Lock, class _Rep, class _Period>
         cv_status
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         wait_for(_Lock& __lock,
                  const chrono::duration<_Rep, _Period>& __d);
 
     template <class _Lock, class _Rep, class _Period, class _Predicate>
         bool
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         wait_for(_Lock& __lock,
                  const chrono::duration<_Rep, _Period>& __d,
                  _Predicate __pred);
@@ -257,14 +257,14 @@ condition_variable_any::wait_for(_Lock& __lock,
                                  _Predicate __pred)
 {
     return wait_until(__lock, chrono::steady_clock::now() + __d,
-                      _VSTD::move(__pred));
+                      _CUDA_VSTD::move(__pred));
 }
 
-_LIBCPP_FUNC_VIS
+_LIBCUDACXX_FUNC_VIS
 void notify_all_at_thread_exit(condition_variable&, unique_lock<mutex>);
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // !_LIBCPP_HAS_NO_THREADS
+#endif // !_LIBCUDACXX_HAS_NO_THREADS
 
-#endif // _LIBCPP_CONDITION_VARIABLE
+#endif // _LIBCUDACXX_CONDITION_VARIABLE

diff  --git a/libcxx/include/coroutine b/libcxx/include/coroutine
index 6582f5554ed0..6a66a00b9c91 100644
--- a/libcxx/include/coroutine
+++ b/libcxx/include/coroutine
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_COROUTINE
-#define _LIBCPP_COROUTINE
+#ifndef _LIBCUDACXX_COROUTINE
+#define _LIBCUDACXX_COROUTINE
 
 /**
     coroutine synopsis
@@ -46,15 +46,15 @@ struct suspend_always;
 #include <__coroutine/trivial_awaitables.h>
 #include <version>
 
-#ifndef _LIBCPP_REMOVE_TRANSITIVE_INCLUDES
+#ifndef _LIBCUDACXX_REMOVE_TRANSITIVE_INCLUDES
 #  include <iosfwd>
 #endif
 
 // standard-mandated includes
 #include <compare>
 
-#ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
+#ifndef _LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER
 #  pragma GCC system_header
 #endif
 
-#endif // _LIBCPP_COROUTINE
+#endif // _LIBCUDACXX_COROUTINE

diff  --git a/libcxx/include/csetjmp b/libcxx/include/csetjmp
index 4f40bcbf61e9..bd135edd4c23 100644
--- a/libcxx/include/csetjmp
+++ b/libcxx/include/csetjmp
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_CSETJMP
-#define _LIBCPP_CSETJMP
+#ifndef _LIBCUDACXX_CSETJMP
+#define _LIBCUDACXX_CSETJMP
 
 /*
     csetjmp synopsis
@@ -34,15 +34,15 @@ void longjmp(jmp_buf env, int val);
 #include <__config>
 #include <setjmp.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-using ::jmp_buf _LIBCPP_USING_IF_EXISTS;
-using ::longjmp _LIBCPP_USING_IF_EXISTS;
+using ::jmp_buf _LIBCUDACXX_USING_IF_EXISTS;
+using ::longjmp _LIBCUDACXX_USING_IF_EXISTS;
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_CSETJMP
+#endif // _LIBCUDACXX_CSETJMP

diff  --git a/libcxx/include/csignal b/libcxx/include/csignal
index c1b58f818b62..cc57edb34640 100644
--- a/libcxx/include/csignal
+++ b/libcxx/include/csignal
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_CSIGNAL
-#define _LIBCPP_CSIGNAL
+#ifndef _LIBCUDACXX_CSIGNAL
+#define _LIBCUDACXX_CSIGNAL
 
 /*
     csignal synopsis
@@ -46,16 +46,16 @@ int raise(int sig);
 # include <signal.h>
 #endif
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-using ::sig_atomic_t _LIBCPP_USING_IF_EXISTS;
-using ::signal _LIBCPP_USING_IF_EXISTS;
-using ::raise _LIBCPP_USING_IF_EXISTS;
+using ::sig_atomic_t _LIBCUDACXX_USING_IF_EXISTS;
+using ::signal _LIBCUDACXX_USING_IF_EXISTS;
+using ::raise _LIBCUDACXX_USING_IF_EXISTS;
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_CSIGNAL
+#endif // _LIBCUDACXX_CSIGNAL

diff  --git a/libcxx/include/cstdarg b/libcxx/include/cstdarg
index f36ade202b7a..d6a1bdf352b7 100644
--- a/libcxx/include/cstdarg
+++ b/libcxx/include/cstdarg
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_CSTDARG
-#define _LIBCPP_CSTDARG
+#ifndef _LIBCUDACXX_CSTDARG
+#define _LIBCUDACXX_CSTDARG
 
 /*
     cstdarg synopsis
@@ -35,14 +35,14 @@ Types:
 #include <__config>
 #include <stdarg.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-using ::va_list _LIBCPP_USING_IF_EXISTS;
+using ::va_list _LIBCUDACXX_USING_IF_EXISTS;
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_CSTDARG
+#endif // _LIBCUDACXX_CSTDARG

diff  --git a/libcxx/include/cstdbool b/libcxx/include/cstdbool
index ce608033a22c..3e56e783ebab 100644
--- a/libcxx/include/cstdbool
+++ b/libcxx/include/cstdbool
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_CSTDBOOL
-#define _LIBCPP_CSTDBOOL
+#ifndef _LIBCUDACXX_CSTDBOOL
+#define _LIBCUDACXX_CSTDBOOL
 
 /*
     cstdbool synopsis
@@ -22,11 +22,11 @@ Macros:
 #include <__assert> // all public C++ headers provide the assertion handler
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
 #undef __bool_true_false_are_defined
 #define __bool_true_false_are_defined 1
 
-#endif // _LIBCPP_CSTDBOOL
+#endif // _LIBCUDACXX_CSTDBOOL

diff  --git a/libcxx/include/cstddef b/libcxx/include/cstddef
index 8daba076d7db..28c057982517 100644
--- a/libcxx/include/cstddef
+++ b/libcxx/include/cstddef
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_CSTDDEF
-#define _LIBCPP_CSTDDEF
+#ifndef _LIBCUDACXX_CSTDDEF
+#define _LIBCUDACXX_CSTDDEF
 
 /*
     cstddef synopsis
@@ -41,23 +41,23 @@ Types:
 #include <stddef.h>
 #include <version>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 using ::nullptr_t;
-using ::ptr
diff _t _LIBCPP_USING_IF_EXISTS;
-using ::size_t _LIBCPP_USING_IF_EXISTS;
+using ::ptr
diff _t _LIBCUDACXX_USING_IF_EXISTS;
+using ::size_t _LIBCUDACXX_USING_IF_EXISTS;
 
-#if !defined(_LIBCPP_CXX03_LANG)
-using ::max_align_t _LIBCPP_USING_IF_EXISTS;
+#if !defined(_LIBCUDACXX_CXX03_LANG)
+using ::max_align_t _LIBCUDACXX_USING_IF_EXISTS;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 namespace std  // purposefully not versioned
 {
 enum class byte : unsigned char {};
@@ -127,11 +127,11 @@ template <class _Integer>
   { return static_cast<byte>(static_cast<unsigned char>(static_cast<unsigned int>(__lhs) >> __shift)); }
 
 template <class _Integer, class = _EnableByteOverload<_Integer> >
-  _LIBCPP_NODISCARD_EXT constexpr _Integer
+  _LIBCUDACXX_NODISCARD_EXT constexpr _Integer
   to_integer(byte __b) noexcept { return static_cast<_Integer>(__b); }
 
 } // namespace std
 
 #endif
 
-#endif // _LIBCPP_CSTDDEF
+#endif // _LIBCUDACXX_CSTDDEF

diff  --git a/libcxx/include/cstdint b/libcxx/include/cstdint
index 83cda947b497..bb588d7bec91 100644
--- a/libcxx/include/cstdint
+++ b/libcxx/include/cstdint
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_CSTDINT
-#define _LIBCPP_CSTDINT
+#ifndef _LIBCUDACXX_CSTDINT
+#define _LIBCUDACXX_CSTDINT
 
 /*
     cstdint synopsis
@@ -144,48 +144,48 @@ Types:
 #include <__config>
 #include <stdint.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-using ::int8_t _LIBCPP_USING_IF_EXISTS;
-using ::int16_t _LIBCPP_USING_IF_EXISTS;
-using ::int32_t _LIBCPP_USING_IF_EXISTS;
-using ::int64_t _LIBCPP_USING_IF_EXISTS;
+using ::int8_t _LIBCUDACXX_USING_IF_EXISTS;
+using ::int16_t _LIBCUDACXX_USING_IF_EXISTS;
+using ::int32_t _LIBCUDACXX_USING_IF_EXISTS;
+using ::int64_t _LIBCUDACXX_USING_IF_EXISTS;
 
-using ::uint8_t _LIBCPP_USING_IF_EXISTS;
-using ::uint16_t _LIBCPP_USING_IF_EXISTS;
-using ::uint32_t _LIBCPP_USING_IF_EXISTS;
-using ::uint64_t _LIBCPP_USING_IF_EXISTS;
+using ::uint8_t _LIBCUDACXX_USING_IF_EXISTS;
+using ::uint16_t _LIBCUDACXX_USING_IF_EXISTS;
+using ::uint32_t _LIBCUDACXX_USING_IF_EXISTS;
+using ::uint64_t _LIBCUDACXX_USING_IF_EXISTS;
 
-using ::int_least8_t _LIBCPP_USING_IF_EXISTS;
-using ::int_least16_t _LIBCPP_USING_IF_EXISTS;
-using ::int_least32_t _LIBCPP_USING_IF_EXISTS;
-using ::int_least64_t _LIBCPP_USING_IF_EXISTS;
+using ::int_least8_t _LIBCUDACXX_USING_IF_EXISTS;
+using ::int_least16_t _LIBCUDACXX_USING_IF_EXISTS;
+using ::int_least32_t _LIBCUDACXX_USING_IF_EXISTS;
+using ::int_least64_t _LIBCUDACXX_USING_IF_EXISTS;
 
-using ::uint_least8_t _LIBCPP_USING_IF_EXISTS;
-using ::uint_least16_t _LIBCPP_USING_IF_EXISTS;
-using ::uint_least32_t _LIBCPP_USING_IF_EXISTS;
-using ::uint_least64_t _LIBCPP_USING_IF_EXISTS;
+using ::uint_least8_t _LIBCUDACXX_USING_IF_EXISTS;
+using ::uint_least16_t _LIBCUDACXX_USING_IF_EXISTS;
+using ::uint_least32_t _LIBCUDACXX_USING_IF_EXISTS;
+using ::uint_least64_t _LIBCUDACXX_USING_IF_EXISTS;
 
-using ::int_fast8_t _LIBCPP_USING_IF_EXISTS;
-using ::int_fast16_t _LIBCPP_USING_IF_EXISTS;
-using ::int_fast32_t _LIBCPP_USING_IF_EXISTS;
-using ::int_fast64_t _LIBCPP_USING_IF_EXISTS;
+using ::int_fast8_t _LIBCUDACXX_USING_IF_EXISTS;
+using ::int_fast16_t _LIBCUDACXX_USING_IF_EXISTS;
+using ::int_fast32_t _LIBCUDACXX_USING_IF_EXISTS;
+using ::int_fast64_t _LIBCUDACXX_USING_IF_EXISTS;
 
-using ::uint_fast8_t _LIBCPP_USING_IF_EXISTS;
-using ::uint_fast16_t _LIBCPP_USING_IF_EXISTS;
-using ::uint_fast32_t _LIBCPP_USING_IF_EXISTS;
-using ::uint_fast64_t _LIBCPP_USING_IF_EXISTS;
+using ::uint_fast8_t _LIBCUDACXX_USING_IF_EXISTS;
+using ::uint_fast16_t _LIBCUDACXX_USING_IF_EXISTS;
+using ::uint_fast32_t _LIBCUDACXX_USING_IF_EXISTS;
+using ::uint_fast64_t _LIBCUDACXX_USING_IF_EXISTS;
 
-using ::intptr_t _LIBCPP_USING_IF_EXISTS;
-using ::uintptr_t _LIBCPP_USING_IF_EXISTS;
+using ::intptr_t _LIBCUDACXX_USING_IF_EXISTS;
+using ::uintptr_t _LIBCUDACXX_USING_IF_EXISTS;
 
-using ::intmax_t _LIBCPP_USING_IF_EXISTS;
-using ::uintmax_t _LIBCPP_USING_IF_EXISTS;
+using ::intmax_t _LIBCUDACXX_USING_IF_EXISTS;
+using ::uintmax_t _LIBCUDACXX_USING_IF_EXISTS;
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_CSTDINT
+#endif // _LIBCUDACXX_CSTDINT

diff  --git a/libcxx/include/cstdio b/libcxx/include/cstdio
index d191086a85da..9c1a0bb19fe0 100644
--- a/libcxx/include/cstdio
+++ b/libcxx/include/cstdio
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_CSTDIO
-#define _LIBCPP_CSTDIO
+#ifndef _LIBCUDACXX_CSTDIO
+#define _LIBCUDACXX_CSTDIO
 
 /*
     cstdio synopsis
@@ -99,72 +99,72 @@ void perror(const char* s);
 #include <__config>
 #include <stdio.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-using ::FILE _LIBCPP_USING_IF_EXISTS;
-using ::fpos_t _LIBCPP_USING_IF_EXISTS;
-using ::size_t _LIBCPP_USING_IF_EXISTS;
-
-using ::fclose _LIBCPP_USING_IF_EXISTS;
-using ::fflush _LIBCPP_USING_IF_EXISTS;
-using ::setbuf _LIBCPP_USING_IF_EXISTS;
-using ::setvbuf _LIBCPP_USING_IF_EXISTS;
-using ::fprintf _LIBCPP_USING_IF_EXISTS;
-using ::fscanf _LIBCPP_USING_IF_EXISTS;
-using ::snprintf _LIBCPP_USING_IF_EXISTS;
-using ::sprintf _LIBCPP_USING_IF_EXISTS;
-using ::sscanf _LIBCPP_USING_IF_EXISTS;
-using ::vfprintf _LIBCPP_USING_IF_EXISTS;
-using ::vfscanf _LIBCPP_USING_IF_EXISTS;
-using ::vsscanf _LIBCPP_USING_IF_EXISTS;
-using ::vsnprintf _LIBCPP_USING_IF_EXISTS;
-using ::vsprintf _LIBCPP_USING_IF_EXISTS;
-using ::fgetc _LIBCPP_USING_IF_EXISTS;
-using ::fgets _LIBCPP_USING_IF_EXISTS;
-using ::fputc _LIBCPP_USING_IF_EXISTS;
-using ::fputs _LIBCPP_USING_IF_EXISTS;
-using ::getc _LIBCPP_USING_IF_EXISTS;
-using ::putc _LIBCPP_USING_IF_EXISTS;
-using ::ungetc _LIBCPP_USING_IF_EXISTS;
-using ::fread _LIBCPP_USING_IF_EXISTS;
-using ::fwrite _LIBCPP_USING_IF_EXISTS;
-#ifndef _LIBCPP_HAS_NO_FGETPOS_FSETPOS
-using ::fgetpos _LIBCPP_USING_IF_EXISTS;
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
+
+using ::FILE _LIBCUDACXX_USING_IF_EXISTS;
+using ::fpos_t _LIBCUDACXX_USING_IF_EXISTS;
+using ::size_t _LIBCUDACXX_USING_IF_EXISTS;
+
+using ::fclose _LIBCUDACXX_USING_IF_EXISTS;
+using ::fflush _LIBCUDACXX_USING_IF_EXISTS;
+using ::setbuf _LIBCUDACXX_USING_IF_EXISTS;
+using ::setvbuf _LIBCUDACXX_USING_IF_EXISTS;
+using ::fprintf _LIBCUDACXX_USING_IF_EXISTS;
+using ::fscanf _LIBCUDACXX_USING_IF_EXISTS;
+using ::snprintf _LIBCUDACXX_USING_IF_EXISTS;
+using ::sprintf _LIBCUDACXX_USING_IF_EXISTS;
+using ::sscanf _LIBCUDACXX_USING_IF_EXISTS;
+using ::vfprintf _LIBCUDACXX_USING_IF_EXISTS;
+using ::vfscanf _LIBCUDACXX_USING_IF_EXISTS;
+using ::vsscanf _LIBCUDACXX_USING_IF_EXISTS;
+using ::vsnprintf _LIBCUDACXX_USING_IF_EXISTS;
+using ::vsprintf _LIBCUDACXX_USING_IF_EXISTS;
+using ::fgetc _LIBCUDACXX_USING_IF_EXISTS;
+using ::fgets _LIBCUDACXX_USING_IF_EXISTS;
+using ::fputc _LIBCUDACXX_USING_IF_EXISTS;
+using ::fputs _LIBCUDACXX_USING_IF_EXISTS;
+using ::getc _LIBCUDACXX_USING_IF_EXISTS;
+using ::putc _LIBCUDACXX_USING_IF_EXISTS;
+using ::ungetc _LIBCUDACXX_USING_IF_EXISTS;
+using ::fread _LIBCUDACXX_USING_IF_EXISTS;
+using ::fwrite _LIBCUDACXX_USING_IF_EXISTS;
+#ifndef _LIBCUDACXX_HAS_NO_FGETPOS_FSETPOS
+using ::fgetpos _LIBCUDACXX_USING_IF_EXISTS;
 #endif
-using ::fseek _LIBCPP_USING_IF_EXISTS;
-#ifndef _LIBCPP_HAS_NO_FGETPOS_FSETPOS
-using ::fsetpos _LIBCPP_USING_IF_EXISTS;
+using ::fseek _LIBCUDACXX_USING_IF_EXISTS;
+#ifndef _LIBCUDACXX_HAS_NO_FGETPOS_FSETPOS
+using ::fsetpos _LIBCUDACXX_USING_IF_EXISTS;
 #endif
-using ::ftell _LIBCPP_USING_IF_EXISTS;
-using ::rewind _LIBCPP_USING_IF_EXISTS;
-using ::clearerr _LIBCPP_USING_IF_EXISTS;
-using ::feof _LIBCPP_USING_IF_EXISTS;
-using ::ferror _LIBCPP_USING_IF_EXISTS;
-using ::perror _LIBCPP_USING_IF_EXISTS;
-
-using ::fopen _LIBCPP_USING_IF_EXISTS;
-using ::freopen _LIBCPP_USING_IF_EXISTS;
-using ::remove _LIBCPP_USING_IF_EXISTS;
-using ::rename _LIBCPP_USING_IF_EXISTS;
-using ::tmpfile _LIBCPP_USING_IF_EXISTS;
-using ::tmpnam _LIBCPP_USING_IF_EXISTS;
-
-using ::getchar _LIBCPP_USING_IF_EXISTS;
-#if _LIBCPP_STD_VER <= 11 && !defined(_LIBCPP_C_HAS_NO_GETS)
-using ::gets _LIBCPP_USING_IF_EXISTS;
+using ::ftell _LIBCUDACXX_USING_IF_EXISTS;
+using ::rewind _LIBCUDACXX_USING_IF_EXISTS;
+using ::clearerr _LIBCUDACXX_USING_IF_EXISTS;
+using ::feof _LIBCUDACXX_USING_IF_EXISTS;
+using ::ferror _LIBCUDACXX_USING_IF_EXISTS;
+using ::perror _LIBCUDACXX_USING_IF_EXISTS;
+
+using ::fopen _LIBCUDACXX_USING_IF_EXISTS;
+using ::freopen _LIBCUDACXX_USING_IF_EXISTS;
+using ::remove _LIBCUDACXX_USING_IF_EXISTS;
+using ::rename _LIBCUDACXX_USING_IF_EXISTS;
+using ::tmpfile _LIBCUDACXX_USING_IF_EXISTS;
+using ::tmpnam _LIBCUDACXX_USING_IF_EXISTS;
+
+using ::getchar _LIBCUDACXX_USING_IF_EXISTS;
+#if _LIBCUDACXX_STD_VER <= 11 && !defined(_LIBCUDACXX_C_HAS_NO_GETS)
+using ::gets _LIBCUDACXX_USING_IF_EXISTS;
 #endif
-using ::scanf _LIBCPP_USING_IF_EXISTS;
-using ::vscanf _LIBCPP_USING_IF_EXISTS;
+using ::scanf _LIBCUDACXX_USING_IF_EXISTS;
+using ::vscanf _LIBCUDACXX_USING_IF_EXISTS;
 
-using ::printf _LIBCPP_USING_IF_EXISTS;
-using ::putchar _LIBCPP_USING_IF_EXISTS;
-using ::puts _LIBCPP_USING_IF_EXISTS;
-using ::vprintf _LIBCPP_USING_IF_EXISTS;
+using ::printf _LIBCUDACXX_USING_IF_EXISTS;
+using ::putchar _LIBCUDACXX_USING_IF_EXISTS;
+using ::puts _LIBCUDACXX_USING_IF_EXISTS;
+using ::vprintf _LIBCUDACXX_USING_IF_EXISTS;
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_CSTDIO
+#endif // _LIBCUDACXX_CSTDIO

diff  --git a/libcxx/include/cstdlib b/libcxx/include/cstdlib
index 457c31f625d8..dde6f0cb3200 100644
--- a/libcxx/include/cstdlib
+++ b/libcxx/include/cstdlib
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_CSTDLIB
-#define _LIBCPP_CSTDLIB
+#ifndef _LIBCUDACXX_CSTDLIB
+#define _LIBCUDACXX_CSTDLIB
 
 /*
     cstdlib synopsis
@@ -85,60 +85,60 @@ void *aligned_alloc(size_t alignment, size_t size);                       // C11
 #include <__config>
 #include <stdlib.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-using ::size_t _LIBCPP_USING_IF_EXISTS;
-using ::div_t _LIBCPP_USING_IF_EXISTS;
-using ::ldiv_t _LIBCPP_USING_IF_EXISTS;
-using ::lldiv_t _LIBCPP_USING_IF_EXISTS;
-using ::atof _LIBCPP_USING_IF_EXISTS;
-using ::atoi _LIBCPP_USING_IF_EXISTS;
-using ::atol _LIBCPP_USING_IF_EXISTS;
-using ::atoll _LIBCPP_USING_IF_EXISTS;
-using ::strtod _LIBCPP_USING_IF_EXISTS;
-using ::strtof _LIBCPP_USING_IF_EXISTS;
-using ::strtold _LIBCPP_USING_IF_EXISTS;
-using ::strtol _LIBCPP_USING_IF_EXISTS;
-using ::strtoll _LIBCPP_USING_IF_EXISTS;
-using ::strtoul _LIBCPP_USING_IF_EXISTS;
-using ::strtoull _LIBCPP_USING_IF_EXISTS;
-using ::rand _LIBCPP_USING_IF_EXISTS;
-using ::srand _LIBCPP_USING_IF_EXISTS;
-using ::calloc _LIBCPP_USING_IF_EXISTS;
-using ::free _LIBCPP_USING_IF_EXISTS;
-using ::malloc _LIBCPP_USING_IF_EXISTS;
-using ::realloc _LIBCPP_USING_IF_EXISTS;
-using ::abort _LIBCPP_USING_IF_EXISTS;
-using ::atexit _LIBCPP_USING_IF_EXISTS;
-using ::exit _LIBCPP_USING_IF_EXISTS;
-using ::_Exit _LIBCPP_USING_IF_EXISTS;
-using ::getenv _LIBCPP_USING_IF_EXISTS;
-using ::system _LIBCPP_USING_IF_EXISTS;
-using ::bsearch _LIBCPP_USING_IF_EXISTS;
-using ::qsort _LIBCPP_USING_IF_EXISTS;
-using ::abs _LIBCPP_USING_IF_EXISTS;
-using ::labs _LIBCPP_USING_IF_EXISTS;
-using ::llabs _LIBCPP_USING_IF_EXISTS;
-using ::div _LIBCPP_USING_IF_EXISTS;
-using ::ldiv _LIBCPP_USING_IF_EXISTS;
-using ::lldiv _LIBCPP_USING_IF_EXISTS;
-using ::mblen _LIBCPP_USING_IF_EXISTS;
-using ::mbtowc _LIBCPP_USING_IF_EXISTS;
-using ::wctomb _LIBCPP_USING_IF_EXISTS;
-using ::mbstowcs _LIBCPP_USING_IF_EXISTS;
-using ::wcstombs _LIBCPP_USING_IF_EXISTS;
-#if !defined(_LIBCPP_CXX03_LANG)
-using ::at_quick_exit _LIBCPP_USING_IF_EXISTS;
-using ::quick_exit _LIBCPP_USING_IF_EXISTS;
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
+
+using ::size_t _LIBCUDACXX_USING_IF_EXISTS;
+using ::div_t _LIBCUDACXX_USING_IF_EXISTS;
+using ::ldiv_t _LIBCUDACXX_USING_IF_EXISTS;
+using ::lldiv_t _LIBCUDACXX_USING_IF_EXISTS;
+using ::atof _LIBCUDACXX_USING_IF_EXISTS;
+using ::atoi _LIBCUDACXX_USING_IF_EXISTS;
+using ::atol _LIBCUDACXX_USING_IF_EXISTS;
+using ::atoll _LIBCUDACXX_USING_IF_EXISTS;
+using ::strtod _LIBCUDACXX_USING_IF_EXISTS;
+using ::strtof _LIBCUDACXX_USING_IF_EXISTS;
+using ::strtold _LIBCUDACXX_USING_IF_EXISTS;
+using ::strtol _LIBCUDACXX_USING_IF_EXISTS;
+using ::strtoll _LIBCUDACXX_USING_IF_EXISTS;
+using ::strtoul _LIBCUDACXX_USING_IF_EXISTS;
+using ::strtoull _LIBCUDACXX_USING_IF_EXISTS;
+using ::rand _LIBCUDACXX_USING_IF_EXISTS;
+using ::srand _LIBCUDACXX_USING_IF_EXISTS;
+using ::calloc _LIBCUDACXX_USING_IF_EXISTS;
+using ::free _LIBCUDACXX_USING_IF_EXISTS;
+using ::malloc _LIBCUDACXX_USING_IF_EXISTS;
+using ::realloc _LIBCUDACXX_USING_IF_EXISTS;
+using ::abort _LIBCUDACXX_USING_IF_EXISTS;
+using ::atexit _LIBCUDACXX_USING_IF_EXISTS;
+using ::exit _LIBCUDACXX_USING_IF_EXISTS;
+using ::_Exit _LIBCUDACXX_USING_IF_EXISTS;
+using ::getenv _LIBCUDACXX_USING_IF_EXISTS;
+using ::system _LIBCUDACXX_USING_IF_EXISTS;
+using ::bsearch _LIBCUDACXX_USING_IF_EXISTS;
+using ::qsort _LIBCUDACXX_USING_IF_EXISTS;
+using ::abs _LIBCUDACXX_USING_IF_EXISTS;
+using ::labs _LIBCUDACXX_USING_IF_EXISTS;
+using ::llabs _LIBCUDACXX_USING_IF_EXISTS;
+using ::div _LIBCUDACXX_USING_IF_EXISTS;
+using ::ldiv _LIBCUDACXX_USING_IF_EXISTS;
+using ::lldiv _LIBCUDACXX_USING_IF_EXISTS;
+using ::mblen _LIBCUDACXX_USING_IF_EXISTS;
+using ::mbtowc _LIBCUDACXX_USING_IF_EXISTS;
+using ::wctomb _LIBCUDACXX_USING_IF_EXISTS;
+using ::mbstowcs _LIBCUDACXX_USING_IF_EXISTS;
+using ::wcstombs _LIBCUDACXX_USING_IF_EXISTS;
+#if !defined(_LIBCUDACXX_CXX03_LANG)
+using ::at_quick_exit _LIBCUDACXX_USING_IF_EXISTS;
+using ::quick_exit _LIBCUDACXX_USING_IF_EXISTS;
 #endif
-#if _LIBCPP_STD_VER > 14
-using ::aligned_alloc _LIBCPP_USING_IF_EXISTS;
+#if _LIBCUDACXX_STD_VER > 14
+using ::aligned_alloc _LIBCUDACXX_USING_IF_EXISTS;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_CSTDLIB
+#endif // _LIBCUDACXX_CSTDLIB

diff  --git a/libcxx/include/cstring b/libcxx/include/cstring
index 37c92e149b8f..7a9e13c447ff 100644
--- a/libcxx/include/cstring
+++ b/libcxx/include/cstring
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_CSTRING
-#define _LIBCPP_CSTRING
+#ifndef _LIBCUDACXX_CSTRING
+#define _LIBCUDACXX_CSTRING
 
 /*
     cstring synopsis
@@ -60,36 +60,36 @@ size_t strlen(const char* s);
 #include <__config>
 #include <string.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-using ::size_t _LIBCPP_USING_IF_EXISTS;
-using ::memcpy _LIBCPP_USING_IF_EXISTS;
-using ::memmove _LIBCPP_USING_IF_EXISTS;
-using ::strcpy _LIBCPP_USING_IF_EXISTS;
-using ::strncpy _LIBCPP_USING_IF_EXISTS;
-using ::strcat _LIBCPP_USING_IF_EXISTS;
-using ::strncat _LIBCPP_USING_IF_EXISTS;
-using ::memcmp _LIBCPP_USING_IF_EXISTS;
-using ::strcmp _LIBCPP_USING_IF_EXISTS;
-using ::strncmp _LIBCPP_USING_IF_EXISTS;
-using ::strcoll _LIBCPP_USING_IF_EXISTS;
-using ::strxfrm _LIBCPP_USING_IF_EXISTS;
-using ::memchr _LIBCPP_USING_IF_EXISTS;
-using ::strchr _LIBCPP_USING_IF_EXISTS;
-using ::strcspn _LIBCPP_USING_IF_EXISTS;
-using ::strpbrk _LIBCPP_USING_IF_EXISTS;
-using ::strrchr _LIBCPP_USING_IF_EXISTS;
-using ::strspn _LIBCPP_USING_IF_EXISTS;
-using ::strstr _LIBCPP_USING_IF_EXISTS;
-using ::strtok _LIBCPP_USING_IF_EXISTS;
-using ::memset _LIBCPP_USING_IF_EXISTS;
-using ::strerror _LIBCPP_USING_IF_EXISTS;
-using ::strlen _LIBCPP_USING_IF_EXISTS;
-
-_LIBCPP_END_NAMESPACE_STD
-
-#endif // _LIBCPP_CSTRING
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
+
+using ::size_t _LIBCUDACXX_USING_IF_EXISTS;
+using ::memcpy _LIBCUDACXX_USING_IF_EXISTS;
+using ::memmove _LIBCUDACXX_USING_IF_EXISTS;
+using ::strcpy _LIBCUDACXX_USING_IF_EXISTS;
+using ::strncpy _LIBCUDACXX_USING_IF_EXISTS;
+using ::strcat _LIBCUDACXX_USING_IF_EXISTS;
+using ::strncat _LIBCUDACXX_USING_IF_EXISTS;
+using ::memcmp _LIBCUDACXX_USING_IF_EXISTS;
+using ::strcmp _LIBCUDACXX_USING_IF_EXISTS;
+using ::strncmp _LIBCUDACXX_USING_IF_EXISTS;
+using ::strcoll _LIBCUDACXX_USING_IF_EXISTS;
+using ::strxfrm _LIBCUDACXX_USING_IF_EXISTS;
+using ::memchr _LIBCUDACXX_USING_IF_EXISTS;
+using ::strchr _LIBCUDACXX_USING_IF_EXISTS;
+using ::strcspn _LIBCUDACXX_USING_IF_EXISTS;
+using ::strpbrk _LIBCUDACXX_USING_IF_EXISTS;
+using ::strrchr _LIBCUDACXX_USING_IF_EXISTS;
+using ::strspn _LIBCUDACXX_USING_IF_EXISTS;
+using ::strstr _LIBCUDACXX_USING_IF_EXISTS;
+using ::strtok _LIBCUDACXX_USING_IF_EXISTS;
+using ::memset _LIBCUDACXX_USING_IF_EXISTS;
+using ::strerror _LIBCUDACXX_USING_IF_EXISTS;
+using ::strlen _LIBCUDACXX_USING_IF_EXISTS;
+
+_LIBCUDACXX_END_NAMESPACE_STD
+
+#endif // _LIBCUDACXX_CSTRING

diff  --git a/libcxx/include/ctgmath b/libcxx/include/ctgmath
index bfcf2f98d470..a98bd3d45bb2 100644
--- a/libcxx/include/ctgmath
+++ b/libcxx/include/ctgmath
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_CTGMATH
-#define _LIBCPP_CTGMATH
+#ifndef _LIBCUDACXX_CTGMATH
+#define _LIBCUDACXX_CTGMATH
 
 /*
     ctgmath synopsis
@@ -22,8 +22,8 @@
 #include <ccomplex>
 #include <cmath>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#endif // _LIBCPP_CTGMATH
+#endif // _LIBCUDACXX_CTGMATH

diff  --git a/libcxx/include/ctime b/libcxx/include/ctime
index 0c6e4dfd6f98..2b4f5fedd52a 100644
--- a/libcxx/include/ctime
+++ b/libcxx/include/ctime
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_CTIME
-#define _LIBCPP_CTIME
+#ifndef _LIBCUDACXX_CTIME
+#define _LIBCUDACXX_CTIME
 
 /*
     ctime synopsis
@@ -49,32 +49,32 @@ int timespec_get( struct timespec *ts, int base); // C++17
 #include <__config>
 #include <time.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-using ::clock_t _LIBCPP_USING_IF_EXISTS;
-using ::size_t _LIBCPP_USING_IF_EXISTS;
-using ::time_t _LIBCPP_USING_IF_EXISTS;
-using ::tm _LIBCPP_USING_IF_EXISTS;
-#if _LIBCPP_STD_VER > 14
-using ::timespec _LIBCPP_USING_IF_EXISTS;
+using ::clock_t _LIBCUDACXX_USING_IF_EXISTS;
+using ::size_t _LIBCUDACXX_USING_IF_EXISTS;
+using ::time_t _LIBCUDACXX_USING_IF_EXISTS;
+using ::tm _LIBCUDACXX_USING_IF_EXISTS;
+#if _LIBCUDACXX_STD_VER > 14
+using ::timespec _LIBCUDACXX_USING_IF_EXISTS;
 #endif
-using ::clock _LIBCPP_USING_IF_EXISTS;
-using ::
diff time _LIBCPP_USING_IF_EXISTS;
-using ::mktime _LIBCPP_USING_IF_EXISTS;
-using ::time _LIBCPP_USING_IF_EXISTS;
-using ::asctime _LIBCPP_USING_IF_EXISTS;
-using ::ctime _LIBCPP_USING_IF_EXISTS;
-using ::gmtime _LIBCPP_USING_IF_EXISTS;
-using ::localtime _LIBCPP_USING_IF_EXISTS;
-using ::strftime _LIBCPP_USING_IF_EXISTS;
-#if _LIBCPP_STD_VER > 14
-using ::timespec_get _LIBCPP_USING_IF_EXISTS;
+using ::clock _LIBCUDACXX_USING_IF_EXISTS;
+using ::
diff time _LIBCUDACXX_USING_IF_EXISTS;
+using ::mktime _LIBCUDACXX_USING_IF_EXISTS;
+using ::time _LIBCUDACXX_USING_IF_EXISTS;
+using ::asctime _LIBCUDACXX_USING_IF_EXISTS;
+using ::ctime _LIBCUDACXX_USING_IF_EXISTS;
+using ::gmtime _LIBCUDACXX_USING_IF_EXISTS;
+using ::localtime _LIBCUDACXX_USING_IF_EXISTS;
+using ::strftime _LIBCUDACXX_USING_IF_EXISTS;
+#if _LIBCUDACXX_STD_VER > 14
+using ::timespec_get _LIBCUDACXX_USING_IF_EXISTS;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_CTIME
+#endif // _LIBCUDACXX_CTIME

diff  --git a/libcxx/include/ctype.h b/libcxx/include/ctype.h
index ba0925069c64..58da5f952a52 100644
--- a/libcxx/include/ctype.h
+++ b/libcxx/include/ctype.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_CTYPE_H
-#define _LIBCPP_CTYPE_H
+#ifndef _LIBCUDACXX_CTYPE_H
+#define _LIBCUDACXX_CTYPE_H
 
 /*
     ctype.h synopsis
@@ -31,7 +31,7 @@ int toupper(int c);
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
@@ -56,4 +56,4 @@ int toupper(int c);
 
 #endif
 
-#endif // _LIBCPP_CTYPE_H
+#endif // _LIBCUDACXX_CTYPE_H

diff  --git a/libcxx/include/cuchar b/libcxx/include/cuchar
index a4ed585d1aeb..d1883c47e238 100644
--- a/libcxx/include/cuchar
+++ b/libcxx/include/cuchar
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_CUCHAR
-#define _LIBCPP_CUCHAR
+#ifndef _LIBCUDACXX_CUCHAR
+#define _LIBCUDACXX_CUCHAR
 
 /*
     cuchar synopsis // since C++11
@@ -38,24 +38,24 @@ size_t c32rtomb(char* s, char32_t c32, mbstate_t* ps);
 #include <__config>
 #include <uchar.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if !defined(_LIBCPP_CXX03_LANG)
+#if !defined(_LIBCUDACXX_CXX03_LANG)
 
-using ::mbstate_t _LIBCPP_USING_IF_EXISTS;
-using ::size_t _LIBCPP_USING_IF_EXISTS;
+using ::mbstate_t _LIBCUDACXX_USING_IF_EXISTS;
+using ::size_t _LIBCUDACXX_USING_IF_EXISTS;
 
-using ::mbrtoc16 _LIBCPP_USING_IF_EXISTS;
-using ::c16rtomb _LIBCPP_USING_IF_EXISTS;
-using ::mbrtoc32 _LIBCPP_USING_IF_EXISTS;
-using ::c32rtomb _LIBCPP_USING_IF_EXISTS;
+using ::mbrtoc16 _LIBCUDACXX_USING_IF_EXISTS;
+using ::c16rtomb _LIBCUDACXX_USING_IF_EXISTS;
+using ::mbrtoc32 _LIBCUDACXX_USING_IF_EXISTS;
+using ::c32rtomb _LIBCUDACXX_USING_IF_EXISTS;
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif  // _LIBCPP_CUCHAR
+#endif  // _LIBCUDACXX_CUCHAR

diff  --git a/libcxx/include/cwchar b/libcxx/include/cwchar
index 5c69ab2a7bb1..efae11dfb475 100644
--- a/libcxx/include/cwchar
+++ b/libcxx/include/cwchar
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_CWCHAR
-#define _LIBCPP_CWCHAR
+#ifndef _LIBCUDACXX_CWCHAR
+#define _LIBCUDACXX_CWCHAR
 
 /*
     cwchar synopsis
@@ -107,79 +107,79 @@ size_t wcsrtombs(char* restrict dst, const wchar_t** restrict src, size_t len,
 #include <cwctype>
 #include <wchar.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-using ::mbstate_t _LIBCPP_USING_IF_EXISTS;
-using ::size_t _LIBCPP_USING_IF_EXISTS;
-using ::tm _LIBCPP_USING_IF_EXISTS;
-using ::wint_t _LIBCPP_USING_IF_EXISTS;
-using ::FILE _LIBCPP_USING_IF_EXISTS;
-using ::fwprintf _LIBCPP_USING_IF_EXISTS;
-using ::fwscanf _LIBCPP_USING_IF_EXISTS;
-using ::swprintf _LIBCPP_USING_IF_EXISTS;
-using ::vfwprintf _LIBCPP_USING_IF_EXISTS;
-using ::vswprintf _LIBCPP_USING_IF_EXISTS;
-using ::swscanf _LIBCPP_USING_IF_EXISTS;
-using ::vfwscanf _LIBCPP_USING_IF_EXISTS;
-using ::vswscanf _LIBCPP_USING_IF_EXISTS;
-using ::fgetwc _LIBCPP_USING_IF_EXISTS;
-using ::fgetws _LIBCPP_USING_IF_EXISTS;
-using ::fputwc _LIBCPP_USING_IF_EXISTS;
-using ::fputws _LIBCPP_USING_IF_EXISTS;
-using ::fwide _LIBCPP_USING_IF_EXISTS;
-using ::getwc _LIBCPP_USING_IF_EXISTS;
-using ::putwc _LIBCPP_USING_IF_EXISTS;
-using ::ungetwc _LIBCPP_USING_IF_EXISTS;
-using ::wcstod _LIBCPP_USING_IF_EXISTS;
-using ::wcstof _LIBCPP_USING_IF_EXISTS;
-using ::wcstold _LIBCPP_USING_IF_EXISTS;
-using ::wcstol _LIBCPP_USING_IF_EXISTS;
-using ::wcstoll _LIBCPP_USING_IF_EXISTS;
-using ::wcstoul _LIBCPP_USING_IF_EXISTS;
-using ::wcstoull _LIBCPP_USING_IF_EXISTS;
-using ::wcscpy _LIBCPP_USING_IF_EXISTS;
-using ::wcsncpy _LIBCPP_USING_IF_EXISTS;
-using ::wcscat _LIBCPP_USING_IF_EXISTS;
-using ::wcsncat _LIBCPP_USING_IF_EXISTS;
-using ::wcscmp _LIBCPP_USING_IF_EXISTS;
-using ::wcscoll _LIBCPP_USING_IF_EXISTS;
-using ::wcsncmp _LIBCPP_USING_IF_EXISTS;
-using ::wcsxfrm _LIBCPP_USING_IF_EXISTS;
-using ::wcschr _LIBCPP_USING_IF_EXISTS;
-using ::wcspbrk _LIBCPP_USING_IF_EXISTS;
-using ::wcsrchr _LIBCPP_USING_IF_EXISTS;
-using ::wcsstr _LIBCPP_USING_IF_EXISTS;
-using ::wmemchr _LIBCPP_USING_IF_EXISTS;
-using ::wcscspn _LIBCPP_USING_IF_EXISTS;
-using ::wcslen _LIBCPP_USING_IF_EXISTS;
-using ::wcsspn _LIBCPP_USING_IF_EXISTS;
-using ::wcstok _LIBCPP_USING_IF_EXISTS;
-using ::wmemcmp _LIBCPP_USING_IF_EXISTS;
-using ::wmemcpy _LIBCPP_USING_IF_EXISTS;
-using ::wmemmove _LIBCPP_USING_IF_EXISTS;
-using ::wmemset _LIBCPP_USING_IF_EXISTS;
-using ::wcsftime _LIBCPP_USING_IF_EXISTS;
-using ::btowc _LIBCPP_USING_IF_EXISTS;
-using ::wctob _LIBCPP_USING_IF_EXISTS;
-using ::mbsinit _LIBCPP_USING_IF_EXISTS;
-using ::mbrlen _LIBCPP_USING_IF_EXISTS;
-using ::mbrtowc _LIBCPP_USING_IF_EXISTS;
-using ::wcrtomb _LIBCPP_USING_IF_EXISTS;
-using ::mbsrtowcs _LIBCPP_USING_IF_EXISTS;
-using ::wcsrtombs _LIBCPP_USING_IF_EXISTS;
-
-using ::getwchar _LIBCPP_USING_IF_EXISTS;
-using ::vwscanf _LIBCPP_USING_IF_EXISTS;
-using ::wscanf _LIBCPP_USING_IF_EXISTS;
-
-using ::putwchar _LIBCPP_USING_IF_EXISTS;
-using ::vwprintf _LIBCPP_USING_IF_EXISTS;
-using ::wprintf _LIBCPP_USING_IF_EXISTS;
-
-_LIBCPP_END_NAMESPACE_STD
-
-#endif // _LIBCPP_CWCHAR
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
+
+using ::mbstate_t _LIBCUDACXX_USING_IF_EXISTS;
+using ::size_t _LIBCUDACXX_USING_IF_EXISTS;
+using ::tm _LIBCUDACXX_USING_IF_EXISTS;
+using ::wint_t _LIBCUDACXX_USING_IF_EXISTS;
+using ::FILE _LIBCUDACXX_USING_IF_EXISTS;
+using ::fwprintf _LIBCUDACXX_USING_IF_EXISTS;
+using ::fwscanf _LIBCUDACXX_USING_IF_EXISTS;
+using ::swprintf _LIBCUDACXX_USING_IF_EXISTS;
+using ::vfwprintf _LIBCUDACXX_USING_IF_EXISTS;
+using ::vswprintf _LIBCUDACXX_USING_IF_EXISTS;
+using ::swscanf _LIBCUDACXX_USING_IF_EXISTS;
+using ::vfwscanf _LIBCUDACXX_USING_IF_EXISTS;
+using ::vswscanf _LIBCUDACXX_USING_IF_EXISTS;
+using ::fgetwc _LIBCUDACXX_USING_IF_EXISTS;
+using ::fgetws _LIBCUDACXX_USING_IF_EXISTS;
+using ::fputwc _LIBCUDACXX_USING_IF_EXISTS;
+using ::fputws _LIBCUDACXX_USING_IF_EXISTS;
+using ::fwide _LIBCUDACXX_USING_IF_EXISTS;
+using ::getwc _LIBCUDACXX_USING_IF_EXISTS;
+using ::putwc _LIBCUDACXX_USING_IF_EXISTS;
+using ::ungetwc _LIBCUDACXX_USING_IF_EXISTS;
+using ::wcstod _LIBCUDACXX_USING_IF_EXISTS;
+using ::wcstof _LIBCUDACXX_USING_IF_EXISTS;
+using ::wcstold _LIBCUDACXX_USING_IF_EXISTS;
+using ::wcstol _LIBCUDACXX_USING_IF_EXISTS;
+using ::wcstoll _LIBCUDACXX_USING_IF_EXISTS;
+using ::wcstoul _LIBCUDACXX_USING_IF_EXISTS;
+using ::wcstoull _LIBCUDACXX_USING_IF_EXISTS;
+using ::wcscpy _LIBCUDACXX_USING_IF_EXISTS;
+using ::wcsncpy _LIBCUDACXX_USING_IF_EXISTS;
+using ::wcscat _LIBCUDACXX_USING_IF_EXISTS;
+using ::wcsncat _LIBCUDACXX_USING_IF_EXISTS;
+using ::wcscmp _LIBCUDACXX_USING_IF_EXISTS;
+using ::wcscoll _LIBCUDACXX_USING_IF_EXISTS;
+using ::wcsncmp _LIBCUDACXX_USING_IF_EXISTS;
+using ::wcsxfrm _LIBCUDACXX_USING_IF_EXISTS;
+using ::wcschr _LIBCUDACXX_USING_IF_EXISTS;
+using ::wcspbrk _LIBCUDACXX_USING_IF_EXISTS;
+using ::wcsrchr _LIBCUDACXX_USING_IF_EXISTS;
+using ::wcsstr _LIBCUDACXX_USING_IF_EXISTS;
+using ::wmemchr _LIBCUDACXX_USING_IF_EXISTS;
+using ::wcscspn _LIBCUDACXX_USING_IF_EXISTS;
+using ::wcslen _LIBCUDACXX_USING_IF_EXISTS;
+using ::wcsspn _LIBCUDACXX_USING_IF_EXISTS;
+using ::wcstok _LIBCUDACXX_USING_IF_EXISTS;
+using ::wmemcmp _LIBCUDACXX_USING_IF_EXISTS;
+using ::wmemcpy _LIBCUDACXX_USING_IF_EXISTS;
+using ::wmemmove _LIBCUDACXX_USING_IF_EXISTS;
+using ::wmemset _LIBCUDACXX_USING_IF_EXISTS;
+using ::wcsftime _LIBCUDACXX_USING_IF_EXISTS;
+using ::btowc _LIBCUDACXX_USING_IF_EXISTS;
+using ::wctob _LIBCUDACXX_USING_IF_EXISTS;
+using ::mbsinit _LIBCUDACXX_USING_IF_EXISTS;
+using ::mbrlen _LIBCUDACXX_USING_IF_EXISTS;
+using ::mbrtowc _LIBCUDACXX_USING_IF_EXISTS;
+using ::wcrtomb _LIBCUDACXX_USING_IF_EXISTS;
+using ::mbsrtowcs _LIBCUDACXX_USING_IF_EXISTS;
+using ::wcsrtombs _LIBCUDACXX_USING_IF_EXISTS;
+
+using ::getwchar _LIBCUDACXX_USING_IF_EXISTS;
+using ::vwscanf _LIBCUDACXX_USING_IF_EXISTS;
+using ::wscanf _LIBCUDACXX_USING_IF_EXISTS;
+
+using ::putwchar _LIBCUDACXX_USING_IF_EXISTS;
+using ::vwprintf _LIBCUDACXX_USING_IF_EXISTS;
+using ::wprintf _LIBCUDACXX_USING_IF_EXISTS;
+
+_LIBCUDACXX_END_NAMESPACE_STD
+
+#endif // _LIBCUDACXX_CWCHAR

diff  --git a/libcxx/include/cwctype b/libcxx/include/cwctype
index 429b00c2446d..f6e3237cb95b 100644
--- a/libcxx/include/cwctype
+++ b/libcxx/include/cwctype
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_CWCTYPE
-#define _LIBCPP_CWCTYPE
+#ifndef _LIBCUDACXX_CWCTYPE
+#define _LIBCUDACXX_CWCTYPE
 
 /*
     cwctype synopsis
@@ -54,36 +54,36 @@ wctrans_t wctrans(const char* property);
 #include <cctype>
 #include <wctype.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-#if defined(_LIBCPP_INCLUDED_C_LIBRARY_WCTYPE_H)
-using ::wint_t _LIBCPP_USING_IF_EXISTS;
-using ::wctrans_t _LIBCPP_USING_IF_EXISTS;
-using ::wctype_t _LIBCPP_USING_IF_EXISTS;
-using ::iswalnum _LIBCPP_USING_IF_EXISTS;
-using ::iswalpha _LIBCPP_USING_IF_EXISTS;
-using ::iswblank _LIBCPP_USING_IF_EXISTS;
-using ::iswcntrl _LIBCPP_USING_IF_EXISTS;
-using ::iswdigit _LIBCPP_USING_IF_EXISTS;
-using ::iswgraph _LIBCPP_USING_IF_EXISTS;
-using ::iswlower _LIBCPP_USING_IF_EXISTS;
-using ::iswprint _LIBCPP_USING_IF_EXISTS;
-using ::iswpunct _LIBCPP_USING_IF_EXISTS;
-using ::iswspace _LIBCPP_USING_IF_EXISTS;
-using ::iswupper _LIBCPP_USING_IF_EXISTS;
-using ::iswxdigit _LIBCPP_USING_IF_EXISTS;
-using ::iswctype _LIBCPP_USING_IF_EXISTS;
-using ::wctype _LIBCPP_USING_IF_EXISTS;
-using ::towlower _LIBCPP_USING_IF_EXISTS;
-using ::towupper _LIBCPP_USING_IF_EXISTS;
-using ::towctrans _LIBCPP_USING_IF_EXISTS;
-using ::wctrans _LIBCPP_USING_IF_EXISTS;
-#endif // _LIBCPP_INCLUDED_C_LIBRARY_WCTYPE_H
-
-_LIBCPP_END_NAMESPACE_STD
-
-#endif // _LIBCPP_CWCTYPE
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
+
+#if defined(_LIBCUDACXX_INCLUDED_C_LIBRARY_WCTYPE_H)
+using ::wint_t _LIBCUDACXX_USING_IF_EXISTS;
+using ::wctrans_t _LIBCUDACXX_USING_IF_EXISTS;
+using ::wctype_t _LIBCUDACXX_USING_IF_EXISTS;
+using ::iswalnum _LIBCUDACXX_USING_IF_EXISTS;
+using ::iswalpha _LIBCUDACXX_USING_IF_EXISTS;
+using ::iswblank _LIBCUDACXX_USING_IF_EXISTS;
+using ::iswcntrl _LIBCUDACXX_USING_IF_EXISTS;
+using ::iswdigit _LIBCUDACXX_USING_IF_EXISTS;
+using ::iswgraph _LIBCUDACXX_USING_IF_EXISTS;
+using ::iswlower _LIBCUDACXX_USING_IF_EXISTS;
+using ::iswprint _LIBCUDACXX_USING_IF_EXISTS;
+using ::iswpunct _LIBCUDACXX_USING_IF_EXISTS;
+using ::iswspace _LIBCUDACXX_USING_IF_EXISTS;
+using ::iswupper _LIBCUDACXX_USING_IF_EXISTS;
+using ::iswxdigit _LIBCUDACXX_USING_IF_EXISTS;
+using ::iswctype _LIBCUDACXX_USING_IF_EXISTS;
+using ::wctype _LIBCUDACXX_USING_IF_EXISTS;
+using ::towlower _LIBCUDACXX_USING_IF_EXISTS;
+using ::towupper _LIBCUDACXX_USING_IF_EXISTS;
+using ::towctrans _LIBCUDACXX_USING_IF_EXISTS;
+using ::wctrans _LIBCUDACXX_USING_IF_EXISTS;
+#endif // _LIBCUDACXX_INCLUDED_C_LIBRARY_WCTYPE_H
+
+_LIBCUDACXX_END_NAMESPACE_STD
+
+#endif // _LIBCUDACXX_CWCTYPE

diff  --git a/libcxx/include/deque b/libcxx/include/deque
index 0d7eb9aa9316..5e520c39aa42 100644
--- a/libcxx/include/deque
+++ b/libcxx/include/deque
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_DEQUE
-#define _LIBCPP_DEQUE
+#ifndef _LIBCUDACXX_DEQUE
+#define _LIBCUDACXX_DEQUE
 
 /*
     deque synopsis
@@ -185,7 +185,7 @@ template <class T, class Allocator, class Predicate>
 #include <type_traits>
 #include <version>
 
-#ifndef _LIBCPP_REMOVE_TRANSITIVE_INCLUDES
+#ifndef _LIBCUDACXX_REMOVE_TRANSITIVE_INCLUDES
 #  include <algorithm>
 #  include <functional>
 #  include <iterator>
@@ -204,22 +204,22 @@ template <class T, class Allocator, class Predicate>
 #include <compare>
 #include <initializer_list>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Tp, class _Allocator> class __deque_base;
-template <class _Tp, class _Allocator = allocator<_Tp> > class _LIBCPP_TEMPLATE_VIS deque;
+template <class _Tp, class _Allocator = allocator<_Tp> > class _LIBCUDACXX_TEMPLATE_VIS deque;
 
 template <class _ValueType, class _Pointer, class _Reference, class _MapPointer,
           class _DiffType, _DiffType _BlockSize>
-class _LIBCPP_TEMPLATE_VIS __deque_iterator;
+class _LIBCUDACXX_TEMPLATE_VIS __deque_iterator;
 
 template <class _RAIter,
           class _V2, class _P2, class _R2, class _M2, class _D2, _D2 _B2>
@@ -316,7 +316,7 @@ struct __deque_block_size {
 
 template <class _ValueType, class _Pointer, class _Reference, class _MapPointer,
           class _DiffType, _DiffType _BS =
-#ifdef _LIBCPP_ABI_INCOMPLETE_TYPES_IN_DEQUE
+#ifdef _LIBCUDACXX_ABI_INCOMPLETE_TYPES_IN_DEQUE
 // Keep template parameter to avoid changing all template declarations thoughout
 // this file.
                                0
@@ -324,7 +324,7 @@ template <class _ValueType, class _Pointer, class _Reference, class _MapPointer,
                                __deque_block_size<_ValueType, _DiffType>::value
 #endif
           >
-class _LIBCPP_TEMPLATE_VIS __deque_iterator
+class _LIBCUDACXX_TEMPLATE_VIS __deque_iterator
 {
     typedef _MapPointer __map_iterator;
 public:
@@ -340,22 +340,22 @@ public:
     typedef random_access_iterator_tag  iterator_category;
     typedef _Reference                  reference;
 
-    _LIBCPP_INLINE_VISIBILITY __deque_iterator() _NOEXCEPT
-#if _LIBCPP_STD_VER > 11
+    _LIBCUDACXX_INLINE_VISIBILITY __deque_iterator() _NOEXCEPT
+#if _LIBCUDACXX_STD_VER > 11
      : __m_iter_(nullptr), __ptr_(nullptr)
 #endif
      {}
 
     template <class _Pp, class _Rp, class _MP>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __deque_iterator(const __deque_iterator<value_type, _Pp, _Rp, _MP, 
diff erence_type, _BS>& __it,
                 typename enable_if<is_convertible<_Pp, pointer>::value>::type* = 0) _NOEXCEPT
         : __m_iter_(__it.__m_iter_), __ptr_(__it.__ptr_) {}
 
-    _LIBCPP_INLINE_VISIBILITY reference operator*() const {return *__ptr_;}
-    _LIBCPP_INLINE_VISIBILITY pointer operator->() const {return __ptr_;}
+    _LIBCUDACXX_INLINE_VISIBILITY reference operator*() const {return *__ptr_;}
+    _LIBCUDACXX_INLINE_VISIBILITY pointer operator->() const {return __ptr_;}
 
-    _LIBCPP_INLINE_VISIBILITY __deque_iterator& operator++()
+    _LIBCUDACXX_INLINE_VISIBILITY __deque_iterator& operator++()
     {
         if (++__ptr_ - *__m_iter_ == __block_size)
         {
@@ -365,14 +365,14 @@ public:
         return *this;
     }
 
-    _LIBCPP_INLINE_VISIBILITY __deque_iterator operator++(int)
+    _LIBCUDACXX_INLINE_VISIBILITY __deque_iterator operator++(int)
     {
         __deque_iterator __tmp = *this;
         ++(*this);
         return __tmp;
     }
 
-    _LIBCPP_INLINE_VISIBILITY __deque_iterator& operator--()
+    _LIBCUDACXX_INLINE_VISIBILITY __deque_iterator& operator--()
     {
         if (__ptr_ == *__m_iter_)
         {
@@ -383,14 +383,14 @@ public:
         return *this;
     }
 
-    _LIBCPP_INLINE_VISIBILITY __deque_iterator operator--(int)
+    _LIBCUDACXX_INLINE_VISIBILITY __deque_iterator operator--(int)
     {
         __deque_iterator __tmp = *this;
         --(*this);
         return __tmp;
     }
 
-    _LIBCPP_INLINE_VISIBILITY __deque_iterator& operator+=(
diff erence_type __n)
+    _LIBCUDACXX_INLINE_VISIBILITY __deque_iterator& operator+=(
diff erence_type __n)
     {
         if (__n != 0)
         {
@@ -410,30 +410,30 @@ public:
         return *this;
     }
 
-    _LIBCPP_INLINE_VISIBILITY __deque_iterator& operator-=(
diff erence_type __n)
+    _LIBCUDACXX_INLINE_VISIBILITY __deque_iterator& operator-=(
diff erence_type __n)
     {
         return *this += -__n;
     }
 
-    _LIBCPP_INLINE_VISIBILITY __deque_iterator operator+(
diff erence_type __n) const
+    _LIBCUDACXX_INLINE_VISIBILITY __deque_iterator operator+(
diff erence_type __n) const
     {
         __deque_iterator __t(*this);
         __t += __n;
         return __t;
     }
 
-    _LIBCPP_INLINE_VISIBILITY __deque_iterator operator-(
diff erence_type __n) const
+    _LIBCUDACXX_INLINE_VISIBILITY __deque_iterator operator-(
diff erence_type __n) const
     {
         __deque_iterator __t(*this);
         __t -= __n;
         return __t;
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     friend __deque_iterator operator+(
diff erence_type __n, const __deque_iterator& __it)
         {return __it + __n;}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     friend 
diff erence_type operator-(const __deque_iterator& __x, const __deque_iterator& __y)
     {
         if (__x != __y)
@@ -443,42 +443,42 @@ public:
         return 0;
     }
 
-    _LIBCPP_INLINE_VISIBILITY reference operator[](
diff erence_type __n) const
+    _LIBCUDACXX_INLINE_VISIBILITY reference operator[](
diff erence_type __n) const
         {return *(*this + __n);}
 
-    _LIBCPP_INLINE_VISIBILITY friend
+    _LIBCUDACXX_INLINE_VISIBILITY friend
         bool operator==(const __deque_iterator& __x, const __deque_iterator& __y)
         {return __x.__ptr_ == __y.__ptr_;}
 
-    _LIBCPP_INLINE_VISIBILITY friend
+    _LIBCUDACXX_INLINE_VISIBILITY friend
         bool operator!=(const __deque_iterator& __x, const __deque_iterator& __y)
         {return !(__x == __y);}
 
-    _LIBCPP_INLINE_VISIBILITY friend
+    _LIBCUDACXX_INLINE_VISIBILITY friend
         bool operator<(const __deque_iterator& __x, const __deque_iterator& __y)
         {return __x.__m_iter_ < __y.__m_iter_ ||
                (__x.__m_iter_ == __y.__m_iter_ && __x.__ptr_ < __y.__ptr_);}
 
-    _LIBCPP_INLINE_VISIBILITY friend
+    _LIBCUDACXX_INLINE_VISIBILITY friend
         bool operator>(const __deque_iterator& __x, const __deque_iterator& __y)
         {return __y < __x;}
 
-    _LIBCPP_INLINE_VISIBILITY friend
+    _LIBCUDACXX_INLINE_VISIBILITY friend
         bool operator<=(const __deque_iterator& __x, const __deque_iterator& __y)
         {return !(__y < __x);}
 
-    _LIBCPP_INLINE_VISIBILITY friend
+    _LIBCUDACXX_INLINE_VISIBILITY friend
         bool operator>=(const __deque_iterator& __x, const __deque_iterator& __y)
         {return !(__x < __y);}
 
 private:
-    _LIBCPP_INLINE_VISIBILITY explicit __deque_iterator(__map_iterator __m, pointer __p) _NOEXCEPT
+    _LIBCUDACXX_INLINE_VISIBILITY explicit __deque_iterator(__map_iterator __m, pointer __p) _NOEXCEPT
         : __m_iter_(__m), __ptr_(__p) {}
 
     template <class _Tp, class _Ap> friend class __deque_base;
-    template <class _Tp, class _Ap> friend class _LIBCPP_TEMPLATE_VIS deque;
+    template <class _Tp, class _Ap> friend class _LIBCUDACXX_TEMPLATE_VIS deque;
     template <class _Vp, class _Pp, class _Rp, class _MP, class _Dp, _Dp>
-        friend class _LIBCPP_TEMPLATE_VIS __deque_iterator;
+        friend class _LIBCUDACXX_TEMPLATE_VIS __deque_iterator;
 
     template <class _RAIter,
               class _V2, class _P2, class _R2, class _M2, class _D2, _D2 _B2>
@@ -612,7 +612,7 @@ copy(_RAIter __f,
             __n = __bs;
             __m = __f + __n;
         }
-        _VSTD::copy(__f, __m, __rb);
+        _CUDA_VSTD::copy(__f, __m, __rb);
         __f = __m;
         __r += __n;
     }
@@ -640,7 +640,7 @@ copy(__deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __f,
             __bs = __n;
             __fe = __fb + __bs;
         }
-        __r = _VSTD::copy(__fb, __fe, __r);
+        __r = _CUDA_VSTD::copy(__fb, __fe, __r);
         __n -= __bs;
         __f += __bs;
     }
@@ -668,7 +668,7 @@ copy(__deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __f,
             __bs = __n;
             __fe = __fb + __bs;
         }
-        __r = _VSTD::copy(__fb, __fe, __r);
+        __r = _CUDA_VSTD::copy(__fb, __fe, __r);
         __n -= __bs;
         __f += __bs;
     }
@@ -689,7 +689,7 @@ copy_backward(_RAIter __f,
     typedef typename __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2>::pointer pointer;
     while (__f != __l)
     {
-        __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> __rp = _VSTD::prev(__r);
+        __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> __rp = _CUDA_VSTD::prev(__r);
         pointer __rb = *__rp.__m_iter_;
         pointer __re = __rp.__ptr_ + 1;
         
diff erence_type __bs = __re - __rb;
@@ -700,7 +700,7 @@ copy_backward(_RAIter __f,
             __n = __bs;
             __m = __l - __n;
         }
-        _VSTD::copy_backward(__m, __l, __re);
+        _CUDA_VSTD::copy_backward(__m, __l, __re);
         __l = __m;
         __r -= __n;
     }
@@ -728,7 +728,7 @@ copy_backward(__deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __f,
             __bs = __n;
             __lb = __le - __bs;
         }
-        __r = _VSTD::copy_backward(__lb, __le, __r);
+        __r = _CUDA_VSTD::copy_backward(__lb, __le, __r);
         __n -= __bs;
         __l -= __bs - 1;
     }
@@ -756,7 +756,7 @@ copy_backward(__deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __f,
             __bs = __n;
             __lb = __le - __bs;
         }
-        __r = _VSTD::copy_backward(__lb, __le, __r);
+        __r = _CUDA_VSTD::copy_backward(__lb, __le, __r);
         __n -= __bs;
         __l -= __bs - 1;
     }
@@ -788,7 +788,7 @@ move(_RAIter __f,
             __n = __bs;
             __m = __f + __n;
         }
-        _VSTD::move(__f, __m, __rb);
+        _CUDA_VSTD::move(__f, __m, __rb);
         __f = __m;
         __r += __n;
     }
@@ -816,7 +816,7 @@ move(__deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __f,
             __bs = __n;
             __fe = __fb + __bs;
         }
-        __r = _VSTD::move(__fb, __fe, __r);
+        __r = _CUDA_VSTD::move(__fb, __fe, __r);
         __n -= __bs;
         __f += __bs;
     }
@@ -844,7 +844,7 @@ move(__deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __f,
             __bs = __n;
             __fe = __fb + __bs;
         }
-        __r = _VSTD::move(__fb, __fe, __r);
+        __r = _CUDA_VSTD::move(__fb, __fe, __r);
         __n -= __bs;
         __f += __bs;
     }
@@ -865,7 +865,7 @@ move_backward(_RAIter __f,
     typedef typename __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2>::pointer pointer;
     while (__f != __l)
     {
-        __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> __rp = _VSTD::prev(__r);
+        __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> __rp = _CUDA_VSTD::prev(__r);
         pointer __rb = *__rp.__m_iter_;
         pointer __re = __rp.__ptr_ + 1;
         
diff erence_type __bs = __re - __rb;
@@ -876,7 +876,7 @@ move_backward(_RAIter __f,
             __n = __bs;
             __m = __l - __n;
         }
-        _VSTD::move_backward(__m, __l, __re);
+        _CUDA_VSTD::move_backward(__m, __l, __re);
         __l = __m;
         __r -= __n;
     }
@@ -904,7 +904,7 @@ move_backward(__deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __f,
             __bs = __n;
             __lb = __le - __bs;
         }
-        __r = _VSTD::move_backward(__lb, __le, __r);
+        __r = _CUDA_VSTD::move_backward(__lb, __le, __r);
         __n -= __bs;
         __l -= __bs - 1;
     }
@@ -932,7 +932,7 @@ move_backward(__deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __f,
             __bs = __n;
             __lb = __le - __bs;
         }
-        __r = _VSTD::move_backward(__lb, __le, __r);
+        __r = _CUDA_VSTD::move_backward(__lb, __le, __r);
         __n -= __bs;
         __l -= __bs - 1;
     }
@@ -1048,29 +1048,29 @@ protected:
     iterator       end() _NOEXCEPT;
     const_iterator end() const _NOEXCEPT;
 
-    _LIBCPP_INLINE_VISIBILITY size_type&            size()          {return __size_.first();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY size_type&            size()          {return __size_.first();}
+    _LIBCUDACXX_INLINE_VISIBILITY
     const size_type& size() const _NOEXCEPT {return __size_.first();}
-    _LIBCPP_INLINE_VISIBILITY allocator_type&       __alloc()       {return __size_.second();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY allocator_type&       __alloc()       {return __size_.second();}
+    _LIBCUDACXX_INLINE_VISIBILITY
     const allocator_type& __alloc() const _NOEXCEPT {return __size_.second();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __deque_base()
         _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value);
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __deque_base(const allocator_type& __a);
 public:
     ~__deque_base();
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
     __deque_base(__deque_base&& __c)
         _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value);
     __deque_base(__deque_base&& __c, const allocator_type& __a);
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
     void swap(__deque_base& __c)
-#if _LIBCPP_STD_VER >= 14
+#if _LIBCUDACXX_STD_VER >= 14
         _NOEXCEPT;
 #else
         _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
@@ -1081,19 +1081,19 @@ protected:
 
     bool __invariants() const;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __move_assign(__deque_base& __c)
         _NOEXCEPT_(__alloc_traits::propagate_on_container_move_assignment::value &&
                    is_nothrow_move_assignable<allocator_type>::value)
     {
-        __map_ = _VSTD::move(__c.__map_);
+        __map_ = _CUDA_VSTD::move(__c.__map_);
         __start_ = __c.__start_;
         size() = __c.size();
         __move_assign_alloc(__c);
         __c.__start_ = __c.size() = 0;
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __move_assign_alloc(__deque_base& __c)
         _NOEXCEPT_(!__alloc_traits::propagate_on_container_move_assignment::value ||
                    is_nothrow_move_assignable<allocator_type>::value)
@@ -1101,14 +1101,14 @@ protected:
                       __alloc_traits::propagate_on_container_move_assignment::value>());}
 
 private:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __move_assign_alloc(__deque_base& __c, true_type)
         _NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
         {
-            __alloc() = _VSTD::move(__c.__alloc());
+            __alloc() = _CUDA_VSTD::move(__c.__alloc());
         }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __move_assign_alloc(__deque_base&, false_type) _NOEXCEPT
         {}
 };
@@ -1202,14 +1202,14 @@ __deque_base<_Tp, _Allocator>::~__deque_base()
         __alloc_traits::deallocate(__alloc(), *__i, __block_size);
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
 template <class _Tp, class _Allocator>
 __deque_base<_Tp, _Allocator>::__deque_base(__deque_base&& __c)
     _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)
-    : __map_(_VSTD::move(__c.__map_)),
-      __start_(_VSTD::move(__c.__start_)),
-      __size_(_VSTD::move(__c.__size_))
+    : __map_(_CUDA_VSTD::move(__c.__map_)),
+      __start_(_CUDA_VSTD::move(__c.__start_)),
+      __size_(_CUDA_VSTD::move(__c.__size_))
 {
     __c.__start_ = 0;
     __c.size() = 0;
@@ -1217,9 +1217,9 @@ __deque_base<_Tp, _Allocator>::__deque_base(__deque_base&& __c)
 
 template <class _Tp, class _Allocator>
 __deque_base<_Tp, _Allocator>::__deque_base(__deque_base&& __c, const allocator_type& __a)
-    : __map_(_VSTD::move(__c.__map_), __pointer_allocator(__a)),
-      __start_(_VSTD::move(__c.__start_)),
-      __size_(_VSTD::move(__c.size()), __a)
+    : __map_(_CUDA_VSTD::move(__c.__map_), __pointer_allocator(__a)),
+      __start_(_CUDA_VSTD::move(__c.__start_)),
+      __size_(_CUDA_VSTD::move(__c.size()), __a)
 {
     if (__a == __c.__alloc())
     {
@@ -1234,12 +1234,12 @@ __deque_base<_Tp, _Allocator>::__deque_base(__deque_base&& __c, const allocator_
     }
 }
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
 template <class _Tp, class _Allocator>
 void
 __deque_base<_Tp, _Allocator>::swap(__deque_base& __c)
-#if _LIBCPP_STD_VER >= 14
+#if _LIBCUDACXX_STD_VER >= 14
         _NOEXCEPT
 #else
         _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
@@ -1247,9 +1247,9 @@ __deque_base<_Tp, _Allocator>::swap(__deque_base& __c)
 #endif
 {
     __map_.swap(__c.__map_);
-    _VSTD::swap(__start_, __c.__start_);
-    _VSTD::swap(size(), __c.size());
-    _VSTD::__swap_allocator(__alloc(), __c.__alloc());
+    _CUDA_VSTD::swap(__start_, __c.__start_);
+    _CUDA_VSTD::swap(size(), __c.size());
+    _CUDA_VSTD::__swap_allocator(__alloc(), __c.__alloc());
 }
 
 template <class _Tp, class _Allocator>
@@ -1258,7 +1258,7 @@ __deque_base<_Tp, _Allocator>::clear() _NOEXCEPT
 {
     allocator_type& __a = __alloc();
     for (iterator __i = begin(), __e = end(); __i != __e; ++__i)
-        __alloc_traits::destroy(__a, _VSTD::addressof(*__i));
+        __alloc_traits::destroy(__a, _CUDA_VSTD::addressof(*__i));
     size() = 0;
     while (__map_.size() > 2)
     {
@@ -1277,7 +1277,7 @@ __deque_base<_Tp, _Allocator>::clear() _NOEXCEPT
 }
 
 template <class _Tp, class _Allocator /*= allocator<_Tp>*/>
-class _LIBCPP_TEMPLATE_VIS deque
+class _LIBCUDACXX_TEMPLATE_VIS deque
     : private __deque_base<_Tp, _Allocator>
 {
 public:
@@ -1301,21 +1301,21 @@ public:
 
     typedef typename __base::pointer                      pointer;
     typedef typename __base::const_pointer                const_pointer;
-    typedef _VSTD::reverse_iterator<iterator>             reverse_iterator;
-    typedef _VSTD::reverse_iterator<const_iterator>       const_reverse_iterator;
+    typedef _CUDA_VSTD::reverse_iterator<iterator>             reverse_iterator;
+    typedef _CUDA_VSTD::reverse_iterator<const_iterator>       const_reverse_iterator;
 
     using typename __base::__deque_range;
     using typename __base::__deque_block_range;
     using typename __base::_ConstructTransaction;
 
     // construct/copy/destroy:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     deque()
         _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
         {}
-    _LIBCPP_INLINE_VISIBILITY explicit deque(const allocator_type& __a) : __base(__a) {}
+    _LIBCUDACXX_INLINE_VISIBILITY explicit deque(const allocator_type& __a) : __base(__a) {}
     explicit deque(size_type __n);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
     explicit deque(size_type __n, const _Allocator& __a);
 #endif
     deque(size_type __n, const value_type& __v);
@@ -1338,25 +1338,25 @@ public:
 
     deque& operator=(const deque& __c);
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
     deque(initializer_list<value_type> __il);
     deque(initializer_list<value_type> __il, const allocator_type& __a);
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     deque& operator=(initializer_list<value_type> __il) {assign(__il); return *this;}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     deque(deque&& __c) _NOEXCEPT_(is_nothrow_move_constructible<__base>::value);
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     deque(deque&& __c, const __type_identity_t<allocator_type>& __a);
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     deque& operator=(deque&& __c)
         _NOEXCEPT_(__alloc_traits::propagate_on_container_move_assignment::value &&
                    is_nothrow_move_assignable<allocator_type>::value);
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void assign(initializer_list<value_type> __il) {assign(__il.begin(), __il.end());}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
     template <class _InputIter>
         void assign(_InputIter __f, _InputIter __l,
@@ -1367,83 +1367,83 @@ public:
                     typename enable_if<__is_cpp17_random_access_iterator<_RAIter>::value>::type* = 0);
     void assign(size_type __n, const value_type& __v);
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     allocator_type get_allocator() const _NOEXCEPT;
 
     // iterators:
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator       begin() _NOEXCEPT       {return __base::begin();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator begin() const _NOEXCEPT {return __base::begin();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator       end() _NOEXCEPT         {return __base::end();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator end()   const _NOEXCEPT {return __base::end();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     reverse_iterator       rbegin() _NOEXCEPT
         {return       reverse_iterator(__base::end());}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_reverse_iterator rbegin() const _NOEXCEPT
         {return const_reverse_iterator(__base::end());}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     reverse_iterator       rend() _NOEXCEPT
         {return       reverse_iterator(__base::begin());}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_reverse_iterator rend()   const _NOEXCEPT
         {return const_reverse_iterator(__base::begin());}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator         cbegin()  const _NOEXCEPT
         {return __base::begin();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator         cend()    const _NOEXCEPT
         {return __base::end();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_reverse_iterator crbegin() const _NOEXCEPT
         {return const_reverse_iterator(__base::end());}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_reverse_iterator crend()   const _NOEXCEPT
         {return const_reverse_iterator(__base::begin());}
 
     // capacity:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type size() const _NOEXCEPT {return __base::size();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type max_size() const _NOEXCEPT
-        {return _VSTD::min<size_type>(
+        {return _CUDA_VSTD::min<size_type>(
             __alloc_traits::max_size(__base::__alloc()),
             numeric_limits<
diff erence_type>::max());}
     void resize(size_type __n);
     void resize(size_type __n, const value_type& __v);
     void shrink_to_fit() _NOEXCEPT;
-    _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_NODISCARD_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY
     bool empty() const _NOEXCEPT {return __base::size() == 0;}
 
     // element access:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     reference operator[](size_type __i) _NOEXCEPT;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_reference operator[](size_type __i) const _NOEXCEPT;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     reference at(size_type __i);
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_reference at(size_type __i) const;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     reference front() _NOEXCEPT;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_reference front() const _NOEXCEPT;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     reference back() _NOEXCEPT;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_reference back() const _NOEXCEPT;
 
     // 23.2.2.3 modifiers:
     void push_front(const value_type& __v);
     void push_back(const value_type& __v);
-#ifndef _LIBCPP_CXX03_LANG
-#if _LIBCPP_STD_VER > 14
+#ifndef _LIBCUDACXX_CXX03_LANG
+#if _LIBCUDACXX_STD_VER > 14
     template <class... _Args> reference emplace_front(_Args&&... __args);
     template <class... _Args> reference emplace_back (_Args&&... __args);
 #else
@@ -1456,10 +1456,10 @@ public:
     void push_back(value_type&& __v);
     iterator insert(const_iterator __p, value_type&& __v);
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator insert(const_iterator __p, initializer_list<value_type> __il)
         {return insert(__p, __il.begin(), __il.end());}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
     iterator insert(const_iterator __p, const value_type& __v);
     iterator insert(const_iterator __p, size_type __n, const value_type& __v);
     template <class _InputIter>
@@ -1477,59 +1477,59 @@ public:
     iterator erase(const_iterator __p);
     iterator erase(const_iterator __f, const_iterator __l);
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void swap(deque& __c)
-#if _LIBCPP_STD_VER >= 14
+#if _LIBCUDACXX_STD_VER >= 14
         _NOEXCEPT;
 #else
         _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
                    __is_nothrow_swappable<allocator_type>::value);
 #endif
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void clear() _NOEXCEPT;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool __invariants() const {return __base::__invariants();}
 
     typedef typename __base::__map_const_pointer __map_const_pointer;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     static size_type __recommend_blocks(size_type __n)
     {
         return __n / __base::__block_size + (__n % __base::__block_size != 0);
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type __capacity() const
     {
         return __base::__map_.size() == 0 ? 0 : __base::__map_.size() * __base::__block_size - 1;
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type __block_count() const
     {
         return __base::__map_.size();
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type __front_spare() const
     {
         return __base::__start_;
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type __front_spare_blocks() const {
       return __front_spare() / __base::__block_size;
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type __back_spare() const
     {
         return __capacity() - (__base::__start_ + __base::size());
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type __back_spare_blocks() const {
       return __back_spare() / __base::__block_size;
     }
 
  private:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool __maybe_remove_front_spare(bool __keep_one = true) {
       if (__front_spare_blocks() >= 2 || (!__keep_one && __front_spare_blocks())) {
         __alloc_traits::deallocate(__base::__alloc(), __base::__map_.front(),
@@ -1541,7 +1541,7 @@ public:
       return false;
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool __maybe_remove_back_spare(bool __keep_one = true) {
       if (__back_spare_blocks() >= 2 || (!__keep_one && __back_spare_blocks())) {
         __alloc_traits::deallocate(__base::__alloc(), __base::__map_.back(),
@@ -1574,12 +1574,12 @@ public:
     void __move_construct_backward_and_check(iterator __f, iterator __l,
                                              iterator __r, const_pointer& __vt);
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __copy_assign_alloc(const deque& __c)
         {__copy_assign_alloc(__c, integral_constant<bool,
                       __alloc_traits::propagate_on_container_copy_assignment::value>());}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __copy_assign_alloc(const deque& __c, true_type)
         {
             if (__base::__alloc() != __c.__alloc())
@@ -1591,7 +1591,7 @@ public:
             __base::__map_.__alloc() = __c.__map_.__alloc();
         }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __copy_assign_alloc(const deque&, false_type)
         {}
 
@@ -1600,7 +1600,7 @@ public:
     void __move_assign(deque& __c, false_type);
 };
 
-#if _LIBCPP_STD_VER >= 17
+#if _LIBCUDACXX_STD_VER >= 17
 template<class _InputIterator,
          class _Alloc = allocator<__iter_value_type<_InputIterator>>,
          class = enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>,
@@ -1625,7 +1625,7 @@ deque<_Tp, _Allocator>::deque(size_type __n)
         __append(__n);
 }
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <class _Tp, class _Allocator>
 deque<_Tp, _Allocator>::deque(size_type __n, const _Allocator& __a)
     : __base(__a)
@@ -1677,7 +1677,7 @@ template <class _Tp, class _Allocator>
 deque<_Tp, _Allocator>&
 deque<_Tp, _Allocator>::operator=(const deque& __c)
 {
-    if (this != _VSTD::addressof(__c))
+    if (this != _CUDA_VSTD::addressof(__c))
     {
         __copy_assign_alloc(__c);
         assign(__c.begin(), __c.end());
@@ -1685,7 +1685,7 @@ deque<_Tp, _Allocator>::operator=(const deque& __c)
     return *this;
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
 template <class _Tp, class _Allocator>
 deque<_Tp, _Allocator>::deque(initializer_list<value_type> __il)
@@ -1704,14 +1704,14 @@ template <class _Tp, class _Allocator>
 inline
 deque<_Tp, _Allocator>::deque(deque&& __c)
     _NOEXCEPT_(is_nothrow_move_constructible<__base>::value)
-    : __base(_VSTD::move(__c))
+    : __base(_CUDA_VSTD::move(__c))
 {
 }
 
 template <class _Tp, class _Allocator>
 inline
 deque<_Tp, _Allocator>::deque(deque&& __c, const __type_identity_t<allocator_type>& __a)
-    : __base(_VSTD::move(__c), __a)
+    : __base(_CUDA_VSTD::move(__c), __a)
 {
     if (__a != __c.__alloc())
     {
@@ -1755,7 +1755,7 @@ deque<_Tp, _Allocator>::__move_assign(deque& __c, true_type)
     __base::__move_assign(__c);
 }
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
 template <class _Tp, class _Allocator>
 template <class _InputIter>
@@ -1783,11 +1783,11 @@ deque<_Tp, _Allocator>::assign(_RAIter __f, _RAIter __l,
     if (static_cast<size_type>(__l - __f) > __base::size())
     {
         _RAIter __m = __f + __base::size();
-        _VSTD::copy(__f, __m, __base::begin());
+        _CUDA_VSTD::copy(__f, __m, __base::begin());
         __append(__m, __l);
     }
     else
-        __erase_to_end(_VSTD::copy(__f, __l, __base::begin()));
+        __erase_to_end(_CUDA_VSTD::copy(__f, __l, __base::begin()));
 }
 
 template <class _Tp, class _Allocator>
@@ -1796,12 +1796,12 @@ deque<_Tp, _Allocator>::assign(size_type __n, const value_type& __v)
 {
     if (__n > __base::size())
     {
-        _VSTD::fill_n(__base::begin(), __base::size(), __v);
+        _CUDA_VSTD::fill_n(__base::begin(), __base::size(), __v);
         __n -= __base::size();
         __append(__n, __v);
     }
     else
-        __erase_to_end(_VSTD::fill_n(__base::begin(), __n, __v));
+        __erase_to_end(_CUDA_VSTD::fill_n(__base::begin(), __n, __v));
 }
 
 template <class _Tp, class _Allocator>
@@ -1878,7 +1878,7 @@ typename deque<_Tp, _Allocator>::reference
 deque<_Tp, _Allocator>::at(size_type __i)
 {
     if (__i >= __base::size())
-        _VSTD::__throw_out_of_range("deque");
+        _CUDA_VSTD::__throw_out_of_range("deque");
     size_type __p = __base::__start_ + __i;
     return *(*(__base::__map_.begin() + __p / __base::__block_size) + __p % __base::__block_size);
 }
@@ -1889,7 +1889,7 @@ typename deque<_Tp, _Allocator>::const_reference
 deque<_Tp, _Allocator>::at(size_type __i) const
 {
     if (__i >= __base::size())
-        _VSTD::__throw_out_of_range("deque");
+        _CUDA_VSTD::__throw_out_of_range("deque");
     size_type __p = __base::__start_ + __i;
     return *(*(__base::__map_.begin() + __p / __base::__block_size) + __p % __base::__block_size);
 }
@@ -1938,7 +1938,7 @@ deque<_Tp, _Allocator>::push_back(const value_type& __v)
     if (__back_spare() == 0)
         __add_back_capacity();
     // __back_spare() >= 1
-    __alloc_traits::construct(__a, _VSTD::addressof(*__base::end()), __v);
+    __alloc_traits::construct(__a, _CUDA_VSTD::addressof(*__base::end()), __v);
     ++__base::size();
 }
 
@@ -1950,12 +1950,12 @@ deque<_Tp, _Allocator>::push_front(const value_type& __v)
     if (__front_spare() == 0)
         __add_front_capacity();
     // __front_spare() >= 1
-    __alloc_traits::construct(__a, _VSTD::addressof(*--__base::begin()), __v);
+    __alloc_traits::construct(__a, _CUDA_VSTD::addressof(*--__base::begin()), __v);
     --__base::__start_;
     ++__base::size();
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 template <class _Tp, class _Allocator>
 void
 deque<_Tp, _Allocator>::push_back(value_type&& __v)
@@ -1964,13 +1964,13 @@ deque<_Tp, _Allocator>::push_back(value_type&& __v)
     if (__back_spare() == 0)
         __add_back_capacity();
     // __back_spare() >= 1
-    __alloc_traits::construct(__a, _VSTD::addressof(*__base::end()), _VSTD::move(__v));
+    __alloc_traits::construct(__a, _CUDA_VSTD::addressof(*__base::end()), _CUDA_VSTD::move(__v));
     ++__base::size();
 }
 
 template <class _Tp, class _Allocator>
 template <class... _Args>
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 typename deque<_Tp, _Allocator>::reference
 #else
 void
@@ -1981,10 +1981,10 @@ deque<_Tp, _Allocator>::emplace_back(_Args&&... __args)
     if (__back_spare() == 0)
         __add_back_capacity();
     // __back_spare() >= 1
-    __alloc_traits::construct(__a, _VSTD::addressof(*__base::end()),
-                              _VSTD::forward<_Args>(__args)...);
+    __alloc_traits::construct(__a, _CUDA_VSTD::addressof(*__base::end()),
+                              _CUDA_VSTD::forward<_Args>(__args)...);
     ++__base::size();
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
     return *--__base::end();
 #endif
 }
@@ -1997,7 +1997,7 @@ deque<_Tp, _Allocator>::push_front(value_type&& __v)
     if (__front_spare() == 0)
         __add_front_capacity();
     // __front_spare() >= 1
-    __alloc_traits::construct(__a, _VSTD::addressof(*--__base::begin()), _VSTD::move(__v));
+    __alloc_traits::construct(__a, _CUDA_VSTD::addressof(*--__base::begin()), _CUDA_VSTD::move(__v));
     --__base::__start_;
     ++__base::size();
 }
@@ -2005,7 +2005,7 @@ deque<_Tp, _Allocator>::push_front(value_type&& __v)
 
 template <class _Tp, class _Allocator>
 template <class... _Args>
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 typename deque<_Tp, _Allocator>::reference
 #else
 void
@@ -2016,10 +2016,10 @@ deque<_Tp, _Allocator>::emplace_front(_Args&&... __args)
     if (__front_spare() == 0)
         __add_front_capacity();
     // __front_spare() >= 1
-    __alloc_traits::construct(__a, _VSTD::addressof(*--__base::begin()), _VSTD::forward<_Args>(__args)...);
+    __alloc_traits::construct(__a, _CUDA_VSTD::addressof(*--__base::begin()), _CUDA_VSTD::forward<_Args>(__args)...);
     --__base::__start_;
     ++__base::size();
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
     return *__base::begin();
 #endif
 }
@@ -2038,20 +2038,20 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, value_type&& __v)
         // __front_spare() >= 1
         if (__pos == 0)
         {
-            __alloc_traits::construct(__a, _VSTD::addressof(*--__base::begin()), _VSTD::move(__v));
+            __alloc_traits::construct(__a, _CUDA_VSTD::addressof(*--__base::begin()), _CUDA_VSTD::move(__v));
             --__base::__start_;
             ++__base::size();
         }
         else
         {
             iterator __b = __base::begin();
-            iterator __bm1 = _VSTD::prev(__b);
-            __alloc_traits::construct(__a, _VSTD::addressof(*__bm1), _VSTD::move(*__b));
+            iterator __bm1 = _CUDA_VSTD::prev(__b);
+            __alloc_traits::construct(__a, _CUDA_VSTD::addressof(*__bm1), _CUDA_VSTD::move(*__b));
             --__base::__start_;
             ++__base::size();
             if (__pos > 1)
-                __b = _VSTD::move(_VSTD::next(__b), __b + __pos, __b);
-            *__b = _VSTD::move(__v);
+                __b = _CUDA_VSTD::move(_CUDA_VSTD::next(__b), __b + __pos, __b);
+            *__b = _CUDA_VSTD::move(__v);
         }
     }
     else
@@ -2062,18 +2062,18 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, value_type&& __v)
         size_type __de = __base::size() - __pos;
         if (__de == 0)
         {
-            __alloc_traits::construct(__a, _VSTD::addressof(*__base::end()), _VSTD::move(__v));
+            __alloc_traits::construct(__a, _CUDA_VSTD::addressof(*__base::end()), _CUDA_VSTD::move(__v));
             ++__base::size();
         }
         else
         {
             iterator __e = __base::end();
-            iterator __em1 = _VSTD::prev(__e);
-            __alloc_traits::construct(__a, _VSTD::addressof(*__e), _VSTD::move(*__em1));
+            iterator __em1 = _CUDA_VSTD::prev(__e);
+            __alloc_traits::construct(__a, _CUDA_VSTD::addressof(*__e), _CUDA_VSTD::move(*__em1));
             ++__base::size();
             if (__de > 1)
-                __e = _VSTD::move_backward(__e - __de, __em1, __e);
-            *--__e = _VSTD::move(__v);
+                __e = _CUDA_VSTD::move_backward(__e - __de, __em1, __e);
+            *--__e = _CUDA_VSTD::move(__v);
         }
     }
     return __base::begin() + __pos;
@@ -2094,21 +2094,21 @@ deque<_Tp, _Allocator>::emplace(const_iterator __p, _Args&&... __args)
         // __front_spare() >= 1
         if (__pos == 0)
         {
-            __alloc_traits::construct(__a, _VSTD::addressof(*--__base::begin()), _VSTD::forward<_Args>(__args)...);
+            __alloc_traits::construct(__a, _CUDA_VSTD::addressof(*--__base::begin()), _CUDA_VSTD::forward<_Args>(__args)...);
             --__base::__start_;
             ++__base::size();
         }
         else
         {
-            __temp_value<value_type, _Allocator> __tmp(this->__alloc(), _VSTD::forward<_Args>(__args)...);
+            __temp_value<value_type, _Allocator> __tmp(this->__alloc(), _CUDA_VSTD::forward<_Args>(__args)...);
             iterator __b = __base::begin();
-            iterator __bm1 = _VSTD::prev(__b);
-            __alloc_traits::construct(__a, _VSTD::addressof(*__bm1), _VSTD::move(*__b));
+            iterator __bm1 = _CUDA_VSTD::prev(__b);
+            __alloc_traits::construct(__a, _CUDA_VSTD::addressof(*__bm1), _CUDA_VSTD::move(*__b));
             --__base::__start_;
             ++__base::size();
             if (__pos > 1)
-                __b = _VSTD::move(_VSTD::next(__b), __b + __pos, __b);
-            *__b = _VSTD::move(__tmp.get());
+                __b = _CUDA_VSTD::move(_CUDA_VSTD::next(__b), __b + __pos, __b);
+            *__b = _CUDA_VSTD::move(__tmp.get());
         }
     }
     else
@@ -2119,25 +2119,25 @@ deque<_Tp, _Allocator>::emplace(const_iterator __p, _Args&&... __args)
         size_type __de = __base::size() - __pos;
         if (__de == 0)
         {
-            __alloc_traits::construct(__a, _VSTD::addressof(*__base::end()), _VSTD::forward<_Args>(__args)...);
+            __alloc_traits::construct(__a, _CUDA_VSTD::addressof(*__base::end()), _CUDA_VSTD::forward<_Args>(__args)...);
             ++__base::size();
         }
         else
         {
-            __temp_value<value_type, _Allocator> __tmp(this->__alloc(), _VSTD::forward<_Args>(__args)...);
+            __temp_value<value_type, _Allocator> __tmp(this->__alloc(), _CUDA_VSTD::forward<_Args>(__args)...);
             iterator __e = __base::end();
-            iterator __em1 = _VSTD::prev(__e);
-            __alloc_traits::construct(__a, _VSTD::addressof(*__e), _VSTD::move(*__em1));
+            iterator __em1 = _CUDA_VSTD::prev(__e);
+            __alloc_traits::construct(__a, _CUDA_VSTD::addressof(*__e), _CUDA_VSTD::move(*__em1));
             ++__base::size();
             if (__de > 1)
-                __e = _VSTD::move_backward(__e - __de, __em1, __e);
-            *--__e = _VSTD::move(__tmp.get());
+                __e = _CUDA_VSTD::move_backward(__e - __de, __em1, __e);
+            *--__e = _CUDA_VSTD::move(__tmp.get());
         }
     }
     return __base::begin() + __pos;
 }
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
 
 template <class _Tp, class _Allocator>
@@ -2154,7 +2154,7 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, const value_type& __v)
         // __front_spare() >= 1
         if (__pos == 0)
         {
-            __alloc_traits::construct(__a, _VSTD::addressof(*--__base::begin()), __v);
+            __alloc_traits::construct(__a, _CUDA_VSTD::addressof(*--__base::begin()), __v);
             --__base::__start_;
             ++__base::size();
         }
@@ -2162,14 +2162,14 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, const value_type& __v)
         {
             const_pointer __vt = pointer_traits<const_pointer>::pointer_to(__v);
             iterator __b = __base::begin();
-            iterator __bm1 = _VSTD::prev(__b);
+            iterator __bm1 = _CUDA_VSTD::prev(__b);
             if (__vt == pointer_traits<const_pointer>::pointer_to(*__b))
                 __vt = pointer_traits<const_pointer>::pointer_to(*__bm1);
-            __alloc_traits::construct(__a, _VSTD::addressof(*__bm1), _VSTD::move(*__b));
+            __alloc_traits::construct(__a, _CUDA_VSTD::addressof(*__bm1), _CUDA_VSTD::move(*__b));
             --__base::__start_;
             ++__base::size();
             if (__pos > 1)
-                __b = __move_and_check(_VSTD::next(__b), __b + __pos, __b, __vt);
+                __b = __move_and_check(_CUDA_VSTD::next(__b), __b + __pos, __b, __vt);
             *__b = *__vt;
         }
     }
@@ -2181,17 +2181,17 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, const value_type& __v)
         size_type __de = __base::size() - __pos;
         if (__de == 0)
         {
-            __alloc_traits::construct(__a, _VSTD::addressof(*__base::end()), __v);
+            __alloc_traits::construct(__a, _CUDA_VSTD::addressof(*__base::end()), __v);
             ++__base::size();
         }
         else
         {
             const_pointer __vt = pointer_traits<const_pointer>::pointer_to(__v);
             iterator __e = __base::end();
-            iterator __em1 = _VSTD::prev(__e);
+            iterator __em1 = _CUDA_VSTD::prev(__e);
             if (__vt == pointer_traits<const_pointer>::pointer_to(*__em1))
                 __vt = pointer_traits<const_pointer>::pointer_to(*__e);
-            __alloc_traits::construct(__a, _VSTD::addressof(*__e), _VSTD::move(*__em1));
+            __alloc_traits::construct(__a, _CUDA_VSTD::addressof(*__e), _CUDA_VSTD::move(*__em1));
             ++__base::size();
             if (__de > 1)
                 __e = __move_backward_and_check(__e - __de, __em1, __e, __vt);
@@ -2218,7 +2218,7 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, size_type __n, const value_ty
         if (__n > __pos)
         {
             for (size_type __m = __n - __pos; __m; --__m, --__base::__start_, ++__base::size())
-                __alloc_traits::construct(__a, _VSTD::addressof(*--__i), __v);
+                __alloc_traits::construct(__a, _CUDA_VSTD::addressof(*--__i), __v);
             __n = __pos;
         }
         if (__n > 0)
@@ -2228,7 +2228,7 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, size_type __n, const value_ty
             __move_construct_backward_and_check(__old_begin, __obn, __i, __vt);
             if (__n < __pos)
                 __old_begin = __move_and_check(__obn, __old_begin + __pos, __old_begin, __vt);
-            _VSTD::fill_n(__old_begin, __n, *__vt);
+            _CUDA_VSTD::fill_n(__old_begin, __n, *__vt);
         }
     }
     else
@@ -2243,7 +2243,7 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, size_type __n, const value_ty
         if (__n > __de)
         {
             for (size_type __m = __n - __de; __m; --__m, (void) ++__i, ++__base::size())
-                __alloc_traits::construct(__a, _VSTD::addressof(*__i), __v);
+                __alloc_traits::construct(__a, _CUDA_VSTD::addressof(*__i), __v);
             __n = __de;
         }
         if (__n > 0)
@@ -2253,7 +2253,7 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, size_type __n, const value_ty
             __move_construct_and_check(__oen, __old_end, __i, __vt);
             if (__n < __de)
                 __old_end = __move_backward_and_check(__old_end - __de, __oen, __old_end, __vt);
-            _VSTD::fill_n(__old_end - __n, __n, *__vt);
+            _CUDA_VSTD::fill_n(__old_end - __n, __n, *__vt);
         }
     }
     return __base::begin() + __pos;
@@ -2277,7 +2277,7 @@ typename deque<_Tp, _Allocator>::iterator
 deque<_Tp, _Allocator>::insert(const_iterator __p, _ForwardIterator __f, _ForwardIterator __l,
                                typename enable_if<__is_exactly_cpp17_forward_iterator<_ForwardIterator>::value>::type*)
 {
-    size_type __n = _VSTD::distance(__f, __l);
+    size_type __n = _CUDA_VSTD::distance(__f, __l);
     __split_buffer<value_type, allocator_type&> __buf(__n, 0, __base::__alloc());
     __buf.__construct_at_end(__f, __l);
     typedef typename __split_buffer<value_type, allocator_type&>::iterator __fwd;
@@ -2290,7 +2290,7 @@ typename deque<_Tp, _Allocator>::iterator
 deque<_Tp, _Allocator>::insert(const_iterator __p, _BiIter __f, _BiIter __l,
                                typename enable_if<__is_cpp17_bidirectional_iterator<_BiIter>::value>::type*)
 {
-    size_type __n = _VSTD::distance(__f, __l);
+    size_type __n = _CUDA_VSTD::distance(__f, __l);
     size_type __pos = __p - __base::begin();
     size_type __to_end = __base::size() - __pos;
     allocator_type& __a = __base::__alloc();
@@ -2304,9 +2304,9 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, _BiIter __f, _BiIter __l,
         _BiIter __m = __f;
         if (__n > __pos)
         {
-            __m = __pos < __n / 2 ? _VSTD::prev(__l, __pos) : _VSTD::next(__f, __n - __pos);
+            __m = __pos < __n / 2 ? _CUDA_VSTD::prev(__l, __pos) : _CUDA_VSTD::next(__f, __n - __pos);
             for (_BiIter __j = __m; __j != __f; --__base::__start_, ++__base::size())
-                __alloc_traits::construct(__a, _VSTD::addressof(*--__i), *--__j);
+                __alloc_traits::construct(__a, _CUDA_VSTD::addressof(*--__i), *--__j);
             __n = __pos;
         }
         if (__n > 0)
@@ -2314,13 +2314,13 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, _BiIter __f, _BiIter __l,
             iterator __obn = __old_begin + __n;
             for (iterator __j = __obn; __j != __old_begin;)
             {
-                __alloc_traits::construct(__a, _VSTD::addressof(*--__i), _VSTD::move(*--__j));
+                __alloc_traits::construct(__a, _CUDA_VSTD::addressof(*--__i), _CUDA_VSTD::move(*--__j));
                 --__base::__start_;
                 ++__base::size();
             }
             if (__n < __pos)
-                __old_begin = _VSTD::move(__obn, __old_begin + __pos, __old_begin);
-            _VSTD::copy(__m, __l, __old_begin);
+                __old_begin = _CUDA_VSTD::move(__obn, __old_begin + __pos, __old_begin);
+            _CUDA_VSTD::copy(__m, __l, __old_begin);
         }
     }
     else
@@ -2335,19 +2335,19 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, _BiIter __f, _BiIter __l,
         size_type __de = __base::size() - __pos;
         if (__n > __de)
         {
-            __m = __de < __n / 2 ? _VSTD::next(__f, __de) : _VSTD::prev(__l, __n - __de);
+            __m = __de < __n / 2 ? _CUDA_VSTD::next(__f, __de) : _CUDA_VSTD::prev(__l, __n - __de);
             for (_BiIter __j = __m; __j != __l; ++__i, (void) ++__j, ++__base::size())
-                __alloc_traits::construct(__a, _VSTD::addressof(*__i), *__j);
+                __alloc_traits::construct(__a, _CUDA_VSTD::addressof(*__i), *__j);
             __n = __de;
         }
         if (__n > 0)
         {
             iterator __oen = __old_end - __n;
             for (iterator __j = __oen; __j != __old_end; ++__i, (void) ++__j, ++__base::size())
-                __alloc_traits::construct(__a, _VSTD::addressof(*__i), _VSTD::move(*__j));
+                __alloc_traits::construct(__a, _CUDA_VSTD::addressof(*__i), _CUDA_VSTD::move(*__j));
             if (__n < __de)
-                __old_end = _VSTD::move_backward(__old_end - __de, __oen, __old_end);
-            _VSTD::copy_backward(__f, __m, __old_end);
+                __old_end = _CUDA_VSTD::move_backward(__old_end - __de, __oen, __old_end);
+            _CUDA_VSTD::copy_backward(__f, __m, __old_end);
         }
     }
     return __base::begin() + __pos;
@@ -2360,7 +2360,7 @@ deque<_Tp, _Allocator>::__append(_InpIter __f, _InpIter __l,
                                  typename enable_if<__is_exactly_cpp17_input_iterator<_InpIter>::value>::type*)
 {
     for (; __f != __l; ++__f)
-#ifdef _LIBCPP_CXX03_LANG
+#ifdef _LIBCUDACXX_CXX03_LANG
         push_back(*__f);
 #else
         emplace_back(*__f);
@@ -2373,7 +2373,7 @@ void
 deque<_Tp, _Allocator>::__append(_ForIter __f, _ForIter __l,
                                  typename enable_if<__is_cpp17_forward_iterator<_ForIter>::value>::type*)
 {
-    size_type __n = _VSTD::distance(__f, __l);
+    size_type __n = _CUDA_VSTD::distance(__f, __l);
     allocator_type& __a = __base::__alloc();
     size_type __back_capacity = __back_spare();
     if (__n > __back_capacity)
@@ -2382,7 +2382,7 @@ deque<_Tp, _Allocator>::__append(_ForIter __f, _ForIter __l,
     for (__deque_block_range __br : __deque_range(__base::end(), __base::end() + __n)) {
       _ConstructTransaction __tx(this, __br);
       for (; __tx.__pos_ != __tx.__end_; ++__tx.__pos_, (void)++__f) {
-        __alloc_traits::construct(__a, _VSTD::__to_address(__tx.__pos_), *__f);
+        __alloc_traits::construct(__a, _CUDA_VSTD::__to_address(__tx.__pos_), *__f);
       }
     }
 }
@@ -2399,7 +2399,7 @@ deque<_Tp, _Allocator>::__append(size_type __n)
     for (__deque_block_range __br : __deque_range(__base::end(), __base::end() + __n)) {
       _ConstructTransaction __tx(this, __br);
       for (; __tx.__pos_ != __tx.__end_; ++__tx.__pos_) {
-        __alloc_traits::construct(__a, _VSTD::__to_address(__tx.__pos_));
+        __alloc_traits::construct(__a, _CUDA_VSTD::__to_address(__tx.__pos_));
       }
     }
 }
@@ -2416,7 +2416,7 @@ deque<_Tp, _Allocator>::__append(size_type __n, const value_type& __v)
     for (__deque_block_range __br : __deque_range(__base::end(), __base::end() + __n)) {
       _ConstructTransaction __tx(this, __br);
       for (; __tx.__pos_ != __tx.__end_; ++__tx.__pos_) {
-        __alloc_traits::construct(__a, _VSTD::__to_address(__tx.__pos_), __v);
+        __alloc_traits::construct(__a, _CUDA_VSTD::__to_address(__tx.__pos_), __v);
       }
     }
 
@@ -2472,10 +2472,10 @@ deque<_Tp, _Allocator>::__add_front_capacity()
         for (typename __base::__map_pointer __i = __base::__map_.begin();
                 __i != __base::__map_.end(); ++__i)
             __buf.push_back(*__i);
-        _VSTD::swap(__base::__map_.__first_, __buf.__first_);
-        _VSTD::swap(__base::__map_.__begin_, __buf.__begin_);
-        _VSTD::swap(__base::__map_.__end_, __buf.__end_);
-        _VSTD::swap(__base::__map_.__end_cap(), __buf.__end_cap());
+        _CUDA_VSTD::swap(__base::__map_.__first_, __buf.__first_);
+        _CUDA_VSTD::swap(__base::__map_.__begin_, __buf.__begin_);
+        _CUDA_VSTD::swap(__base::__map_.__end_, __buf.__end_);
+        _CUDA_VSTD::swap(__base::__map_.__end_cap(), __buf.__end_cap());
         __base::__start_ = __base::__map_.size() == 1 ?
                                __base::__block_size / 2 :
                                __base::__start_ + __base::__block_size;
@@ -2492,7 +2492,7 @@ deque<_Tp, _Allocator>::__add_front_capacity(size_type __n)
     size_type __nb = __recommend_blocks(__n + __base::__map_.empty());
     // Number of unused blocks at back:
     size_type __back_capacity = __back_spare() / __base::__block_size;
-    __back_capacity = _VSTD::min(__back_capacity, __nb);  // don't take more than you need
+    __back_capacity = _CUDA_VSTD::min(__back_capacity, __nb);  // don't take more than you need
     __nb -= __back_capacity;  // number of blocks need to allocate
     // If __nb == 0, then we have sufficient capacity.
     if (__nb == 0)
@@ -2535,13 +2535,13 @@ deque<_Tp, _Allocator>::__add_front_capacity(size_type __n)
             __buf(max<size_type>(2* __base::__map_.capacity(),
                                  __nb + __base::__map_.size()),
                   0, __base::__map_.__alloc());
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         try
         {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
             for (; __nb > 0; --__nb)
                 __buf.push_back(__alloc_traits::allocate(__a, __base::__block_size));
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         }
         catch (...)
         {
@@ -2550,7 +2550,7 @@ deque<_Tp, _Allocator>::__add_front_capacity(size_type __n)
                 __alloc_traits::deallocate(__a, *__i, __base::__block_size);
             throw;
         }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
         for (; __back_capacity > 0; --__back_capacity)
         {
             __buf.push_back(__base::__map_.back());
@@ -2559,10 +2559,10 @@ deque<_Tp, _Allocator>::__add_front_capacity(size_type __n)
         for (typename __base::__map_pointer __i = __base::__map_.begin();
                 __i != __base::__map_.end(); ++__i)
             __buf.push_back(*__i);
-        _VSTD::swap(__base::__map_.__first_, __buf.__first_);
-        _VSTD::swap(__base::__map_.__begin_, __buf.__begin_);
-        _VSTD::swap(__base::__map_.__end_, __buf.__end_);
-        _VSTD::swap(__base::__map_.__end_cap(), __buf.__end_cap());
+        _CUDA_VSTD::swap(__base::__map_.__first_, __buf.__first_);
+        _CUDA_VSTD::swap(__base::__map_.__begin_, __buf.__begin_);
+        _CUDA_VSTD::swap(__base::__map_.__end_, __buf.__end_);
+        _CUDA_VSTD::swap(__base::__map_.__end_cap(), __buf.__end_cap());
         __base::__start_ += __ds;
     }
 }
@@ -2615,10 +2615,10 @@ deque<_Tp, _Allocator>::__add_back_capacity()
         for (typename __base::__map_pointer __i = __base::__map_.end();
                 __i != __base::__map_.begin();)
             __buf.push_front(*--__i);
-        _VSTD::swap(__base::__map_.__first_, __buf.__first_);
-        _VSTD::swap(__base::__map_.__begin_, __buf.__begin_);
-        _VSTD::swap(__base::__map_.__end_, __buf.__end_);
-        _VSTD::swap(__base::__map_.__end_cap(), __buf.__end_cap());
+        _CUDA_VSTD::swap(__base::__map_.__first_, __buf.__first_);
+        _CUDA_VSTD::swap(__base::__map_.__begin_, __buf.__begin_);
+        _CUDA_VSTD::swap(__base::__map_.__end_, __buf.__end_);
+        _CUDA_VSTD::swap(__base::__map_.__end_cap(), __buf.__end_cap());
     }
 }
 
@@ -2632,7 +2632,7 @@ deque<_Tp, _Allocator>::__add_back_capacity(size_type __n)
     size_type __nb = __recommend_blocks(__n + __base::__map_.empty());
     // Number of unused blocks at front:
     size_type __front_capacity = __front_spare() / __base::__block_size;
-    __front_capacity = _VSTD::min(__front_capacity, __nb);  // don't take more than you need
+    __front_capacity = _CUDA_VSTD::min(__front_capacity, __nb);  // don't take more than you need
     __nb -= __front_capacity;  // number of blocks need to allocate
     // If __nb == 0, then we have sufficient capacity.
     if (__nb == 0)
@@ -2677,13 +2677,13 @@ deque<_Tp, _Allocator>::__add_back_capacity(size_type __n)
                                  __nb + __base::__map_.size()),
                   __base::__map_.size() - __front_capacity,
                   __base::__map_.__alloc());
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         try
         {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
             for (; __nb > 0; --__nb)
                 __buf.push_back(__alloc_traits::allocate(__a, __base::__block_size));
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         }
         catch (...)
         {
@@ -2692,7 +2692,7 @@ deque<_Tp, _Allocator>::__add_back_capacity(size_type __n)
                 __alloc_traits::deallocate(__a, *__i, __base::__block_size);
             throw;
         }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
         for (; __front_capacity > 0; --__front_capacity)
         {
             __buf.push_back(__base::__map_.front());
@@ -2701,10 +2701,10 @@ deque<_Tp, _Allocator>::__add_back_capacity(size_type __n)
         for (typename __base::__map_pointer __i = __base::__map_.end();
                 __i != __base::__map_.begin();)
             __buf.push_front(*--__i);
-        _VSTD::swap(__base::__map_.__first_, __buf.__first_);
-        _VSTD::swap(__base::__map_.__begin_, __buf.__begin_);
-        _VSTD::swap(__base::__map_.__end_, __buf.__end_);
-        _VSTD::swap(__base::__map_.__end_cap(), __buf.__end_cap());
+        _CUDA_VSTD::swap(__base::__map_.__first_, __buf.__first_);
+        _CUDA_VSTD::swap(__base::__map_.__begin_, __buf.__begin_);
+        _CUDA_VSTD::swap(__base::__map_.__end_, __buf.__end_);
+        _CUDA_VSTD::swap(__base::__map_.__end_cap(), __buf.__end_cap());
         __base::__start_ -= __ds;
     }
 }
@@ -2714,7 +2714,7 @@ void
 deque<_Tp, _Allocator>::pop_front()
 {
     allocator_type& __a = __base::__alloc();
-    __alloc_traits::destroy(__a, _VSTD::__to_address(*(__base::__map_.begin() +
+    __alloc_traits::destroy(__a, _CUDA_VSTD::__to_address(*(__base::__map_.begin() +
                                                     __base::__start_ / __base::__block_size) +
                                                     __base::__start_ % __base::__block_size));
     --__base::size();
@@ -2726,10 +2726,10 @@ template <class _Tp, class _Allocator>
 void
 deque<_Tp, _Allocator>::pop_back()
 {
-    _LIBCPP_ASSERT(!empty(), "deque::pop_back called on an empty deque");
+    _LIBCUDACXX_ASSERT(!empty(), "deque::pop_back called on an empty deque");
     allocator_type& __a = __base::__alloc();
     size_type __p = __base::size() + __base::__start_ - 1;
-    __alloc_traits::destroy(__a, _VSTD::__to_address(*(__base::__map_.begin() +
+    __alloc_traits::destroy(__a, _CUDA_VSTD::__to_address(*(__base::__map_.begin() +
                                                     __p / __base::__block_size) +
                                                     __p % __base::__block_size));
     --__base::size();
@@ -2745,7 +2745,7 @@ deque<_Tp, _Allocator>::__move_and_check(iterator __f, iterator __l, iterator __
 {
     // as if
     //   for (; __f != __l; ++__f, ++__r)
-    //       *__r = _VSTD::move(*__f);
+    //       *__r = _CUDA_VSTD::move(*__f);
     
diff erence_type __n = __l - __f;
     while (__n > 0)
     {
@@ -2759,7 +2759,7 @@ deque<_Tp, _Allocator>::__move_and_check(iterator __f, iterator __l, iterator __
         }
         if (__fb <= __vt && __vt < __fe)
             __vt = (const_iterator(static_cast<__map_const_pointer>(__f.__m_iter_), __vt) -= __f - __r).__ptr_;
-        __r = _VSTD::move(__fb, __fe, __r);
+        __r = _CUDA_VSTD::move(__fb, __fe, __r);
         __n -= __bs;
         __f += __bs;
     }
@@ -2775,7 +2775,7 @@ deque<_Tp, _Allocator>::__move_backward_and_check(iterator __f, iterator __l, it
 {
     // as if
     //   while (__f != __l)
-    //       *--__r = _VSTD::move(*--__l);
+    //       *--__r = _CUDA_VSTD::move(*--__l);
     
diff erence_type __n = __l - __f;
     while (__n > 0)
     {
@@ -2790,7 +2790,7 @@ deque<_Tp, _Allocator>::__move_backward_and_check(iterator __f, iterator __l, it
         }
         if (__lb <= __vt && __vt < __le)
             __vt = (const_iterator(static_cast<__map_const_pointer>(__l.__m_iter_), __vt) += __r - __l - 1).__ptr_;
-        __r = _VSTD::move_backward(__lb, __le, __r);
+        __r = _CUDA_VSTD::move_backward(__lb, __le, __r);
         __n -= __bs;
         __l -= __bs - 1;
     }
@@ -2807,7 +2807,7 @@ deque<_Tp, _Allocator>::__move_construct_and_check(iterator __f, iterator __l,
     allocator_type& __a = __base::__alloc();
     // as if
     //   for (; __f != __l; ++__r, ++__f, ++__base::size())
-    //       __alloc_traits::construct(__a, _VSTD::addressof(*__r), _VSTD::move(*__f));
+    //       __alloc_traits::construct(__a, _CUDA_VSTD::addressof(*__r), _CUDA_VSTD::move(*__f));
     
diff erence_type __n = __l - __f;
     while (__n > 0)
     {
@@ -2822,7 +2822,7 @@ deque<_Tp, _Allocator>::__move_construct_and_check(iterator __f, iterator __l,
         if (__fb <= __vt && __vt < __fe)
             __vt = (const_iterator(static_cast<__map_const_pointer>(__f.__m_iter_), __vt) += __r - __f).__ptr_;
         for (; __fb != __fe; ++__fb, ++__r, ++__base::size())
-            __alloc_traits::construct(__a, _VSTD::addressof(*__r), _VSTD::move(*__fb));
+            __alloc_traits::construct(__a, _CUDA_VSTD::addressof(*__r), _CUDA_VSTD::move(*__fb));
         __n -= __bs;
         __f += __bs;
     }
@@ -2839,7 +2839,7 @@ deque<_Tp, _Allocator>::__move_construct_backward_and_check(iterator __f, iterat
     // as if
     //   for (iterator __j = __l; __j != __f;)
     //   {
-    //       __alloc_traitsconstruct(__a, _VSTD::addressof(*--__r), _VSTD::move(*--__j));
+    //       __alloc_traitsconstruct(__a, _CUDA_VSTD::addressof(*--__r), _CUDA_VSTD::move(*--__j));
     //       --__base::__start_;
     //       ++__base::size();
     //   }
@@ -2859,7 +2859,7 @@ deque<_Tp, _Allocator>::__move_construct_backward_and_check(iterator __f, iterat
             __vt = (const_iterator(static_cast<__map_const_pointer>(__l.__m_iter_), __vt) -= __l - __r + 1).__ptr_;
         while (__le != __lb)
         {
-            __alloc_traits::construct(__a, _VSTD::addressof(*--__r), _VSTD::move(*--__le));
+            __alloc_traits::construct(__a, _CUDA_VSTD::addressof(*--__r), _CUDA_VSTD::move(*--__le));
             --__base::__start_;
             ++__base::size();
         }
@@ -2878,16 +2878,16 @@ deque<_Tp, _Allocator>::erase(const_iterator __f)
     allocator_type& __a = __base::__alloc();
     if (static_cast<size_t>(__pos) <= (__base::size() - 1) / 2)
     {   // erase from front
-        _VSTD::move_backward(__b, __p, _VSTD::next(__p));
-        __alloc_traits::destroy(__a, _VSTD::addressof(*__b));
+        _CUDA_VSTD::move_backward(__b, __p, _CUDA_VSTD::next(__p));
+        __alloc_traits::destroy(__a, _CUDA_VSTD::addressof(*__b));
         --__base::size();
         ++__base::__start_;
         __maybe_remove_front_spare();
     }
     else
     {   // erase from back
-        iterator __i = _VSTD::move(_VSTD::next(__p), __base::end(), __p);
-        __alloc_traits::destroy(__a, _VSTD::addressof(*__i));
+        iterator __i = _CUDA_VSTD::move(_CUDA_VSTD::next(__p), __base::end(), __p);
+        __alloc_traits::destroy(__a, _CUDA_VSTD::addressof(*__i));
         --__base::size();
         __maybe_remove_back_spare();
     }
@@ -2907,9 +2907,9 @@ deque<_Tp, _Allocator>::erase(const_iterator __f, const_iterator __l)
         allocator_type& __a = __base::__alloc();
         if (static_cast<size_t>(__pos) <= (__base::size() - __n) / 2)
         {   // erase from front
-            iterator __i = _VSTD::move_backward(__b, __p, __p + __n);
+            iterator __i = _CUDA_VSTD::move_backward(__b, __p, __p + __n);
             for (; __b != __i; ++__b)
-                __alloc_traits::destroy(__a, _VSTD::addressof(*__b));
+                __alloc_traits::destroy(__a, _CUDA_VSTD::addressof(*__b));
             __base::size() -= __n;
             __base::__start_ += __n;
             while (__maybe_remove_front_spare()) {
@@ -2917,9 +2917,9 @@ deque<_Tp, _Allocator>::erase(const_iterator __f, const_iterator __l)
         }
         else
         {   // erase from back
-            iterator __i = _VSTD::move(__p + __n, __base::end(), __p);
+            iterator __i = _CUDA_VSTD::move(__p + __n, __base::end(), __p);
             for (iterator __e = __base::end(); __i != __e; ++__i)
-                __alloc_traits::destroy(__a, _VSTD::addressof(*__i));
+                __alloc_traits::destroy(__a, _CUDA_VSTD::addressof(*__i));
             __base::size() -= __n;
             while (__maybe_remove_back_spare()) {
             }
@@ -2940,7 +2940,7 @@ deque<_Tp, _Allocator>::__erase_to_end(const_iterator __f)
         iterator __b = __base::begin();
         
diff erence_type __pos = __f - __b;
         for (iterator __p = __b + __pos; __p != __e; ++__p)
-            __alloc_traits::destroy(__a, _VSTD::addressof(*__p));
+            __alloc_traits::destroy(__a, _CUDA_VSTD::addressof(*__p));
         __base::size() -= __n;
         while (__maybe_remove_back_spare()) {
         }
@@ -2951,7 +2951,7 @@ template <class _Tp, class _Allocator>
 inline
 void
 deque<_Tp, _Allocator>::swap(deque& __c)
-#if _LIBCPP_STD_VER >= 14
+#if _LIBCUDACXX_STD_VER >= 14
         _NOEXCEPT
 #else
         _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
@@ -2970,16 +2970,16 @@ deque<_Tp, _Allocator>::clear() _NOEXCEPT
 }
 
 template <class _Tp, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator==(const deque<_Tp, _Allocator>& __x, const deque<_Tp, _Allocator>& __y)
 {
     const typename deque<_Tp, _Allocator>::size_type __sz = __x.size();
-    return __sz == __y.size() && _VSTD::equal(__x.begin(), __x.end(), __y.begin());
+    return __sz == __y.size() && _CUDA_VSTD::equal(__x.begin(), __x.end(), __y.begin());
 }
 
 template <class _Tp, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator!=(const deque<_Tp, _Allocator>& __x, const deque<_Tp, _Allocator>& __y)
 {
@@ -2987,15 +2987,15 @@ operator!=(const deque<_Tp, _Allocator>& __x, const deque<_Tp, _Allocator>& __y)
 }
 
 template <class _Tp, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator< (const deque<_Tp, _Allocator>& __x, const deque<_Tp, _Allocator>& __y)
 {
-    return _VSTD::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());
+    return _CUDA_VSTD::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());
 }
 
 template <class _Tp, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator> (const deque<_Tp, _Allocator>& __x, const deque<_Tp, _Allocator>& __y)
 {
@@ -3003,7 +3003,7 @@ operator> (const deque<_Tp, _Allocator>& __x, const deque<_Tp, _Allocator>& __y)
 }
 
 template <class _Tp, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator>=(const deque<_Tp, _Allocator>& __x, const deque<_Tp, _Allocator>& __y)
 {
@@ -3011,7 +3011,7 @@ operator>=(const deque<_Tp, _Allocator>& __x, const deque<_Tp, _Allocator>& __y)
 }
 
 template <class _Tp, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator<=(const deque<_Tp, _Allocator>& __x, const deque<_Tp, _Allocator>& __y)
 {
@@ -3019,7 +3019,7 @@ operator<=(const deque<_Tp, _Allocator>& __x, const deque<_Tp, _Allocator>& __y)
 }
 
 template <class _Tp, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 swap(deque<_Tp, _Allocator>& __x, deque<_Tp, _Allocator>& __y)
     _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
@@ -3027,34 +3027,34 @@ swap(deque<_Tp, _Allocator>& __x, deque<_Tp, _Allocator>& __y)
     __x.swap(__y);
 }
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 template <class _Tp, class _Allocator, class _Up>
-inline _LIBCPP_INLINE_VISIBILITY typename deque<_Tp, _Allocator>::size_type
+inline _LIBCUDACXX_INLINE_VISIBILITY typename deque<_Tp, _Allocator>::size_type
 erase(deque<_Tp, _Allocator>& __c, const _Up& __v) {
   auto __old_size = __c.size();
-  __c.erase(_VSTD::remove(__c.begin(), __c.end(), __v), __c.end());
+  __c.erase(_CUDA_VSTD::remove(__c.begin(), __c.end(), __v), __c.end());
   return __old_size - __c.size();
 }
 
 template <class _Tp, class _Allocator, class _Predicate>
-inline _LIBCPP_INLINE_VISIBILITY typename deque<_Tp, _Allocator>::size_type
+inline _LIBCUDACXX_INLINE_VISIBILITY typename deque<_Tp, _Allocator>::size_type
 erase_if(deque<_Tp, _Allocator>& __c, _Predicate __pred) {
   auto __old_size = __c.size();
-  __c.erase(_VSTD::remove_if(__c.begin(), __c.end(), __pred), __c.end());
+  __c.erase(_CUDA_VSTD::remove_if(__c.begin(), __c.end(), __pred), __c.end());
   return __old_size - __c.size();
 }
 
 template <>
 inline constexpr bool __format::__enable_insertable<std::deque<char>> = true;
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 template <>
 inline constexpr bool __format::__enable_insertable<std::deque<wchar_t>> = true;
 #endif
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP_DEQUE
+#endif // _LIBCUDACXX_DEQUE

diff  --git a/libcxx/include/errno.h b/libcxx/include/errno.h
index ea0559f0f5d1..7c02399029d8 100644
--- a/libcxx/include/errno.h
+++ b/libcxx/include/errno.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_ERRNO_H
-#define _LIBCPP_ERRNO_H
+#ifndef _LIBCUDACXX_ERRNO_H
+#define _LIBCUDACXX_ERRNO_H
 
 /*
     errno.h synopsis
@@ -24,7 +24,7 @@
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
@@ -394,4 +394,4 @@ static const int __elast2 = 105;
 
 #endif // __cplusplus
 
-#endif // _LIBCPP_ERRNO_H
+#endif // _LIBCUDACXX_ERRNO_H

diff  --git a/libcxx/include/exception b/libcxx/include/exception
index 7b514e5dca54..99b7cb187a32 100644
--- a/libcxx/include/exception
+++ b/libcxx/include/exception
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_EXCEPTION
-#define _LIBCPP_EXCEPTION
+#ifndef _LIBCUDACXX_EXCEPTION
+#define _LIBCUDACXX_EXCEPTION
 
 /*
     exception synopsis
@@ -85,93 +85,93 @@ template <class E> void rethrow_if_nested(const E& e);
 #include <type_traits>
 #include <version>
 
-#if defined(_LIBCPP_ABI_VCRUNTIME)
+#if defined(_LIBCUDACXX_ABI_VCRUNTIME)
 #include <vcruntime_exception.h>
 #endif
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
 namespace std  // purposefully not using versioning namespace
 {
 
-#if !defined(_LIBCPP_ABI_VCRUNTIME)
-class _LIBCPP_EXCEPTION_ABI exception
+#if !defined(_LIBCUDACXX_ABI_VCRUNTIME)
+class _LIBCUDACXX_EXCEPTION_ABI exception
 {
 public:
-    _LIBCPP_INLINE_VISIBILITY exception() _NOEXCEPT {}
-    _LIBCPP_INLINE_VISIBILITY exception(const exception&) _NOEXCEPT = default;
+    _LIBCUDACXX_INLINE_VISIBILITY exception() _NOEXCEPT {}
+    _LIBCUDACXX_INLINE_VISIBILITY exception(const exception&) _NOEXCEPT = default;
 
     virtual ~exception() _NOEXCEPT;
     virtual const char* what() const _NOEXCEPT;
 };
 
-class _LIBCPP_EXCEPTION_ABI bad_exception
+class _LIBCUDACXX_EXCEPTION_ABI bad_exception
     : public exception
 {
 public:
-    _LIBCPP_INLINE_VISIBILITY bad_exception() _NOEXCEPT {}
+    _LIBCUDACXX_INLINE_VISIBILITY bad_exception() _NOEXCEPT {}
     virtual ~bad_exception() _NOEXCEPT;
     virtual const char* what() const _NOEXCEPT;
 };
-#endif // !_LIBCPP_ABI_VCRUNTIME
+#endif // !_LIBCUDACXX_ABI_VCRUNTIME
 
-#if _LIBCPP_STD_VER <= 14 \
-    || defined(_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS) \
-    || defined(_LIBCPP_BUILDING_LIBRARY)
+#if _LIBCUDACXX_STD_VER <= 14 \
+    || defined(_LIBCUDACXX_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS) \
+    || defined(_LIBCUDACXX_BUILDING_LIBRARY)
 typedef void (*unexpected_handler)();
-_LIBCPP_FUNC_VIS unexpected_handler set_unexpected(unexpected_handler) _NOEXCEPT;
-_LIBCPP_FUNC_VIS unexpected_handler get_unexpected() _NOEXCEPT;
-_LIBCPP_NORETURN _LIBCPP_FUNC_VIS void unexpected();
+_LIBCUDACXX_FUNC_VIS unexpected_handler set_unexpected(unexpected_handler) _NOEXCEPT;
+_LIBCUDACXX_FUNC_VIS unexpected_handler get_unexpected() _NOEXCEPT;
+_LIBCUDACXX_NORETURN _LIBCUDACXX_FUNC_VIS void unexpected();
 #endif
 
 typedef void (*terminate_handler)();
-_LIBCPP_FUNC_VIS terminate_handler set_terminate(terminate_handler) _NOEXCEPT;
-_LIBCPP_FUNC_VIS terminate_handler get_terminate() _NOEXCEPT;
-_LIBCPP_NORETURN _LIBCPP_FUNC_VIS void terminate() _NOEXCEPT;
+_LIBCUDACXX_FUNC_VIS terminate_handler set_terminate(terminate_handler) _NOEXCEPT;
+_LIBCUDACXX_FUNC_VIS terminate_handler get_terminate() _NOEXCEPT;
+_LIBCUDACXX_NORETURN _LIBCUDACXX_FUNC_VIS void terminate() _NOEXCEPT;
 
-_LIBCPP_FUNC_VIS bool uncaught_exception() _NOEXCEPT;
-_LIBCPP_FUNC_VIS _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS int uncaught_exceptions() _NOEXCEPT;
+_LIBCUDACXX_FUNC_VIS bool uncaught_exception() _NOEXCEPT;
+_LIBCUDACXX_FUNC_VIS _LIBCUDACXX_AVAILABILITY_UNCAUGHT_EXCEPTIONS int uncaught_exceptions() _NOEXCEPT;
 
-class _LIBCPP_TYPE_VIS exception_ptr;
+class _LIBCUDACXX_TYPE_VIS exception_ptr;
 
-_LIBCPP_FUNC_VIS exception_ptr current_exception() _NOEXCEPT;
-_LIBCPP_NORETURN _LIBCPP_FUNC_VIS void rethrow_exception(exception_ptr);
+_LIBCUDACXX_FUNC_VIS exception_ptr current_exception() _NOEXCEPT;
+_LIBCUDACXX_NORETURN _LIBCUDACXX_FUNC_VIS void rethrow_exception(exception_ptr);
 
-#ifndef _LIBCPP_ABI_MICROSOFT
+#ifndef _LIBCUDACXX_ABI_MICROSOFT
 
-class _LIBCPP_TYPE_VIS exception_ptr
+class _LIBCUDACXX_TYPE_VIS exception_ptr
 {
     void* __ptr_;
 public:
-    _LIBCPP_INLINE_VISIBILITY exception_ptr() _NOEXCEPT : __ptr_() {}
-    _LIBCPP_INLINE_VISIBILITY exception_ptr(nullptr_t) _NOEXCEPT : __ptr_() {}
+    _LIBCUDACXX_INLINE_VISIBILITY exception_ptr() _NOEXCEPT : __ptr_() {}
+    _LIBCUDACXX_INLINE_VISIBILITY exception_ptr(nullptr_t) _NOEXCEPT : __ptr_() {}
 
     exception_ptr(const exception_ptr&) _NOEXCEPT;
     exception_ptr& operator=(const exception_ptr&) _NOEXCEPT;
     ~exception_ptr() _NOEXCEPT;
 
-    _LIBCPP_INLINE_VISIBILITY explicit operator bool() const _NOEXCEPT
+    _LIBCUDACXX_INLINE_VISIBILITY explicit operator bool() const _NOEXCEPT
     {return __ptr_ != nullptr;}
 
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
     bool operator==(const exception_ptr& __x, const exception_ptr& __y) _NOEXCEPT
         {return __x.__ptr_ == __y.__ptr_;}
 
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
     bool operator!=(const exception_ptr& __x, const exception_ptr& __y) _NOEXCEPT
         {return !(__x == __y);}
 
-    friend _LIBCPP_FUNC_VIS exception_ptr current_exception() _NOEXCEPT;
-    friend _LIBCPP_FUNC_VIS void rethrow_exception(exception_ptr);
+    friend _LIBCUDACXX_FUNC_VIS exception_ptr current_exception() _NOEXCEPT;
+    friend _LIBCUDACXX_FUNC_VIS void rethrow_exception(exception_ptr);
 };
 
 template<class _Ep>
-_LIBCPP_INLINE_VISIBILITY exception_ptr
+_LIBCUDACXX_INLINE_VISIBILITY exception_ptr
 make_exception_ptr(_Ep __e) _NOEXCEPT
 {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     try
     {
         throw __e;
@@ -182,19 +182,19 @@ make_exception_ptr(_Ep __e) _NOEXCEPT
     }
 #else
     ((void)__e);
-    _VSTD::abort();
+    _CUDA_VSTD::abort();
 #endif
 }
 
-#else // _LIBCPP_ABI_MICROSOFT
+#else // _LIBCUDACXX_ABI_MICROSOFT
 
-class _LIBCPP_TYPE_VIS exception_ptr
+class _LIBCUDACXX_TYPE_VIS exception_ptr
 {
-_LIBCPP_DIAGNOSTIC_PUSH
-_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wunused-private-field")
+_LIBCUDACXX_DIAGNOSTIC_PUSH
+_LIBCUDACXX_CLANG_DIAGNOSTIC_IGNORED("-Wunused-private-field")
     void* __ptr1_;
     void* __ptr2_;
-_LIBCPP_DIAGNOSTIC_POP
+_LIBCUDACXX_DIAGNOSTIC_POP
 public:
     exception_ptr() _NOEXCEPT;
     exception_ptr(nullptr_t) _NOEXCEPT;
@@ -205,34 +205,34 @@ public:
     explicit operator bool() const _NOEXCEPT;
 };
 
-_LIBCPP_FUNC_VIS
+_LIBCUDACXX_FUNC_VIS
 bool operator==(const exception_ptr& __x, const exception_ptr& __y) _NOEXCEPT;
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool operator!=(const exception_ptr& __x, const exception_ptr& __y) _NOEXCEPT
     {return !(__x == __y);}
 
-_LIBCPP_FUNC_VIS void swap(exception_ptr&, exception_ptr&) _NOEXCEPT;
+_LIBCUDACXX_FUNC_VIS void swap(exception_ptr&, exception_ptr&) _NOEXCEPT;
 
-_LIBCPP_FUNC_VIS exception_ptr __copy_exception_ptr(void *__except, const void* __ptr);
-_LIBCPP_FUNC_VIS exception_ptr current_exception() _NOEXCEPT;
-_LIBCPP_NORETURN _LIBCPP_FUNC_VIS void rethrow_exception(exception_ptr);
+_LIBCUDACXX_FUNC_VIS exception_ptr __copy_exception_ptr(void *__except, const void* __ptr);
+_LIBCUDACXX_FUNC_VIS exception_ptr current_exception() _NOEXCEPT;
+_LIBCUDACXX_NORETURN _LIBCUDACXX_FUNC_VIS void rethrow_exception(exception_ptr);
 
 // This is a built-in template function which automagically extracts the required
 // information.
 template <class _E> void *__GetExceptionInfo(_E);
 
 template<class _Ep>
-_LIBCPP_INLINE_VISIBILITY exception_ptr
+_LIBCUDACXX_INLINE_VISIBILITY exception_ptr
 make_exception_ptr(_Ep __e) _NOEXCEPT
 {
-  return __copy_exception_ptr(_VSTD::addressof(__e), __GetExceptionInfo(__e));
+  return __copy_exception_ptr(_CUDA_VSTD::addressof(__e), __GetExceptionInfo(__e));
 }
 
-#endif // _LIBCPP_ABI_MICROSOFT
+#endif // _LIBCUDACXX_ABI_MICROSOFT
 // nested_exception
 
-class _LIBCPP_EXCEPTION_ABI nested_exception
+class _LIBCUDACXX_EXCEPTION_ABI nested_exception
 {
     exception_ptr __ptr_;
 public:
@@ -242,8 +242,8 @@ public:
     virtual ~nested_exception() _NOEXCEPT;
 
     // access functions
-    _LIBCPP_NORETURN void rethrow_nested() const;
-    _LIBCPP_INLINE_VISIBILITY exception_ptr nested_ptr() const _NOEXCEPT {return __ptr_;}
+    _LIBCUDACXX_NORETURN void rethrow_nested() const;
+    _LIBCUDACXX_INLINE_VISIBILITY exception_ptr nested_ptr() const _NOEXCEPT {return __ptr_;}
 };
 
 template <class _Tp>
@@ -251,16 +251,16 @@ struct __nested
     : public _Tp,
       public nested_exception
 {
-    _LIBCPP_INLINE_VISIBILITY explicit __nested(const _Tp& __t) : _Tp(__t) {}
+    _LIBCUDACXX_INLINE_VISIBILITY explicit __nested(const _Tp& __t) : _Tp(__t) {}
 };
 
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
 template <class _Tp, class _Up, bool>
 struct __throw_with_nested;
 
 template <class _Tp, class _Up>
 struct __throw_with_nested<_Tp, _Up, true> {
-    _LIBCPP_NORETURN static inline _LIBCPP_INLINE_VISIBILITY void
+    _LIBCUDACXX_NORETURN static inline _LIBCUDACXX_INLINE_VISIBILITY void
     __do_throw(_Tp&& __t)
     {
         throw __nested<_Up>(static_cast<_Tp&&>(__t));
@@ -269,12 +269,12 @@ struct __throw_with_nested<_Tp, _Up, true> {
 
 template <class _Tp, class _Up>
 struct __throw_with_nested<_Tp, _Up, false> {
-    _LIBCPP_NORETURN static inline _LIBCPP_INLINE_VISIBILITY void
-#ifndef _LIBCPP_CXX03_LANG
+    _LIBCUDACXX_NORETURN static inline _LIBCUDACXX_INLINE_VISIBILITY void
+#ifndef _LIBCUDACXX_CXX03_LANG
     __do_throw(_Tp&& __t)
 #else
     __do_throw (_Tp& __t)
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
     {
         throw static_cast<_Tp&&>(__t);
     }
@@ -282,17 +282,17 @@ struct __throw_with_nested<_Tp, _Up, false> {
 #endif
 
 template <class _Tp>
-_LIBCPP_NORETURN
+_LIBCUDACXX_NORETURN
 void
 throw_with_nested(_Tp&& __t)
 {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     typedef typename decay<_Tp>::type _Up;
     static_assert( is_copy_constructible<_Up>::value, "type thrown must be CopyConstructible");
     __throw_with_nested<_Tp, _Up,
         is_class<_Up>::value &&
         !is_base_of<nested_exception, _Up>::value &&
-        !__libcpp_is_final<_Up>::value>::
+        !__LIBCUDACXX_is_final<_Up>::value>::
             __do_throw(static_cast<_Tp&&>(__t));
 #else
     ((void)__t);
@@ -307,18 +307,18 @@ struct __can_dynamic_cast : _BoolConstant<
                    is_convertible<const _From*, const _To*>::value)> {};
 
 template <class _Ep>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 rethrow_if_nested(const _Ep& __e,
                   __enable_if_t< __can_dynamic_cast<_Ep, nested_exception>::value>* = 0)
 {
-    const nested_exception* __nep = dynamic_cast<const nested_exception*>(_VSTD::addressof(__e));
+    const nested_exception* __nep = dynamic_cast<const nested_exception*>(_CUDA_VSTD::addressof(__e));
     if (__nep)
         __nep->rethrow_nested();
 }
 
 template <class _Ep>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 rethrow_if_nested(const _Ep&,
                   __enable_if_t<!__can_dynamic_cast<_Ep, nested_exception>::value>* = 0)
@@ -327,4 +327,4 @@ rethrow_if_nested(const _Ep&,
 
 } // namespace std
 
-#endif // _LIBCPP_EXCEPTION
+#endif // _LIBCUDACXX_EXCEPTION

diff  --git a/libcxx/include/execution b/libcxx/include/execution
index 040297038637..c58f7fb4449a 100644
--- a/libcxx/include/execution
+++ b/libcxx/include/execution
@@ -7,19 +7,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_EXECUTION
-#define _LIBCPP_EXECUTION
+#ifndef _LIBCUDACXX_EXECUTION
+#define _LIBCUDACXX_EXECUTION
 
 #include <__assert> // all public C++ headers provide the assertion handler
 #include <__config>
 #include <version>
 
-#if defined(_LIBCPP_HAS_PARALLEL_ALGORITHMS) && _LIBCPP_STD_VER >= 17
+#if defined(_LIBCUDACXX_HAS_PARALLEL_ALGORITHMS) && _LIBCUDACXX_STD_VER >= 17
 #   include <__pstl_execution>
 #endif
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#endif // _LIBCPP_EXECUTION
+#endif // _LIBCUDACXX_EXECUTION

diff  --git a/libcxx/include/experimental/__config b/libcxx/include/experimental/__config
index a71b348c0490..30dd0eb3d159 100644
--- a/libcxx/include/experimental/__config
+++ b/libcxx/include/experimental/__config
@@ -7,60 +7,60 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_EXPERIMENTAL_CONFIG
-#define _LIBCPP_EXPERIMENTAL_CONFIG
+#ifndef _LIBCUDACXX_EXPERIMENTAL_CONFIG
+#define _LIBCUDACXX_EXPERIMENTAL_CONFIG
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#define _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL namespace std { namespace experimental {
-#define _LIBCPP_END_NAMESPACE_EXPERIMENTAL  } }
+#define _LIBCUDACXX_BEGIN_NAMESPACE_EXPERIMENTAL namespace std { namespace experimental {
+#define _LIBCUDACXX_END_NAMESPACE_EXPERIMENTAL  } }
 #define _VSTD_EXPERIMENTAL std::experimental
 
-#define _LIBCPP_BEGIN_NAMESPACE_LFTS _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL inline namespace fundamentals_v1 {
-#define _LIBCPP_END_NAMESPACE_LFTS  } } }
+#define _LIBCUDACXX_BEGIN_NAMESPACE_LFTS _LIBCUDACXX_BEGIN_NAMESPACE_EXPERIMENTAL inline namespace fundamentals_v1 {
+#define _LIBCUDACXX_END_NAMESPACE_LFTS  } } }
 #define _VSTD_LFTS _VSTD_EXPERIMENTAL::fundamentals_v1
 
-#define _LIBCPP_BEGIN_NAMESPACE_LFTS_V2 _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL inline namespace fundamentals_v2 {
-#define _LIBCPP_END_NAMESPACE_LFTS_V2  } } }
+#define _LIBCUDACXX_BEGIN_NAMESPACE_LFTS_V2 _LIBCUDACXX_BEGIN_NAMESPACE_EXPERIMENTAL inline namespace fundamentals_v2 {
+#define _LIBCUDACXX_END_NAMESPACE_LFTS_V2  } } }
 #define _VSTD_LFTS_V2 _VSTD_EXPERIMENTAL::fundamentals_v2
 
-#define _LIBCPP_BEGIN_NAMESPACE_LFTS_PMR _LIBCPP_BEGIN_NAMESPACE_LFTS namespace pmr {
-#define _LIBCPP_END_NAMESPACE_LFTS_PMR _LIBCPP_END_NAMESPACE_LFTS }
+#define _LIBCUDACXX_BEGIN_NAMESPACE_LFTS_PMR _LIBCUDACXX_BEGIN_NAMESPACE_LFTS namespace pmr {
+#define _LIBCUDACXX_END_NAMESPACE_LFTS_PMR _LIBCUDACXX_END_NAMESPACE_LFTS }
 #define _VSTD_LFTS_PMR _VSTD_LFTS::pmr
 
 #if !defined(__cpp_coroutines) || __cpp_coroutines < 201703L
-#define _LIBCPP_HAS_NO_EXPERIMENTAL_COROUTINES
+#define _LIBCUDACXX_HAS_NO_EXPERIMENTAL_COROUTINES
 #endif
 
-#define _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_COROUTINES \
-  _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL inline namespace coroutines_v1 {
+#define _LIBCUDACXX_BEGIN_NAMESPACE_EXPERIMENTAL_COROUTINES \
+  _LIBCUDACXX_BEGIN_NAMESPACE_EXPERIMENTAL inline namespace coroutines_v1 {
 
-#define _LIBCPP_END_NAMESPACE_EXPERIMENTAL_COROUTINES \
-  } _LIBCPP_END_NAMESPACE_EXPERIMENTAL
+#define _LIBCUDACXX_END_NAMESPACE_EXPERIMENTAL_COROUTINES \
+  } _LIBCUDACXX_END_NAMESPACE_EXPERIMENTAL
 
 #define _VSTD_CORO _VSTD_EXPERIMENTAL::coroutines_v1
 
-#define _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_SIMD \
-    _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL inline namespace parallelism_v2 {
+#define _LIBCUDACXX_BEGIN_NAMESPACE_EXPERIMENTAL_SIMD \
+    _LIBCUDACXX_BEGIN_NAMESPACE_EXPERIMENTAL inline namespace parallelism_v2 {
 
-#define _LIBCPP_END_NAMESPACE_EXPERIMENTAL_SIMD \
-    } _LIBCPP_END_NAMESPACE_EXPERIMENTAL
+#define _LIBCUDACXX_END_NAMESPACE_EXPERIMENTAL_SIMD \
+    } _LIBCUDACXX_END_NAMESPACE_EXPERIMENTAL
 
-#define _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_SIMD_ABI \
-    _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_SIMD namespace simd_abi {
+#define _LIBCUDACXX_BEGIN_NAMESPACE_EXPERIMENTAL_SIMD_ABI \
+    _LIBCUDACXX_BEGIN_NAMESPACE_EXPERIMENTAL_SIMD namespace simd_abi {
 
-#define _LIBCPP_END_NAMESPACE_EXPERIMENTAL_SIMD_ABI \
-    } _LIBCPP_END_NAMESPACE_EXPERIMENTAL_SIMD
+#define _LIBCUDACXX_END_NAMESPACE_EXPERIMENTAL_SIMD_ABI \
+    } _LIBCUDACXX_END_NAMESPACE_EXPERIMENTAL_SIMD
 
 // TODO: support more targets
 #if defined(__AVX__)
-#define _LIBCPP_NATIVE_SIMD_WIDTH_IN_BYTES 32
+#define _LIBCUDACXX_NATIVE_SIMD_WIDTH_IN_BYTES 32
 #else
-#define _LIBCPP_NATIVE_SIMD_WIDTH_IN_BYTES 16
+#define _LIBCUDACXX_NATIVE_SIMD_WIDTH_IN_BYTES 16
 #endif
 
 #endif

diff  --git a/libcxx/include/experimental/__memory b/libcxx/include/experimental/__memory
index 749cf4c0c657..69d1599cfaf4 100644
--- a/libcxx/include/experimental/__memory
+++ b/libcxx/include/experimental/__memory
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_EXPERIMENTAL___MEMORY
-#define _LIBCPP_EXPERIMENTAL___MEMORY
+#ifndef _LIBCUDACXX_EXPERIMENTAL___MEMORY
+#define _LIBCUDACXX_EXPERIMENTAL___MEMORY
 
 #include <__memory/allocator_arg_t.h>
 #include <__memory/uses_allocator.h>
@@ -16,11 +16,11 @@
 #include <experimental/utility> // for erased_type
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_LFTS
+_LIBCUDACXX_BEGIN_NAMESPACE_LFTS
 
 template <
     class _Tp, class _Alloc
@@ -79,39 +79,39 @@ struct __lfts_uses_alloc_ctor
 {};
 
 template <class _Tp, class _Allocator, class... _Args>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void __user_alloc_construct_impl (integral_constant<int, 0>, _Tp *__storage, const _Allocator &, _Args &&... __args )
 {
-    new (__storage) _Tp (_VSTD::forward<_Args>(__args)...);
+    new (__storage) _Tp (_CUDA_VSTD::forward<_Args>(__args)...);
 }
 
 // FIXME: This should have a version which takes a non-const alloc.
 template <class _Tp, class _Allocator, class... _Args>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void __user_alloc_construct_impl (integral_constant<int, 1>, _Tp *__storage, const _Allocator &__a, _Args &&... __args )
 {
-    new (__storage) _Tp (allocator_arg, __a, _VSTD::forward<_Args>(__args)...);
+    new (__storage) _Tp (allocator_arg, __a, _CUDA_VSTD::forward<_Args>(__args)...);
 }
 
 // FIXME: This should have a version which takes a non-const alloc.
 template <class _Tp, class _Allocator, class... _Args>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void __user_alloc_construct_impl (integral_constant<int, 2>, _Tp *__storage, const _Allocator &__a, _Args &&... __args )
 {
-    new (__storage) _Tp (_VSTD::forward<_Args>(__args)..., __a);
+    new (__storage) _Tp (_CUDA_VSTD::forward<_Args>(__args)..., __a);
 }
 
 template <class _Tp, class _Alloc, class ..._Args>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void __lfts_user_alloc_construct(
     _Tp * __store, const _Alloc & __a, _Args &&... __args)
 {
     ::std::experimental::fundamentals_v1::__user_alloc_construct_impl(
         typename __lfts_uses_alloc_ctor<_Tp, _Alloc, _Args...>::type()
-       , __store, __a, _VSTD::forward<_Args>(__args)...
+       , __store, __a, _CUDA_VSTD::forward<_Args>(__args)...
        );
 }
 
-_LIBCPP_END_NAMESPACE_LFTS
+_LIBCUDACXX_END_NAMESPACE_LFTS
 
-#endif /* _LIBCPP_EXPERIMENTAL___MEMORY */
+#endif /* _LIBCUDACXX_EXPERIMENTAL___MEMORY */

diff  --git a/libcxx/include/experimental/algorithm b/libcxx/include/experimental/algorithm
index e0ca3c73be6b..6d0a0464e8f6 100644
--- a/libcxx/include/experimental/algorithm
+++ b/libcxx/include/experimental/algorithm
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_EXPERIMENTAL_ALGORITHM
-#define _LIBCPP_EXPERIMENTAL_ALGORITHM
+#ifndef _LIBCUDACXX_EXPERIMENTAL_ALGORITHM
+#define _LIBCUDACXX_EXPERIMENTAL_ALGORITHM
 
 /*
    experimental/algorithm synopsis
@@ -37,17 +37,17 @@ ForwardIterator search(ForwardIterator first, ForwardIterator last,
 #include <experimental/__config>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_LFTS
+_LIBCUDACXX_BEGIN_NAMESPACE_LFTS
 
 template <class _ForwardIterator, class _Searcher>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _ForwardIterator search(_ForwardIterator __f, _ForwardIterator __l, const _Searcher &__s)
 { return __s(__f, __l).first; }
 
-_LIBCPP_END_NAMESPACE_LFTS
+_LIBCUDACXX_END_NAMESPACE_LFTS
 
-#endif /* _LIBCPP_EXPERIMENTAL_ALGORITHM */
+#endif /* _LIBCUDACXX_EXPERIMENTAL_ALGORITHM */

diff  --git a/libcxx/include/experimental/coroutine b/libcxx/include/experimental/coroutine
index 111073bb6d67..b6b300c3ca8e 100644
--- a/libcxx/include/experimental/coroutine
+++ b/libcxx/include/experimental/coroutine
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_EXPERIMENTAL_COROUTINE
-#define _LIBCPP_EXPERIMENTAL_COROUTINE
+#ifndef _LIBCUDACXX_EXPERIMENTAL_COROUTINE
+#define _LIBCUDACXX_EXPERIMENTAL_COROUTINE
 
 /**
     experimental/coroutine synopsis
@@ -54,13 +54,13 @@ template <class P> struct hash<coroutine_handle<P>>;
 #include <new>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#ifndef _LIBCPP_HAS_NO_EXPERIMENTAL_COROUTINES
+#ifndef _LIBCUDACXX_HAS_NO_EXPERIMENTAL_COROUTINES
 
-_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_COROUTINES
+_LIBCUDACXX_BEGIN_NAMESPACE_EXPERIMENTAL_COROUTINES
 
 template <class _Tp, class = void>
 struct __coroutine_traits_sfinae {};
@@ -79,57 +79,57 @@ struct coroutine_traits
 };
 
 template <typename _Promise = void>
-class _LIBCPP_TEMPLATE_VIS coroutine_handle;
+class _LIBCUDACXX_TEMPLATE_VIS coroutine_handle;
 
 template <>
-class _LIBCPP_TEMPLATE_VIS coroutine_handle<void> {
+class _LIBCUDACXX_TEMPLATE_VIS coroutine_handle<void> {
 public:
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR coroutine_handle() _NOEXCEPT : __handle_(nullptr) {}
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR coroutine_handle() _NOEXCEPT : __handle_(nullptr) {}
 
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR coroutine_handle(nullptr_t) _NOEXCEPT : __handle_(nullptr) {}
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR coroutine_handle(nullptr_t) _NOEXCEPT : __handle_(nullptr) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     coroutine_handle& operator=(nullptr_t) _NOEXCEPT {
         __handle_ = nullptr;
         return *this;
     }
 
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR void* address() const _NOEXCEPT { return __handle_; }
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR void* address() const _NOEXCEPT { return __handle_; }
 
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR explicit operator bool() const _NOEXCEPT { return __handle_; }
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR explicit operator bool() const _NOEXCEPT { return __handle_; }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void operator()() { resume(); }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void resume() {
-      _LIBCPP_ASSERT(__is_suspended(),
+      _LIBCUDACXX_ASSERT(__is_suspended(),
                      "resume() can only be called on suspended coroutines");
-      _LIBCPP_ASSERT(!done(),
+      _LIBCUDACXX_ASSERT(!done(),
                 "resume() has undefined behavior when the coroutine is done");
       __builtin_coro_resume(__handle_);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void destroy() {
-      _LIBCPP_ASSERT(__is_suspended(),
+      _LIBCUDACXX_ASSERT(__is_suspended(),
                      "destroy() can only be called on suspended coroutines");
       __builtin_coro_destroy(__handle_);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool done() const {
-      _LIBCPP_ASSERT(__is_suspended(),
+      _LIBCUDACXX_ASSERT(__is_suspended(),
                      "done() can only be called on suspended coroutines");
       return __builtin_coro_done(__handle_);
     }
 
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     static coroutine_handle from_address(void* __addr) _NOEXCEPT {
         coroutine_handle __tmp;
         __tmp.__handle_ = __addr;
@@ -137,7 +137,7 @@ public:
     }
 
     // FIXME: Should from_address(nullptr) be allowed?
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     static coroutine_handle from_address(nullptr_t) _NOEXCEPT {
       return coroutine_handle(nullptr);
     }
@@ -160,56 +160,56 @@ private:
 };
 
 // 18.11.2.7 comparison operators:
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool operator==(coroutine_handle<> __x, coroutine_handle<> __y) _NOEXCEPT {
     return __x.address() == __y.address();
 }
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool operator!=(coroutine_handle<> __x, coroutine_handle<> __y) _NOEXCEPT {
     return !(__x == __y);
 }
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool operator<(coroutine_handle<> __x, coroutine_handle<> __y) _NOEXCEPT {
     return less<void*>()(__x.address(), __y.address());
 }
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool operator>(coroutine_handle<> __x, coroutine_handle<> __y) _NOEXCEPT {
     return __y < __x;
 }
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool operator<=(coroutine_handle<> __x, coroutine_handle<> __y) _NOEXCEPT {
     return !(__x > __y);
 }
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool operator>=(coroutine_handle<> __x, coroutine_handle<> __y) _NOEXCEPT {
     return !(__x < __y);
 }
 
 template <typename _Promise>
-class _LIBCPP_TEMPLATE_VIS coroutine_handle : public coroutine_handle<> {
+class _LIBCUDACXX_TEMPLATE_VIS coroutine_handle : public coroutine_handle<> {
     using _Base = coroutine_handle<>;
 public:
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
     // 18.11.2.1 construct/reset
     using coroutine_handle<>::coroutine_handle;
 #else
-    _LIBCPP_INLINE_VISIBILITY coroutine_handle() _NOEXCEPT : _Base() {}
-    _LIBCPP_INLINE_VISIBILITY coroutine_handle(nullptr_t) _NOEXCEPT : _Base(nullptr) {}
+    _LIBCUDACXX_INLINE_VISIBILITY coroutine_handle() _NOEXCEPT : _Base() {}
+    _LIBCUDACXX_INLINE_VISIBILITY coroutine_handle(nullptr_t) _NOEXCEPT : _Base(nullptr) {}
 #endif
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     coroutine_handle& operator=(nullptr_t) _NOEXCEPT {
         _Base::operator=(nullptr);
         return *this;
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Promise& promise() const {
         return *static_cast<_Promise*>(
-            __builtin_coro_promise(this->__handle_, _LIBCPP_ALIGNOF(_Promise), false));
+            __builtin_coro_promise(this->__handle_, _LIBCUDACXX_ALIGNOF(_Promise), false));
     }
 
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     static coroutine_handle from_address(void* __addr) _NOEXCEPT {
         coroutine_handle __tmp;
         __tmp.__handle_ = __addr;
@@ -220,7 +220,7 @@ public:
     // the deleted _Promise* overload doesn't make from_address(nullptr)
     // ambiguous.
     // FIXME: should from_address work with nullptr?
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     static coroutine_handle from_address(nullptr_t) _NOEXCEPT {
       return coroutine_handle(nullptr);
     }
@@ -239,13 +239,13 @@ public:
         "pointers to the coroutine's promise type; use 'from_promise' instead");
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     static coroutine_handle from_promise(_Promise& __promise) _NOEXCEPT {
         typedef typename remove_cv<_Promise>::type _RawPromise;
         coroutine_handle __tmp;
         __tmp.__handle_ = __builtin_coro_promise(
-            _VSTD::addressof(const_cast<_RawPromise&>(__promise)),
-             _LIBCPP_ALIGNOF(_Promise), true);
+            _CUDA_VSTD::addressof(const_cast<_RawPromise&>(__promise)),
+             _LIBCUDACXX_ALIGNOF(_Promise), true);
         return __tmp;
     }
 };
@@ -254,74 +254,74 @@ public:
 struct noop_coroutine_promise {};
 
 template <>
-class _LIBCPP_TEMPLATE_VIS coroutine_handle<noop_coroutine_promise>
+class _LIBCUDACXX_TEMPLATE_VIS coroutine_handle<noop_coroutine_promise>
     : public coroutine_handle<> {
   using _Base = coroutine_handle<>;
   using _Promise = noop_coroutine_promise;
 public:
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   _Promise& promise() const {
     return *static_cast<_Promise*>(
-      __builtin_coro_promise(this->__handle_, _LIBCPP_ALIGNOF(_Promise), false));
+      __builtin_coro_promise(this->__handle_, _LIBCUDACXX_ALIGNOF(_Promise), false));
   }
 
-  _LIBCPP_CONSTEXPR explicit operator bool() const _NOEXCEPT { return true; }
-  _LIBCPP_CONSTEXPR bool done() const _NOEXCEPT { return false; }
+  _LIBCUDACXX_CONSTEXPR explicit operator bool() const _NOEXCEPT { return true; }
+  _LIBCUDACXX_CONSTEXPR bool done() const _NOEXCEPT { return false; }
 
-  _LIBCPP_CONSTEXPR_AFTER_CXX17 void operator()() const _NOEXCEPT {}
-  _LIBCPP_CONSTEXPR_AFTER_CXX17 void resume() const _NOEXCEPT {}
-  _LIBCPP_CONSTEXPR_AFTER_CXX17 void destroy() const _NOEXCEPT {}
+  _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 void operator()() const _NOEXCEPT {}
+  _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 void resume() const _NOEXCEPT {}
+  _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 void destroy() const _NOEXCEPT {}
 
 private:
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   friend coroutine_handle<noop_coroutine_promise> noop_coroutine() _NOEXCEPT;
 
-  _LIBCPP_INLINE_VISIBILITY coroutine_handle() _NOEXCEPT {
+  _LIBCUDACXX_INLINE_VISIBILITY coroutine_handle() _NOEXCEPT {
     this->__handle_ = __builtin_coro_noop();
   }
 };
 
 using noop_coroutine_handle = coroutine_handle<noop_coroutine_promise>;
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 noop_coroutine_handle noop_coroutine() _NOEXCEPT {
   return noop_coroutine_handle();
 }
 #endif // __has_builtin(__builtin_coro_noop)
 
 struct suspend_never {
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   bool await_ready() const _NOEXCEPT { return true; }
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   void await_suspend(coroutine_handle<>) const _NOEXCEPT {}
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   void await_resume() const _NOEXCEPT {}
 };
 
 struct suspend_always {
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   bool await_ready() const _NOEXCEPT { return false; }
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   void await_suspend(coroutine_handle<>) const _NOEXCEPT {}
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   void await_resume() const _NOEXCEPT {}
 };
 
-_LIBCPP_END_NAMESPACE_EXPERIMENTAL_COROUTINES
+_LIBCUDACXX_END_NAMESPACE_EXPERIMENTAL_COROUTINES
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Tp>
 struct hash<_VSTD_CORO::coroutine_handle<_Tp> > {
     using __arg_type = _VSTD_CORO::coroutine_handle<_Tp>;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t operator()(__arg_type const& __v) const _NOEXCEPT
     {return hash<void*>()(__v.address());}
 };
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_COROUTINES)
+#endif // !defined(_LIBCUDACXX_HAS_NO_EXPERIMENTAL_COROUTINES)
 
-#endif /* _LIBCPP_EXPERIMENTAL_COROUTINE */
+#endif /* _LIBCUDACXX_EXPERIMENTAL_COROUTINE */

diff  --git a/libcxx/include/experimental/deque b/libcxx/include/experimental/deque
index 3e3f9098a8fd..16fe629f9121 100644
--- a/libcxx/include/experimental/deque
+++ b/libcxx/include/experimental/deque
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_EXPERIMENTAL_DEQUE
-#define _LIBCPP_EXPERIMENTAL_DEQUE
+#ifndef _LIBCUDACXX_EXPERIMENTAL_DEQUE
+#define _LIBCUDACXX_EXPERIMENTAL_DEQUE
 
 /*
     experimental/deque synopsis
@@ -34,15 +34,15 @@ namespace pmr {
 #include <experimental/__config>
 #include <experimental/memory_resource>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR
+_LIBCUDACXX_BEGIN_NAMESPACE_LFTS_PMR
 
 template <class _ValueT>
-using deque = _VSTD::deque<_ValueT, polymorphic_allocator<_ValueT>>;
+using deque = _CUDA_VSTD::deque<_ValueT, polymorphic_allocator<_ValueT>>;
 
-_LIBCPP_END_NAMESPACE_LFTS_PMR
+_LIBCUDACXX_END_NAMESPACE_LFTS_PMR
 
-#endif /* _LIBCPP_EXPERIMENTAL_DEQUE */
+#endif /* _LIBCUDACXX_EXPERIMENTAL_DEQUE */

diff  --git a/libcxx/include/experimental/forward_list b/libcxx/include/experimental/forward_list
index 4b102c554704..791dcd97bdcf 100644
--- a/libcxx/include/experimental/forward_list
+++ b/libcxx/include/experimental/forward_list
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_EXPERIMENTAL_FORWARD_LIST
-#define _LIBCPP_EXPERIMENTAL_FORWARD_LIST
+#ifndef _LIBCUDACXX_EXPERIMENTAL_FORWARD_LIST
+#define _LIBCUDACXX_EXPERIMENTAL_FORWARD_LIST
 
 /*
     experimental/forward_list synopsis
@@ -34,15 +34,15 @@ namespace pmr {
 #include <experimental/memory_resource>
 #include <forward_list>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR
+_LIBCUDACXX_BEGIN_NAMESPACE_LFTS_PMR
 
 template <class _ValueT>
-using forward_list = _VSTD::forward_list<_ValueT, polymorphic_allocator<_ValueT>>;
+using forward_list = _CUDA_VSTD::forward_list<_ValueT, polymorphic_allocator<_ValueT>>;
 
-_LIBCPP_END_NAMESPACE_LFTS_PMR
+_LIBCUDACXX_END_NAMESPACE_LFTS_PMR
 
-#endif /* _LIBCPP_EXPERIMENTAL_FORWARD_LIST */
+#endif /* _LIBCUDACXX_EXPERIMENTAL_FORWARD_LIST */

diff  --git a/libcxx/include/experimental/functional b/libcxx/include/experimental/functional
index 12440744ca50..8bcbdfe12955 100644
--- a/libcxx/include/experimental/functional
+++ b/libcxx/include/experimental/functional
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_EXPERIMENTAL_FUNCTIONAL
-#define _LIBCPP_EXPERIMENTAL_FUNCTIONAL
+#ifndef _LIBCUDACXX_EXPERIMENTAL_FUNCTIONAL
+#define _LIBCUDACXX_EXPERIMENTAL_FUNCTIONAL
 
 /*
    experimental/functional synopsis
@@ -71,37 +71,37 @@ inline namespace fundamentals_v1 {
 #include <unordered_map>
 #include <vector>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_LFTS
+_LIBCUDACXX_BEGIN_NAMESPACE_LFTS
 
-#ifdef _LIBCPP_NO_EXPERIMENTAL_DEPRECATION_WARNING_SEARCHERS
-#  define _LIBCPP_DEPRECATED_DEFAULT_SEARCHER
-#  define _LIBCPP_DEPRECATED_BOYER_MOORE_SEARCHER
-#  define _LIBCPP_DEPRECATED_BOYER_MOORE_HORSPOOL_SEARCHER
+#ifdef _LIBCUDACXX_NO_EXPERIMENTAL_DEPRECATION_WARNING_SEARCHERS
+#  define _LIBCUDACXX_DEPRECATED_DEFAULT_SEARCHER
+#  define _LIBCUDACXX_DEPRECATED_BOYER_MOORE_SEARCHER
+#  define _LIBCUDACXX_DEPRECATED_BOYER_MOORE_HORSPOOL_SEARCHER
 #else
-#  define _LIBCPP_DEPRECATED_DEFAULT_SEARCHER _LIBCPP_DEPRECATED_("std::exprerimental::default_searcher will be removed in LLVM 17. Use std::default_searcher instead")
-#  define _LIBCPP_DEPRECATED_BOYER_MOORE_SEARCHER _LIBCPP_DEPRECATED_("std::exprerimental::boyer_moore_searcher will be removed in LLVM 17. Use std::boyer_moore_searcher instead")
-#  define _LIBCPP_DEPRECATED_BOYER_MOORE_HORSPOOL_SEARCHER _LIBCPP_DEPRECATED_("std::exprerimental::boyer_moore_horspool_searcher will be removed in LLVM 17. Use std::boyer_moore_horspool_searcher instead")
+#  define _LIBCUDACXX_DEPRECATED_DEFAULT_SEARCHER _LIBCUDACXX_DEPRECATED_("std::exprerimental::default_searcher will be removed in LLVM 17. Use std::default_searcher instead")
+#  define _LIBCUDACXX_DEPRECATED_BOYER_MOORE_SEARCHER _LIBCUDACXX_DEPRECATED_("std::exprerimental::boyer_moore_searcher will be removed in LLVM 17. Use std::boyer_moore_searcher instead")
+#  define _LIBCUDACXX_DEPRECATED_BOYER_MOORE_HORSPOOL_SEARCHER _LIBCUDACXX_DEPRECATED_("std::exprerimental::boyer_moore_horspool_searcher will be removed in LLVM 17. Use std::boyer_moore_horspool_searcher instead")
 #endif
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 // default searcher
 template<class _ForwardIterator, class _BinaryPredicate = equal_to<>>
-class _LIBCPP_DEPRECATED_DEFAULT_SEARCHER _LIBCPP_TEMPLATE_VIS default_searcher {
+class _LIBCUDACXX_DEPRECATED_DEFAULT_SEARCHER _LIBCUDACXX_TEMPLATE_VIS default_searcher {
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     default_searcher(_ForwardIterator __f, _ForwardIterator __l,
                        _BinaryPredicate __p = _BinaryPredicate())
         : __first_(__f), __last_(__l), __pred_(__p) {}
 
     template <typename _ForwardIterator2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     pair<_ForwardIterator2, _ForwardIterator2>
     operator () (_ForwardIterator2 __f, _ForwardIterator2 __l) const
     {
@@ -116,7 +116,7 @@ private:
     };
 
 template<class _ForwardIterator, class _BinaryPredicate = equal_to<>>
-_LIBCPP_DEPRECATED_DEFAULT_SEARCHER _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_DEPRECATED_DEFAULT_SEARCHER _LIBCUDACXX_INLINE_VISIBILITY
 default_searcher<_ForwardIterator, _BinaryPredicate>
 make_default_searcher( _ForwardIterator __f, _ForwardIterator __l, _BinaryPredicate __p = _BinaryPredicate ())
 {
@@ -135,17 +135,17 @@ class _BMSkipTable<_Key, _Value, _Hash, _BinaryPredicate, false> {
     std::unordered_map<_Key, _Value, _Hash, _BinaryPredicate> __table;
 
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _BMSkipTable(size_t __sz, _Value __default, _Hash __hf, _BinaryPredicate __pred)
         : __default_value_(__default), __table(__sz, __hf, __pred) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void insert(const key_type &__key, value_type __val)
     {
         __table [__key] = __val;    // Would skip_.insert (val) be better here?
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     value_type operator [](const key_type & __key) const
     {
         auto __it = __table.find (__key);
@@ -166,19 +166,19 @@ private:
     skip_map __table;
 
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _BMSkipTable(size_t /*__sz*/, _Value __default, _Hash /*__hf*/, _BinaryPredicate /*__pred*/)
     {
         std::fill_n(__table.begin(), __table.size(), __default);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void insert(key_type __key, value_type __val)
     {
         __table[static_cast<unsigned_key_type>(__key)] = __val;
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     value_type operator [](key_type __key) const
     {
         return __table[static_cast<unsigned_key_type>(__key)];
@@ -189,7 +189,7 @@ public:
 template <class _RandomAccessIterator1,
           class _Hash = hash<typename iterator_traits<_RandomAccessIterator1>::value_type>,
           class _BinaryPredicate = equal_to<>>
-class _LIBCPP_DEPRECATED_BOYER_MOORE_SEARCHER _LIBCPP_TEMPLATE_VIS boyer_moore_searcher {
+class _LIBCUDACXX_DEPRECATED_BOYER_MOORE_SEARCHER _LIBCUDACXX_TEMPLATE_VIS boyer_moore_searcher {
 private:
     typedef typename std::iterator_traits<_RandomAccessIterator1>::
diff erence_type 
diff erence_type;
     typedef typename std::iterator_traits<_RandomAccessIterator1>::value_type      value_type;
@@ -204,7 +204,7 @@ public:
     boyer_moore_searcher(_RandomAccessIterator1 __f, _RandomAccessIterator1 __l,
                 _Hash __hf = _Hash(), _BinaryPredicate __pred = _BinaryPredicate())
             : __first_(__f), __last_(__l), __pred_(__pred),
-              __pattern_length_(_VSTD::distance(__first_, __last_)),
+              __pattern_length_(_CUDA_VSTD::distance(__first_, __last_)),
               __skip_{make_shared<skip_table_type>(__pattern_length_, -1, __hf, __pred_)},
               __suffix_{make_shared<vector<
diff erence_type>>(__pattern_length_ + 1)}
         {
@@ -227,7 +227,7 @@ public:
         if (__first_ == __last_) return make_pair(__f, __f); // empty pattern
 
     //  If the pattern is larger than the corpus, we can't find it!
-        if ( __pattern_length_ > _VSTD::distance(__f, __l))
+        if ( __pattern_length_ > _CUDA_VSTD::distance(__f, __l))
             return make_pair(__l, __l);
 
     //  Do the search
@@ -279,7 +279,7 @@ private:
     template<typename _Iterator, typename _Container>
     void __compute_bm_prefix ( _Iterator __f, _Iterator __l, _BinaryPredicate __pred, _Container &__prefix )
     {
-        const size_t __count = _VSTD::distance(__f, __l);
+        const size_t __count = _CUDA_VSTD::distance(__f, __l);
 
         __prefix[0] = 0;
         size_t __k = 0;
@@ -297,7 +297,7 @@ private:
     void __build_suffix_table(_RandomAccessIterator1 __f, _RandomAccessIterator1 __l,
                                                     _BinaryPredicate __pred)
     {
-        const size_t __count = _VSTD::distance(__f, __l);
+        const size_t __count = _CUDA_VSTD::distance(__f, __l);
         vector<
diff erence_type> & __suffix = *__suffix_.get();
         if (__count > 0)
         {
@@ -326,7 +326,7 @@ private:
 template<class _RandomAccessIterator,
          class _Hash = hash<typename iterator_traits<_RandomAccessIterator>::value_type>,
          class _BinaryPredicate = equal_to<>>
-_LIBCPP_DEPRECATED_BOYER_MOORE_SEARCHER _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_DEPRECATED_BOYER_MOORE_SEARCHER _LIBCUDACXX_INLINE_VISIBILITY
 boyer_moore_searcher<_RandomAccessIterator, _Hash, _BinaryPredicate>
 make_boyer_moore_searcher( _RandomAccessIterator __f, _RandomAccessIterator __l,
                     _Hash __hf = _Hash(), _BinaryPredicate __p = _BinaryPredicate ())
@@ -338,7 +338,7 @@ make_boyer_moore_searcher( _RandomAccessIterator __f, _RandomAccessIterator __l,
 template <class _RandomAccessIterator1,
           class _Hash = hash<typename iterator_traits<_RandomAccessIterator1>::value_type>,
           class _BinaryPredicate = equal_to<>>
-class _LIBCPP_DEPRECATED_BOYER_MOORE_HORSPOOL_SEARCHER _LIBCPP_TEMPLATE_VIS boyer_moore_horspool_searcher {
+class _LIBCUDACXX_DEPRECATED_BOYER_MOORE_HORSPOOL_SEARCHER _LIBCUDACXX_TEMPLATE_VIS boyer_moore_horspool_searcher {
 private:
     typedef typename std::iterator_traits<_RandomAccessIterator1>::
diff erence_type 
diff erence_type;
     typedef typename std::iterator_traits<_RandomAccessIterator1>::value_type      value_type;
@@ -353,8 +353,8 @@ public:
     boyer_moore_horspool_searcher(_RandomAccessIterator1 __f, _RandomAccessIterator1 __l,
                 _Hash __hf = _Hash(), _BinaryPredicate __pred = _BinaryPredicate())
             : __first_(__f), __last_(__l), __pred_(__pred),
-              __pattern_length_(_VSTD::distance(__first_, __last_)),
-              __skip_{_VSTD::make_shared<skip_table_type>(__pattern_length_, __pattern_length_, __hf, __pred_)}
+              __pattern_length_(_CUDA_VSTD::distance(__first_, __last_)),
+              __skip_{_CUDA_VSTD::make_shared<skip_table_type>(__pattern_length_, __pattern_length_, __hf, __pred_)}
         {
     //  build the skip table
             if ( __f != __l )
@@ -377,7 +377,7 @@ public:
         if (__first_ == __last_) return make_pair(__f, __f); // empty pattern
 
     //  If the pattern is larger than the corpus, we can't find it!
-        if ( __pattern_length_ > _VSTD::distance(__f, __l))
+        if ( __pattern_length_ > _CUDA_VSTD::distance(__f, __l))
             return make_pair(__l, __l);
 
     //  Do the search
@@ -419,7 +419,7 @@ private:
 template<class _RandomAccessIterator,
          class _Hash = hash<typename iterator_traits<_RandomAccessIterator>::value_type>,
          class _BinaryPredicate = equal_to<>>
-_LIBCPP_DEPRECATED_BOYER_MOORE_HORSPOOL_SEARCHER _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_DEPRECATED_BOYER_MOORE_HORSPOOL_SEARCHER _LIBCUDACXX_INLINE_VISIBILITY
 boyer_moore_horspool_searcher<_RandomAccessIterator, _Hash, _BinaryPredicate>
 make_boyer_moore_horspool_searcher( _RandomAccessIterator __f, _RandomAccessIterator __l,
                     _Hash __hf = _Hash(), _BinaryPredicate __p = _BinaryPredicate ())
@@ -427,10 +427,10 @@ make_boyer_moore_horspool_searcher( _RandomAccessIterator __f, _RandomAccessIter
     return boyer_moore_horspool_searcher<_RandomAccessIterator, _Hash, _BinaryPredicate>(__f, __l, __hf, __p);
 }
 
-#endif // _LIBCPP_STD_VER > 11
+#endif // _LIBCUDACXX_STD_VER > 11
 
-_LIBCPP_END_NAMESPACE_LFTS
+_LIBCUDACXX_END_NAMESPACE_LFTS
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif /* _LIBCPP_EXPERIMENTAL_FUNCTIONAL */
+#endif /* _LIBCUDACXX_EXPERIMENTAL_FUNCTIONAL */

diff  --git a/libcxx/include/experimental/iterator b/libcxx/include/experimental/iterator
index a92bca6a20fa..f427ebc2ba4b 100644
--- a/libcxx/include/experimental/iterator
+++ b/libcxx/include/experimental/iterator
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_EXPERIMENTAL_ITERATOR
-#define _LIBCPP_EXPERIMENTAL_ITERATOR
+#ifndef _LIBCUDACXX_EXPERIMENTAL_ITERATOR
+#define _LIBCUDACXX_EXPERIMENTAL_ITERATOR
 
 /*
 namespace std {
@@ -60,13 +60,13 @@ namespace std {
 #include <iosfwd> // char_traits
 #include <iterator>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 
-_LIBCPP_BEGIN_NAMESPACE_LFTS
+_LIBCUDACXX_BEGIN_NAMESPACE_LFTS
 
 template <class _Delim, class _CharT = char, class _Traits = char_traits<_CharT>>
 class ostream_joiner {
@@ -82,10 +82,10 @@ public:
     typedef void                                 reference;
 
     ostream_joiner(ostream_type& __os, _Delim&& __d)
-        : __output_iter(_VSTD::addressof(__os)), __delim(_VSTD::move(__d)), __first(true) {}
+        : __output_iter(_CUDA_VSTD::addressof(__os)), __delim(_CUDA_VSTD::move(__d)), __first(true) {}
 
     ostream_joiner(ostream_type& __os, const _Delim& __d)
-        : __output_iter(_VSTD::addressof(__os)), __delim(__d), __first(true) {}
+        : __output_iter(_CUDA_VSTD::addressof(__os)), __delim(__d), __first(true) {}
 
 
     template<typename _Tp>
@@ -112,10 +112,10 @@ private:
 template <class _CharT, class _Traits, class _Delim>
 ostream_joiner<typename decay<_Delim>::type, _CharT, _Traits>
 make_ostream_joiner(basic_ostream<_CharT, _Traits>& __os, _Delim && __d)
-{ return ostream_joiner<typename decay<_Delim>::type, _CharT, _Traits>(__os, _VSTD::forward<_Delim>(__d)); }
+{ return ostream_joiner<typename decay<_Delim>::type, _CharT, _Traits>(__os, _CUDA_VSTD::forward<_Delim>(__d)); }
 
-_LIBCPP_END_NAMESPACE_LFTS
+_LIBCUDACXX_END_NAMESPACE_LFTS
 
-#endif // _LIBCPP_STD_VER > 11
+#endif // _LIBCUDACXX_STD_VER > 11
 
-#endif // _LIBCPP_EXPERIMENTAL_ITERATOR
+#endif // _LIBCUDACXX_EXPERIMENTAL_ITERATOR

diff  --git a/libcxx/include/experimental/list b/libcxx/include/experimental/list
index c8480575977e..8c57e2fa7e0e 100644
--- a/libcxx/include/experimental/list
+++ b/libcxx/include/experimental/list
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_EXPERIMENTAL_LIST
-#define _LIBCPP_EXPERIMENTAL_LIST
+#ifndef _LIBCUDACXX_EXPERIMENTAL_LIST
+#define _LIBCUDACXX_EXPERIMENTAL_LIST
 
 /*
     experimental/list synopsis
@@ -34,15 +34,15 @@ namespace pmr {
 #include <experimental/memory_resource>
 #include <list>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR
+_LIBCUDACXX_BEGIN_NAMESPACE_LFTS_PMR
 
 template <class _ValueT>
-using list = _VSTD::list<_ValueT, polymorphic_allocator<_ValueT>>;
+using list = _CUDA_VSTD::list<_ValueT, polymorphic_allocator<_ValueT>>;
 
-_LIBCPP_END_NAMESPACE_LFTS_PMR
+_LIBCUDACXX_END_NAMESPACE_LFTS_PMR
 
-#endif /* _LIBCPP_EXPERIMENTAL_LIST */
+#endif /* _LIBCUDACXX_EXPERIMENTAL_LIST */

diff  --git a/libcxx/include/experimental/map b/libcxx/include/experimental/map
index 3dee7f703aeb..e57564dd337f 100644
--- a/libcxx/include/experimental/map
+++ b/libcxx/include/experimental/map
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_EXPERIMENTAL_MAP
-#define _LIBCPP_EXPERIMENTAL_MAP
+#ifndef _LIBCUDACXX_EXPERIMENTAL_MAP
+#define _LIBCUDACXX_EXPERIMENTAL_MAP
 
 /*
     experimental/map synopsis
@@ -39,20 +39,20 @@ namespace pmr {
 #include <experimental/memory_resource>
 #include <map>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR
+_LIBCUDACXX_BEGIN_NAMESPACE_LFTS_PMR
 
 template <class _Key, class _Value, class  _Compare = less<_Key>>
-using map = _VSTD::map<_Key, _Value, _Compare,
+using map = _CUDA_VSTD::map<_Key, _Value, _Compare,
                         polymorphic_allocator<pair<const _Key, _Value>>>;
 
 template <class _Key, class _Value, class  _Compare = less<_Key>>
-using multimap = _VSTD::multimap<_Key, _Value, _Compare,
+using multimap = _CUDA_VSTD::multimap<_Key, _Value, _Compare,
                         polymorphic_allocator<pair<const _Key, _Value>>>;
 
-_LIBCPP_END_NAMESPACE_LFTS_PMR
+_LIBCUDACXX_END_NAMESPACE_LFTS_PMR
 
-#endif /* _LIBCPP_EXPERIMENTAL_MAP */
+#endif /* _LIBCUDACXX_EXPERIMENTAL_MAP */

diff  --git a/libcxx/include/experimental/memory_resource b/libcxx/include/experimental/memory_resource
index f7b19aafd40f..7f1fa38f7ab6 100644
--- a/libcxx/include/experimental/memory_resource
+++ b/libcxx/include/experimental/memory_resource
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_EXPERIMENTAL_MEMORY_RESOURCE
-#define _LIBCPP_EXPERIMENTAL_MEMORY_RESOURCE
+#ifndef _LIBCUDACXX_EXPERIMENTAL_MEMORY_RESOURCE
+#define _LIBCUDACXX_EXPERIMENTAL_MEMORY_RESOURCE
 
 /**
     experimental/memory_resource synopsis
@@ -77,41 +77,41 @@ namespace pmr {
 #include <stdexcept>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR
+_LIBCUDACXX_BEGIN_NAMESPACE_LFTS_PMR
 
 // Round __s up to next multiple of __a.
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 size_t __aligned_allocation_size(size_t __s, size_t __a) _NOEXCEPT
 {
-    _LIBCPP_ASSERT(__s + __a > __s, "aligned allocation size overflows");
+    _LIBCUDACXX_ASSERT(__s + __a > __s, "aligned allocation size overflows");
     return (__s + __a - 1) & ~(__a - 1);
 }
 
 // 8.5, memory.resource
-class _LIBCPP_TYPE_VIS memory_resource
+class _LIBCUDACXX_TYPE_VIS memory_resource
 {
-    static const size_t __max_align = _LIBCPP_ALIGNOF(max_align_t);
+    static const size_t __max_align = _LIBCUDACXX_ALIGNOF(max_align_t);
 
 // 8.5.2, memory.resource.public
 public:
     virtual ~memory_resource() = default;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void* allocate(size_t __bytes, size_t __align = __max_align)
         { return do_allocate(__bytes, __align); }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void deallocate(void * __p, size_t __bytes, size_t __align = __max_align)
         { do_deallocate(__p, __bytes, __align); }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool is_equal(memory_resource const & __other) const _NOEXCEPT
         { return do_is_equal(__other); }
 
@@ -123,48 +123,48 @@ private:
 };
 
 // 8.5.4, memory.resource.eq
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool operator==(memory_resource const & __lhs,
                 memory_resource const & __rhs) _NOEXCEPT
 {
     return &__lhs == &__rhs || __lhs.is_equal(__rhs);
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool operator!=(memory_resource const & __lhs,
                 memory_resource const & __rhs) _NOEXCEPT
 {
     return !(__lhs == __rhs);
 }
 
-_LIBCPP_FUNC_VIS
+_LIBCUDACXX_FUNC_VIS
 memory_resource * new_delete_resource() _NOEXCEPT;
 
-_LIBCPP_FUNC_VIS
+_LIBCUDACXX_FUNC_VIS
 memory_resource * null_memory_resource() _NOEXCEPT;
 
-_LIBCPP_FUNC_VIS
+_LIBCUDACXX_FUNC_VIS
 memory_resource * get_default_resource() _NOEXCEPT;
 
-_LIBCPP_FUNC_VIS
+_LIBCUDACXX_FUNC_VIS
 memory_resource * set_default_resource(memory_resource * __new_res) _NOEXCEPT;
 
 // 8.6, memory.polymorphic.allocator.class
 
 // 8.6.1, memory.polymorphic.allocator.overview
 template <class _ValueType>
-class _LIBCPP_TEMPLATE_VIS polymorphic_allocator
+class _LIBCUDACXX_TEMPLATE_VIS polymorphic_allocator
 {
 public:
     typedef _ValueType value_type;
 
     // 8.6.2, memory.polymorphic.allocator.ctor
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     polymorphic_allocator() _NOEXCEPT
       : __res_(_VSTD_LFTS_PMR::get_default_resource())
     {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     polymorphic_allocator(memory_resource * __r) _NOEXCEPT
       : __res_(__r)
     {}
@@ -172,7 +172,7 @@ public:
     polymorphic_allocator(polymorphic_allocator const &) = default;
 
     template <class _Tp>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     polymorphic_allocator(polymorphic_allocator<_Tp> const & __other) _NOEXCEPT
       : __res_(__other.resource())
     {}
@@ -181,33 +181,33 @@ public:
     operator=(polymorphic_allocator const &) = delete;
 
     // 8.6.3, memory.polymorphic.allocator.mem
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _ValueType* allocate(size_t __n) {
         if (__n > __max_size())
             __throw_bad_array_new_length();
         return static_cast<_ValueType*>(
-            __res_->allocate(__n * sizeof(_ValueType), _LIBCPP_ALIGNOF(_ValueType))
+            __res_->allocate(__n * sizeof(_ValueType), _LIBCUDACXX_ALIGNOF(_ValueType))
         );
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void deallocate(_ValueType * __p, size_t __n) _NOEXCEPT {
-        _LIBCPP_ASSERT(__n <= __max_size(),
+        _LIBCUDACXX_ASSERT(__n <= __max_size(),
                        "deallocate called for size which exceeds max_size()");
-        __res_->deallocate(__p, __n * sizeof(_ValueType), _LIBCPP_ALIGNOF(_ValueType));
+        __res_->deallocate(__p, __n * sizeof(_ValueType), _LIBCUDACXX_ALIGNOF(_ValueType));
     }
 
     template <class _Tp, class ..._Ts>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void construct(_Tp* __p, _Ts &&... __args)
     {
         _VSTD_LFTS::__lfts_user_alloc_construct(
-            __p, *this, _VSTD::forward<_Ts>(__args)...
+            __p, *this, _CUDA_VSTD::forward<_Ts>(__args)...
           );
     }
 
     template <class _T1, class _T2, class ..._Args1, class ..._Args2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void construct(pair<_T1, _T2>* __p, piecewise_construct_t,
                    tuple<_Args1...> __x, tuple<_Args2...> __y)
     {
@@ -216,95 +216,95 @@ public:
               typename __lfts_uses_alloc_ctor<
                   _T1, polymorphic_allocator&, _Args1...
               >::type()
-            , _VSTD::move(__x)
+            , _CUDA_VSTD::move(__x)
             , typename __make_tuple_indices<sizeof...(_Args1)>::type{}
           )
           , __transform_tuple(
               typename __lfts_uses_alloc_ctor<
                   _T2, polymorphic_allocator&, _Args2...
               >::type()
-            , _VSTD::move(__y)
+            , _CUDA_VSTD::move(__y)
             , typename __make_tuple_indices<sizeof...(_Args2)>::type{}
           )
         );
     }
 
     template <class _T1, class _T2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void construct(pair<_T1, _T2>* __p) {
         construct(__p, piecewise_construct, tuple<>(), tuple<>());
     }
 
     template <class _T1, class _T2, class _Up, class _Vp>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void construct(pair<_T1, _T2> * __p, _Up && __u, _Vp && __v) {
         construct(__p, piecewise_construct
-          , _VSTD::forward_as_tuple(_VSTD::forward<_Up>(__u))
-          , _VSTD::forward_as_tuple(_VSTD::forward<_Vp>(__v)));
+          , _CUDA_VSTD::forward_as_tuple(_CUDA_VSTD::forward<_Up>(__u))
+          , _CUDA_VSTD::forward_as_tuple(_CUDA_VSTD::forward<_Vp>(__v)));
     }
 
     template <class _T1, class _T2, class _U1, class _U2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void construct(pair<_T1, _T2> * __p, pair<_U1, _U2> const & __pr) {
         construct(__p, piecewise_construct
-            , _VSTD::forward_as_tuple(__pr.first)
-            , _VSTD::forward_as_tuple(__pr.second));
+            , _CUDA_VSTD::forward_as_tuple(__pr.first)
+            , _CUDA_VSTD::forward_as_tuple(__pr.second));
     }
 
     template <class _T1, class _T2, class _U1, class _U2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void construct(pair<_T1, _T2> * __p, pair<_U1, _U2> && __pr){
         construct(__p, piecewise_construct
-            , _VSTD::forward_as_tuple(_VSTD::forward<_U1>(__pr.first))
-            , _VSTD::forward_as_tuple(_VSTD::forward<_U2>(__pr.second)));
+            , _CUDA_VSTD::forward_as_tuple(_CUDA_VSTD::forward<_U1>(__pr.first))
+            , _CUDA_VSTD::forward_as_tuple(_CUDA_VSTD::forward<_U2>(__pr.second)));
     }
 
     template <class _Tp>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void destroy(_Tp * __p) _NOEXCEPT
         { __p->~_Tp(); }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     polymorphic_allocator
     select_on_container_copy_construction() const _NOEXCEPT
         { return polymorphic_allocator(); }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     memory_resource * resource() const _NOEXCEPT
         { return __res_; }
 
 private:
     template <class ..._Args, size_t ..._Idx>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     tuple<_Args&&...>
     __transform_tuple(integral_constant<int, 0>, tuple<_Args...>&& __t,
                       __tuple_indices<_Idx...>) const
     {
-        return _VSTD::forward_as_tuple(_VSTD::get<_Idx>(_VSTD::move(__t))...);
+        return _CUDA_VSTD::forward_as_tuple(_CUDA_VSTD::get<_Idx>(_CUDA_VSTD::move(__t))...);
     }
 
     template <class ..._Args, size_t ..._Idx>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     tuple<allocator_arg_t const&, polymorphic_allocator&, _Args&&...>
     __transform_tuple(integral_constant<int, 1>, tuple<_Args...> && __t,
                       __tuple_indices<_Idx...>)
     {
         using _Tup = tuple<allocator_arg_t const&, polymorphic_allocator&, _Args&&...>;
         return _Tup(allocator_arg, *this,
-                    _VSTD::get<_Idx>(_VSTD::move(__t))...);
+                    _CUDA_VSTD::get<_Idx>(_CUDA_VSTD::move(__t))...);
     }
 
     template <class ..._Args, size_t ..._Idx>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     tuple<_Args&&..., polymorphic_allocator&>
     __transform_tuple(integral_constant<int, 2>, tuple<_Args...> && __t,
                       __tuple_indices<_Idx...>)
     {
         using _Tup = tuple<_Args&&..., polymorphic_allocator&>;
-        return _Tup(_VSTD::get<_Idx>(_VSTD::move(__t))..., *this);
+        return _Tup(_CUDA_VSTD::get<_Idx>(_CUDA_VSTD::move(__t))..., *this);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t __max_size() const _NOEXCEPT
         { return numeric_limits<size_t>::max() / sizeof(value_type); }
 
@@ -314,7 +314,7 @@ private:
 // 8.6.4, memory.polymorphic.allocator.eq
 
 template <class _Tp, class _Up>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool operator==(polymorphic_allocator<_Tp> const & __lhs,
                 polymorphic_allocator<_Up> const & __rhs) _NOEXCEPT
 {
@@ -322,7 +322,7 @@ bool operator==(polymorphic_allocator<_Tp> const & __lhs,
 }
 
 template <class _Tp, class _Up>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool operator!=(polymorphic_allocator<_Tp> const & __lhs,
                 polymorphic_allocator<_Up> const & __rhs) _NOEXCEPT
 {
@@ -333,7 +333,7 @@ bool operator!=(polymorphic_allocator<_Tp> const & __lhs,
 
 // 8.7.1, memory.resource.adaptor.overview
 template <class _CharAlloc>
-class _LIBCPP_TEMPLATE_VIS __resource_adaptor_imp
+class _LIBCUDACXX_TEMPLATE_VIS __resource_adaptor_imp
   : public memory_resource
 {
     using _CTraits = allocator_traits<_CharAlloc>;
@@ -341,7 +341,7 @@ class _LIBCPP_TEMPLATE_VIS __resource_adaptor_imp
                && is_same<typename _CTraits::pointer, char*>::value
                && is_same<typename _CTraits::void_pointer, void*>::value, "");
 
-    static const size_t _MaxAlign = _LIBCPP_ALIGNOF(max_align_t);
+    static const size_t _MaxAlign = _LIBCUDACXX_ALIGNOF(max_align_t);
 
     using _Alloc = typename _CTraits::template rebind_alloc<
             typename aligned_storage<_MaxAlign, _MaxAlign>::type
@@ -360,20 +360,20 @@ public:
 
     // 8.7.2, memory.resource.adaptor.ctor
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __resource_adaptor_imp(allocator_type const & __a)
       : __alloc_(__a)
     {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __resource_adaptor_imp(allocator_type && __a)
-      : __alloc_(_VSTD::move(__a))
+      : __alloc_(_CUDA_VSTD::move(__a))
     {}
 
     __resource_adaptor_imp &
     operator=(__resource_adaptor_imp const &) = default;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     allocator_type get_allocator() const
     { return __alloc_; }
 
@@ -389,7 +389,7 @@ private:
 
     virtual void do_deallocate(void * __p, size_t __bytes, size_t)
     {
-        _LIBCPP_ASSERT(__bytes <= __max_size(),
+        _LIBCUDACXX_ASSERT(__bytes <= __max_size(),
             "do_deallocate called for size which exceeds the maximum allocation size");
         size_t __s = __aligned_allocation_size(__bytes, _MaxAlign) / _MaxAlign;
         __alloc_.deallocate((_ValueType*)__p, __s);
@@ -401,7 +401,7 @@ private:
         return __p  ? __alloc_ == __p->__alloc_ : false;
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t __max_size() const _NOEXCEPT {
         return numeric_limits<size_t>::max() - _MaxAlign;
     }
@@ -412,8 +412,8 @@ using resource_adaptor = __resource_adaptor_imp<
     typename allocator_traits<_Alloc>::template rebind_alloc<char>
   >;
 
-_LIBCPP_END_NAMESPACE_LFTS_PMR
+_LIBCUDACXX_END_NAMESPACE_LFTS_PMR
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif /* _LIBCPP_EXPERIMENTAL_MEMORY_RESOURCE */
+#endif /* _LIBCUDACXX_EXPERIMENTAL_MEMORY_RESOURCE */

diff  --git a/libcxx/include/experimental/propagate_const b/libcxx/include/experimental/propagate_const
index 432635668e4e..5d70e68c4e6a 100644
--- a/libcxx/include/experimental/propagate_const
+++ b/libcxx/include/experimental/propagate_const
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_EXPERIMENTAL_PROPAGATE_CONST
-#define _LIBCPP_EXPERIMENTAL_PROPAGATE_CONST
+#ifndef _LIBCUDACXX_EXPERIMENTAL_PROPAGATE_CONST
+#define _LIBCUDACXX_EXPERIMENTAL_PROPAGATE_CONST
 
 /*
     propagate_const synopsis
@@ -115,23 +115,23 @@
 #include <experimental/__config>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 
-_LIBCPP_BEGIN_NAMESPACE_LFTS_V2
+_LIBCUDACXX_BEGIN_NAMESPACE_LFTS_V2
 
 template <class _Tp>
 class propagate_const;
 
 template <class _Up>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR
 const _Up& get_underlying(const propagate_const<_Up>& __pu) _NOEXCEPT;
 
 template <class _Up>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR
 _Up& get_underlying(propagate_const<_Up>& __pu) _NOEXCEPT;
 
 template <class _Tp>
@@ -151,25 +151,25 @@ public:
 
 private:
   template <class _Up>
-  static _LIBCPP_CONSTEXPR element_type* __get_pointer(_Up* __u)
+  static _LIBCUDACXX_CONSTEXPR element_type* __get_pointer(_Up* __u)
   {
     return __u;
   }
 
   template <class _Up>
-  static _LIBCPP_CONSTEXPR element_type* __get_pointer(_Up& __u)
+  static _LIBCUDACXX_CONSTEXPR element_type* __get_pointer(_Up& __u)
   {
     return __get_pointer(__u.get());
   }
 
   template <class _Up>
-  static _LIBCPP_CONSTEXPR const element_type* __get_pointer(const _Up* __u)
+  static _LIBCUDACXX_CONSTEXPR const element_type* __get_pointer(const _Up* __u)
   {
     return __u;
   }
 
   template <class _Up>
-  static _LIBCPP_CONSTEXPR const element_type* __get_pointer(const _Up& __u)
+  static _LIBCUDACXX_CONSTEXPR const element_type* __get_pointer(const _Up& __u)
   {
     return __get_pointer(__u.get());
   }
@@ -188,25 +188,25 @@ private:
 
 public:
 
-  template <class _Up> friend _LIBCPP_CONSTEXPR const _Up& ::_VSTD_LFTS_V2::get_underlying(const propagate_const<_Up>& __pu) _NOEXCEPT;
-  template <class _Up> friend _LIBCPP_CONSTEXPR _Up& ::_VSTD_LFTS_V2::get_underlying(propagate_const<_Up>& __pu) _NOEXCEPT;
+  template <class _Up> friend _LIBCUDACXX_CONSTEXPR const _Up& ::_VSTD_LFTS_V2::get_underlying(const propagate_const<_Up>& __pu) _NOEXCEPT;
+  template <class _Up> friend _LIBCUDACXX_CONSTEXPR _Up& ::_VSTD_LFTS_V2::get_underlying(propagate_const<_Up>& __pu) _NOEXCEPT;
 
-  _LIBCPP_CONSTEXPR propagate_const() = default;
+  _LIBCUDACXX_CONSTEXPR propagate_const() = default;
 
   propagate_const(const propagate_const&) = delete;
 
-  _LIBCPP_CONSTEXPR propagate_const(propagate_const&&) = default;
+  _LIBCUDACXX_CONSTEXPR propagate_const(propagate_const&&) = default;
 
   template <class _Up, enable_if_t<!is_convertible<_Up, _Tp>::value &&
                                  is_constructible<_Tp, _Up&&>::value,bool> = true>
-  explicit _LIBCPP_CONSTEXPR propagate_const(propagate_const<_Up>&& __pu)
+  explicit _LIBCUDACXX_CONSTEXPR propagate_const(propagate_const<_Up>&& __pu)
       : __t_(std::move(_VSTD_LFTS_V2::get_underlying(__pu)))
   {
   }
 
   template <class _Up, enable_if_t<is_convertible<_Up&&, _Tp>::value &&
                                  is_constructible<_Tp, _Up&&>::value,bool> = false>
-  _LIBCPP_CONSTEXPR propagate_const(propagate_const<_Up>&& __pu)
+  _LIBCUDACXX_CONSTEXPR propagate_const(propagate_const<_Up>&& __pu)
       : __t_(std::move(_VSTD_LFTS_V2::get_underlying(__pu)))
   {
   }
@@ -214,7 +214,7 @@ public:
   template <class _Up, enable_if_t<!is_convertible<_Up&&, _Tp>::value &&
                                  is_constructible<_Tp, _Up&&>::value &&
                                  !__is_propagate_const<decay_t<_Up>>::value,bool> = true>
-  explicit _LIBCPP_CONSTEXPR propagate_const(_Up&& __u)
+  explicit _LIBCUDACXX_CONSTEXPR propagate_const(_Up&& __u)
       : __t_(std::forward<_Up>(__u))
   {
   }
@@ -222,267 +222,267 @@ public:
   template <class _Up, enable_if_t<is_convertible<_Up&&, _Tp>::value &&
                                  is_constructible<_Tp, _Up&&>::value &&
                                  !__is_propagate_const<decay_t<_Up>>::value,bool> = false>
-  _LIBCPP_CONSTEXPR propagate_const(_Up&& __u)
+  _LIBCUDACXX_CONSTEXPR propagate_const(_Up&& __u)
       : __t_(std::forward<_Up>(__u))
   {
   }
 
   propagate_const& operator=(const propagate_const&) = delete;
 
-  _LIBCPP_CONSTEXPR propagate_const& operator=(propagate_const&&) = default;
+  _LIBCUDACXX_CONSTEXPR propagate_const& operator=(propagate_const&&) = default;
 
   template <class _Up>
-  _LIBCPP_CONSTEXPR propagate_const& operator=(propagate_const<_Up>&& __pu)
+  _LIBCUDACXX_CONSTEXPR propagate_const& operator=(propagate_const<_Up>&& __pu)
   {
     __t_ = std::move(_VSTD_LFTS_V2::get_underlying(__pu));
     return *this;
   }
 
   template <class _Up, class _Vp = enable_if_t<!__is_propagate_const<decay_t<_Up>>::value>>
-  _LIBCPP_CONSTEXPR propagate_const& operator=(_Up&& __u)
+  _LIBCUDACXX_CONSTEXPR propagate_const& operator=(_Up&& __u)
   {
     __t_ = std::forward<_Up>(__u);
     return *this;
   }
 
-  _LIBCPP_CONSTEXPR const element_type* get() const
+  _LIBCUDACXX_CONSTEXPR const element_type* get() const
   {
     return __get_pointer(__t_);
   }
 
-  _LIBCPP_CONSTEXPR element_type* get()
+  _LIBCUDACXX_CONSTEXPR element_type* get()
   {
     return __get_pointer(__t_);
   }
 
-  explicit _LIBCPP_CONSTEXPR operator bool() const
+  explicit _LIBCUDACXX_CONSTEXPR operator bool() const
   {
     return get() != nullptr;
   }
 
-  _LIBCPP_CONSTEXPR const element_type* operator->() const
+  _LIBCUDACXX_CONSTEXPR const element_type* operator->() const
   {
     return get();
   }
 
   template <class _Tp_ = _Tp, class _Up = enable_if_t<is_convertible<
                                   const _Tp_, const element_type *>::value>>
-  _LIBCPP_CONSTEXPR operator const element_type *() const {
+  _LIBCUDACXX_CONSTEXPR operator const element_type *() const {
     return get();
   }
 
-  _LIBCPP_CONSTEXPR const element_type& operator*() const
+  _LIBCUDACXX_CONSTEXPR const element_type& operator*() const
   {
     return *get();
   }
 
-  _LIBCPP_CONSTEXPR element_type* operator->()
+  _LIBCUDACXX_CONSTEXPR element_type* operator->()
   {
     return get();
   }
 
   template <class _Tp_ = _Tp, class _Up = enable_if_t<
                                   is_convertible<_Tp_, element_type *>::value>>
-  _LIBCPP_CONSTEXPR operator element_type *() {
+  _LIBCUDACXX_CONSTEXPR operator element_type *() {
     return get();
   }
 
-  _LIBCPP_CONSTEXPR element_type& operator*()
+  _LIBCUDACXX_CONSTEXPR element_type& operator*()
   {
     return *get();
   }
 
-  _LIBCPP_CONSTEXPR void swap(propagate_const& __pt) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value)
+  _LIBCUDACXX_CONSTEXPR void swap(propagate_const& __pt) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value)
   {
-    using _VSTD::swap;
+    using _CUDA_VSTD::swap;
     swap(__t_, __pt.__t_);
   }
 };
 
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR bool operator==(const propagate_const<_Tp>& __pt, nullptr_t)
+_LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR bool operator==(const propagate_const<_Tp>& __pt, nullptr_t)
 {
   return _VSTD_LFTS_V2::get_underlying(__pt) == nullptr;
 }
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR bool operator==(nullptr_t, const propagate_const<_Tp>& __pt)
+_LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR bool operator==(nullptr_t, const propagate_const<_Tp>& __pt)
 {
   return nullptr == _VSTD_LFTS_V2::get_underlying(__pt);
 }
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR bool operator!=(const propagate_const<_Tp>& __pt, nullptr_t)
+_LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR bool operator!=(const propagate_const<_Tp>& __pt, nullptr_t)
 {
   return _VSTD_LFTS_V2::get_underlying(__pt) != nullptr;
 }
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR bool operator!=(nullptr_t, const propagate_const<_Tp>& __pt)
+_LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR bool operator!=(nullptr_t, const propagate_const<_Tp>& __pt)
 {
   return nullptr != _VSTD_LFTS_V2::get_underlying(__pt);
 }
 
 template <class _Tp, class _Up>
-_LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR bool operator==(const propagate_const<_Tp>& __pt,
+_LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR bool operator==(const propagate_const<_Tp>& __pt,
                           const propagate_const<_Up>& __pu)
 {
   return _VSTD_LFTS_V2::get_underlying(__pt) == _VSTD_LFTS_V2::get_underlying(__pu);
 }
 
 template <class _Tp, class _Up>
-_LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR bool operator!=(const propagate_const<_Tp>& __pt,
+_LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR bool operator!=(const propagate_const<_Tp>& __pt,
                           const propagate_const<_Up>& __pu)
 {
   return _VSTD_LFTS_V2::get_underlying(__pt) != _VSTD_LFTS_V2::get_underlying(__pu);
 }
 
 template <class _Tp, class _Up>
-_LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR bool operator<(const propagate_const<_Tp>& __pt,
+_LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR bool operator<(const propagate_const<_Tp>& __pt,
                          const propagate_const<_Up>& __pu)
 {
   return _VSTD_LFTS_V2::get_underlying(__pt) < _VSTD_LFTS_V2::get_underlying(__pu);
 }
 
 template <class _Tp, class _Up>
-_LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR bool operator>(const propagate_const<_Tp>& __pt,
+_LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR bool operator>(const propagate_const<_Tp>& __pt,
                          const propagate_const<_Up>& __pu)
 {
   return _VSTD_LFTS_V2::get_underlying(__pt) > _VSTD_LFTS_V2::get_underlying(__pu);
 }
 
 template <class _Tp, class _Up>
-_LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR bool operator<=(const propagate_const<_Tp>& __pt,
+_LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR bool operator<=(const propagate_const<_Tp>& __pt,
                           const propagate_const<_Up>& __pu)
 {
   return _VSTD_LFTS_V2::get_underlying(__pt) <= _VSTD_LFTS_V2::get_underlying(__pu);
 }
 
 template <class _Tp, class _Up>
-_LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR bool operator>=(const propagate_const<_Tp>& __pt,
+_LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR bool operator>=(const propagate_const<_Tp>& __pt,
                           const propagate_const<_Up>& __pu)
 {
   return _VSTD_LFTS_V2::get_underlying(__pt) >= _VSTD_LFTS_V2::get_underlying(__pu);
 }
 
 template <class _Tp, class _Up>
-_LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR bool operator==(const propagate_const<_Tp>& __pt, const _Up& __u)
+_LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR bool operator==(const propagate_const<_Tp>& __pt, const _Up& __u)
 {
   return _VSTD_LFTS_V2::get_underlying(__pt) == __u;
 }
 
 template <class _Tp, class _Up>
-_LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR bool operator!=(const propagate_const<_Tp>& __pt, const _Up& __u)
+_LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR bool operator!=(const propagate_const<_Tp>& __pt, const _Up& __u)
 {
   return _VSTD_LFTS_V2::get_underlying(__pt) != __u;
 }
 
 template <class _Tp, class _Up>
-_LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR bool operator<(const propagate_const<_Tp>& __pt, const _Up& __u)
+_LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR bool operator<(const propagate_const<_Tp>& __pt, const _Up& __u)
 {
   return _VSTD_LFTS_V2::get_underlying(__pt) < __u;
 }
 
 template <class _Tp, class _Up>
-_LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR bool operator>(const propagate_const<_Tp>& __pt, const _Up& __u)
+_LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR bool operator>(const propagate_const<_Tp>& __pt, const _Up& __u)
 {
   return _VSTD_LFTS_V2::get_underlying(__pt) > __u;
 }
 
 template <class _Tp, class _Up>
-_LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR bool operator<=(const propagate_const<_Tp>& __pt, const _Up& __u)
+_LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR bool operator<=(const propagate_const<_Tp>& __pt, const _Up& __u)
 {
   return _VSTD_LFTS_V2::get_underlying(__pt) <= __u;
 }
 
 template <class _Tp, class _Up>
-_LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR bool operator>=(const propagate_const<_Tp>& __pt, const _Up& __u)
+_LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR bool operator>=(const propagate_const<_Tp>& __pt, const _Up& __u)
 {
   return _VSTD_LFTS_V2::get_underlying(__pt) >= __u;
 }
 
 
 template <class _Tp, class _Up>
-_LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR bool operator==(const _Tp& __t, const propagate_const<_Up>& __pu)
+_LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR bool operator==(const _Tp& __t, const propagate_const<_Up>& __pu)
 {
   return __t == _VSTD_LFTS_V2::get_underlying(__pu);
 }
 
 template <class _Tp, class _Up>
-_LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR bool operator!=(const _Tp& __t, const propagate_const<_Up>& __pu)
+_LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR bool operator!=(const _Tp& __t, const propagate_const<_Up>& __pu)
 {
   return __t != _VSTD_LFTS_V2::get_underlying(__pu);
 }
 
 template <class _Tp, class _Up>
-_LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR bool operator<(const _Tp& __t, const propagate_const<_Up>& __pu)
+_LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR bool operator<(const _Tp& __t, const propagate_const<_Up>& __pu)
 {
   return __t < _VSTD_LFTS_V2::get_underlying(__pu);
 }
 
 template <class _Tp, class _Up>
-_LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR bool operator>(const _Tp& __t, const propagate_const<_Up>& __pu)
+_LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR bool operator>(const _Tp& __t, const propagate_const<_Up>& __pu)
 {
   return __t > _VSTD_LFTS_V2::get_underlying(__pu);
 }
 
 template <class _Tp, class _Up>
-_LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR bool operator<=(const _Tp& __t, const propagate_const<_Up>& __pu)
+_LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR bool operator<=(const _Tp& __t, const propagate_const<_Up>& __pu)
 {
   return __t <= _VSTD_LFTS_V2::get_underlying(__pu);
 }
 
 template <class _Tp, class _Up>
-_LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR bool operator>=(const _Tp& __t, const propagate_const<_Up>& __pu)
+_LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR bool operator>=(const _Tp& __t, const propagate_const<_Up>& __pu)
 {
   return __t >= _VSTD_LFTS_V2::get_underlying(__pu);
 }
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR void swap(propagate_const<_Tp>& __pc1, propagate_const<_Tp>& __pc2) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value)
+_LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR void swap(propagate_const<_Tp>& __pc1, propagate_const<_Tp>& __pc2) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value)
 {
   __pc1.swap(__pc2);
 }
 
 template <class _Tp>
-_LIBCPP_CONSTEXPR const _Tp& get_underlying(const propagate_const<_Tp>& __pt) _NOEXCEPT
+_LIBCUDACXX_CONSTEXPR const _Tp& get_underlying(const propagate_const<_Tp>& __pt) _NOEXCEPT
 {
   return __pt.__t_;
 }
 
 template <class _Tp>
-_LIBCPP_CONSTEXPR _Tp& get_underlying(propagate_const<_Tp>& __pt) _NOEXCEPT
+_LIBCUDACXX_CONSTEXPR _Tp& get_underlying(propagate_const<_Tp>& __pt) _NOEXCEPT
 {
   return __pt.__t_;
 }
 
-_LIBCPP_END_NAMESPACE_LFTS_V2
+_LIBCUDACXX_END_NAMESPACE_LFTS_V2
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Tp>
 struct hash<experimental::fundamentals_v2::propagate_const<_Tp>>
@@ -574,7 +574,7 @@ struct greater_equal<experimental::fundamentals_v2::propagate_const<_Tp>>
   }
 };
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 11
-#endif // _LIBCPP_EXPERIMENTAL_PROPAGATE_CONST
+#endif // _LIBCUDACXX_STD_VER > 11
+#endif // _LIBCUDACXX_EXPERIMENTAL_PROPAGATE_CONST

diff  --git a/libcxx/include/experimental/regex b/libcxx/include/experimental/regex
index 4dc2bbae4510..0512f99b0b98 100644
--- a/libcxx/include/experimental/regex
+++ b/libcxx/include/experimental/regex
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_EXPERIMENTAL_REGEX
-#define _LIBCPP_EXPERIMENTAL_REGEX
+#ifndef _LIBCUDACXX_EXPERIMENTAL_REGEX
+#define _LIBCUDACXX_EXPERIMENTAL_REGEX
 
 /*
     experimental/regex synopsis
@@ -42,24 +42,24 @@ namespace pmr {
 #include <experimental/string>
 #include <regex>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR
+_LIBCUDACXX_BEGIN_NAMESPACE_LFTS_PMR
 
 template <class _BiDirIter>
 using match_results =
-    _VSTD::match_results<_BiDirIter,
-        polymorphic_allocator<_VSTD::sub_match<_BiDirIter>>>;
+    _CUDA_VSTD::match_results<_BiDirIter,
+        polymorphic_allocator<_CUDA_VSTD::sub_match<_BiDirIter>>>;
 
 typedef match_results<const char*> cmatch;
 typedef match_results<_VSTD_LFTS_PMR::string::const_iterator> smatch;
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 typedef match_results<const wchar_t*> wcmatch;
 typedef match_results<_VSTD_LFTS_PMR::wstring::const_iterator> wsmatch;
 #endif
 
-_LIBCPP_END_NAMESPACE_LFTS_PMR
+_LIBCUDACXX_END_NAMESPACE_LFTS_PMR
 
-#endif /* _LIBCPP_EXPERIMENTAL_REGEX */
+#endif /* _LIBCUDACXX_EXPERIMENTAL_REGEX */

diff  --git a/libcxx/include/experimental/set b/libcxx/include/experimental/set
index e2e75e35448b..b25ff803a5f9 100644
--- a/libcxx/include/experimental/set
+++ b/libcxx/include/experimental/set
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_EXPERIMENTAL_SET
-#define _LIBCPP_EXPERIMENTAL_SET
+#ifndef _LIBCUDACXX_EXPERIMENTAL_SET
+#define _LIBCUDACXX_EXPERIMENTAL_SET
 
 /*
     experimental/set synopsis
@@ -39,20 +39,20 @@ namespace pmr {
 #include <experimental/memory_resource>
 #include <set>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR
+_LIBCUDACXX_BEGIN_NAMESPACE_LFTS_PMR
 
 template <class _Value, class  _Compare = less<_Value>>
-using set = _VSTD::set<_Value, _Compare,
+using set = _CUDA_VSTD::set<_Value, _Compare,
                         polymorphic_allocator<_Value>>;
 
 template <class _Value, class  _Compare = less<_Value>>
-using multiset = _VSTD::multiset<_Value, _Compare,
+using multiset = _CUDA_VSTD::multiset<_Value, _Compare,
                         polymorphic_allocator<_Value>>;
 
-_LIBCPP_END_NAMESPACE_LFTS_PMR
+_LIBCUDACXX_END_NAMESPACE_LFTS_PMR
 
-#endif /* _LIBCPP_EXPERIMENTAL_SET */
+#endif /* _LIBCUDACXX_EXPERIMENTAL_SET */

diff  --git a/libcxx/include/experimental/simd b/libcxx/include/experimental/simd
index f77ce59bb269..cb872f30d273 100644
--- a/libcxx/include/experimental/simd
+++ b/libcxx/include/experimental/simd
@@ -6,8 +6,8 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-#ifndef _LIBCPP_EXPERIMENTAL_SIMD
-#define _LIBCPP_EXPERIMENTAL_SIMD
+#ifndef _LIBCUDACXX_EXPERIMENTAL_SIMD
+#define _LIBCUDACXX_EXPERIMENTAL_SIMD
 
 /*
     experimental/simd synopsis
@@ -656,21 +656,21 @@ public:
 #include <experimental/__config>
 #include <tuple>
 
-#ifndef _LIBCPP_REMOVE_TRANSITIVE_INCLUDES
+#ifndef _LIBCUDACXX_REMOVE_TRANSITIVE_INCLUDES
 #  include <algorithm>
 #  include <functional>
 #endif
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_SIMD
+_LIBCUDACXX_BEGIN_NAMESPACE_EXPERIMENTAL_SIMD
 
-#if _LIBCPP_STD_VER >= 17
+#if _LIBCUDACXX_STD_VER >= 17
 
 enum class _StorageKind {
   _Scalar,
@@ -718,7 +718,7 @@ public:
   }
 };
 
-#ifndef _LIBCPP_HAS_NO_VECTOR_EXTENSION
+#ifndef _LIBCUDACXX_HAS_NO_VECTOR_EXTENSION
 
 constexpr size_t __floor_pow_of_2(size_t __val) {
   return ((__val - 1) & __val) == 0 ? __val
@@ -731,73 +731,73 @@ constexpr size_t __ceil_pow_of_2(size_t __val) {
 
 template <class _Tp, size_t __bytes>
 struct __vec_ext_traits {
-#if !defined(_LIBCPP_COMPILER_CLANG_BASED)
+#if !defined(_LIBCUDACXX_COMPILER_CLANG_BASED)
   typedef _Tp type __attribute__((vector_size(__ceil_pow_of_2(__bytes))));
 #endif
 };
 
-#if defined(_LIBCPP_COMPILER_CLANG_BASED)
-#define _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, _NUM_ELEMENT)                        \
+#if defined(_LIBCUDACXX_COMPILER_CLANG_BASED)
+#define _LIBCUDACXX_SPECIALIZE_VEC_EXT(_TYPE, _NUM_ELEMENT)                        \
   template <>                                                                  \
   struct __vec_ext_traits<_TYPE, sizeof(_TYPE) * _NUM_ELEMENT> {               \
     using type =                                                               \
         _TYPE __attribute__((vector_size(sizeof(_TYPE) * _NUM_ELEMENT)));      \
   }
 
-#define _LIBCPP_SPECIALIZE_VEC_EXT_32(_TYPE)                                   \
-  _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 1);                                        \
-  _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 2);                                        \
-  _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 3);                                        \
-  _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 4);                                        \
-  _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 5);                                        \
-  _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 6);                                        \
-  _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 7);                                        \
-  _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 8);                                        \
-  _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 9);                                        \
-  _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 10);                                       \
-  _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 11);                                       \
-  _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 12);                                       \
-  _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 13);                                       \
-  _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 14);                                       \
-  _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 15);                                       \
-  _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 16);                                       \
-  _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 17);                                       \
-  _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 18);                                       \
-  _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 19);                                       \
-  _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 20);                                       \
-  _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 21);                                       \
-  _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 22);                                       \
-  _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 23);                                       \
-  _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 24);                                       \
-  _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 25);                                       \
-  _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 26);                                       \
-  _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 27);                                       \
-  _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 28);                                       \
-  _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 29);                                       \
-  _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 30);                                       \
-  _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 31);                                       \
-  _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 32)
-
-_LIBCPP_SPECIALIZE_VEC_EXT_32(char);
-_LIBCPP_SPECIALIZE_VEC_EXT_32(char16_t);
-_LIBCPP_SPECIALIZE_VEC_EXT_32(char32_t);
-_LIBCPP_SPECIALIZE_VEC_EXT_32(wchar_t);
-_LIBCPP_SPECIALIZE_VEC_EXT_32(signed char);
-_LIBCPP_SPECIALIZE_VEC_EXT_32(signed short);
-_LIBCPP_SPECIALIZE_VEC_EXT_32(signed int);
-_LIBCPP_SPECIALIZE_VEC_EXT_32(signed long);
-_LIBCPP_SPECIALIZE_VEC_EXT_32(signed long long);
-_LIBCPP_SPECIALIZE_VEC_EXT_32(unsigned char);
-_LIBCPP_SPECIALIZE_VEC_EXT_32(unsigned short);
-_LIBCPP_SPECIALIZE_VEC_EXT_32(unsigned int);
-_LIBCPP_SPECIALIZE_VEC_EXT_32(unsigned long);
-_LIBCPP_SPECIALIZE_VEC_EXT_32(unsigned long long);
-_LIBCPP_SPECIALIZE_VEC_EXT_32(float);
-_LIBCPP_SPECIALIZE_VEC_EXT_32(double);
-_LIBCPP_SPECIALIZE_VEC_EXT_32(long double);
-
-#undef _LIBCPP_SPECIALIZE_VEC_EXT_32
-#undef _LIBCPP_SPECIALIZE_VEC_EXT
+#define _LIBCUDACXX_SPECIALIZE_VEC_EXT_32(_TYPE)                                   \
+  _LIBCUDACXX_SPECIALIZE_VEC_EXT(_TYPE, 1);                                        \
+  _LIBCUDACXX_SPECIALIZE_VEC_EXT(_TYPE, 2);                                        \
+  _LIBCUDACXX_SPECIALIZE_VEC_EXT(_TYPE, 3);                                        \
+  _LIBCUDACXX_SPECIALIZE_VEC_EXT(_TYPE, 4);                                        \
+  _LIBCUDACXX_SPECIALIZE_VEC_EXT(_TYPE, 5);                                        \
+  _LIBCUDACXX_SPECIALIZE_VEC_EXT(_TYPE, 6);                                        \
+  _LIBCUDACXX_SPECIALIZE_VEC_EXT(_TYPE, 7);                                        \
+  _LIBCUDACXX_SPECIALIZE_VEC_EXT(_TYPE, 8);                                        \
+  _LIBCUDACXX_SPECIALIZE_VEC_EXT(_TYPE, 9);                                        \
+  _LIBCUDACXX_SPECIALIZE_VEC_EXT(_TYPE, 10);                                       \
+  _LIBCUDACXX_SPECIALIZE_VEC_EXT(_TYPE, 11);                                       \
+  _LIBCUDACXX_SPECIALIZE_VEC_EXT(_TYPE, 12);                                       \
+  _LIBCUDACXX_SPECIALIZE_VEC_EXT(_TYPE, 13);                                       \
+  _LIBCUDACXX_SPECIALIZE_VEC_EXT(_TYPE, 14);                                       \
+  _LIBCUDACXX_SPECIALIZE_VEC_EXT(_TYPE, 15);                                       \
+  _LIBCUDACXX_SPECIALIZE_VEC_EXT(_TYPE, 16);                                       \
+  _LIBCUDACXX_SPECIALIZE_VEC_EXT(_TYPE, 17);                                       \
+  _LIBCUDACXX_SPECIALIZE_VEC_EXT(_TYPE, 18);                                       \
+  _LIBCUDACXX_SPECIALIZE_VEC_EXT(_TYPE, 19);                                       \
+  _LIBCUDACXX_SPECIALIZE_VEC_EXT(_TYPE, 20);                                       \
+  _LIBCUDACXX_SPECIALIZE_VEC_EXT(_TYPE, 21);                                       \
+  _LIBCUDACXX_SPECIALIZE_VEC_EXT(_TYPE, 22);                                       \
+  _LIBCUDACXX_SPECIALIZE_VEC_EXT(_TYPE, 23);                                       \
+  _LIBCUDACXX_SPECIALIZE_VEC_EXT(_TYPE, 24);                                       \
+  _LIBCUDACXX_SPECIALIZE_VEC_EXT(_TYPE, 25);                                       \
+  _LIBCUDACXX_SPECIALIZE_VEC_EXT(_TYPE, 26);                                       \
+  _LIBCUDACXX_SPECIALIZE_VEC_EXT(_TYPE, 27);                                       \
+  _LIBCUDACXX_SPECIALIZE_VEC_EXT(_TYPE, 28);                                       \
+  _LIBCUDACXX_SPECIALIZE_VEC_EXT(_TYPE, 29);                                       \
+  _LIBCUDACXX_SPECIALIZE_VEC_EXT(_TYPE, 30);                                       \
+  _LIBCUDACXX_SPECIALIZE_VEC_EXT(_TYPE, 31);                                       \
+  _LIBCUDACXX_SPECIALIZE_VEC_EXT(_TYPE, 32)
+
+_LIBCUDACXX_SPECIALIZE_VEC_EXT_32(char);
+_LIBCUDACXX_SPECIALIZE_VEC_EXT_32(char16_t);
+_LIBCUDACXX_SPECIALIZE_VEC_EXT_32(char32_t);
+_LIBCUDACXX_SPECIALIZE_VEC_EXT_32(wchar_t);
+_LIBCUDACXX_SPECIALIZE_VEC_EXT_32(signed char);
+_LIBCUDACXX_SPECIALIZE_VEC_EXT_32(signed short);
+_LIBCUDACXX_SPECIALIZE_VEC_EXT_32(signed int);
+_LIBCUDACXX_SPECIALIZE_VEC_EXT_32(signed long);
+_LIBCUDACXX_SPECIALIZE_VEC_EXT_32(signed long long);
+_LIBCUDACXX_SPECIALIZE_VEC_EXT_32(unsigned char);
+_LIBCUDACXX_SPECIALIZE_VEC_EXT_32(unsigned short);
+_LIBCUDACXX_SPECIALIZE_VEC_EXT_32(unsigned int);
+_LIBCUDACXX_SPECIALIZE_VEC_EXT_32(unsigned long);
+_LIBCUDACXX_SPECIALIZE_VEC_EXT_32(unsigned long long);
+_LIBCUDACXX_SPECIALIZE_VEC_EXT_32(float);
+_LIBCUDACXX_SPECIALIZE_VEC_EXT_32(double);
+_LIBCUDACXX_SPECIALIZE_VEC_EXT_32(long double);
+
+#undef _LIBCUDACXX_SPECIALIZE_VEC_EXT_32
+#undef _LIBCUDACXX_SPECIALIZE_VEC_EXT
 #endif
 
 template <class _Tp, int __num_element>
@@ -820,7 +820,7 @@ public:
   }
 };
 
-#endif // _LIBCPP_HAS_NO_VECTOR_EXTENSION
+#endif // _LIBCUDACXX_HAS_NO_VECTOR_EXTENSION
 
 template <class _Vp, class _Tp, class _Abi>
 class __simd_reference {
@@ -960,8 +960,8 @@ constexpr bool __vectorizable() {
          !std::is_volatile<_Tp>::value && !std::is_same<_Tp, bool>::value;
 }
 
-_LIBCPP_END_NAMESPACE_EXPERIMENTAL_SIMD
-_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_SIMD_ABI
+_LIBCUDACXX_END_NAMESPACE_EXPERIMENTAL_SIMD
+_LIBCUDACXX_BEGIN_NAMESPACE_EXPERIMENTAL_SIMD_ABI
 
 using scalar = __simd_abi<_StorageKind::_Scalar, 1>;
 
@@ -974,18 +974,18 @@ inline constexpr size_t max_fixed_size = 32;
 template <class _Tp>
 using compatible = fixed_size<16 / sizeof(_Tp)>;
 
-#ifndef _LIBCPP_HAS_NO_VECTOR_EXTENSION
+#ifndef _LIBCUDACXX_HAS_NO_VECTOR_EXTENSION
 template <class _Tp>
 using native = __simd_abi<_StorageKind::_VecExt,
-                          _LIBCPP_NATIVE_SIMD_WIDTH_IN_BYTES / sizeof(_Tp)>;
+                          _LIBCUDACXX_NATIVE_SIMD_WIDTH_IN_BYTES / sizeof(_Tp)>;
 #else
 template <class _Tp>
 using native =
-    fixed_size<_Tp, _LIBCPP_NATIVE_SIMD_WIDTH_IN_BYTES / sizeof(_Tp)>;
-#endif // _LIBCPP_HAS_NO_VECTOR_EXTENSION
+    fixed_size<_Tp, _LIBCUDACXX_NATIVE_SIMD_WIDTH_IN_BYTES / sizeof(_Tp)>;
+#endif // _LIBCUDACXX_HAS_NO_VECTOR_EXTENSION
 
-_LIBCPP_END_NAMESPACE_EXPERIMENTAL_SIMD_ABI
-_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_SIMD
+_LIBCUDACXX_END_NAMESPACE_EXPERIMENTAL_SIMD_ABI
+_LIBCUDACXX_BEGIN_NAMESPACE_EXPERIMENTAL_SIMD
 
 template <class _Tp, class _Abi = simd_abi::compatible<_Tp>>
 class simd;
@@ -1573,10 +1573,10 @@ public:
 #endif
 };
 
-#endif // _LIBCPP_STD_VER >= 17
+#endif // _LIBCUDACXX_STD_VER >= 17
 
-_LIBCPP_END_NAMESPACE_EXPERIMENTAL_SIMD
+_LIBCUDACXX_END_NAMESPACE_EXPERIMENTAL_SIMD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif /* _LIBCPP_EXPERIMENTAL_SIMD */
+#endif /* _LIBCUDACXX_EXPERIMENTAL_SIMD */

diff  --git a/libcxx/include/experimental/string b/libcxx/include/experimental/string
index c795d685d735..c2a3e3a3a093 100644
--- a/libcxx/include/experimental/string
+++ b/libcxx/include/experimental/string
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_EXPERIMENTAL_STRING
-#define _LIBCPP_EXPERIMENTAL_STRING
+#ifndef _LIBCUDACXX_EXPERIMENTAL_STRING
+#define _LIBCUDACXX_EXPERIMENTAL_STRING
 
 /*
     experimental/string synopsis
@@ -43,23 +43,23 @@ namespace pmr {
 #include <experimental/memory_resource>
 #include <string>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR
+_LIBCUDACXX_BEGIN_NAMESPACE_LFTS_PMR
 
 template <class _CharT, class _Traits = char_traits<_CharT>>
 using basic_string =
-    _VSTD::basic_string<_CharT, _Traits, polymorphic_allocator<_CharT>>;
+    _CUDA_VSTD::basic_string<_CharT, _Traits, polymorphic_allocator<_CharT>>;
 
 typedef basic_string<char> string;
 typedef basic_string<char16_t> u16string;
 typedef basic_string<char32_t> u32string;
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 typedef basic_string<wchar_t> wstring;
 #endif
 
-_LIBCPP_END_NAMESPACE_LFTS_PMR
+_LIBCUDACXX_END_NAMESPACE_LFTS_PMR
 
-#endif /* _LIBCPP_EXPERIMENTAL_STRING */
+#endif /* _LIBCUDACXX_EXPERIMENTAL_STRING */

diff  --git a/libcxx/include/experimental/type_traits b/libcxx/include/experimental/type_traits
index dd4c53963640..f9144fbdcada 100644
--- a/libcxx/include/experimental/type_traits
+++ b/libcxx/include/experimental/type_traits
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_EXPERIMENTAL_TYPE_TRAITS
-#define _LIBCPP_EXPERIMENTAL_TYPE_TRAITS
+#ifndef _LIBCUDACXX_EXPERIMENTAL_TYPE_TRAITS
+#define _LIBCUDACXX_EXPERIMENTAL_TYPE_TRAITS
 
 /**
     experimental/type_traits synopsis
@@ -71,30 +71,30 @@ inline namespace fundamentals_v1 {
 #include <__assert> // all public C++ headers provide the assertion handler
 #include <experimental/__config>
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 
 #include <initializer_list>
 #include <type_traits>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_LFTS
+_LIBCUDACXX_BEGIN_NAMESPACE_LFTS
 
 // 3.3.2, Other type transformations
 /*
 template <class>
-class _LIBCPP_TEMPLATE_VIS raw_invocation_type;
+class _LIBCUDACXX_TEMPLATE_VIS raw_invocation_type;
 
 template <class _Fn, class ..._Args>
-class _LIBCPP_TEMPLATE_VIS raw_invocation_type<_Fn(_Args...)>;
+class _LIBCUDACXX_TEMPLATE_VIS raw_invocation_type<_Fn(_Args...)>;
 
 template <class>
-class _LIBCPP_TEMPLATE_VIS invokation_type;
+class _LIBCUDACXX_TEMPLATE_VIS invokation_type;
 
 template <class _Fn, class ..._Args>
-class _LIBCPP_TEMPLATE_VIS invokation_type<_Fn(_Args...)>;
+class _LIBCUDACXX_TEMPLATE_VIS invokation_type<_Fn(_Args...)>;
 
 template <class _Tp>
 using invokation_type_t = typename invokation_type<_Tp>::type;
@@ -130,7 +130,7 @@ template <template<class...> class _Op, class... _Args>
 template <template<class...> class _Op, class... _Args>
   using detected_t = typename _DETECTOR<nonesuch, void, _Op, _Args...>::type;
 template <template<class...> class _Op, class... _Args>
-  _LIBCPP_CONSTEXPR bool is_detected_v = is_detected<_Op, _Args...>::value;
+  _LIBCUDACXX_CONSTEXPR bool is_detected_v = is_detected<_Op, _Args...>::value;
 
 template <class Default, template<class...> class _Op, class... _Args>
   using detected_or = _DETECTOR<Default, void, _Op, _Args...>;
@@ -140,16 +140,16 @@ template <class Default, template<class...> class _Op, class... _Args>
 template <class Expected, template<class...> class _Op, class... _Args>
   using is_detected_exact = is_same<Expected, detected_t<_Op, _Args...>>;
 template <class Expected, template<class...> class _Op, class... _Args>
-  _LIBCPP_CONSTEXPR bool is_detected_exact_v = is_detected_exact<Expected, _Op, _Args...>::value;
+  _LIBCUDACXX_CONSTEXPR bool is_detected_exact_v = is_detected_exact<Expected, _Op, _Args...>::value;
 
 template <class To, template<class...> class _Op, class... _Args>
   using is_detected_convertible = is_convertible<detected_t<_Op, _Args...>, To>;
 template <class To, template<class...> class _Op, class... _Args>
-  _LIBCPP_CONSTEXPR bool is_detected_convertible_v = is_detected_convertible<To, _Op, _Args...>::value;
+  _LIBCUDACXX_CONSTEXPR bool is_detected_convertible_v = is_detected_convertible<To, _Op, _Args...>::value;
 
 
-_LIBCPP_END_NAMESPACE_LFTS
+_LIBCUDACXX_END_NAMESPACE_LFTS
 
-#endif /* _LIBCPP_STD_VER > 11 */
+#endif /* _LIBCUDACXX_STD_VER > 11 */
 
-#endif /* _LIBCPP_EXPERIMENTAL_TYPE_TRAITS */
+#endif /* _LIBCUDACXX_EXPERIMENTAL_TYPE_TRAITS */

diff  --git a/libcxx/include/experimental/unordered_map b/libcxx/include/experimental/unordered_map
index 636d31bdc557..23e2d9e68d57 100644
--- a/libcxx/include/experimental/unordered_map
+++ b/libcxx/include/experimental/unordered_map
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_EXPERIMENTAL_UNORDERED_MAP
-#define _LIBCPP_EXPERIMENTAL_UNORDERED_MAP
+#ifndef _LIBCUDACXX_EXPERIMENTAL_UNORDERED_MAP
+#define _LIBCUDACXX_EXPERIMENTAL_UNORDERED_MAP
 
 /*
     experimental/unordered_map synopsis
@@ -45,7 +45,7 @@ namespace pmr {
 #include <experimental/memory_resource>
 #include <unordered_map>
 
-#ifndef _LIBCPP_REMOVE_TRANSITIVE_INCLUDES
+#ifndef _LIBCUDACXX_REMOVE_TRANSITIVE_INCLUDES
 #  include <algorithm>
 #  include <array>
 #  include <bit>
@@ -53,22 +53,22 @@ namespace pmr {
 #  include <vector>
 #endif
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR
+_LIBCUDACXX_BEGIN_NAMESPACE_LFTS_PMR
 
 template <class _Key, class _Value,
           class _Hash = hash<_Key>, class _Pred = equal_to<_Key>>
-using unordered_map = _VSTD::unordered_map<_Key, _Value, _Hash, _Pred,
+using unordered_map = _CUDA_VSTD::unordered_map<_Key, _Value, _Hash, _Pred,
                         polymorphic_allocator<pair<const _Key, _Value>>>;
 
 template <class _Key, class _Value,
           class _Hash = hash<_Key>, class _Pred = equal_to<_Key>>
-using unordered_multimap = _VSTD::unordered_multimap<_Key, _Value, _Hash, _Pred,
+using unordered_multimap = _CUDA_VSTD::unordered_multimap<_Key, _Value, _Hash, _Pred,
                         polymorphic_allocator<pair<const _Key, _Value>>>;
 
-_LIBCPP_END_NAMESPACE_LFTS_PMR
+_LIBCUDACXX_END_NAMESPACE_LFTS_PMR
 
-#endif /* _LIBCPP_EXPERIMENTAL_UNORDERED_MAP */
+#endif /* _LIBCUDACXX_EXPERIMENTAL_UNORDERED_MAP */

diff  --git a/libcxx/include/experimental/unordered_set b/libcxx/include/experimental/unordered_set
index 509f3ec1044e..0f5d59c7ede7 100644
--- a/libcxx/include/experimental/unordered_set
+++ b/libcxx/include/experimental/unordered_set
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_EXPERIMENTAL_UNORDERED_SET
-#define _LIBCPP_EXPERIMENTAL_UNORDERED_SET
+#ifndef _LIBCUDACXX_EXPERIMENTAL_UNORDERED_SET
+#define _LIBCUDACXX_EXPERIMENTAL_UNORDERED_SET
 
 /*
     experimental/unordered_set synopsis
@@ -39,22 +39,22 @@ namespace pmr {
 #include <experimental/memory_resource>
 #include <unordered_set>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR
+_LIBCUDACXX_BEGIN_NAMESPACE_LFTS_PMR
 
 template <class _Value,
           class _Hash = hash<_Value>, class _Pred = equal_to<_Value>>
-using unordered_set = _VSTD::unordered_set<_Value, _Hash, _Pred,
+using unordered_set = _CUDA_VSTD::unordered_set<_Value, _Hash, _Pred,
                         polymorphic_allocator<_Value>>;
 
 template <class _Value,
           class _Hash = hash<_Value>, class _Pred = equal_to<_Value>>
-using unordered_multiset = _VSTD::unordered_multiset<_Value, _Hash, _Pred,
+using unordered_multiset = _CUDA_VSTD::unordered_multiset<_Value, _Hash, _Pred,
                         polymorphic_allocator<_Value>>;
 
-_LIBCPP_END_NAMESPACE_LFTS_PMR
+_LIBCUDACXX_END_NAMESPACE_LFTS_PMR
 
-#endif /* _LIBCPP_EXPERIMENTAL_UNORDERED_SET */
+#endif /* _LIBCUDACXX_EXPERIMENTAL_UNORDERED_SET */

diff  --git a/libcxx/include/experimental/utility b/libcxx/include/experimental/utility
index 576b8be46357..54c9d327f125 100644
--- a/libcxx/include/experimental/utility
+++ b/libcxx/include/experimental/utility
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_EXPERIMENTAL_UTILITY
-#define _LIBCPP_EXPERIMENTAL_UTILITY
+#ifndef _LIBCUDACXX_EXPERIMENTAL_UTILITY
+#define _LIBCUDACXX_EXPERIMENTAL_UTILITY
 
 /*
     experimental/utility synopsis
@@ -34,14 +34,14 @@ inline namespace fundamentals_v1 {
 #include <experimental/__config>
 #include <utility>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_LFTS
+_LIBCUDACXX_BEGIN_NAMESPACE_LFTS
 
-  struct _LIBCPP_TEMPLATE_VIS erased_type { };
+  struct _LIBCUDACXX_TEMPLATE_VIS erased_type { };
 
-_LIBCPP_END_NAMESPACE_LFTS
+_LIBCUDACXX_END_NAMESPACE_LFTS
 
-#endif /* _LIBCPP_EXPERIMENTAL_UTILITY */
+#endif /* _LIBCUDACXX_EXPERIMENTAL_UTILITY */

diff  --git a/libcxx/include/experimental/vector b/libcxx/include/experimental/vector
index 97c51c830c4a..690f44f227ce 100644
--- a/libcxx/include/experimental/vector
+++ b/libcxx/include/experimental/vector
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_EXPERIMENTAL_VECTOR
-#define _LIBCPP_EXPERIMENTAL_VECTOR
+#ifndef _LIBCUDACXX_EXPERIMENTAL_VECTOR
+#define _LIBCUDACXX_EXPERIMENTAL_VECTOR
 
 /*
     experimental/vector synopsis
@@ -34,15 +34,15 @@ namespace pmr {
 #include <experimental/memory_resource>
 #include <vector>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR
+_LIBCUDACXX_BEGIN_NAMESPACE_LFTS_PMR
 
 template <class _ValueT>
-using vector = _VSTD::vector<_ValueT, polymorphic_allocator<_ValueT>>;
+using vector = _CUDA_VSTD::vector<_ValueT, polymorphic_allocator<_ValueT>>;
 
-_LIBCPP_END_NAMESPACE_LFTS_PMR
+_LIBCUDACXX_END_NAMESPACE_LFTS_PMR
 
-#endif /* _LIBCPP_EXPERIMENTAL_VECTOR */
+#endif /* _LIBCUDACXX_EXPERIMENTAL_VECTOR */

diff  --git a/libcxx/include/ext/__hash b/libcxx/include/ext/__hash
index 0e6c2cc05b52..81b96e82158b 100644
--- a/libcxx/include/ext/__hash
+++ b/libcxx/include/ext/__hash
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_EXT_HASH
-#define _LIBCPP_EXT_HASH
+#ifndef _LIBCUDACXX_EXT_HASH
+#define _LIBCUDACXX_EXT_HASH
 
 #  pragma GCC system_header
 
@@ -18,112 +18,112 @@
 
 namespace __gnu_cxx {
 
-template <typename _Tp> struct _LIBCPP_TEMPLATE_VIS hash { };
+template <typename _Tp> struct _LIBCUDACXX_TEMPLATE_VIS hash { };
 
-template <> struct _LIBCPP_TEMPLATE_VIS hash<const char*>
+template <> struct _LIBCUDACXX_TEMPLATE_VIS hash<const char*>
  : public std::__unary_function<const char*, size_t>
 {
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t operator()(const char *__c) const _NOEXCEPT
     {
         return std::__do_string_hash(__c, __c + strlen(__c));
     }
 };
 
-template <> struct _LIBCPP_TEMPLATE_VIS hash<char *>
+template <> struct _LIBCUDACXX_TEMPLATE_VIS hash<char *>
  : public std::__unary_function<char*, size_t>
 {
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t operator()(char *__c) const _NOEXCEPT
     {
         return std::__do_string_hash<const char *>(__c, __c + strlen(__c));
     }
 };
 
-template <> struct _LIBCPP_TEMPLATE_VIS hash<char>
+template <> struct _LIBCUDACXX_TEMPLATE_VIS hash<char>
  : public std::__unary_function<char, size_t>
 {
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t operator()(char __c) const _NOEXCEPT
     {
         return __c;
     }
 };
 
-template <> struct _LIBCPP_TEMPLATE_VIS hash<signed char>
+template <> struct _LIBCUDACXX_TEMPLATE_VIS hash<signed char>
  : public std::__unary_function<signed char, size_t>
 {
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t operator()(signed char __c) const _NOEXCEPT
     {
         return __c;
     }
 };
 
-template <> struct _LIBCPP_TEMPLATE_VIS hash<unsigned char>
+template <> struct _LIBCUDACXX_TEMPLATE_VIS hash<unsigned char>
  : public std::__unary_function<unsigned char, size_t>
 {
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t operator()(unsigned char __c) const _NOEXCEPT
     {
         return __c;
     }
 };
 
-template <> struct _LIBCPP_TEMPLATE_VIS hash<short>
+template <> struct _LIBCUDACXX_TEMPLATE_VIS hash<short>
  : public std::__unary_function<short, size_t>
 {
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t operator()(short __c) const _NOEXCEPT
     {
         return __c;
     }
 };
 
-template <> struct _LIBCPP_TEMPLATE_VIS hash<unsigned short>
+template <> struct _LIBCUDACXX_TEMPLATE_VIS hash<unsigned short>
  : public std::__unary_function<unsigned short, size_t>
 {
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t operator()(unsigned short __c) const _NOEXCEPT
     {
         return __c;
     }
 };
 
-template <> struct _LIBCPP_TEMPLATE_VIS hash<int>
+template <> struct _LIBCUDACXX_TEMPLATE_VIS hash<int>
     : public std::__unary_function<int, size_t>
 {
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t operator()(int __c) const _NOEXCEPT
     {
         return __c;
     }
 };
 
-template <> struct _LIBCPP_TEMPLATE_VIS hash<unsigned int>
+template <> struct _LIBCUDACXX_TEMPLATE_VIS hash<unsigned int>
     : public std::__unary_function<unsigned int, size_t>
 {
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t operator()(unsigned int __c) const _NOEXCEPT
     {
         return __c;
     }
 };
 
-template <> struct _LIBCPP_TEMPLATE_VIS hash<long>
+template <> struct _LIBCUDACXX_TEMPLATE_VIS hash<long>
     : public std::__unary_function<long, size_t>
 {
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t operator()(long __c) const _NOEXCEPT
     {
         return __c;
     }
 };
 
-template <> struct _LIBCPP_TEMPLATE_VIS hash<unsigned long>
+template <> struct _LIBCUDACXX_TEMPLATE_VIS hash<unsigned long>
     : public std::__unary_function<unsigned long, size_t>
 {
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t operator()(unsigned long __c) const _NOEXCEPT
     {
         return __c;
@@ -131,4 +131,4 @@ template <> struct _LIBCPP_TEMPLATE_VIS hash<unsigned long>
 };
 } // namespace __gnu_cxx
 
-#endif // _LIBCPP_EXT_HASH
+#endif // _LIBCUDACXX_EXT_HASH

diff  --git a/libcxx/include/ext/hash_map b/libcxx/include/ext/hash_map
index a581d5c550c4..393671ce9632 100644
--- a/libcxx/include/ext/hash_map
+++ b/libcxx/include/ext/hash_map
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_HASH_MAP
-#define _LIBCPP_HASH_MAP
+#ifndef _LIBCUDACXX_HASH_MAP
+#define _LIBCUDACXX_HASH_MAP
 
 /*
 
@@ -210,38 +210,38 @@ template <class Key, class T, class Hash, class Pred, class Alloc>
 #include <stdexcept>
 #include <type_traits>
 
-#ifndef _LIBCPP_REMOVE_TRANSITIVE_INCLUDES
+#ifndef _LIBCUDACXX_REMOVE_TRANSITIVE_INCLUDES
 #  include <iterator>
 #endif
 
 #if defined(__DEPRECATED) && __DEPRECATED
-#if defined(_LIBCPP_WARNING)
-    _LIBCPP_WARNING("Use of the header <ext/hash_map> is deprecated.  Migrate to <unordered_map>")
+#if defined(_LIBCUDACXX_WARNING)
+    _LIBCUDACXX_WARNING("Use of the header <ext/hash_map> is deprecated.  Migrate to <unordered_map>")
 #else
 #   warning Use of the header <ext/hash_map> is deprecated.  Migrate to <unordered_map>
 #endif
 #endif
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
 namespace __gnu_cxx {
 
 template <class _Tp, class _Hash,
-          bool = std::is_empty<_Hash>::value && !std::__libcpp_is_final<_Hash>::value
+          bool = std::is_empty<_Hash>::value && !std::__LIBCUDACXX_is_final<_Hash>::value
         >
 class __hash_map_hasher
     : private _Hash
 {
 public:
-    _LIBCPP_INLINE_VISIBILITY __hash_map_hasher() : _Hash() {}
-    _LIBCPP_INLINE_VISIBILITY __hash_map_hasher(const _Hash& __h) : _Hash(__h) {}
-    _LIBCPP_INLINE_VISIBILITY const _Hash& hash_function() const {return *this;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY __hash_map_hasher() : _Hash() {}
+    _LIBCUDACXX_INLINE_VISIBILITY __hash_map_hasher(const _Hash& __h) : _Hash(__h) {}
+    _LIBCUDACXX_INLINE_VISIBILITY const _Hash& hash_function() const {return *this;}
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t operator()(const _Tp& __x) const
         {return static_cast<const _Hash&>(*this)(__x.first);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t operator()(const typename _Tp::first_type& __x) const
         {return static_cast<const _Hash&>(*this)(__x);}
 };
@@ -251,37 +251,37 @@ class __hash_map_hasher<_Tp, _Hash, false>
 {
     _Hash __hash_;
 public:
-    _LIBCPP_INLINE_VISIBILITY __hash_map_hasher() : __hash_() {}
-    _LIBCPP_INLINE_VISIBILITY __hash_map_hasher(const _Hash& __h) : __hash_(__h) {}
-    _LIBCPP_INLINE_VISIBILITY const _Hash& hash_function() const {return __hash_;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY __hash_map_hasher() : __hash_() {}
+    _LIBCUDACXX_INLINE_VISIBILITY __hash_map_hasher(const _Hash& __h) : __hash_(__h) {}
+    _LIBCUDACXX_INLINE_VISIBILITY const _Hash& hash_function() const {return __hash_;}
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t operator()(const _Tp& __x) const
         {return __hash_(__x.first);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t operator()(const typename _Tp::first_type& __x) const
         {return __hash_(__x);}
 };
 
 template <class _Tp, class _Pred,
-          bool = std::is_empty<_Pred>::value && !std::__libcpp_is_final<_Pred>::value
+          bool = std::is_empty<_Pred>::value && !std::__LIBCUDACXX_is_final<_Pred>::value
          >
 class __hash_map_equal
     : private _Pred
 {
 public:
-    _LIBCPP_INLINE_VISIBILITY __hash_map_equal() : _Pred() {}
-    _LIBCPP_INLINE_VISIBILITY __hash_map_equal(const _Pred& __p) : _Pred(__p) {}
-    _LIBCPP_INLINE_VISIBILITY const _Pred& key_eq() const {return *this;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY __hash_map_equal() : _Pred() {}
+    _LIBCUDACXX_INLINE_VISIBILITY __hash_map_equal(const _Pred& __p) : _Pred(__p) {}
+    _LIBCUDACXX_INLINE_VISIBILITY const _Pred& key_eq() const {return *this;}
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool operator()(const _Tp& __x, const _Tp& __y) const
         {return static_cast<const _Pred&>(*this)(__x.first, __y.first);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool operator()(const typename _Tp::first_type& __x, const _Tp& __y) const
         {return static_cast<const _Pred&>(*this)(__x, __y.first);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool operator()(const _Tp& __x, const typename _Tp::first_type& __y) const
         {return static_cast<const _Pred&>(*this)(__x.first, __y);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool operator()(const typename _Tp::first_type& __x,
                     const typename _Tp::first_type& __y) const
         {return static_cast<const _Pred&>(*this)(__x, __y);}
@@ -292,19 +292,19 @@ class __hash_map_equal<_Tp, _Pred, false>
 {
     _Pred __pred_;
 public:
-    _LIBCPP_INLINE_VISIBILITY __hash_map_equal() : __pred_() {}
-    _LIBCPP_INLINE_VISIBILITY __hash_map_equal(const _Pred& __p) : __pred_(__p) {}
-    _LIBCPP_INLINE_VISIBILITY const _Pred& key_eq() const {return __pred_;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY __hash_map_equal() : __pred_() {}
+    _LIBCUDACXX_INLINE_VISIBILITY __hash_map_equal(const _Pred& __p) : __pred_(__p) {}
+    _LIBCUDACXX_INLINE_VISIBILITY const _Pred& key_eq() const {return __pred_;}
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool operator()(const _Tp& __x, const _Tp& __y) const
         {return __pred_(__x.first, __y.first);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool operator()(const typename _Tp::first_type& __x, const _Tp& __y) const
         {return __pred_(__x, __y.first);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool operator()(const _Tp& __x, const typename _Tp::first_type& __y) const
         {return __pred_(__x.first, __y);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool operator()(const typename _Tp::first_type& __x,
                     const typename _Tp::first_type& __y) const
         {return __pred_(__x, __y);}
@@ -331,15 +331,15 @@ public:
     __hash_map_node_destructor(__hash_map_node_destructor const&) = default;
     __hash_map_node_destructor& operator=(const __hash_map_node_destructor&) = delete;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __hash_map_node_destructor(allocator_type& __na)
         : __na_(__na),
           __first_constructed(false),
           __second_constructed(false)
         {}
 
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     __hash_map_node_destructor(std::__hash_node_destructor<allocator_type>&& __x)
         : __na_(__x.__na_),
           __first_constructed(__x.__value_constructed),
@@ -347,8 +347,8 @@ public:
         {
             __x.__value_constructed = false;
         }
-#else  // _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+#else  // _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     __hash_map_node_destructor(const std::__hash_node_destructor<allocator_type>& __x)
         : __na_(__x.__na_),
           __first_constructed(__x.__value_constructed),
@@ -356,22 +356,22 @@ public:
         {
             const_cast<bool&>(__x.__value_constructed) = false;
         }
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void operator()(pointer __p)
     {
         if (__second_constructed)
-            __alloc_traits::destroy(__na_, _VSTD::addressof(__p->__value_.second));
+            __alloc_traits::destroy(__na_, _CUDA_VSTD::addressof(__p->__value_.second));
         if (__first_constructed)
-            __alloc_traits::destroy(__na_, _VSTD::addressof(__p->__value_.first));
+            __alloc_traits::destroy(__na_, _CUDA_VSTD::addressof(__p->__value_.first));
         if (__p)
             __alloc_traits::deallocate(__na_, __p, 1);
     }
 };
 
 template <class _HashIterator>
-class _LIBCPP_TEMPLATE_VIS __hash_map_iterator
+class _LIBCUDACXX_TEMPLATE_VIS __hash_map_iterator
 {
     _HashIterator __i_;
 
@@ -385,15 +385,15 @@ public:
     typedef typename std::__rebind_pointer<typename _HashIterator::pointer, value_type>::type
         pointer;
 
-    _LIBCPP_INLINE_VISIBILITY __hash_map_iterator() {}
+    _LIBCUDACXX_INLINE_VISIBILITY __hash_map_iterator() {}
 
-    _LIBCPP_INLINE_VISIBILITY __hash_map_iterator(_HashIterator __i) : __i_(__i) {}
+    _LIBCUDACXX_INLINE_VISIBILITY __hash_map_iterator(_HashIterator __i) : __i_(__i) {}
 
-    _LIBCPP_INLINE_VISIBILITY reference operator*() const {return *operator->();}
-    _LIBCPP_INLINE_VISIBILITY pointer operator->() const {return (pointer)__i_.operator->();}
+    _LIBCUDACXX_INLINE_VISIBILITY reference operator*() const {return *operator->();}
+    _LIBCUDACXX_INLINE_VISIBILITY pointer operator->() const {return (pointer)__i_.operator->();}
 
-    _LIBCPP_INLINE_VISIBILITY __hash_map_iterator& operator++() {++__i_; return *this;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY __hash_map_iterator& operator++() {++__i_; return *this;}
+    _LIBCUDACXX_INLINE_VISIBILITY
     __hash_map_iterator operator++(int)
     {
         __hash_map_iterator __t(*this);
@@ -401,22 +401,22 @@ public:
         return __t;
     }
 
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
     bool operator==(const __hash_map_iterator& __x, const __hash_map_iterator& __y)
         {return __x.__i_ == __y.__i_;}
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
     bool operator!=(const __hash_map_iterator& __x, const __hash_map_iterator& __y)
         {return __x.__i_ != __y.__i_;}
 
-    template <class, class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS hash_map;
-    template <class, class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS hash_multimap;
-    template <class> friend class _LIBCPP_TEMPLATE_VIS __hash_const_iterator;
-    template <class> friend class _LIBCPP_TEMPLATE_VIS __hash_const_local_iterator;
-    template <class> friend class _LIBCPP_TEMPLATE_VIS __hash_map_const_iterator;
+    template <class, class, class, class, class> friend class _LIBCUDACXX_TEMPLATE_VIS hash_map;
+    template <class, class, class, class, class> friend class _LIBCUDACXX_TEMPLATE_VIS hash_multimap;
+    template <class> friend class _LIBCUDACXX_TEMPLATE_VIS __hash_const_iterator;
+    template <class> friend class _LIBCUDACXX_TEMPLATE_VIS __hash_const_local_iterator;
+    template <class> friend class _LIBCUDACXX_TEMPLATE_VIS __hash_map_const_iterator;
 };
 
 template <class _HashIterator>
-class _LIBCPP_TEMPLATE_VIS __hash_map_const_iterator
+class _LIBCUDACXX_TEMPLATE_VIS __hash_map_const_iterator
 {
     _HashIterator __i_;
 
@@ -430,23 +430,23 @@ public:
     typedef typename std::__rebind_pointer<typename _HashIterator::pointer, const value_type>::type
         pointer;
 
-    _LIBCPP_INLINE_VISIBILITY __hash_map_const_iterator() {}
+    _LIBCUDACXX_INLINE_VISIBILITY __hash_map_const_iterator() {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __hash_map_const_iterator(_HashIterator __i) : __i_(__i) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __hash_map_const_iterator(
             __hash_map_iterator<typename _HashIterator::__non_const_iterator> __i)
                 : __i_(__i.__i_) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     reference operator*() const {return *operator->();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     pointer operator->() const {return (pointer)__i_.operator->();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __hash_map_const_iterator& operator++() {++__i_; return *this;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __hash_map_const_iterator operator++(int)
     {
         __hash_map_const_iterator __t(*this);
@@ -454,22 +454,22 @@ public:
         return __t;
     }
 
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
     bool operator==(const __hash_map_const_iterator& __x, const __hash_map_const_iterator& __y)
         {return __x.__i_ == __y.__i_;}
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
     bool operator!=(const __hash_map_const_iterator& __x, const __hash_map_const_iterator& __y)
         {return __x.__i_ != __y.__i_;}
 
-    template <class, class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS hash_map;
-    template <class, class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS hash_multimap;
-    template <class> friend class _LIBCPP_TEMPLATE_VIS __hash_const_iterator;
-    template <class> friend class _LIBCPP_TEMPLATE_VIS __hash_const_local_iterator;
+    template <class, class, class, class, class> friend class _LIBCUDACXX_TEMPLATE_VIS hash_map;
+    template <class, class, class, class, class> friend class _LIBCUDACXX_TEMPLATE_VIS hash_multimap;
+    template <class> friend class _LIBCUDACXX_TEMPLATE_VIS __hash_const_iterator;
+    template <class> friend class _LIBCUDACXX_TEMPLATE_VIS __hash_const_local_iterator;
 };
 
 template <class _Key, class _Tp, class _Hash = hash<_Key>, class _Pred = std::equal_to<_Key>,
           class _Alloc = std::allocator<std::pair<const _Key, _Tp> > >
-class _LIBCPP_TEMPLATE_VIS hash_map
+class _LIBCUDACXX_TEMPLATE_VIS hash_map
 {
 public:
     // types
@@ -512,7 +512,7 @@ public:
     typedef __hash_map_iterator<typename __table::iterator>       iterator;
     typedef __hash_map_const_iterator<typename __table::const_iterator> const_iterator;
 
-    _LIBCPP_INLINE_VISIBILITY hash_map() { }
+    _LIBCUDACXX_INLINE_VISIBILITY hash_map() { }
     explicit hash_map(size_type __n, const hasher& __hf = hasher(),
                            const key_equal& __eql = key_equal());
     hash_map(size_type __n, const hasher& __hf,
@@ -531,80 +531,80 @@ public:
                       const allocator_type& __a);
     hash_map(const hash_map& __u);
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     allocator_type get_allocator() const
         {return allocator_type(__table_.__node_alloc());}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool      empty() const {return __table_.size() == 0;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type size() const  {return __table_.size();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type max_size() const {return __table_.max_size();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator       begin()        {return __table_.begin();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator       end()          {return __table_.end();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator begin()  const {return __table_.begin();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator end()    const {return __table_.end();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     std::pair<iterator, bool> insert(const value_type& __x)
         {return __table_.__insert_unique(__x);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator insert(const_iterator, const value_type& __x) {return insert(__x).first;}
     template <class _InputIterator>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         void insert(_InputIterator __first, _InputIterator __last);
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void erase(const_iterator __p) {__table_.erase(__p.__i_);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type erase(const key_type& __k) {return __table_.__erase_unique(__k);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void erase(const_iterator __first, const_iterator __last)
         {__table_.erase(__first.__i_, __last.__i_);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void clear() {__table_.clear();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void swap(hash_map& __u) {__table_.swap(__u.__table_);}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     hasher hash_funct() const
         {return __table_.hash_function().hash_function();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     key_equal key_eq() const
         {return __table_.key_eq().key_eq();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator       find(const key_type& __k)       {return __table_.find(__k);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator find(const key_type& __k) const {return __table_.find(__k);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type count(const key_type& __k) const {return __table_.__count_unique(__k);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     std::pair<iterator, iterator>             equal_range(const key_type& __k)
         {return __table_.__equal_range_unique(__k);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     std::pair<const_iterator, const_iterator> equal_range(const key_type& __k) const
         {return __table_.__equal_range_unique(__k);}
 
     mapped_type& operator[](const key_type& __k);
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type bucket_count() const {return __table_.bucket_count();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type max_bucket_count() const {return __table_.max_bucket_count();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type elems_in_bucket(size_type __n) const
         {return __table_.bucket_size(__n);}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void resize(size_type __n) {__table_.__rehash_unique(__n);}
 
 private:
@@ -673,9 +673,9 @@ hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(const key_type& __k)
 {
     __node_allocator& __na = __table_.__node_alloc();
     __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
-    __node_traits::construct(__na, _VSTD::addressof(__h->__value_.first), __k);
+    __node_traits::construct(__na, _CUDA_VSTD::addressof(__h->__value_.first), __k);
     __h.get_deleter().__first_constructed = true;
-    __node_traits::construct(__na, _VSTD::addressof(__h->__value_.second));
+    __node_traits::construct(__na, _CUDA_VSTD::addressof(__h->__value_.second));
     __h.get_deleter().__second_constructed = true;
     return __h;
 }
@@ -705,7 +705,7 @@ hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[](const key_type& __k)
 }
 
 template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 swap(hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
      hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
@@ -733,7 +733,7 @@ operator==(const hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
 }
 
 template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator!=(const hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
            const hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
@@ -743,7 +743,7 @@ operator!=(const hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
 
 template <class _Key, class _Tp, class _Hash = hash<_Key>, class _Pred = std::equal_to<_Key>,
           class _Alloc = std::allocator<std::pair<const _Key, _Tp> > >
-class _LIBCPP_TEMPLATE_VIS hash_multimap
+class _LIBCUDACXX_TEMPLATE_VIS hash_multimap
 {
 public:
     // types
@@ -783,7 +783,7 @@ public:
     typedef __hash_map_iterator<typename __table::iterator>       iterator;
     typedef __hash_map_const_iterator<typename __table::const_iterator> const_iterator;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     hash_multimap() { }
     explicit hash_multimap(size_type __n, const hasher& __hf = hasher(),
                                 const key_equal& __eql = key_equal());
@@ -803,77 +803,77 @@ public:
                       const allocator_type& __a);
     hash_multimap(const hash_multimap& __u);
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     allocator_type get_allocator() const
         {return allocator_type(__table_.__node_alloc());}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool      empty() const {return __table_.size() == 0;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type size() const  {return __table_.size();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type max_size() const {return __table_.max_size();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator       begin()        {return __table_.begin();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator       end()          {return __table_.end();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator begin()  const {return __table_.begin();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator end()    const {return __table_.end();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator insert(const value_type& __x) {return __table_.__insert_multi(__x);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator insert(const_iterator, const value_type& __x) {return insert(__x);}
     template <class _InputIterator>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         void insert(_InputIterator __first, _InputIterator __last);
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void erase(const_iterator __p) {__table_.erase(__p.__i_);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type erase(const key_type& __k) {return __table_.__erase_multi(__k);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void erase(const_iterator __first, const_iterator __last)
         {__table_.erase(__first.__i_, __last.__i_);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void clear() {__table_.clear();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void swap(hash_multimap& __u) {__table_.swap(__u.__table_);}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     hasher hash_funct() const
         {return __table_.hash_function().hash_function();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     key_equal key_eq() const
         {return __table_.key_eq().key_eq();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator       find(const key_type& __k)       {return __table_.find(__k);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator find(const key_type& __k) const {return __table_.find(__k);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type count(const key_type& __k) const {return __table_.__count_multi(__k);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     std::pair<iterator, iterator>             equal_range(const key_type& __k)
         {return __table_.__equal_range_multi(__k);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     std::pair<const_iterator, const_iterator> equal_range(const key_type& __k) const
         {return __table_.__equal_range_multi(__k);}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type bucket_count() const {return __table_.bucket_count();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type max_bucket_count() const {return __table_.max_bucket_count();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type elems_in_bucket(size_type __n) const
         {return __table_.bucket_size(__n);}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void resize(size_type __n) {__table_.__rehash_multi(__n);}
 };
 
@@ -945,7 +945,7 @@ hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::insert(_InputIterator __first,
 }
 
 template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 swap(hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
      hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
@@ -967,9 +967,9 @@ operator==(const hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
     {
         _EqRng __xeq = __x.equal_range(__i->first);
         _EqRng __yeq = __y.equal_range(__i->first);
-        if (_VSTD::distance(__xeq.first, __xeq.second) !=
-            _VSTD::distance(__yeq.first, __yeq.second) ||
-                  !_VSTD::is_permutation(__xeq.first, __xeq.second, __yeq.first))
+        if (_CUDA_VSTD::distance(__xeq.first, __xeq.second) !=
+            _CUDA_VSTD::distance(__yeq.first, __yeq.second) ||
+                  !_CUDA_VSTD::is_permutation(__xeq.first, __xeq.second, __yeq.first))
             return false;
         __i = __xeq.second;
     }
@@ -977,7 +977,7 @@ operator==(const hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
 }
 
 template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator!=(const hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
            const hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
@@ -987,4 +987,4 @@ operator!=(const hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
 
 } // namespace __gnu_cxx
 
-#endif // _LIBCPP_HASH_MAP
+#endif // _LIBCUDACXX_HASH_MAP

diff  --git a/libcxx/include/ext/hash_set b/libcxx/include/ext/hash_set
index 5823b5fb9476..084b51bcdd3b 100644
--- a/libcxx/include/ext/hash_set
+++ b/libcxx/include/ext/hash_set
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_HASH_SET
-#define _LIBCPP_HASH_SET
+#ifndef _LIBCUDACXX_HASH_SET
+#define _LIBCUDACXX_HASH_SET
 
 /*
 
@@ -199,19 +199,19 @@ template <class Value, class Hash, class Pred, class Alloc>
 #include <ext/__hash>
 #include <functional>
 
-#ifndef _LIBCPP_REMOVE_TRANSITIVE_INCLUDES
+#ifndef _LIBCUDACXX_REMOVE_TRANSITIVE_INCLUDES
 #  include <iterator>
 #endif
 
 #if defined(__DEPRECATED) && __DEPRECATED
-#if defined(_LIBCPP_WARNING)
-    _LIBCPP_WARNING("Use of the header <ext/hash_set> is deprecated.  Migrate to <unordered_set>")
+#if defined(_LIBCUDACXX_WARNING)
+    _LIBCUDACXX_WARNING("Use of the header <ext/hash_set> is deprecated.  Migrate to <unordered_set>")
 #else
 #   warning Use of the header <ext/hash_set> is deprecated.  Migrate to <unordered_set>
 #endif
 #endif
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
@@ -220,7 +220,7 @@ namespace __gnu_cxx {
 
 template <class _Value, class _Hash = hash<_Value>, class _Pred = std::equal_to<_Value>,
           class _Alloc = std::allocator<_Value> >
-class _LIBCPP_TEMPLATE_VIS hash_set
+class _LIBCUDACXX_TEMPLATE_VIS hash_set
 {
 public:
     // types
@@ -246,7 +246,7 @@ public:
     typedef typename __table::const_iterator       iterator;
     typedef typename __table::const_iterator       const_iterator;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     hash_set() { }
     explicit hash_set(size_type __n, const hasher& __hf = hasher(),
                            const key_equal& __eql = key_equal());
@@ -264,75 +264,75 @@ public:
                       const allocator_type& __a);
     hash_set(const hash_set& __u);
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     allocator_type get_allocator() const
         {return allocator_type(__table_.__node_alloc());}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool      empty() const {return __table_.size() == 0;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type size() const  {return __table_.size();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type max_size() const {return __table_.max_size();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator       begin()        {return __table_.begin();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator       end()          {return __table_.end();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator begin()  const {return __table_.begin();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator end()    const {return __table_.end();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     std::pair<iterator, bool> insert(const value_type& __x)
         {return __table_.__insert_unique(__x);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator insert(const_iterator, const value_type& __x) {return insert(__x).first;}
     template <class _InputIterator>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         void insert(_InputIterator __first, _InputIterator __last);
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void erase(const_iterator __p) {__table_.erase(__p);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type erase(const key_type& __k) {return __table_.__erase_unique(__k);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void erase(const_iterator __first, const_iterator __last)
         {__table_.erase(__first, __last);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void clear() {__table_.clear();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void swap(hash_set& __u) {__table_.swap(__u.__table_);}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     hasher hash_funct() const {return __table_.hash_function();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     key_equal key_eq() const {return __table_.key_eq();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator       find(const key_type& __k)       {return __table_.find(__k);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator find(const key_type& __k) const {return __table_.find(__k);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type count(const key_type& __k) const {return __table_.__count_unique(__k);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     std::pair<iterator, iterator>             equal_range(const key_type& __k)
         {return __table_.__equal_range_unique(__k);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     std::pair<const_iterator, const_iterator> equal_range(const key_type& __k) const
         {return __table_.__equal_range_unique(__k);}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type bucket_count() const {return __table_.bucket_count();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type max_bucket_count() const {return __table_.max_bucket_count();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type elems_in_bucket(size_type __n) const {return __table_.bucket_size(__n);}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void resize(size_type __n) {__table_.__rehash_unique(__n);}
 };
 
@@ -403,7 +403,7 @@ hash_set<_Value, _Hash, _Pred, _Alloc>::insert(_InputIterator __first,
 }
 
 template <class _Value, class _Hash, class _Pred, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 swap(hash_set<_Value, _Hash, _Pred, _Alloc>& __x,
      hash_set<_Value, _Hash, _Pred, _Alloc>& __y)
@@ -431,7 +431,7 @@ operator==(const hash_set<_Value, _Hash, _Pred, _Alloc>& __x,
 }
 
 template <class _Value, class _Hash, class _Pred, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator!=(const hash_set<_Value, _Hash, _Pred, _Alloc>& __x,
            const hash_set<_Value, _Hash, _Pred, _Alloc>& __y)
@@ -441,7 +441,7 @@ operator!=(const hash_set<_Value, _Hash, _Pred, _Alloc>& __x,
 
 template <class _Value, class _Hash = hash<_Value>, class _Pred = std::equal_to<_Value>,
           class _Alloc = std::allocator<_Value> >
-class _LIBCPP_TEMPLATE_VIS hash_multiset
+class _LIBCUDACXX_TEMPLATE_VIS hash_multiset
 {
 public:
     // types
@@ -467,7 +467,7 @@ public:
     typedef typename __table::const_iterator       iterator;
     typedef typename __table::const_iterator       const_iterator;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     hash_multiset() { }
     explicit hash_multiset(size_type __n, const hasher& __hf = hasher(),
                                 const key_equal& __eql = key_equal());
@@ -485,74 +485,74 @@ public:
                       const key_equal& __eql, const allocator_type& __a);
     hash_multiset(const hash_multiset& __u);
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     allocator_type get_allocator() const
         {return allocator_type(__table_.__node_alloc());}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool      empty() const {return __table_.size() == 0;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type size() const  {return __table_.size();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type max_size() const {return __table_.max_size();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator       begin()        {return __table_.begin();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator       end()          {return __table_.end();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator begin()  const {return __table_.begin();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator end()    const {return __table_.end();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator insert(const value_type& __x) {return __table_.__insert_multi(__x);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator insert(const_iterator, const value_type& __x) {return insert(__x);}
     template <class _InputIterator>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         void insert(_InputIterator __first, _InputIterator __last);
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void erase(const_iterator __p) {__table_.erase(__p);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type erase(const key_type& __k) {return __table_.__erase_multi(__k);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void erase(const_iterator __first, const_iterator __last)
         {__table_.erase(__first, __last);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void clear() {__table_.clear();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void swap(hash_multiset& __u) {__table_.swap(__u.__table_);}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     hasher hash_funct() const {return __table_.hash_function();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     key_equal key_eq() const {return __table_.key_eq();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator       find(const key_type& __k)       {return __table_.find(__k);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator find(const key_type& __k) const {return __table_.find(__k);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type count(const key_type& __k) const {return __table_.__count_multi(__k);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     std::pair<iterator, iterator>             equal_range(const key_type& __k)
         {return __table_.__equal_range_multi(__k);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     std::pair<const_iterator, const_iterator> equal_range(const key_type& __k) const
         {return __table_.__equal_range_multi(__k);}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type bucket_count() const {return __table_.bucket_count();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type max_bucket_count() const {return __table_.max_bucket_count();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type elems_in_bucket(size_type __n) const {return __table_.bucket_size(__n);}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void resize(size_type __n) {__table_.__rehash_multi(__n);}
 };
 
@@ -624,7 +624,7 @@ hash_multiset<_Value, _Hash, _Pred, _Alloc>::insert(_InputIterator __first,
 }
 
 template <class _Value, class _Hash, class _Pred, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 swap(hash_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
      hash_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
@@ -646,9 +646,9 @@ operator==(const hash_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
     {
         _EqRng __xeq = __x.equal_range(*__i);
         _EqRng __yeq = __y.equal_range(*__i);
-        if (_VSTD::distance(__xeq.first, __xeq.second) !=
-            _VSTD::distance(__yeq.first, __yeq.second) ||
-                  !_VSTD::is_permutation(__xeq.first, __xeq.second, __yeq.first))
+        if (_CUDA_VSTD::distance(__xeq.first, __xeq.second) !=
+            _CUDA_VSTD::distance(__yeq.first, __yeq.second) ||
+                  !_CUDA_VSTD::is_permutation(__xeq.first, __xeq.second, __yeq.first))
             return false;
         __i = __xeq.second;
     }
@@ -656,7 +656,7 @@ operator==(const hash_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
 }
 
 template <class _Value, class _Hash, class _Pred, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator!=(const hash_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
            const hash_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
@@ -666,4 +666,4 @@ operator!=(const hash_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
 
 } // namespace __gnu_cxx
 
-#endif // _LIBCPP_HASH_SET
+#endif // _LIBCUDACXX_HASH_SET

diff  --git a/libcxx/include/fenv.h b/libcxx/include/fenv.h
index a9ba6800245b..9464abbfc21a 100644
--- a/libcxx/include/fenv.h
+++ b/libcxx/include/fenv.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_FENV_H
-#define _LIBCPP_FENV_H
+#ifndef _LIBCUDACXX_FENV_H
+#define _LIBCUDACXX_FENV_H
 
 
 /*
@@ -52,7 +52,7 @@ int feupdateenv(const fenv_t* envp);
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
@@ -113,4 +113,4 @@ extern "C++" {
 
 #endif // defined(__cplusplus)
 
-#endif // _LIBCPP_FENV_H
+#endif // _LIBCUDACXX_FENV_H

diff  --git a/libcxx/include/filesystem b/libcxx/include/filesystem
index 87de8861ea42..a9ad774cbea0 100644
--- a/libcxx/include/filesystem
+++ b/libcxx/include/filesystem
@@ -6,8 +6,8 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-#ifndef _LIBCPP_FILESYSTEM
-#define _LIBCPP_FILESYSTEM
+#ifndef _LIBCUDACXX_FILESYSTEM
+#define _LIBCUDACXX_FILESYSTEM
 
 /*
     filesystem synopsis
@@ -262,12 +262,12 @@ inline constexpr bool std::ranges::enable_view<std::filesystem::recursive_direct
 // standard-mandated includes
 #include <compare>
 
-#if defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
+#if defined(_LIBCUDACXX_HAS_NO_FILESYSTEM_LIBRARY)
 # error "The <filesystem> library is not supported since libc++ has been configured without support for a filesystem."
 #endif
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#endif // _LIBCPP_FILESYSTEM
+#endif // _LIBCUDACXX_FILESYSTEM

diff  --git a/libcxx/include/float.h b/libcxx/include/float.h
index 606081251dfb..ecc7621787b4 100644
--- a/libcxx/include/float.h
+++ b/libcxx/include/float.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_FLOAT_H
-#define _LIBCPP_FLOAT_H
+#ifndef _LIBCUDACXX_FLOAT_H
+#define _LIBCUDACXX_FLOAT_H
 
 /*
     float.h synopsis
@@ -72,7 +72,7 @@
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
@@ -90,4 +90,4 @@
 
 #endif // __cplusplus
 
-#endif // _LIBCPP_FLOAT_H
+#endif // _LIBCUDACXX_FLOAT_H

diff  --git a/libcxx/include/format b/libcxx/include/format
index 6b14570bc627..690290eb2e26 100644
--- a/libcxx/include/format
+++ b/libcxx/include/format
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_FORMAT
-#define _LIBCPP_FORMAT
+#ifndef _LIBCUDACXX_FORMAT
+#define _LIBCUDACXX_FORMAT
 
 /*
 
@@ -139,7 +139,7 @@ namespace std {
 // Make sure all feature-test macros are available.
 #include <version>
 // Enable the contents of the header only when libc++ was built with experimental features enabled.
-#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
+#if !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_FORMAT)
 
 #include <__algorithm/clamp.h>
 #include <__config>
@@ -174,17 +174,17 @@ namespace std {
 #include <string_view>
 #include <type_traits>
 
-#ifndef _LIBCPP_HAS_NO_LOCALIZATION
+#ifndef _LIBCUDACXX_HAS_NO_LOCALIZATION
 #include <locale>
 #endif
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 // TODO FMT Move the implementation in this file to its own granular headers.
 
@@ -194,19 +194,19 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 // to do this optimization now.
 
 using format_args = basic_format_args<format_context>;
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 using wformat_args = basic_format_args<wformat_context>;
 #endif
 
 template <class _Context = format_context, class... _Args>
-_LIBCPP_HIDE_FROM_ABI __format_arg_store<_Context, _Args...> make_format_args(_Args&&... __args) {
-  return _VSTD::__format_arg_store<_Context, _Args...>(__args...);
+_LIBCUDACXX_HIDE_FROM_ABI __format_arg_store<_Context, _Args...> make_format_args(_Args&&... __args) {
+  return _CUDA_VSTD::__format_arg_store<_Context, _Args...>(__args...);
 }
 
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 template <class... _Args>
-_LIBCPP_HIDE_FROM_ABI __format_arg_store<wformat_context, _Args...> make_wformat_args(_Args&&... __args) {
-  return _VSTD::__format_arg_store<wformat_context, _Args...>(__args...);
+_LIBCUDACXX_HIDE_FROM_ABI __format_arg_store<wformat_context, _Args...> make_wformat_args(_Args&&... __args) {
+  return _CUDA_VSTD::__format_arg_store<wformat_context, _Args...>(__args...);
 }
 #endif
 
@@ -217,13 +217,13 @@ namespace __format {
 /// When parsing a handle which is not enabled the code is ill-formed.
 /// This helper uses the parser of the appropriate formatter for the stored type.
 template <class _CharT>
-class _LIBCPP_TEMPLATE_VIS __compile_time_handle {
+class _LIBCUDACXX_TEMPLATE_VIS __compile_time_handle {
 public:
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr void __parse(basic_format_parse_context<_CharT>& __parse_ctx) const { __parse_(__parse_ctx); }
 
   template <class _Tp>
-  _LIBCPP_HIDE_FROM_ABI constexpr void __enable() {
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr void __enable() {
     __parse_ = [](basic_format_parse_context<_CharT>& __parse_ctx) {
       formatter<_Tp, _CharT> __f;
       __parse_ctx.advance_to(__f.parse(__parse_ctx));
@@ -232,7 +232,7 @@ public:
 
   // Before calling __parse the proper handler needs to be set with __enable.
   // The default handler isn't a core constant expression.
-  _LIBCPP_HIDE_FROM_ABI constexpr __compile_time_handle()
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr __compile_time_handle()
       : __parse_([](basic_format_parse_context<_CharT>&) { __throw_format_error("Not a handle"); }) {}
 
 private:
@@ -242,36 +242,36 @@ private:
 // Dummy format_context only providing the parts used during constant
 // validation of the basic_format_string.
 template <class _CharT>
-struct _LIBCPP_TEMPLATE_VIS __compile_time_basic_format_context {
+struct _LIBCUDACXX_TEMPLATE_VIS __compile_time_basic_format_context {
 public:
   using char_type = _CharT;
 
-  _LIBCPP_HIDE_FROM_ABI constexpr explicit __compile_time_basic_format_context(
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit __compile_time_basic_format_context(
       const __arg_t* __args, const __compile_time_handle<_CharT>* __handles, size_t __size)
       : __args_(__args), __handles_(__handles), __size_(__size) {}
 
   // During the compile-time validation nothing needs to be written.
   // Therefore all operations of this iterator are a NOP.
   struct iterator {
-    _LIBCPP_HIDE_FROM_ABI constexpr iterator& operator=(_CharT) { return *this; }
-    _LIBCPP_HIDE_FROM_ABI constexpr iterator& operator*() { return *this; }
-    _LIBCPP_HIDE_FROM_ABI constexpr iterator operator++(int) { return *this; }
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr iterator& operator=(_CharT) { return *this; }
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr iterator& operator*() { return *this; }
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr iterator operator++(int) { return *this; }
   };
 
-  _LIBCPP_HIDE_FROM_ABI constexpr __arg_t arg(size_t __id) const {
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr __arg_t arg(size_t __id) const {
     if (__id >= __size_)
       __throw_format_error("Argument index out of bounds");
     return __args_[__id];
   }
 
-  _LIBCPP_HIDE_FROM_ABI constexpr const __compile_time_handle<_CharT>& __handle(size_t __id) const {
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr const __compile_time_handle<_CharT>& __handle(size_t __id) const {
     if (__id >= __size_)
       __throw_format_error("Argument index out of bounds");
     return __handles_[__id];
   }
 
-  _LIBCPP_HIDE_FROM_ABI constexpr iterator out() { return {}; }
-  _LIBCPP_HIDE_FROM_ABI constexpr void advance_to(iterator) {}
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr iterator out() { return {}; }
+  _LIBCUDACXX_HIDE_FROM_ABI constexpr void advance_to(iterator) {}
 
 private:
   const __arg_t* __args_;
@@ -279,7 +279,7 @@ private:
   size_t __size_;
 };
 
-_LIBCPP_HIDE_FROM_ABI
+_LIBCUDACXX_HIDE_FROM_ABI
 constexpr void __compile_time_validate_integral(__arg_t __type) {
   switch (__type) {
   case __arg_t::__int:
@@ -297,7 +297,7 @@ constexpr void __compile_time_validate_integral(__arg_t __type) {
 
 // _HasPrecision does the formatter have a precision?
 template <class _CharT, class _Tp, bool _HasPrecision = false>
-_LIBCPP_HIDE_FROM_ABI constexpr void
+_LIBCUDACXX_HIDE_FROM_ABI constexpr void
 __compile_time_validate_argument(basic_format_parse_context<_CharT>& __parse_ctx,
                                  __compile_time_basic_format_context<_CharT>& __ctx) {
   formatter<_Tp, _CharT> __formatter;
@@ -327,7 +327,7 @@ __compile_time_validate_argument(basic_format_parse_context<_CharT>& __parse_ctx
 }
 
 template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI constexpr void __compile_time_visit_format_arg(basic_format_parse_context<_CharT>& __parse_ctx,
+_LIBCUDACXX_HIDE_FROM_ABI constexpr void __compile_time_visit_format_arg(basic_format_parse_context<_CharT>& __parse_ctx,
                                                                      __compile_time_basic_format_context<_CharT>& __ctx,
                                                                      __arg_t __type) {
   switch (__type) {
@@ -342,7 +342,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr void __compile_time_visit_format_arg(basic_forma
   case __arg_t::__long_long:
     return __format::__compile_time_validate_argument<_CharT, long long>(__parse_ctx, __ctx);
   case __arg_t::__i128:
-#      ifndef _LIBCPP_HAS_NO_INT128
+#      ifndef _LIBCUDACXX_HAS_NO_INT128
     return __format::__compile_time_validate_argument<_CharT, __int128_t>(__parse_ctx, __ctx);
 #      else
     __throw_format_error("Invalid argument");
@@ -353,7 +353,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr void __compile_time_visit_format_arg(basic_forma
   case __arg_t::__unsigned_long_long:
     return __format::__compile_time_validate_argument<_CharT, unsigned long long>(__parse_ctx, __ctx);
   case __arg_t::__u128:
-#      ifndef _LIBCPP_HAS_NO_INT128
+#      ifndef _LIBCUDACXX_HAS_NO_INT128
     return __format::__compile_time_validate_argument<_CharT, __uint128_t>(__parse_ctx, __ctx);
 #      else
     __throw_format_error("Invalid argument");
@@ -378,7 +378,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr void __compile_time_visit_format_arg(basic_forma
 }
 
 template <class _CharT, class _ParseCtx, class _Ctx>
-_LIBCPP_HIDE_FROM_ABI constexpr const _CharT*
+_LIBCUDACXX_HIDE_FROM_ABI constexpr const _CharT*
 __handle_replacement_field(const _CharT* __begin, const _CharT* __end,
                            _ParseCtx& __parse_ctx, _Ctx& __ctx) {
   __format::__parse_number_result __r =
@@ -406,7 +406,7 @@ __handle_replacement_field(const _CharT* __begin, const _CharT* __end,
     else
         __format::__compile_time_visit_format_arg(__parse_ctx, __ctx, __type);
   } else
-    _VSTD::visit_format_arg(
+    _CUDA_VSTD::visit_format_arg(
         [&](auto __arg) {
           if constexpr (same_as<decltype(__arg), monostate>)
             __throw_format_error("Argument index out of bounds");
@@ -429,7 +429,7 @@ __handle_replacement_field(const _CharT* __begin, const _CharT* __end,
 }
 
 template <class _ParseCtx, class _Ctx>
-_LIBCPP_HIDE_FROM_ABI constexpr typename _Ctx::iterator
+_LIBCUDACXX_HIDE_FROM_ABI constexpr typename _Ctx::iterator
 __vformat_to(_ParseCtx&& __parse_ctx, _Ctx&& __ctx) {
   using _CharT = typename _ParseCtx::char_type;
   static_assert(same_as<typename _Ctx::char_type, _CharT>);
@@ -445,7 +445,7 @@ __vformat_to(_ParseCtx&& __parse_ctx, _Ctx&& __ctx) {
         __throw_format_error("The format string terminates at a '{'");
 
       if (*__begin != _CharT('{')) [[likely]] {
-        __ctx.advance_to(_VSTD::move(__out_it));
+        __ctx.advance_to(_CUDA_VSTD::move(__out_it));
         __begin =
             __handle_replacement_field(__begin, __end, __parse_ctx, __ctx);
         __out_it = __ctx.out();
@@ -475,7 +475,7 @@ __vformat_to(_ParseCtx&& __parse_ctx, _Ctx&& __ctx) {
 } // namespace __format
 
 template <class _CharT, class... _Args>
-struct _LIBCPP_TEMPLATE_VIS basic_format_string {
+struct _LIBCUDACXX_TEMPLATE_VIS basic_format_string {
   template <class _Tp>
     requires convertible_to<const _Tp&, basic_string_view<_CharT>>
   consteval basic_format_string(const _Tp& __str) : __str_{__str} {
@@ -483,7 +483,7 @@ struct _LIBCPP_TEMPLATE_VIS basic_format_string {
                            _Context{__types_.data(), __handles_.data(), sizeof...(_Args)});
   }
 
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT constexpr basic_string_view<_CharT> get() const noexcept {
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_AVAILABILITY_FORMAT constexpr basic_string_view<_CharT> get() const noexcept {
     return __str_;
   }
 
@@ -496,7 +496,7 @@ private:
       __format::__determine_arg_t<_Context, remove_cvref_t<_Args>>()...};
 
   // TODO FMT remove this work-around when the AIX ICE has been resolved.
-#    if defined(_AIX) && defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER < 1400
+#    if defined(_AIX) && defined(_LIBCUDACXX_CLANG_VER) && _LIBCUDACXX_CLANG_VER < 1400
   template <class _Tp>
   static constexpr __format::__compile_time_handle<_CharT> __get_handle() {
     __format::__compile_time_handle<_CharT> __handle;
@@ -523,287 +523,287 @@ private:
 template <class... _Args>
 using format_string = basic_format_string<char, type_identity_t<_Args>...>;
 
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 template <class... _Args>
 using wformat_string = basic_format_string<wchar_t, type_identity_t<_Args>...>;
 #endif
 
 template <class _OutIt, class _CharT, class _FormatOutIt>
-requires(output_iterator<_OutIt, const _CharT&>) _LIBCPP_HIDE_FROM_ABI _OutIt
+requires(output_iterator<_OutIt, const _CharT&>) _LIBCUDACXX_HIDE_FROM_ABI _OutIt
     __vformat_to(
         _OutIt __out_it, basic_string_view<_CharT> __fmt,
         basic_format_args<basic_format_context<_FormatOutIt, _CharT>> __args) {
   if constexpr (same_as<_OutIt, _FormatOutIt>)
-    return _VSTD::__format::__vformat_to(
+    return _CUDA_VSTD::__format::__vformat_to(
         basic_format_parse_context{__fmt, __args.__size()},
-        _VSTD::__format_context_create(_VSTD::move(__out_it), __args));
+        _CUDA_VSTD::__format_context_create(_CUDA_VSTD::move(__out_it), __args));
   else {
-    __format::__format_buffer<_OutIt, _CharT> __buffer{_VSTD::move(__out_it)};
-    _VSTD::__format::__vformat_to(
+    __format::__format_buffer<_OutIt, _CharT> __buffer{_CUDA_VSTD::move(__out_it)};
+    _CUDA_VSTD::__format::__vformat_to(
         basic_format_parse_context{__fmt, __args.__size()},
-        _VSTD::__format_context_create(__buffer.make_output_iterator(),
+        _CUDA_VSTD::__format_context_create(__buffer.make_output_iterator(),
                                        __args));
-    return _VSTD::move(__buffer).out();
+    return _CUDA_VSTD::move(__buffer).out();
   }
 }
 
-// The function is _LIBCPP_ALWAYS_INLINE since the compiler is bad at inlining
+// The function is _LIBCUDACXX_ALWAYS_INLINE since the compiler is bad at inlining
 // https://reviews.llvm.org/D110499#inline-1180704
 // TODO FMT Evaluate whether we want to file a Clang bug report regarding this.
 template <output_iterator<const char&> _OutIt>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt
+_LIBCUDACXX_ALWAYS_INLINE _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_AVAILABILITY_FORMAT _OutIt
 vformat_to(_OutIt __out_it, string_view __fmt, format_args __args) {
-  return _VSTD::__vformat_to(_VSTD::move(__out_it), __fmt, __args);
+  return _CUDA_VSTD::__vformat_to(_CUDA_VSTD::move(__out_it), __fmt, __args);
 }
 
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 template <output_iterator<const wchar_t&> _OutIt>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt
+_LIBCUDACXX_ALWAYS_INLINE _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_AVAILABILITY_FORMAT _OutIt
 vformat_to(_OutIt __out_it, wstring_view __fmt, wformat_args __args) {
-  return _VSTD::__vformat_to(_VSTD::move(__out_it), __fmt, __args);
+  return _CUDA_VSTD::__vformat_to(_CUDA_VSTD::move(__out_it), __fmt, __args);
 }
 #endif
 
 template <output_iterator<const char&> _OutIt, class... _Args>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt
+_LIBCUDACXX_ALWAYS_INLINE _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_AVAILABILITY_FORMAT _OutIt
 format_to(_OutIt __out_it, format_string<_Args...> __fmt, _Args&&... __args) {
-  return _VSTD::vformat_to(_VSTD::move(__out_it), __fmt.get(),
-                           _VSTD::make_format_args(__args...));
+  return _CUDA_VSTD::vformat_to(_CUDA_VSTD::move(__out_it), __fmt.get(),
+                           _CUDA_VSTD::make_format_args(__args...));
 }
 
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 template <output_iterator<const wchar_t&> _OutIt, class... _Args>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt
+_LIBCUDACXX_ALWAYS_INLINE _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_AVAILABILITY_FORMAT _OutIt
 format_to(_OutIt __out_it, wformat_string<_Args...> __fmt, _Args&&... __args) {
-  return _VSTD::vformat_to(_VSTD::move(__out_it), __fmt.get(),
-                           _VSTD::make_wformat_args(__args...));
+  return _CUDA_VSTD::vformat_to(_CUDA_VSTD::move(__out_it), __fmt.get(),
+                           _CUDA_VSTD::make_wformat_args(__args...));
 }
 #endif
 
-_LIBCPP_ALWAYS_INLINE inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT string
+_LIBCUDACXX_ALWAYS_INLINE inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_AVAILABILITY_FORMAT string
 vformat(string_view __fmt, format_args __args) {
   string __res;
-  _VSTD::vformat_to(_VSTD::back_inserter(__res), __fmt, __args);
+  _CUDA_VSTD::vformat_to(_CUDA_VSTD::back_inserter(__res), __fmt, __args);
   return __res;
 }
 
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-_LIBCPP_ALWAYS_INLINE inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT wstring
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
+_LIBCUDACXX_ALWAYS_INLINE inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_AVAILABILITY_FORMAT wstring
 vformat(wstring_view __fmt, wformat_args __args) {
   wstring __res;
-  _VSTD::vformat_to(_VSTD::back_inserter(__res), __fmt, __args);
+  _CUDA_VSTD::vformat_to(_CUDA_VSTD::back_inserter(__res), __fmt, __args);
   return __res;
 }
 #endif
 
 template <class... _Args>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT string format(format_string<_Args...> __fmt,
+_LIBCUDACXX_ALWAYS_INLINE _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_AVAILABILITY_FORMAT string format(format_string<_Args...> __fmt,
                                                                                       _Args&&... __args) {
-  return _VSTD::vformat(__fmt.get(), _VSTD::make_format_args(__args...));
+  return _CUDA_VSTD::vformat(__fmt.get(), _CUDA_VSTD::make_format_args(__args...));
 }
 
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 template <class... _Args>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT wstring
+_LIBCUDACXX_ALWAYS_INLINE _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_AVAILABILITY_FORMAT wstring
 format(wformat_string<_Args...> __fmt, _Args&&... __args) {
-  return _VSTD::vformat(__fmt.get(), _VSTD::make_wformat_args(__args...));
+  return _CUDA_VSTD::vformat(__fmt.get(), _CUDA_VSTD::make_wformat_args(__args...));
 }
 #endif
 
 template <class _Context, class _OutIt, class _CharT>
-_LIBCPP_HIDE_FROM_ABI format_to_n_result<_OutIt> __vformat_to_n(_OutIt __out_it, iter_
diff erence_t<_OutIt> __n,
+_LIBCUDACXX_HIDE_FROM_ABI format_to_n_result<_OutIt> __vformat_to_n(_OutIt __out_it, iter_
diff erence_t<_OutIt> __n,
                                                                 basic_string_view<_CharT> __fmt,
                                                                 basic_format_args<_Context> __args) {
-  __format::__format_to_n_buffer<_OutIt, _CharT> __buffer{_VSTD::move(__out_it), __n};
-  _VSTD::__format::__vformat_to(basic_format_parse_context{__fmt, __args.__size()},
-                                _VSTD::__format_context_create(__buffer.make_output_iterator(), __args));
-  return _VSTD::move(__buffer).result();
+  __format::__format_to_n_buffer<_OutIt, _CharT> __buffer{_CUDA_VSTD::move(__out_it), __n};
+  _CUDA_VSTD::__format::__vformat_to(basic_format_parse_context{__fmt, __args.__size()},
+                                _CUDA_VSTD::__format_context_create(__buffer.make_output_iterator(), __args));
+  return _CUDA_VSTD::move(__buffer).result();
 }
 
 template <output_iterator<const char&> _OutIt, class... _Args>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT format_to_n_result<_OutIt>
+_LIBCUDACXX_ALWAYS_INLINE _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_AVAILABILITY_FORMAT format_to_n_result<_OutIt>
 format_to_n(_OutIt __out_it, iter_
diff erence_t<_OutIt> __n, format_string<_Args...> __fmt, _Args&&... __args) {
-  return _VSTD::__vformat_to_n<format_context>(_VSTD::move(__out_it), __n, __fmt.get(), _VSTD::make_format_args(__args...));
+  return _CUDA_VSTD::__vformat_to_n<format_context>(_CUDA_VSTD::move(__out_it), __n, __fmt.get(), _CUDA_VSTD::make_format_args(__args...));
 }
 
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 template <output_iterator<const wchar_t&> _OutIt, class... _Args>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT format_to_n_result<_OutIt>
+_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_AVAILABILITY_FORMAT format_to_n_result<_OutIt>
 format_to_n(_OutIt __out_it, iter_
diff erence_t<_OutIt> __n, wformat_string<_Args...> __fmt,
             _Args&&... __args) {
-  return _VSTD::__vformat_to_n<wformat_context>(_VSTD::move(__out_it), __n, __fmt.get(), _VSTD::make_wformat_args(__args...));
+  return _CUDA_VSTD::__vformat_to_n<wformat_context>(_CUDA_VSTD::move(__out_it), __n, __fmt.get(), _CUDA_VSTD::make_wformat_args(__args...));
 }
 #endif
 
 template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI size_t __vformatted_size(basic_string_view<_CharT> __fmt, auto __args) {
+_LIBCUDACXX_HIDE_FROM_ABI size_t __vformatted_size(basic_string_view<_CharT> __fmt, auto __args) {
   __format::__formatted_size_buffer<_CharT> __buffer;
-  _VSTD::__format::__vformat_to(basic_format_parse_context{__fmt, __args.__size()},
-                                _VSTD::__format_context_create(__buffer.make_output_iterator(), __args));
-  return _VSTD::move(__buffer).result();
+  _CUDA_VSTD::__format::__vformat_to(basic_format_parse_context{__fmt, __args.__size()},
+                                _CUDA_VSTD::__format_context_create(__buffer.make_output_iterator(), __args));
+  return _CUDA_VSTD::move(__buffer).result();
 }
 
 template <class... _Args>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT size_t
+_LIBCUDACXX_ALWAYS_INLINE _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_AVAILABILITY_FORMAT size_t
 formatted_size(format_string<_Args...> __fmt, _Args&&... __args) {
-  return _VSTD::__vformatted_size(__fmt.get(), basic_format_args{_VSTD::make_format_args(__args...)});
+  return _CUDA_VSTD::__vformatted_size(__fmt.get(), basic_format_args{_CUDA_VSTD::make_format_args(__args...)});
 }
 
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 template <class... _Args>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT size_t
+_LIBCUDACXX_ALWAYS_INLINE _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_AVAILABILITY_FORMAT size_t
 formatted_size(wformat_string<_Args...> __fmt, _Args&&... __args) {
-  return _VSTD::__vformatted_size(__fmt.get(), basic_format_args{_VSTD::make_wformat_args(__args...)});
+  return _CUDA_VSTD::__vformatted_size(__fmt.get(), basic_format_args{_CUDA_VSTD::make_wformat_args(__args...)});
 }
 #endif
 
-#ifndef _LIBCPP_HAS_NO_LOCALIZATION
+#ifndef _LIBCUDACXX_HAS_NO_LOCALIZATION
 
 template <class _OutIt, class _CharT, class _FormatOutIt>
-requires(output_iterator<_OutIt, const _CharT&>) _LIBCPP_HIDE_FROM_ABI _OutIt
+requires(output_iterator<_OutIt, const _CharT&>) _LIBCUDACXX_HIDE_FROM_ABI _OutIt
     __vformat_to(
         _OutIt __out_it, locale __loc, basic_string_view<_CharT> __fmt,
         basic_format_args<basic_format_context<_FormatOutIt, _CharT>> __args) {
   if constexpr (same_as<_OutIt, _FormatOutIt>)
-    return _VSTD::__format::__vformat_to(
+    return _CUDA_VSTD::__format::__vformat_to(
         basic_format_parse_context{__fmt, __args.__size()},
-        _VSTD::__format_context_create(_VSTD::move(__out_it), __args,
-                                       _VSTD::move(__loc)));
+        _CUDA_VSTD::__format_context_create(_CUDA_VSTD::move(__out_it), __args,
+                                       _CUDA_VSTD::move(__loc)));
   else {
-    __format::__format_buffer<_OutIt, _CharT> __buffer{_VSTD::move(__out_it)};
-    _VSTD::__format::__vformat_to(
+    __format::__format_buffer<_OutIt, _CharT> __buffer{_CUDA_VSTD::move(__out_it)};
+    _CUDA_VSTD::__format::__vformat_to(
         basic_format_parse_context{__fmt, __args.__size()},
-        _VSTD::__format_context_create(__buffer.make_output_iterator(),
-                                       __args, _VSTD::move(__loc)));
-    return _VSTD::move(__buffer).out();
+        _CUDA_VSTD::__format_context_create(__buffer.make_output_iterator(),
+                                       __args, _CUDA_VSTD::move(__loc)));
+    return _CUDA_VSTD::move(__buffer).out();
   }
 }
 
 template <output_iterator<const char&> _OutIt>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt vformat_to(
+_LIBCUDACXX_ALWAYS_INLINE _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_AVAILABILITY_FORMAT _OutIt vformat_to(
     _OutIt __out_it, locale __loc, string_view __fmt, format_args __args) {
-  return _VSTD::__vformat_to(_VSTD::move(__out_it), _VSTD::move(__loc), __fmt,
+  return _CUDA_VSTD::__vformat_to(_CUDA_VSTD::move(__out_it), _CUDA_VSTD::move(__loc), __fmt,
                              __args);
 }
 
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 template <output_iterator<const wchar_t&> _OutIt>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt vformat_to(
+_LIBCUDACXX_ALWAYS_INLINE _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_AVAILABILITY_FORMAT _OutIt vformat_to(
     _OutIt __out_it, locale __loc, wstring_view __fmt, wformat_args __args) {
-  return _VSTD::__vformat_to(_VSTD::move(__out_it), _VSTD::move(__loc), __fmt,
+  return _CUDA_VSTD::__vformat_to(_CUDA_VSTD::move(__out_it), _CUDA_VSTD::move(__loc), __fmt,
                              __args);
 }
 #endif
 
 template <output_iterator<const char&> _OutIt, class... _Args>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt
+_LIBCUDACXX_ALWAYS_INLINE _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_AVAILABILITY_FORMAT _OutIt
 format_to(_OutIt __out_it, locale __loc, format_string<_Args...> __fmt, _Args&&... __args) {
-  return _VSTD::vformat_to(_VSTD::move(__out_it), _VSTD::move(__loc), __fmt.get(),
-                           _VSTD::make_format_args(__args...));
+  return _CUDA_VSTD::vformat_to(_CUDA_VSTD::move(__out_it), _CUDA_VSTD::move(__loc), __fmt.get(),
+                           _CUDA_VSTD::make_format_args(__args...));
 }
 
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 template <output_iterator<const wchar_t&> _OutIt, class... _Args>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt
+_LIBCUDACXX_ALWAYS_INLINE _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_AVAILABILITY_FORMAT _OutIt
 format_to(_OutIt __out_it, locale __loc, wformat_string<_Args...> __fmt, _Args&&... __args) {
-  return _VSTD::vformat_to(_VSTD::move(__out_it), _VSTD::move(__loc), __fmt.get(),
-                           _VSTD::make_wformat_args(__args...));
+  return _CUDA_VSTD::vformat_to(_CUDA_VSTD::move(__out_it), _CUDA_VSTD::move(__loc), __fmt.get(),
+                           _CUDA_VSTD::make_wformat_args(__args...));
 }
 #endif
 
-_LIBCPP_ALWAYS_INLINE inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT string
+_LIBCUDACXX_ALWAYS_INLINE inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_AVAILABILITY_FORMAT string
 vformat(locale __loc, string_view __fmt, format_args __args) {
   string __res;
-  _VSTD::vformat_to(_VSTD::back_inserter(__res), _VSTD::move(__loc), __fmt,
+  _CUDA_VSTD::vformat_to(_CUDA_VSTD::back_inserter(__res), _CUDA_VSTD::move(__loc), __fmt,
                     __args);
   return __res;
 }
 
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-_LIBCPP_ALWAYS_INLINE inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT wstring
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
+_LIBCUDACXX_ALWAYS_INLINE inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_AVAILABILITY_FORMAT wstring
 vformat(locale __loc, wstring_view __fmt, wformat_args __args) {
   wstring __res;
-  _VSTD::vformat_to(_VSTD::back_inserter(__res), _VSTD::move(__loc), __fmt,
+  _CUDA_VSTD::vformat_to(_CUDA_VSTD::back_inserter(__res), _CUDA_VSTD::move(__loc), __fmt,
                     __args);
   return __res;
 }
 #endif
 
 template <class... _Args>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT string format(locale __loc,
+_LIBCUDACXX_ALWAYS_INLINE _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_AVAILABILITY_FORMAT string format(locale __loc,
                                                                                       format_string<_Args...> __fmt,
                                                                                       _Args&&... __args) {
-  return _VSTD::vformat(_VSTD::move(__loc), __fmt.get(),
-                        _VSTD::make_format_args(__args...));
+  return _CUDA_VSTD::vformat(_CUDA_VSTD::move(__loc), __fmt.get(),
+                        _CUDA_VSTD::make_format_args(__args...));
 }
 
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 template <class... _Args>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT wstring
+_LIBCUDACXX_ALWAYS_INLINE _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_AVAILABILITY_FORMAT wstring
 format(locale __loc, wformat_string<_Args...> __fmt, _Args&&... __args) {
-  return _VSTD::vformat(_VSTD::move(__loc), __fmt.get(),
-                        _VSTD::make_wformat_args(__args...));
+  return _CUDA_VSTD::vformat(_CUDA_VSTD::move(__loc), __fmt.get(),
+                        _CUDA_VSTD::make_wformat_args(__args...));
 }
 #endif
 
 template <class _Context, class _OutIt, class _CharT>
-_LIBCPP_HIDE_FROM_ABI format_to_n_result<_OutIt> __vformat_to_n(_OutIt __out_it, iter_
diff erence_t<_OutIt> __n,
+_LIBCUDACXX_HIDE_FROM_ABI format_to_n_result<_OutIt> __vformat_to_n(_OutIt __out_it, iter_
diff erence_t<_OutIt> __n,
                                                                 locale __loc, basic_string_view<_CharT> __fmt,
                                                                 basic_format_args<_Context> __args) {
-  __format::__format_to_n_buffer<_OutIt, _CharT> __buffer{_VSTD::move(__out_it), __n};
-  _VSTD::__format::__vformat_to(
+  __format::__format_to_n_buffer<_OutIt, _CharT> __buffer{_CUDA_VSTD::move(__out_it), __n};
+  _CUDA_VSTD::__format::__vformat_to(
       basic_format_parse_context{__fmt, __args.__size()},
-      _VSTD::__format_context_create(__buffer.make_output_iterator(), __args, _VSTD::move(__loc)));
-  return _VSTD::move(__buffer).result();
+      _CUDA_VSTD::__format_context_create(__buffer.make_output_iterator(), __args, _CUDA_VSTD::move(__loc)));
+  return _CUDA_VSTD::move(__buffer).result();
 }
 
 template <output_iterator<const char&> _OutIt, class... _Args>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT format_to_n_result<_OutIt>
+_LIBCUDACXX_ALWAYS_INLINE _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_AVAILABILITY_FORMAT format_to_n_result<_OutIt>
 format_to_n(_OutIt __out_it, iter_
diff erence_t<_OutIt> __n, locale __loc, format_string<_Args...> __fmt,
             _Args&&... __args) {
-  return _VSTD::__vformat_to_n<format_context>(_VSTD::move(__out_it), __n, _VSTD::move(__loc), __fmt.get(),
-                                               _VSTD::make_format_args(__args...));
+  return _CUDA_VSTD::__vformat_to_n<format_context>(_CUDA_VSTD::move(__out_it), __n, _CUDA_VSTD::move(__loc), __fmt.get(),
+                                               _CUDA_VSTD::make_format_args(__args...));
 }
 
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 template <output_iterator<const wchar_t&> _OutIt, class... _Args>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT format_to_n_result<_OutIt>
+_LIBCUDACXX_ALWAYS_INLINE _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_AVAILABILITY_FORMAT format_to_n_result<_OutIt>
 format_to_n(_OutIt __out_it, iter_
diff erence_t<_OutIt> __n, locale __loc, wformat_string<_Args...> __fmt,
             _Args&&... __args) {
-  return _VSTD::__vformat_to_n<wformat_context>(_VSTD::move(__out_it), __n, _VSTD::move(__loc), __fmt.get(),
-                                                _VSTD::make_wformat_args(__args...));
+  return _CUDA_VSTD::__vformat_to_n<wformat_context>(_CUDA_VSTD::move(__out_it), __n, _CUDA_VSTD::move(__loc), __fmt.get(),
+                                                _CUDA_VSTD::make_wformat_args(__args...));
 }
 #endif
 
 template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI size_t __vformatted_size(locale __loc, basic_string_view<_CharT> __fmt, auto __args) {
+_LIBCUDACXX_HIDE_FROM_ABI size_t __vformatted_size(locale __loc, basic_string_view<_CharT> __fmt, auto __args) {
   __format::__formatted_size_buffer<_CharT> __buffer;
-  _VSTD::__format::__vformat_to(
+  _CUDA_VSTD::__format::__vformat_to(
       basic_format_parse_context{__fmt, __args.__size()},
-      _VSTD::__format_context_create(__buffer.make_output_iterator(), __args, _VSTD::move(__loc)));
-  return _VSTD::move(__buffer).result();
+      _CUDA_VSTD::__format_context_create(__buffer.make_output_iterator(), __args, _CUDA_VSTD::move(__loc)));
+  return _CUDA_VSTD::move(__buffer).result();
 }
 
 template <class... _Args>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT size_t
+_LIBCUDACXX_ALWAYS_INLINE _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_AVAILABILITY_FORMAT size_t
 formatted_size(locale __loc, format_string<_Args...> __fmt, _Args&&... __args) {
-  return _VSTD::__vformatted_size(_VSTD::move(__loc), __fmt.get(), basic_format_args{_VSTD::make_format_args(__args...)});
+  return _CUDA_VSTD::__vformatted_size(_CUDA_VSTD::move(__loc), __fmt.get(), basic_format_args{_CUDA_VSTD::make_format_args(__args...)});
 }
 
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 template <class... _Args>
-_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT size_t
+_LIBCUDACXX_ALWAYS_INLINE _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_AVAILABILITY_FORMAT size_t
 formatted_size(locale __loc, wformat_string<_Args...> __fmt, _Args&&... __args) {
-  return _VSTD::__vformatted_size(_VSTD::move(__loc), __fmt.get(), basic_format_args{_VSTD::make_wformat_args(__args...)});
+  return _CUDA_VSTD::__vformatted_size(_CUDA_VSTD::move(__loc), __fmt.get(), basic_format_args{_CUDA_VSTD::make_wformat_args(__args...)});
 }
 #endif
 
-#endif // _LIBCPP_HAS_NO_LOCALIZATION
+#endif // _LIBCUDACXX_HAS_NO_LOCALIZATION
 
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
+#endif // !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_FORMAT)
 
-#endif // _LIBCPP_FORMAT
+#endif // _LIBCUDACXX_FORMAT

diff  --git a/libcxx/include/forward_list b/libcxx/include/forward_list
index ee90aaa4771f..d8c3891342a7 100644
--- a/libcxx/include/forward_list
+++ b/libcxx/include/forward_list
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_FORWARD_LIST
-#define _LIBCPP_FORWARD_LIST
+#ifndef _LIBCUDACXX_FORWARD_LIST
+#define _LIBCUDACXX_FORWARD_LIST
 
 /*
     forward_list synopsis
@@ -195,7 +195,7 @@ template <class T, class Allocator, class Predicate>
 #include <type_traits>
 #include <version>
 
-#ifndef _LIBCPP_REMOVE_TRANSITIVE_INCLUDES
+#ifndef _LIBCUDACXX_REMOVE_TRANSITIVE_INCLUDES
 #  include <algorithm>
 #  include <functional>
 #  include <iterator>
@@ -214,15 +214,15 @@ template <class T, class Allocator, class Predicate>
 #include <compare>
 #include <initializer_list>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Tp, class _VoidPtr> struct __forward_list_node;
 template <class _NodePtr> struct __forward_begin_node;
@@ -248,7 +248,7 @@ struct __forward_node_traits {
                                                                 __begin_node_pointer;
   typedef typename __rebind_pointer<_NodePtr, void>::type       __void_pointer;
 
-#if defined(_LIBCPP_ABI_FORWARD_LIST_REMOVE_NODE_POINTER_UB)
+#if defined(_LIBCUDACXX_ABI_FORWARD_LIST_REMOVE_NODE_POINTER_UB)
   typedef __begin_node_pointer __iter_node_pointer;
 #else
   typedef typename conditional<
@@ -264,11 +264,11 @@ struct __forward_node_traits {
           __node_pointer
     >::type __non_iter_node_pointer;
 
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   static __iter_node_pointer __as_iter_node(__iter_node_pointer __p) {
       return __p;
   }
-  _LIBCPP_INLINE_VISIBILITY
+  _LIBCUDACXX_INLINE_VISIBILITY
   static __iter_node_pointer __as_iter_node(__non_iter_node_pointer __p) {
       return static_cast<__iter_node_pointer>(static_cast<__void_pointer>(__p));
   }
@@ -282,16 +282,16 @@ struct __forward_begin_node
 
     pointer __next_;
 
-    _LIBCPP_INLINE_VISIBILITY __forward_begin_node() : __next_(nullptr) {}
+    _LIBCUDACXX_INLINE_VISIBILITY __forward_begin_node() : __next_(nullptr) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __begin_node_pointer __next_as_begin() const {
         return static_cast<__begin_node_pointer>(__next_);
     }
 };
 
 template <class _Tp, class _VoidPtr>
-struct _LIBCPP_HIDDEN __begin_node_of
+struct _LIBCUDACXX_HIDDEN __begin_node_of
 {
     typedef __forward_begin_node<
         typename __rebind_pointer<_VoidPtr, __forward_list_node<_Tp, _VoidPtr> >::type
@@ -299,7 +299,7 @@ struct _LIBCPP_HIDDEN __begin_node_of
 };
 
 template <class _Tp, class _VoidPtr>
-struct _LIBCPP_STANDALONE_DEBUG __forward_list_node
+struct _LIBCUDACXX_STANDALONE_DEBUG __forward_list_node
     : public __begin_node_of<_Tp, _VoidPtr>::type
 {
     typedef _Tp value_type;
@@ -308,11 +308,11 @@ struct _LIBCPP_STANDALONE_DEBUG __forward_list_node
 };
 
 
-template <class _Tp, class _Alloc = allocator<_Tp> > class _LIBCPP_TEMPLATE_VIS forward_list;
-template<class _NodeConstPtr> class _LIBCPP_TEMPLATE_VIS __forward_list_const_iterator;
+template <class _Tp, class _Alloc = allocator<_Tp> > class _LIBCUDACXX_TEMPLATE_VIS forward_list;
+template<class _NodeConstPtr> class _LIBCUDACXX_TEMPLATE_VIS __forward_list_const_iterator;
 
 template <class _NodePtr>
-class _LIBCPP_TEMPLATE_VIS __forward_list_iterator
+class _LIBCUDACXX_TEMPLATE_VIS __forward_list_iterator
 {
     typedef __forward_node_traits<_NodePtr>         __traits;
     typedef typename __traits::__node_pointer       __node_pointer;
@@ -322,30 +322,30 @@ class _LIBCPP_TEMPLATE_VIS __forward_list_iterator
 
     __iter_node_pointer __ptr_;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __begin_node_pointer __get_begin() const {
         return static_cast<__begin_node_pointer>(
                 static_cast<__void_pointer>(__ptr_));
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __node_pointer __get_unsafe_node_pointer() const {
         return static_cast<__node_pointer>(
                 static_cast<__void_pointer>(__ptr_));
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __forward_list_iterator(nullptr_t) _NOEXCEPT : __ptr_(nullptr) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __forward_list_iterator(__begin_node_pointer __p) _NOEXCEPT
         : __ptr_(__traits::__as_iter_node(__p)) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __forward_list_iterator(__node_pointer __p) _NOEXCEPT
         : __ptr_(__traits::__as_iter_node(__p)) {}
 
-    template<class, class> friend class _LIBCPP_TEMPLATE_VIS forward_list;
-    template<class> friend class _LIBCPP_TEMPLATE_VIS __forward_list_const_iterator;
+    template<class, class> friend class _LIBCUDACXX_TEMPLATE_VIS forward_list;
+    template<class> friend class _LIBCUDACXX_TEMPLATE_VIS __forward_list_const_iterator;
 
 public:
     typedef forward_iterator_tag                              iterator_category;
@@ -355,23 +355,23 @@ public:
                                                               
diff erence_type;
     typedef typename __rebind_pointer<__node_pointer, value_type>::type pointer;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __forward_list_iterator() _NOEXCEPT : __ptr_(nullptr) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     reference operator*() const {return __get_unsafe_node_pointer()->__value_;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     pointer operator->() const {
         return pointer_traits<pointer>::pointer_to(__get_unsafe_node_pointer()->__value_);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __forward_list_iterator& operator++()
     {
         __ptr_ = __traits::__as_iter_node(__ptr_->__next_);
         return *this;
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __forward_list_iterator operator++(int)
     {
         __forward_list_iterator __t(*this);
@@ -379,18 +379,18 @@ public:
         return __t;
     }
 
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
     bool operator==(const __forward_list_iterator& __x,
                     const __forward_list_iterator& __y)
         {return __x.__ptr_ == __y.__ptr_;}
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
     bool operator!=(const __forward_list_iterator& __x,
                     const __forward_list_iterator& __y)
         {return !(__x == __y);}
 };
 
 template <class _NodeConstPtr>
-class _LIBCPP_TEMPLATE_VIS __forward_list_const_iterator
+class _LIBCUDACXX_TEMPLATE_VIS __forward_list_const_iterator
 {
     static_assert((!is_const<typename pointer_traits<_NodeConstPtr>::element_type>::value), "");
     typedef _NodeConstPtr _NodePtr;
@@ -413,15 +413,15 @@ class _LIBCPP_TEMPLATE_VIS __forward_list_const_iterator
                 static_cast<__void_pointer>(__ptr_));
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __forward_list_const_iterator(nullptr_t) _NOEXCEPT
         : __ptr_(nullptr) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __forward_list_const_iterator(__begin_node_pointer __p) _NOEXCEPT
         : __ptr_(__traits::__as_iter_node(__p)) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __forward_list_const_iterator(__node_pointer __p) _NOEXCEPT
         : __ptr_(__traits::__as_iter_node(__p)) {}
 
@@ -437,25 +437,25 @@ public:
     typedef typename __rebind_pointer<__node_pointer, const value_type>::type
                                                               pointer;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __forward_list_const_iterator() _NOEXCEPT : __ptr_(nullptr) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __forward_list_const_iterator(__forward_list_iterator<__node_pointer> __p) _NOEXCEPT
         : __ptr_(__p.__ptr_) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     reference operator*() const {return __get_unsafe_node_pointer()->__value_;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     pointer operator->() const {return pointer_traits<pointer>::pointer_to(
                 __get_unsafe_node_pointer()->__value_);}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __forward_list_const_iterator& operator++()
     {
         __ptr_ = __traits::__as_iter_node(__ptr_->__next_);
         return *this;
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __forward_list_const_iterator operator++(int)
     {
         __forward_list_const_iterator __t(*this);
@@ -463,11 +463,11 @@ public:
         return __t;
     }
 
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
     bool operator==(const __forward_list_const_iterator& __x,
                     const __forward_list_const_iterator& __y)
         {return __x.__ptr_ == __y.__ptr_;}
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
     bool operator!=(const __forward_list_const_iterator& __x,
                            const __forward_list_const_iterator& __y)
         {return !(__x == __y);}
@@ -499,41 +499,41 @@ protected:
 
     __compressed_pair<__begin_node, __node_allocator> __before_begin_;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __begin_node_pointer        __before_begin() _NOEXCEPT
         {return pointer_traits<__begin_node_pointer>::pointer_to(__before_begin_.first());}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __begin_node_pointer __before_begin() const _NOEXCEPT
         {return pointer_traits<__begin_node_pointer>::pointer_to(const_cast<__begin_node&>(__before_begin_.first()));}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
           __node_allocator& __alloc() _NOEXCEPT
             {return __before_begin_.second();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const __node_allocator& __alloc() const _NOEXCEPT
         {return __before_begin_.second();}
 
     typedef __forward_list_iterator<__node_pointer>             iterator;
     typedef __forward_list_const_iterator<__node_pointer>       const_iterator;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __forward_list_base()
         _NOEXCEPT_(is_nothrow_default_constructible<__node_allocator>::value)
         : __before_begin_(__begin_node(), __default_init_tag()) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __forward_list_base(const allocator_type& __a)
         : __before_begin_(__begin_node(), __node_allocator(__a)) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __forward_list_base(const __node_allocator& __a)
         : __before_begin_(__begin_node(), __a) {}
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __forward_list_base(__forward_list_base&& __x)
         _NOEXCEPT_(is_nothrow_move_constructible<__node_allocator>::value);
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __forward_list_base(__forward_list_base&& __x, const allocator_type& __a);
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
 private:
     __forward_list_base(const __forward_list_base&);
@@ -543,12 +543,12 @@ public:
     ~__forward_list_base();
 
 protected:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __copy_assign_alloc(const __forward_list_base& __x)
         {__copy_assign_alloc(__x, integral_constant<bool,
               __node_traits::propagate_on_container_copy_assignment::value>());}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __move_assign_alloc(__forward_list_base& __x)
         _NOEXCEPT_(!__node_traits::propagate_on_container_move_assignment::value ||
                    is_nothrow_move_assignable<__node_allocator>::value)
@@ -556,9 +556,9 @@ protected:
               __node_traits::propagate_on_container_move_assignment::value>());}
 
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void swap(__forward_list_base& __x)
-#if _LIBCPP_STD_VER >= 14
+#if _LIBCUDACXX_STD_VER >= 14
         _NOEXCEPT;
 #else
         _NOEXCEPT_(!__node_traits::propagate_on_container_swap::value ||
@@ -568,9 +568,9 @@ protected:
     void clear() _NOEXCEPT;
 
 private:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __copy_assign_alloc(const __forward_list_base&, false_type) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __copy_assign_alloc(const __forward_list_base& __x, true_type)
     {
         if (__alloc() != __x.__alloc())
@@ -578,22 +578,22 @@ private:
         __alloc() = __x.__alloc();
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __move_assign_alloc(__forward_list_base&, false_type) _NOEXCEPT
         {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __move_assign_alloc(__forward_list_base& __x, true_type)
         _NOEXCEPT_(is_nothrow_move_assignable<__node_allocator>::value)
-        {__alloc() = _VSTD::move(__x.__alloc());}
+        {__alloc() = _CUDA_VSTD::move(__x.__alloc());}
 };
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
 template <class _Tp, class _Alloc>
 inline
 __forward_list_base<_Tp, _Alloc>::__forward_list_base(__forward_list_base&& __x)
         _NOEXCEPT_(is_nothrow_move_constructible<__node_allocator>::value)
-    : __before_begin_(_VSTD::move(__x.__before_begin_))
+    : __before_begin_(_CUDA_VSTD::move(__x.__before_begin_))
 {
     __x.__before_begin()->__next_ = nullptr;
 }
@@ -611,7 +611,7 @@ __forward_list_base<_Tp, _Alloc>::__forward_list_base(__forward_list_base&& __x,
     }
 }
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
 template <class _Tp, class _Alloc>
 __forward_list_base<_Tp, _Alloc>::~__forward_list_base()
@@ -623,16 +623,16 @@ template <class _Tp, class _Alloc>
 inline
 void
 __forward_list_base<_Tp, _Alloc>::swap(__forward_list_base& __x)
-#if _LIBCPP_STD_VER >= 14
+#if _LIBCUDACXX_STD_VER >= 14
         _NOEXCEPT
 #else
         _NOEXCEPT_(!__node_traits::propagate_on_container_swap::value ||
                     __is_nothrow_swappable<__node_allocator>::value)
 #endif
 {
-    _VSTD::__swap_allocator(__alloc(), __x.__alloc(),
+    _CUDA_VSTD::__swap_allocator(__alloc(), __x.__alloc(),
             integral_constant<bool, __node_traits::propagate_on_container_swap::value>());
-    using _VSTD::swap;
+    using _CUDA_VSTD::swap;
     swap(__before_begin()->__next_, __x.__before_begin()->__next_);
 }
 
@@ -644,7 +644,7 @@ __forward_list_base<_Tp, _Alloc>::clear() _NOEXCEPT
     for (__node_pointer __p = __before_begin()->__next_; __p != nullptr;)
     {
         __node_pointer __next = __p->__next_;
-        __node_traits::destroy(__a, _VSTD::addressof(__p->__value_));
+        __node_traits::destroy(__a, _CUDA_VSTD::addressof(__p->__value_));
         __node_traits::deallocate(__a, __p, 1);
         __p = __next;
     }
@@ -652,7 +652,7 @@ __forward_list_base<_Tp, _Alloc>::clear() _NOEXCEPT
 }
 
 template <class _Tp, class _Alloc /*= allocator<_Tp>*/>
-class _LIBCPP_TEMPLATE_VIS forward_list
+class _LIBCUDACXX_TEMPLATE_VIS forward_list
     : private __forward_list_base<_Tp, _Alloc>
 {
     typedef __forward_list_base<_Tp, _Alloc> base;
@@ -678,20 +678,20 @@ public:
 
     typedef typename base::iterator       iterator;
     typedef typename base::const_iterator const_iterator;
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
     typedef size_type                                __remove_return_type;
 #else
     typedef void                                     __remove_return_type;
 #endif
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     forward_list()
         _NOEXCEPT_(is_nothrow_default_constructible<__node_allocator>::value)
         {} // = default;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit forward_list(const allocator_type& __a);
     explicit forward_list(size_type __n);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
     explicit forward_list(size_type __n, const allocator_type& __a);
 #endif
     forward_list(size_type __n, const value_type& __v);
@@ -714,28 +714,28 @@ public:
 
     forward_list& operator=(const forward_list& __x);
 
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     forward_list(forward_list&& __x)
         _NOEXCEPT_(is_nothrow_move_constructible<base>::value)
-        : base(_VSTD::move(__x)) {}
+        : base(_CUDA_VSTD::move(__x)) {}
     forward_list(forward_list&& __x, const __type_identity_t<allocator_type>& __a);
 
     forward_list(initializer_list<value_type> __il);
     forward_list(initializer_list<value_type> __il, const allocator_type& __a);
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     forward_list& operator=(forward_list&& __x)
         _NOEXCEPT_(
              __node_traits::propagate_on_container_move_assignment::value &&
              is_nothrow_move_assignable<allocator_type>::value);
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     forward_list& operator=(initializer_list<value_type> __il);
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void assign(initializer_list<value_type> __il);
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
     // ~forward_list() = default;
 
@@ -744,88 +744,88 @@ public:
         assign(_InputIterator __f, _InputIterator __l);
     void assign(size_type __n, const value_type& __v);
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     allocator_type get_allocator() const _NOEXCEPT
         {return allocator_type(base::__alloc());}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator       begin() _NOEXCEPT
         {return       iterator(base::__before_begin()->__next_);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator begin() const _NOEXCEPT
         {return const_iterator(base::__before_begin()->__next_);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator       end() _NOEXCEPT
         {return       iterator(nullptr);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator end() const _NOEXCEPT
         {return const_iterator(nullptr);}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator cbegin() const _NOEXCEPT
         {return const_iterator(base::__before_begin()->__next_);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator cend() const _NOEXCEPT
         {return const_iterator(nullptr);}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator       before_begin() _NOEXCEPT
         {return       iterator(base::__before_begin());}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator before_begin() const _NOEXCEPT
         {return const_iterator(base::__before_begin());}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator cbefore_begin() const _NOEXCEPT
         {return const_iterator(base::__before_begin());}
 
-    _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_NODISCARD_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY
     bool empty() const _NOEXCEPT
         {return base::__before_begin()->__next_ == nullptr;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type max_size() const _NOEXCEPT {
-        return _VSTD::min<size_type>(
+        return _CUDA_VSTD::min<size_type>(
             __node_traits::max_size(base::__alloc()),
             numeric_limits<
diff erence_type>::max());
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     reference       front()       {return base::__before_begin()->__next_->__value_;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_reference front() const {return base::__before_begin()->__next_->__value_;}
 
-#ifndef _LIBCPP_CXX03_LANG
-#if _LIBCPP_STD_VER > 14
+#ifndef _LIBCUDACXX_CXX03_LANG
+#if _LIBCUDACXX_STD_VER > 14
     template <class... _Args> reference emplace_front(_Args&&... __args);
 #else
     template <class... _Args> void      emplace_front(_Args&&... __args);
 #endif
     void push_front(value_type&& __v);
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
     void push_front(const value_type& __v);
 
     void pop_front();
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
     template <class... _Args>
         iterator emplace_after(const_iterator __p, _Args&&... __args);
 
     iterator insert_after(const_iterator __p, value_type&& __v);
     iterator insert_after(const_iterator __p, initializer_list<value_type> __il)
         {return insert_after(__p, __il.begin(), __il.end());}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
     iterator insert_after(const_iterator __p, const value_type& __v);
     iterator insert_after(const_iterator __p, size_type __n, const value_type& __v);
     template <class _InputIterator>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value, iterator>
         insert_after(const_iterator __p, _InputIterator __f, _InputIterator __l);
 
     iterator erase_after(const_iterator __p);
     iterator erase_after(const_iterator __f, const_iterator __l);
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void swap(forward_list& __x)
-#if _LIBCPP_STD_VER >= 14
+#if _LIBCUDACXX_STD_VER >= 14
         _NOEXCEPT
 #else
         _NOEXCEPT_(!__node_traits::propagate_on_container_swap::value ||
@@ -835,14 +835,14 @@ public:
 
     void resize(size_type __n);
     void resize(size_type __n, const value_type& __v);
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void clear() _NOEXCEPT {base::clear();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void splice_after(const_iterator __p, forward_list&& __x);
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void splice_after(const_iterator __p, forward_list&& __x, const_iterator __i);
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void splice_after(const_iterator __p, forward_list&& __x,
                       const_iterator __f, const_iterator __l);
     void splice_after(const_iterator __p, forward_list& __x);
@@ -851,32 +851,32 @@ public:
                       const_iterator __f, const_iterator __l);
     __remove_return_type remove(const value_type& __v);
     template <class _Predicate> __remove_return_type remove_if(_Predicate __pred);
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __remove_return_type unique() {return unique(__equal_to<value_type>());}
     template <class _BinaryPredicate> __remove_return_type unique(_BinaryPredicate __binary_pred);
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     void merge(forward_list&& __x) {merge(__x, __less<value_type>());}
     template <class _Compare>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         void merge(forward_list&& __x, _Compare __comp)
-        {merge(__x, _VSTD::move(__comp));}
-#endif // _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+        {merge(__x, _CUDA_VSTD::move(__comp));}
+#endif // _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     void merge(forward_list& __x) {merge(__x, __less<value_type>());}
     template <class _Compare> void merge(forward_list& __x, _Compare __comp);
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void sort() {sort(__less<value_type>());}
-    template <class _Compare> _LIBCPP_INLINE_VISIBILITY void sort(_Compare __comp);
+    template <class _Compare> _LIBCUDACXX_INLINE_VISIBILITY void sort(_Compare __comp);
     void reverse() _NOEXCEPT;
 
 private:
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
     void __move_assign(forward_list& __x, true_type)
         _NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value);
     void __move_assign(forward_list& __x, false_type);
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
     template <class _Compare>
         static
@@ -890,7 +890,7 @@ private:
 };
 
 
-#if _LIBCPP_STD_VER >= 17
+#if _LIBCUDACXX_STD_VER >= 17
 template<class _InputIterator,
          class _Alloc = allocator<__iter_value_type<_InputIterator>>,
          class = enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>,
@@ -927,14 +927,14 @@ forward_list<_Tp, _Alloc>::forward_list(size_type __n)
                                                              __p = __p->__next_as_begin())
         {
             __h.reset(__node_traits::allocate(__a, 1));
-            __node_traits::construct(__a, _VSTD::addressof(__h->__value_));
+            __node_traits::construct(__a, _CUDA_VSTD::addressof(__h->__value_));
             __h->__next_ = nullptr;
             __p->__next_ = __h.release();
         }
     }
 }
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <class _Tp, class _Alloc>
 forward_list<_Tp, _Alloc>::forward_list(size_type __n,
                                         const allocator_type& __base_alloc)
@@ -949,7 +949,7 @@ forward_list<_Tp, _Alloc>::forward_list(size_type __n,
                                                              __p = __p->__next_as_begin())
         {
             __h.reset(__node_traits::allocate(__a, 1));
-            __node_traits::construct(__a, _VSTD::addressof(__h->__value_));
+            __node_traits::construct(__a, _CUDA_VSTD::addressof(__h->__value_));
             __h->__next_ = nullptr;
             __p->__next_ = __h.release();
         }
@@ -1000,7 +1000,7 @@ template <class _Tp, class _Alloc>
 forward_list<_Tp, _Alloc>&
 forward_list<_Tp, _Alloc>::operator=(const forward_list& __x)
 {
-    if (this != _VSTD::addressof(__x))
+    if (this != _CUDA_VSTD::addressof(__x))
     {
         base::__copy_assign_alloc(__x);
         assign(__x.begin(), __x.end());
@@ -1008,11 +1008,11 @@ forward_list<_Tp, _Alloc>::operator=(const forward_list& __x)
     return *this;
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 template <class _Tp, class _Alloc>
 forward_list<_Tp, _Alloc>::forward_list(forward_list&& __x,
                                         const __type_identity_t<allocator_type>& __a)
-    : base(_VSTD::move(__x), __a)
+    : base(_CUDA_VSTD::move(__x), __a)
 {
     if (base::__alloc() != __x.__alloc())
     {
@@ -1081,7 +1081,7 @@ forward_list<_Tp, _Alloc>::operator=(initializer_list<value_type> __il)
     return *this;
 }
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
 template <class _Tp, class _Alloc>
 template <class _InputIterator>
@@ -1089,7 +1089,7 @@ __enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value, void>
 forward_list<_Tp, _Alloc>::assign(_InputIterator __f, _InputIterator __l)
 {
     iterator __i = before_begin();
-    iterator __j = _VSTD::next(__i);
+    iterator __j = _CUDA_VSTD::next(__i);
     iterator __e = end();
     for (; __j != __e && __f != __l; ++__i, (void) ++__j, ++__f)
         *__j = *__f;
@@ -1104,7 +1104,7 @@ void
 forward_list<_Tp, _Alloc>::assign(size_type __n, const value_type& __v)
 {
     iterator __i = before_begin();
-    iterator __j = _VSTD::next(__i);
+    iterator __j = _CUDA_VSTD::next(__i);
     iterator __e = end();
     for (; __j != __e && __n > 0; --__n, ++__i, ++__j)
         *__j = __v;
@@ -1114,7 +1114,7 @@ forward_list<_Tp, _Alloc>::assign(size_type __n, const value_type& __v)
         erase_after(__i, __e);
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
 template <class _Tp, class _Alloc>
 inline
@@ -1126,7 +1126,7 @@ forward_list<_Tp, _Alloc>::assign(initializer_list<value_type> __il)
 
 template <class _Tp, class _Alloc>
 template <class... _Args>
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 typename forward_list<_Tp, _Alloc>::reference
 #else
 void
@@ -1136,11 +1136,11 @@ forward_list<_Tp, _Alloc>::emplace_front(_Args&&... __args)
     __node_allocator& __a = base::__alloc();
     typedef __allocator_destructor<__node_allocator> _Dp;
     unique_ptr<__node, _Dp> __h(__node_traits::allocate(__a, 1), _Dp(__a, 1));
-    __node_traits::construct(__a, _VSTD::addressof(__h->__value_),
-                                  _VSTD::forward<_Args>(__args)...);
+    __node_traits::construct(__a, _CUDA_VSTD::addressof(__h->__value_),
+                                  _CUDA_VSTD::forward<_Args>(__args)...);
     __h->__next_ = base::__before_begin()->__next_;
     base::__before_begin()->__next_ = __h.release();
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
     return base::__before_begin()->__next_->__value_;
 #endif
 }
@@ -1152,12 +1152,12 @@ forward_list<_Tp, _Alloc>::push_front(value_type&& __v)
     __node_allocator& __a = base::__alloc();
     typedef __allocator_destructor<__node_allocator> _Dp;
     unique_ptr<__node, _Dp> __h(__node_traits::allocate(__a, 1), _Dp(__a, 1));
-    __node_traits::construct(__a, _VSTD::addressof(__h->__value_), _VSTD::move(__v));
+    __node_traits::construct(__a, _CUDA_VSTD::addressof(__h->__value_), _CUDA_VSTD::move(__v));
     __h->__next_ = base::__before_begin()->__next_;
     base::__before_begin()->__next_ = __h.release();
 }
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
 template <class _Tp, class _Alloc>
 void
@@ -1166,7 +1166,7 @@ forward_list<_Tp, _Alloc>::push_front(const value_type& __v)
     __node_allocator& __a = base::__alloc();
     typedef __allocator_destructor<__node_allocator> _Dp;
     unique_ptr<__node, _Dp> __h(__node_traits::allocate(__a, 1), _Dp(__a, 1));
-    __node_traits::construct(__a, _VSTD::addressof(__h->__value_), __v);
+    __node_traits::construct(__a, _CUDA_VSTD::addressof(__h->__value_), __v);
     __h->__next_ = base::__before_begin()->__next_;
     base::__before_begin()->__next_ = __h.release();
 }
@@ -1178,11 +1178,11 @@ forward_list<_Tp, _Alloc>::pop_front()
     __node_allocator& __a = base::__alloc();
     __node_pointer __p = base::__before_begin()->__next_;
     base::__before_begin()->__next_ = __p->__next_;
-    __node_traits::destroy(__a, _VSTD::addressof(__p->__value_));
+    __node_traits::destroy(__a, _CUDA_VSTD::addressof(__p->__value_));
     __node_traits::deallocate(__a, __p, 1);
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
 template <class _Tp, class _Alloc>
 template <class... _Args>
@@ -1193,8 +1193,8 @@ forward_list<_Tp, _Alloc>::emplace_after(const_iterator __p, _Args&&... __args)
     __node_allocator& __a = base::__alloc();
     typedef __allocator_destructor<__node_allocator> _Dp;
     unique_ptr<__node, _Dp> __h(__node_traits::allocate(__a, 1), _Dp(__a, 1));
-    __node_traits::construct(__a, _VSTD::addressof(__h->__value_),
-                                  _VSTD::forward<_Args>(__args)...);
+    __node_traits::construct(__a, _CUDA_VSTD::addressof(__h->__value_),
+                                  _CUDA_VSTD::forward<_Args>(__args)...);
     __h->__next_ = __r->__next_;
     __r->__next_ = __h.release();
     return iterator(__r->__next_);
@@ -1208,13 +1208,13 @@ forward_list<_Tp, _Alloc>::insert_after(const_iterator __p, value_type&& __v)
     __node_allocator& __a = base::__alloc();
     typedef __allocator_destructor<__node_allocator> _Dp;
     unique_ptr<__node, _Dp> __h(__node_traits::allocate(__a, 1), _Dp(__a, 1));
-    __node_traits::construct(__a, _VSTD::addressof(__h->__value_), _VSTD::move(__v));
+    __node_traits::construct(__a, _CUDA_VSTD::addressof(__h->__value_), _CUDA_VSTD::move(__v));
     __h->__next_ = __r->__next_;
     __r->__next_ = __h.release();
     return iterator(__r->__next_);
 }
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
 template <class _Tp, class _Alloc>
 typename forward_list<_Tp, _Alloc>::iterator
@@ -1224,7 +1224,7 @@ forward_list<_Tp, _Alloc>::insert_after(const_iterator __p, const value_type& __
     __node_allocator& __a = base::__alloc();
     typedef __allocator_destructor<__node_allocator> _Dp;
     unique_ptr<__node, _Dp> __h(__node_traits::allocate(__a, 1), _Dp(__a, 1));
-    __node_traits::construct(__a, _VSTD::addressof(__h->__value_), __v);
+    __node_traits::construct(__a, _CUDA_VSTD::addressof(__h->__value_), __v);
     __h->__next_ = __r->__next_;
     __r->__next_ = __h.release();
     return iterator(__r->__next_);
@@ -1241,33 +1241,33 @@ forward_list<_Tp, _Alloc>::insert_after(const_iterator __p, size_type __n,
         __node_allocator& __a = base::__alloc();
         typedef __allocator_destructor<__node_allocator> _Dp;
         unique_ptr<__node, _Dp> __h(__node_traits::allocate(__a, 1), _Dp(__a, 1));
-        __node_traits::construct(__a, _VSTD::addressof(__h->__value_), __v);
+        __node_traits::construct(__a, _CUDA_VSTD::addressof(__h->__value_), __v);
         __node_pointer __first = __h.release();
         __node_pointer __last = __first;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         try
         {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
             for (--__n; __n != 0; --__n, __last = __last->__next_)
             {
                 __h.reset(__node_traits::allocate(__a, 1));
-                __node_traits::construct(__a, _VSTD::addressof(__h->__value_), __v);
+                __node_traits::construct(__a, _CUDA_VSTD::addressof(__h->__value_), __v);
                 __last->__next_ = __h.release();
             }
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         }
         catch (...)
         {
             while (__first != nullptr)
             {
                 __node_pointer __next = __first->__next_;
-                __node_traits::destroy(__a, _VSTD::addressof(__first->__value_));
+                __node_traits::destroy(__a, _CUDA_VSTD::addressof(__first->__value_));
                 __node_traits::deallocate(__a, __first, 1);
                 __first = __next;
             }
             throw;
         }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
         __last->__next_ = __r->__next_;
         __r->__next_ = __first;
         __r = static_cast<__begin_node_pointer>(__last);
@@ -1287,33 +1287,33 @@ forward_list<_Tp, _Alloc>::insert_after(const_iterator __p,
         __node_allocator& __a = base::__alloc();
         typedef __allocator_destructor<__node_allocator> _Dp;
         unique_ptr<__node, _Dp> __h(__node_traits::allocate(__a, 1), _Dp(__a, 1));
-        __node_traits::construct(__a, _VSTD::addressof(__h->__value_), *__f);
+        __node_traits::construct(__a, _CUDA_VSTD::addressof(__h->__value_), *__f);
         __node_pointer __first = __h.release();
         __node_pointer __last = __first;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         try
         {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
             for (++__f; __f != __l; ++__f, ((void)(__last = __last->__next_)))
             {
                 __h.reset(__node_traits::allocate(__a, 1));
-                __node_traits::construct(__a, _VSTD::addressof(__h->__value_), *__f);
+                __node_traits::construct(__a, _CUDA_VSTD::addressof(__h->__value_), *__f);
                 __last->__next_ = __h.release();
             }
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         }
         catch (...)
         {
             while (__first != nullptr)
             {
                 __node_pointer __next = __first->__next_;
-                __node_traits::destroy(__a, _VSTD::addressof(__first->__value_));
+                __node_traits::destroy(__a, _CUDA_VSTD::addressof(__first->__value_));
                 __node_traits::deallocate(__a, __first, 1);
                 __first = __next;
             }
             throw;
         }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
         __last->__next_ = __r->__next_;
         __r->__next_ = __first;
         __r = static_cast<__begin_node_pointer>(__last);
@@ -1329,7 +1329,7 @@ forward_list<_Tp, _Alloc>::erase_after(const_iterator __f)
     __node_pointer __n = __p->__next_;
     __p->__next_ = __n->__next_;
     __node_allocator& __a = base::__alloc();
-    __node_traits::destroy(__a, _VSTD::addressof(__n->__value_));
+    __node_traits::destroy(__a, _CUDA_VSTD::addressof(__n->__value_));
     __node_traits::deallocate(__a, __n, 1);
     return iterator(__p->__next_);
 }
@@ -1351,7 +1351,7 @@ forward_list<_Tp, _Alloc>::erase_after(const_iterator __f, const_iterator __l)
             do
             {
                 __node_pointer __tmp = __n->__next_;
-                __node_traits::destroy(__a, _VSTD::addressof(__n->__value_));
+                __node_traits::destroy(__a, _CUDA_VSTD::addressof(__n->__value_));
                 __node_traits::deallocate(__a, __n, 1);
                 __n = __tmp;
             } while (__n != __e);
@@ -1384,7 +1384,7 @@ forward_list<_Tp, _Alloc>::resize(size_type __n)
                                                          __ptr = __ptr->__next_as_begin())
             {
                 __h.reset(__node_traits::allocate(__a, 1));
-                __node_traits::construct(__a, _VSTD::addressof(__h->__value_));
+                __node_traits::construct(__a, _CUDA_VSTD::addressof(__h->__value_));
                 __h->__next_ = nullptr;
                 __ptr->__next_ = __h.release();
             }
@@ -1416,7 +1416,7 @@ forward_list<_Tp, _Alloc>::resize(size_type __n, const value_type& __v)
                                                          __ptr = __ptr->__next_as_begin())
             {
                 __h.reset(__node_traits::allocate(__a, 1));
-                __node_traits::construct(__a, _VSTD::addressof(__h->__value_), __v);
+                __node_traits::construct(__a, _CUDA_VSTD::addressof(__h->__value_), __v);
                 __h->__next_ = nullptr;
                 __ptr->__next_ = __h.release();
             }
@@ -1449,7 +1449,7 @@ forward_list<_Tp, _Alloc>::splice_after(const_iterator __p,
                                         forward_list& /*__other*/,
                                         const_iterator __i)
 {
-    const_iterator __lm1 = _VSTD::next(__i);
+    const_iterator __lm1 = _CUDA_VSTD::next(__i);
     if (__p != __i && __p != __lm1)
     {
         __i.__get_begin()->__next_ = __lm1.__get_begin()->__next_;
@@ -1479,7 +1479,7 @@ forward_list<_Tp, _Alloc>::splice_after(const_iterator __p,
 }
 
 template <class _Tp, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 forward_list<_Tp, _Alloc>::splice_after(const_iterator __p,
                                         forward_list&& __x)
@@ -1488,7 +1488,7 @@ forward_list<_Tp, _Alloc>::splice_after(const_iterator __p,
 }
 
 template <class _Tp, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 forward_list<_Tp, _Alloc>::splice_after(const_iterator __p,
                                         forward_list&& __x,
@@ -1498,7 +1498,7 @@ forward_list<_Tp, _Alloc>::splice_after(const_iterator __p,
 }
 
 template <class _Tp, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 forward_list<_Tp, _Alloc>::splice_after(const_iterator __p,
                                         forward_list&& __x,
@@ -1519,7 +1519,7 @@ forward_list<_Tp, _Alloc>::remove(const value_type& __v)
         if (__i.__get_begin()->__next_->__value_ == __v)
         {
             ++__count_removed;
-            iterator __j = _VSTD::next(__i, 2);
+            iterator __j = _CUDA_VSTD::next(__i, 2);
             for (; __j != __e && *__j == __v; ++__j)
                 ++__count_removed;
             __deleted_nodes.splice_after(__deleted_nodes.before_begin(), *this, __i, __j);
@@ -1547,7 +1547,7 @@ forward_list<_Tp, _Alloc>::remove_if(_Predicate __pred)
         if (__pred(__i.__get_begin()->__next_->__value_))
         {
             ++__count_removed;
-            iterator __j = _VSTD::next(__i, 2);
+            iterator __j = _CUDA_VSTD::next(__i, 2);
             for (; __j != __e && __pred(*__j); ++__j)
                 ++__count_removed;
             __deleted_nodes.splice_after(__deleted_nodes.before_begin(), *this, __i, __j);
@@ -1571,7 +1571,7 @@ forward_list<_Tp, _Alloc>::unique(_BinaryPredicate __binary_pred)
     typename forward_list<_Tp, _Alloc>::size_type __count_removed = 0;
     for (iterator __i = begin(), __e = end(); __i != __e;)
     {
-        iterator __j = _VSTD::next(__i);
+        iterator __j = _CUDA_VSTD::next(__i);
         for (; __j != __e && __binary_pred(*__i, *__j); ++__j)
             ++__count_removed;
         if (__i.__get_begin()->__next_ != __j.__get_unsafe_node_pointer())
@@ -1587,7 +1587,7 @@ template <class _Compare>
 void
 forward_list<_Tp, _Alloc>::merge(forward_list& __x, _Compare __comp)
 {
-    if (this != _VSTD::addressof(__x))
+    if (this != _CUDA_VSTD::addressof(__x))
     {
         base::__before_begin()->__next_ = __merge(base::__before_begin()->__next_,
                                                     __x.__before_begin()->__next_,
@@ -1648,7 +1648,7 @@ void
 forward_list<_Tp, _Alloc>::sort(_Compare __comp)
 {
     base::__before_begin()->__next_ = __sort(base::__before_begin()->__next_,
-                                       _VSTD::distance(begin(), end()), __comp);
+                                       _CUDA_VSTD::distance(begin(), end()), __comp);
 }
 
 template <class _Tp, class _Alloc>
@@ -1674,7 +1674,7 @@ forward_list<_Tp, _Alloc>::__sort(__node_pointer __f1, 
diff erence_type __sz,
     }
     
diff erence_type __sz1 = __sz / 2;
     
diff erence_type __sz2 = __sz - __sz1;
-    __node_pointer __t = _VSTD::next(iterator(__f1), __sz1 - 1).__get_unsafe_node_pointer();
+    __node_pointer __t = _CUDA_VSTD::next(iterator(__f1), __sz1 - 1).__get_unsafe_node_pointer();
     __node_pointer __f2 = __t->__next_;
     __t->__next_ = nullptr;
     return __merge(__sort(__f1, __sz1, __comp),
@@ -1718,7 +1718,7 @@ bool operator==(const forward_list<_Tp, _Alloc>& __x,
 }
 
 template <class _Tp, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool operator!=(const forward_list<_Tp, _Alloc>& __x,
                 const forward_list<_Tp, _Alloc>& __y)
 {
@@ -1726,16 +1726,16 @@ bool operator!=(const forward_list<_Tp, _Alloc>& __x,
 }
 
 template <class _Tp, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool operator< (const forward_list<_Tp, _Alloc>& __x,
                 const forward_list<_Tp, _Alloc>& __y)
 {
-    return _VSTD::lexicographical_compare(__x.begin(), __x.end(),
+    return _CUDA_VSTD::lexicographical_compare(__x.begin(), __x.end(),
                                          __y.begin(), __y.end());
 }
 
 template <class _Tp, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool operator> (const forward_list<_Tp, _Alloc>& __x,
                 const forward_list<_Tp, _Alloc>& __y)
 {
@@ -1743,7 +1743,7 @@ bool operator> (const forward_list<_Tp, _Alloc>& __x,
 }
 
 template <class _Tp, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool operator>=(const forward_list<_Tp, _Alloc>& __x,
                 const forward_list<_Tp, _Alloc>& __y)
 {
@@ -1751,7 +1751,7 @@ bool operator>=(const forward_list<_Tp, _Alloc>& __x,
 }
 
 template <class _Tp, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool operator<=(const forward_list<_Tp, _Alloc>& __x,
                 const forward_list<_Tp, _Alloc>& __y)
 {
@@ -1759,7 +1759,7 @@ bool operator<=(const forward_list<_Tp, _Alloc>& __x,
 }
 
 template <class _Tp, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 swap(forward_list<_Tp, _Alloc>& __x, forward_list<_Tp, _Alloc>& __y)
     _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
@@ -1767,24 +1767,24 @@ swap(forward_list<_Tp, _Alloc>& __x, forward_list<_Tp, _Alloc>& __y)
     __x.swap(__y);
 }
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 template <class _Tp, class _Allocator, class _Predicate>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
     typename forward_list<_Tp, _Allocator>::size_type
     erase_if(forward_list<_Tp, _Allocator>& __c, _Predicate __pred) {
   return __c.remove_if(__pred);
 }
 
 template <class _Tp, class _Allocator, class _Up>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
     typename forward_list<_Tp, _Allocator>::size_type
     erase(forward_list<_Tp, _Allocator>& __c, const _Up& __v) {
-  return _VSTD::erase_if(__c, [&](auto& __elem) { return __elem == __v; });
+  return _CUDA_VSTD::erase_if(__c, [&](auto& __elem) { return __elem == __v; });
 }
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP_FORWARD_LIST
+#endif // _LIBCUDACXX_FORWARD_LIST

diff  --git a/libcxx/include/fstream b/libcxx/include/fstream
index ffa75b14eb15..de5a5f37a9e8 100644
--- a/libcxx/include/fstream
+++ b/libcxx/include/fstream
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_FSTREAM
-#define _LIBCPP_FSTREAM
+#ifndef _LIBCUDACXX_FSTREAM
+#define _LIBCUDACXX_FSTREAM
 
 /*
     fstream synopsis
@@ -194,25 +194,25 @@ typedef basic_fstream<wchar_t> wfstream;
 #include <ostream>
 #include <version>
 
-#if !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
+#if !defined(_LIBCUDACXX_HAS_NO_FILESYSTEM_LIBRARY)
 #   include <filesystem>
 #endif
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-#if defined(_LIBCPP_MSVCRT) || defined(_NEWLIB_VERSION)
-#  define _LIBCPP_HAS_NO_OFF_T_FUNCTIONS
+#if defined(_LIBCUDACXX_MSVCRT) || defined(_NEWLIB_VERSION)
+#  define _LIBCUDACXX_HAS_NO_OFF_T_FUNCTIONS
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _CharT, class _Traits>
-class _LIBCPP_TEMPLATE_VIS basic_filebuf
+class _LIBCUDACXX_TEMPLATE_VIS basic_filebuf
     : public basic_streambuf<_CharT, _Traits>
 {
 public:
@@ -229,31 +229,31 @@ public:
     virtual ~basic_filebuf();
 
     // 27.9.1.3 Assign/swap:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_filebuf& operator=(basic_filebuf&& __rhs);
     void swap(basic_filebuf& __rhs);
 
     // 27.9.1.4 Members:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool is_open() const;
     basic_filebuf* open(const char* __s, ios_base::openmode __mode);
-#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR
+#ifdef _LIBCUDACXX_HAS_OPEN_WITH_WCHAR
     basic_filebuf* open(const wchar_t* __s, ios_base::openmode __mode);
 #endif
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_filebuf* open(const string& __s, ios_base::openmode __mode);
 
-#if _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
-    _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
+#if _LIBCUDACXX_STD_VER >= 17 && !defined(_LIBCUDACXX_HAS_NO_FILESYSTEM_LIBRARY)
+    _LIBCUDACXX_AVAILABILITY_FILESYSTEM _LIBCUDACXX_INLINE_VISIBILITY
     basic_filebuf* open(const _VSTD_FS::path& __p, ios_base::openmode __mode) {
       return open(__p.c_str(), __mode);
     }
 #endif
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_filebuf* __open(int __fd, ios_base::openmode __mode);
     basic_filebuf* close();
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     inline static const char*
     __make_mdstring(ios_base::openmode __mode) _NOEXCEPT;
 
@@ -395,17 +395,17 @@ basic_filebuf<_CharT, _Traits>::operator=(basic_filebuf&& __rhs)
 template <class _CharT, class _Traits>
 basic_filebuf<_CharT, _Traits>::~basic_filebuf()
 {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     try
     {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
         close();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     }
     catch (...)
     {
     }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
     if (__owns_eb_)
         delete [] __extbuf_;
     if (__owns_ib_)
@@ -457,18 +457,18 @@ basic_filebuf<_CharT, _Traits>::swap(basic_filebuf& __rhs)
         __rhs.__extbufnext_ = __rhs.__extbuf_ + __ln;
         __rhs.__extbufend_ = __rhs.__extbuf_ + __le;
     }
-    _VSTD::swap(__ebs_, __rhs.__ebs_);
-    _VSTD::swap(__intbuf_, __rhs.__intbuf_);
-    _VSTD::swap(__ibs_, __rhs.__ibs_);
-    _VSTD::swap(__file_, __rhs.__file_);
-    _VSTD::swap(__cv_, __rhs.__cv_);
-    _VSTD::swap(__st_, __rhs.__st_);
-    _VSTD::swap(__st_last_, __rhs.__st_last_);
-    _VSTD::swap(__om_, __rhs.__om_);
-    _VSTD::swap(__cm_, __rhs.__cm_);
-    _VSTD::swap(__owns_eb_, __rhs.__owns_eb_);
-    _VSTD::swap(__owns_ib_, __rhs.__owns_ib_);
-    _VSTD::swap(__always_noconv_, __rhs.__always_noconv_);
+    _CUDA_VSTD::swap(__ebs_, __rhs.__ebs_);
+    _CUDA_VSTD::swap(__intbuf_, __rhs.__intbuf_);
+    _CUDA_VSTD::swap(__ibs_, __rhs.__ibs_);
+    _CUDA_VSTD::swap(__file_, __rhs.__file_);
+    _CUDA_VSTD::swap(__cv_, __rhs.__cv_);
+    _CUDA_VSTD::swap(__st_, __rhs.__st_);
+    _CUDA_VSTD::swap(__st_last_, __rhs.__st_last_);
+    _CUDA_VSTD::swap(__om_, __rhs.__om_);
+    _CUDA_VSTD::swap(__cm_, __rhs.__cm_);
+    _CUDA_VSTD::swap(__owns_eb_, __rhs.__owns_eb_);
+    _CUDA_VSTD::swap(__owns_ib_, __rhs.__owns_ib_);
+    _CUDA_VSTD::swap(__always_noconv_, __rhs.__always_noconv_);
     if (this->eback() == (char_type*)__rhs.__extbuf_min_)
     {
         ptr
diff _t __n = this->gptr() - this->eback();
@@ -504,7 +504,7 @@ basic_filebuf<_CharT, _Traits>::swap(basic_filebuf& __rhs)
 }
 
 template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 swap(basic_filebuf<_CharT, _Traits>& __x, basic_filebuf<_CharT, _Traits>& __y)
 {
@@ -525,38 +525,38 @@ const char* basic_filebuf<_CharT, _Traits>::__make_mdstring(
   switch (__mode & ~ios_base::ate) {
   case ios_base::out:
   case ios_base::out | ios_base::trunc:
-    return "w" _LIBCPP_FOPEN_CLOEXEC_MODE;
+    return "w" _LIBCUDACXX_FOPEN_CLOEXEC_MODE;
   case ios_base::out | ios_base::app:
   case ios_base::app:
-    return "a" _LIBCPP_FOPEN_CLOEXEC_MODE;
+    return "a" _LIBCUDACXX_FOPEN_CLOEXEC_MODE;
   case ios_base::in:
-    return "r" _LIBCPP_FOPEN_CLOEXEC_MODE;
+    return "r" _LIBCUDACXX_FOPEN_CLOEXEC_MODE;
   case ios_base::in | ios_base::out:
-    return "r+" _LIBCPP_FOPEN_CLOEXEC_MODE;
+    return "r+" _LIBCUDACXX_FOPEN_CLOEXEC_MODE;
   case ios_base::in | ios_base::out | ios_base::trunc:
-    return "w+" _LIBCPP_FOPEN_CLOEXEC_MODE;
+    return "w+" _LIBCUDACXX_FOPEN_CLOEXEC_MODE;
   case ios_base::in | ios_base::out | ios_base::app:
   case ios_base::in | ios_base::app:
-    return "a+" _LIBCPP_FOPEN_CLOEXEC_MODE;
+    return "a+" _LIBCUDACXX_FOPEN_CLOEXEC_MODE;
   case ios_base::out | ios_base::binary:
   case ios_base::out | ios_base::trunc | ios_base::binary:
-    return "wb" _LIBCPP_FOPEN_CLOEXEC_MODE;
+    return "wb" _LIBCUDACXX_FOPEN_CLOEXEC_MODE;
   case ios_base::out | ios_base::app | ios_base::binary:
   case ios_base::app | ios_base::binary:
-    return "ab" _LIBCPP_FOPEN_CLOEXEC_MODE;
+    return "ab" _LIBCUDACXX_FOPEN_CLOEXEC_MODE;
   case ios_base::in | ios_base::binary:
-    return "rb" _LIBCPP_FOPEN_CLOEXEC_MODE;
+    return "rb" _LIBCUDACXX_FOPEN_CLOEXEC_MODE;
   case ios_base::in | ios_base::out | ios_base::binary:
-    return "r+b" _LIBCPP_FOPEN_CLOEXEC_MODE;
+    return "r+b" _LIBCUDACXX_FOPEN_CLOEXEC_MODE;
   case ios_base::in | ios_base::out | ios_base::trunc | ios_base::binary:
-    return "w+b" _LIBCPP_FOPEN_CLOEXEC_MODE;
+    return "w+b" _LIBCUDACXX_FOPEN_CLOEXEC_MODE;
   case ios_base::in | ios_base::out | ios_base::app | ios_base::binary:
   case ios_base::in | ios_base::app | ios_base::binary:
-    return "a+b" _LIBCPP_FOPEN_CLOEXEC_MODE;
+    return "a+b" _LIBCUDACXX_FOPEN_CLOEXEC_MODE;
   default:
     return nullptr;
   }
-  __libcpp_unreachable();
+  __LIBCUDACXX_unreachable();
 }
 
 template <class _CharT, class _Traits>
@@ -610,7 +610,7 @@ basic_filebuf<_CharT, _Traits>::__open(int __fd, ios_base::openmode __mode) {
   return __rt;
 }
 
-#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR
+#ifdef _LIBCUDACXX_HAS_OPEN_WITH_WCHAR
 // This is basically the same as the char* overload except that it uses _wfopen
 // and long mode strings.
 template <class _CharT, class _Traits>
@@ -735,7 +735,7 @@ basic_filebuf<_CharT, _Traits>::underflow()
     int_type __c = traits_type::eof();
     if (this->gptr() == this->egptr())
     {
-        _VSTD::memmove(this->eback(), this->egptr() - __unget_sz, __unget_sz * sizeof(char_type));
+        _CUDA_VSTD::memmove(this->eback(), this->egptr() - __unget_sz, __unget_sz * sizeof(char_type));
         if (__always_noconv_)
         {
             size_t __nmemb = static_cast<size_t>(this->egptr() - this->eback() - __unget_sz);
@@ -750,12 +750,12 @@ basic_filebuf<_CharT, _Traits>::underflow()
         }
         else
         {
-            _LIBCPP_ASSERT ( !(__extbufnext_ == NULL && (__extbufend_ != __extbufnext_)), "underflow moving from NULL" );
+            _LIBCUDACXX_ASSERT ( !(__extbufnext_ == NULL && (__extbufend_ != __extbufnext_)), "underflow moving from NULL" );
             if (__extbufend_ != __extbufnext_)
-                _VSTD::memmove(__extbuf_, __extbufnext_, __extbufend_ - __extbufnext_);
+                _CUDA_VSTD::memmove(__extbuf_, __extbufnext_, __extbufend_ - __extbufnext_);
             __extbufnext_ = __extbuf_ + (__extbufend_ - __extbufnext_);
             __extbufend_ = __extbuf_ + (__extbuf_ == __extbuf_min_ ? sizeof(__extbuf_min_) : __ebs_);
-            size_t __nmemb = _VSTD::min(static_cast<size_t>(__ibs_ - __unget_sz),
+            size_t __nmemb = _CUDA_VSTD::min(static_cast<size_t>(__ibs_ - __unget_sz),
                                  static_cast<size_t>(__extbufend_ - __extbufnext_));
             codecvt_base::result __r;
             __st_last_ = __st_;
@@ -958,7 +958,7 @@ basic_filebuf<_CharT, _Traits>::seekoff(off_type __off, ios_base::seekdir __way,
     default:
         return pos_type(off_type(-1));
     }
-#if defined(_LIBCPP_HAS_NO_OFF_T_FUNCTIONS)
+#if defined(_LIBCUDACXX_HAS_NO_OFF_T_FUNCTIONS)
     if (fseek(__file_, __width > 0 ? __width * __off : 0, __whence))
         return pos_type(off_type(-1));
     pos_type __r = ftell(__file_);
@@ -977,7 +977,7 @@ basic_filebuf<_CharT, _Traits>::seekpos(pos_type __sp, ios_base::openmode)
 {
     if (__file_ == nullptr || sync())
         return pos_type(off_type(-1));
-#if defined(_LIBCPP_HAS_NO_OFF_T_FUNCTIONS)
+#if defined(_LIBCUDACXX_HAS_NO_OFF_T_FUNCTIONS)
     if (fseek(__file_, __sp, SEEK_SET))
         return pos_type(off_type(-1));
 #else
@@ -1041,7 +1041,7 @@ basic_filebuf<_CharT, _Traits>::sync()
                 }
             }
         }
-#if defined(_LIBCPP_HAS_NO_OFF_T_FUNCTIONS)
+#if defined(_LIBCUDACXX_HAS_NO_OFF_T_FUNCTIONS)
         if (fseek(__file_, -__c, SEEK_CUR))
             return -1;
 #else
@@ -1144,7 +1144,7 @@ basic_filebuf<_CharT, _Traits>::__write_mode()
 // basic_ifstream
 
 template <class _CharT, class _Traits>
-class _LIBCPP_TEMPLATE_VIS basic_ifstream
+class _LIBCUDACXX_TEMPLATE_VIS basic_ifstream
     : public basic_istream<_CharT, _Traits>
 {
 public:
@@ -1154,48 +1154,48 @@ public:
     typedef typename traits_type::pos_type pos_type;
     typedef typename traits_type::off_type off_type;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_ifstream();
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit basic_ifstream(const char* __s, ios_base::openmode __mode = ios_base::in);
-#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR
-    _LIBCPP_INLINE_VISIBILITY
+#ifdef _LIBCUDACXX_HAS_OPEN_WITH_WCHAR
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit basic_ifstream(const wchar_t* __s, ios_base::openmode __mode = ios_base::in);
 #endif
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit basic_ifstream(const string& __s, ios_base::openmode __mode = ios_base::in);
-#if _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
-    _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
+#if _LIBCUDACXX_STD_VER >= 17 && !defined(_LIBCUDACXX_HAS_NO_FILESYSTEM_LIBRARY)
+    _LIBCUDACXX_AVAILABILITY_FILESYSTEM _LIBCUDACXX_INLINE_VISIBILITY
     explicit basic_ifstream(const filesystem::path& __p, ios_base::openmode __mode = ios_base::in)
       : basic_ifstream(__p.c_str(), __mode) {}
-#endif // _LIBCPP_STD_VER >= 17
-    _LIBCPP_INLINE_VISIBILITY
+#endif // _LIBCUDACXX_STD_VER >= 17
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_ifstream(basic_ifstream&& __rhs);
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_ifstream& operator=(basic_ifstream&& __rhs);
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void swap(basic_ifstream& __rhs);
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_filebuf<char_type, traits_type>* rdbuf() const;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool is_open() const;
     void open(const char* __s, ios_base::openmode __mode = ios_base::in);
-#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR
+#ifdef _LIBCUDACXX_HAS_OPEN_WITH_WCHAR
     void open(const wchar_t* __s, ios_base::openmode __mode = ios_base::in);
 #endif
     void open(const string& __s, ios_base::openmode __mode = ios_base::in);
-#if _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
-    _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
+#if _LIBCUDACXX_STD_VER >= 17 && !defined(_LIBCUDACXX_HAS_NO_FILESYSTEM_LIBRARY)
+    _LIBCUDACXX_AVAILABILITY_FILESYSTEM _LIBCUDACXX_INLINE_VISIBILITY
     void open(const filesystem::path& __p,
               ios_base::openmode __mode = ios_base::in) {
       return open(__p.c_str(), __mode);
     }
-#endif // _LIBCPP_STD_VER >= 17
+#endif // _LIBCUDACXX_STD_VER >= 17
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __open(int __fd, ios_base::openmode __mode);
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void close();
 
 private:
@@ -1218,7 +1218,7 @@ basic_ifstream<_CharT, _Traits>::basic_ifstream(const char* __s, ios_base::openm
         this->setstate(ios_base::failbit);
 }
 
-#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR
+#ifdef _LIBCUDACXX_HAS_OPEN_WITH_WCHAR
 template <class _CharT, class _Traits>
 inline
 basic_ifstream<_CharT, _Traits>::basic_ifstream(const wchar_t* __s, ios_base::openmode __mode)
@@ -1241,8 +1241,8 @@ basic_ifstream<_CharT, _Traits>::basic_ifstream(const string& __s, ios_base::ope
 template <class _CharT, class _Traits>
 inline
 basic_ifstream<_CharT, _Traits>::basic_ifstream(basic_ifstream&& __rhs)
-    : basic_istream<char_type, traits_type>(_VSTD::move(__rhs)),
-      __sb_(_VSTD::move(__rhs.__sb_))
+    : basic_istream<char_type, traits_type>(_CUDA_VSTD::move(__rhs)),
+      __sb_(_CUDA_VSTD::move(__rhs.__sb_))
 {
     this->set_rdbuf(&__sb_);
 }
@@ -1252,8 +1252,8 @@ inline
 basic_ifstream<_CharT, _Traits>&
 basic_ifstream<_CharT, _Traits>::operator=(basic_ifstream&& __rhs)
 {
-    basic_istream<char_type, traits_type>::operator=(_VSTD::move(__rhs));
-    __sb_ = _VSTD::move(__rhs.__sb_);
+    basic_istream<char_type, traits_type>::operator=(_CUDA_VSTD::move(__rhs));
+    __sb_ = _CUDA_VSTD::move(__rhs.__sb_);
     return *this;
 }
 
@@ -1267,7 +1267,7 @@ basic_ifstream<_CharT, _Traits>::swap(basic_ifstream& __rhs)
 }
 
 template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 swap(basic_ifstream<_CharT, _Traits>& __x, basic_ifstream<_CharT, _Traits>& __y)
 {
@@ -1300,7 +1300,7 @@ basic_ifstream<_CharT, _Traits>::open(const char* __s, ios_base::openmode __mode
         this->setstate(ios_base::failbit);
 }
 
-#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR
+#ifdef _LIBCUDACXX_HAS_OPEN_WITH_WCHAR
 template <class _CharT, class _Traits>
 void
 basic_ifstream<_CharT, _Traits>::open(const wchar_t* __s, ios_base::openmode __mode)
@@ -1344,7 +1344,7 @@ basic_ifstream<_CharT, _Traits>::close()
 // basic_ofstream
 
 template <class _CharT, class _Traits>
-class _LIBCPP_TEMPLATE_VIS basic_ofstream
+class _LIBCUDACXX_TEMPLATE_VIS basic_ofstream
     : public basic_ostream<_CharT, _Traits>
 {
 public:
@@ -1354,49 +1354,49 @@ public:
     typedef typename traits_type::pos_type pos_type;
     typedef typename traits_type::off_type off_type;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_ofstream();
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit basic_ofstream(const char* __s, ios_base::openmode __mode = ios_base::out);
-#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR
-    _LIBCPP_INLINE_VISIBILITY
+#ifdef _LIBCUDACXX_HAS_OPEN_WITH_WCHAR
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit basic_ofstream(const wchar_t* __s, ios_base::openmode __mode = ios_base::out);
 #endif
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit basic_ofstream(const string& __s, ios_base::openmode __mode = ios_base::out);
 
-#if _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
-    _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
+#if _LIBCUDACXX_STD_VER >= 17 && !defined(_LIBCUDACXX_HAS_NO_FILESYSTEM_LIBRARY)
+    _LIBCUDACXX_AVAILABILITY_FILESYSTEM _LIBCUDACXX_INLINE_VISIBILITY
     explicit basic_ofstream(const filesystem::path& __p, ios_base::openmode __mode = ios_base::out)
       : basic_ofstream(__p.c_str(), __mode) {}
-#endif // _LIBCPP_STD_VER >= 17
+#endif // _LIBCUDACXX_STD_VER >= 17
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_ofstream(basic_ofstream&& __rhs);
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_ofstream& operator=(basic_ofstream&& __rhs);
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void swap(basic_ofstream& __rhs);
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_filebuf<char_type, traits_type>* rdbuf() const;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool is_open() const;
     void open(const char* __s, ios_base::openmode __mode = ios_base::out);
-#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR
+#ifdef _LIBCUDACXX_HAS_OPEN_WITH_WCHAR
     void open(const wchar_t* __s, ios_base::openmode __mode = ios_base::out);
 #endif
     void open(const string& __s, ios_base::openmode __mode = ios_base::out);
 
-#if _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
-    _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
+#if _LIBCUDACXX_STD_VER >= 17 && !defined(_LIBCUDACXX_HAS_NO_FILESYSTEM_LIBRARY)
+    _LIBCUDACXX_AVAILABILITY_FILESYSTEM _LIBCUDACXX_INLINE_VISIBILITY
     void open(const filesystem::path& __p, ios_base::openmode __mode = ios_base::out)
     { return open(__p.c_str(), __mode); }
-#endif // _LIBCPP_STD_VER >= 17
+#endif // _LIBCUDACXX_STD_VER >= 17
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __open(int __fd, ios_base::openmode __mode);
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void close();
 
 private:
@@ -1419,7 +1419,7 @@ basic_ofstream<_CharT, _Traits>::basic_ofstream(const char* __s, ios_base::openm
         this->setstate(ios_base::failbit);
 }
 
-#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR
+#ifdef _LIBCUDACXX_HAS_OPEN_WITH_WCHAR
 template <class _CharT, class _Traits>
 inline
 basic_ofstream<_CharT, _Traits>::basic_ofstream(const wchar_t* __s, ios_base::openmode __mode)
@@ -1442,8 +1442,8 @@ basic_ofstream<_CharT, _Traits>::basic_ofstream(const string& __s, ios_base::ope
 template <class _CharT, class _Traits>
 inline
 basic_ofstream<_CharT, _Traits>::basic_ofstream(basic_ofstream&& __rhs)
-    : basic_ostream<char_type, traits_type>(_VSTD::move(__rhs)),
-      __sb_(_VSTD::move(__rhs.__sb_))
+    : basic_ostream<char_type, traits_type>(_CUDA_VSTD::move(__rhs)),
+      __sb_(_CUDA_VSTD::move(__rhs.__sb_))
 {
     this->set_rdbuf(&__sb_);
 }
@@ -1453,8 +1453,8 @@ inline
 basic_ofstream<_CharT, _Traits>&
 basic_ofstream<_CharT, _Traits>::operator=(basic_ofstream&& __rhs)
 {
-    basic_ostream<char_type, traits_type>::operator=(_VSTD::move(__rhs));
-    __sb_ = _VSTD::move(__rhs.__sb_);
+    basic_ostream<char_type, traits_type>::operator=(_CUDA_VSTD::move(__rhs));
+    __sb_ = _CUDA_VSTD::move(__rhs.__sb_);
     return *this;
 }
 
@@ -1468,7 +1468,7 @@ basic_ofstream<_CharT, _Traits>::swap(basic_ofstream& __rhs)
 }
 
 template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 swap(basic_ofstream<_CharT, _Traits>& __x, basic_ofstream<_CharT, _Traits>& __y)
 {
@@ -1501,7 +1501,7 @@ basic_ofstream<_CharT, _Traits>::open(const char* __s, ios_base::openmode __mode
         this->setstate(ios_base::failbit);
 }
 
-#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR
+#ifdef _LIBCUDACXX_HAS_OPEN_WITH_WCHAR
 template <class _CharT, class _Traits>
 void
 basic_ofstream<_CharT, _Traits>::open(const wchar_t* __s, ios_base::openmode __mode)
@@ -1545,7 +1545,7 @@ basic_ofstream<_CharT, _Traits>::close()
 // basic_fstream
 
 template <class _CharT, class _Traits>
-class _LIBCPP_TEMPLATE_VIS basic_fstream
+class _LIBCUDACXX_TEMPLATE_VIS basic_fstream
     : public basic_iostream<_CharT, _Traits>
 {
 public:
@@ -1555,49 +1555,49 @@ public:
     typedef typename traits_type::pos_type pos_type;
     typedef typename traits_type::off_type off_type;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_fstream();
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit basic_fstream(const char* __s, ios_base::openmode __mode = ios_base::in | ios_base::out);
-#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR
-    _LIBCPP_INLINE_VISIBILITY
+#ifdef _LIBCUDACXX_HAS_OPEN_WITH_WCHAR
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit basic_fstream(const wchar_t* __s, ios_base::openmode __mode = ios_base::in | ios_base::out);
 #endif
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit basic_fstream(const string& __s, ios_base::openmode __mode = ios_base::in | ios_base::out);
 
-#if _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
-    _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
+#if _LIBCUDACXX_STD_VER >= 17 && !defined(_LIBCUDACXX_HAS_NO_FILESYSTEM_LIBRARY)
+    _LIBCUDACXX_AVAILABILITY_FILESYSTEM _LIBCUDACXX_INLINE_VISIBILITY
     explicit basic_fstream(const filesystem::path& __p, ios_base::openmode __mode = ios_base::in | ios_base::out)
       : basic_fstream(__p.c_str(), __mode) {}
-#endif // _LIBCPP_STD_VER >= 17
+#endif // _LIBCUDACXX_STD_VER >= 17
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_fstream(basic_fstream&& __rhs);
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_fstream& operator=(basic_fstream&& __rhs);
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void swap(basic_fstream& __rhs);
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_filebuf<char_type, traits_type>* rdbuf() const;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool is_open() const;
     void open(const char* __s, ios_base::openmode __mode = ios_base::in | ios_base::out);
-#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR
+#ifdef _LIBCUDACXX_HAS_OPEN_WITH_WCHAR
     void open(const wchar_t* __s, ios_base::openmode __mode = ios_base::in | ios_base::out);
 #endif
     void open(const string& __s, ios_base::openmode __mode = ios_base::in | ios_base::out);
 
-#if _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
-    _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
+#if _LIBCUDACXX_STD_VER >= 17 && !defined(_LIBCUDACXX_HAS_NO_FILESYSTEM_LIBRARY)
+    _LIBCUDACXX_AVAILABILITY_FILESYSTEM _LIBCUDACXX_INLINE_VISIBILITY
     void open(const filesystem::path& __p, ios_base::openmode __mode = ios_base::in|ios_base::out)
     { return open(__p.c_str(), __mode); }
-#endif // _LIBCPP_STD_VER >= 17
+#endif // _LIBCUDACXX_STD_VER >= 17
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void close();
 
 private:
@@ -1620,7 +1620,7 @@ basic_fstream<_CharT, _Traits>::basic_fstream(const char* __s, ios_base::openmod
         this->setstate(ios_base::failbit);
 }
 
-#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR
+#ifdef _LIBCUDACXX_HAS_OPEN_WITH_WCHAR
 template <class _CharT, class _Traits>
 inline
 basic_fstream<_CharT, _Traits>::basic_fstream(const wchar_t* __s, ios_base::openmode __mode)
@@ -1643,8 +1643,8 @@ basic_fstream<_CharT, _Traits>::basic_fstream(const string& __s, ios_base::openm
 template <class _CharT, class _Traits>
 inline
 basic_fstream<_CharT, _Traits>::basic_fstream(basic_fstream&& __rhs)
-    : basic_iostream<char_type, traits_type>(_VSTD::move(__rhs)),
-      __sb_(_VSTD::move(__rhs.__sb_))
+    : basic_iostream<char_type, traits_type>(_CUDA_VSTD::move(__rhs)),
+      __sb_(_CUDA_VSTD::move(__rhs.__sb_))
 {
     this->set_rdbuf(&__sb_);
 }
@@ -1654,8 +1654,8 @@ inline
 basic_fstream<_CharT, _Traits>&
 basic_fstream<_CharT, _Traits>::operator=(basic_fstream&& __rhs)
 {
-    basic_iostream<char_type, traits_type>::operator=(_VSTD::move(__rhs));
-    __sb_ = _VSTD::move(__rhs.__sb_);
+    basic_iostream<char_type, traits_type>::operator=(_CUDA_VSTD::move(__rhs));
+    __sb_ = _CUDA_VSTD::move(__rhs.__sb_);
     return *this;
 }
 
@@ -1669,7 +1669,7 @@ basic_fstream<_CharT, _Traits>::swap(basic_fstream& __rhs)
 }
 
 template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 swap(basic_fstream<_CharT, _Traits>& __x, basic_fstream<_CharT, _Traits>& __y)
 {
@@ -1702,7 +1702,7 @@ basic_fstream<_CharT, _Traits>::open(const char* __s, ios_base::openmode __mode)
         this->setstate(ios_base::failbit);
 }
 
-#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR
+#ifdef _LIBCUDACXX_HAS_OPEN_WITH_WCHAR
 template <class _CharT, class _Traits>
 void
 basic_fstream<_CharT, _Traits>::open(const wchar_t* __s, ios_base::openmode __mode)
@@ -1733,14 +1733,14 @@ basic_fstream<_CharT, _Traits>::close()
         this->setstate(ios_base::failbit);
 }
 
-#if defined(_LIBCPP_ABI_ENABLE_ADDITIONAL_IOSTREAM_EXPLICIT_INSTANTIATIONS_1)
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ifstream<char>;
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ofstream<char>;
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_filebuf<char>;
+#if defined(_LIBCUDACXX_ABI_ENABLE_ADDITIONAL_IOSTREAM_EXPLICIT_INSTANTIATIONS_1)
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS basic_ifstream<char>;
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS basic_ofstream<char>;
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS basic_filebuf<char>;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP_FSTREAM
+#endif // _LIBCUDACXX_FSTREAM

diff  --git a/libcxx/include/functional b/libcxx/include/functional
index de02059f642a..19a3accf4cbb 100644
--- a/libcxx/include/functional
+++ b/libcxx/include/functional
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_FUNCTIONAL
-#define _LIBCPP_FUNCTIONAL
+#ifndef _LIBCUDACXX_FUNCTIONAL
+#define _LIBCUDACXX_FUNCTIONAL
 
 /*
     functional synopsis
@@ -539,12 +539,12 @@ POLICY:  For non-variadic implementations, the number of arguments is limited
 #include <typeinfo>
 #include <version>
 
-#ifndef _LIBCPP_REMOVE_TRANSITIVE_INCLUDES
+#ifndef _LIBCUDACXX_REMOVE_TRANSITIVE_INCLUDES
 #  include <utility>
 #endif
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#endif // _LIBCPP_FUNCTIONAL
+#endif // _LIBCUDACXX_FUNCTIONAL

diff  --git a/libcxx/include/future b/libcxx/include/future
index cedab3608ad2..db5b024533e6 100644
--- a/libcxx/include/future
+++ b/libcxx/include/future
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_FUTURE
-#define _LIBCPP_FUTURE
+#ifndef _LIBCUDACXX_FUTURE
+#define _LIBCUDACXX_FUTURE
 
 /*
     future synopsis
@@ -378,53 +378,53 @@ template <class R, class Alloc> struct uses_allocator<packaged_task<R>, Alloc>;
 #include <thread>
 #include <version>
 
-#ifndef _LIBCPP_REMOVE_TRANSITIVE_INCLUDES
+#ifndef _LIBCUDACXX_REMOVE_TRANSITIVE_INCLUDES
 #  include <chrono>
 #endif
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#ifdef _LIBCPP_HAS_NO_THREADS
+#ifdef _LIBCUDACXX_HAS_NO_THREADS
 # error "<future> is not supported since libc++ has been configured without support for threads."
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 //enum class future_errc
-_LIBCPP_DECLARE_STRONG_ENUM(future_errc)
+_LIBCUDACXX_DECLARE_STRONG_ENUM(future_errc)
 {
     future_already_retrieved = 1,
     promise_already_satisfied,
     no_state,
     broken_promise
 };
-_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(future_errc)
+_LIBCUDACXX_DECLARE_STRONG_ENUM_EPILOG(future_errc)
 
 template <>
-struct _LIBCPP_TEMPLATE_VIS is_error_code_enum<future_errc> : public true_type {};
+struct _LIBCUDACXX_TEMPLATE_VIS is_error_code_enum<future_errc> : public true_type {};
 
-#ifdef _LIBCPP_CXX03_LANG
+#ifdef _LIBCUDACXX_CXX03_LANG
 template <>
-struct _LIBCPP_TEMPLATE_VIS is_error_code_enum<future_errc::__lx> : public true_type { };
+struct _LIBCUDACXX_TEMPLATE_VIS is_error_code_enum<future_errc::__lx> : public true_type { };
 #endif
 
 //enum class launch
-_LIBCPP_DECLARE_STRONG_ENUM(launch)
+_LIBCUDACXX_DECLARE_STRONG_ENUM(launch)
 {
     async = 1,
     deferred = 2,
     any = async | deferred
 };
-_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(launch)
+_LIBCUDACXX_DECLARE_STRONG_ENUM_EPILOG(launch)
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
 typedef underlying_type<launch>::type __launch_underlying_type;
 
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR
 launch
 operator&(launch __x, launch __y)
 {
@@ -432,8 +432,8 @@ operator&(launch __x, launch __y)
                                static_cast<__launch_underlying_type>(__y));
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR
 launch
 operator|(launch __x, launch __y)
 {
@@ -441,8 +441,8 @@ operator|(launch __x, launch __y)
                                static_cast<__launch_underlying_type>(__y));
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR
 launch
 operator^(launch __x, launch __y)
 {
@@ -450,92 +450,92 @@ operator^(launch __x, launch __y)
                                static_cast<__launch_underlying_type>(__y));
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR
 launch
 operator~(launch __x)
 {
     return static_cast<launch>(~static_cast<__launch_underlying_type>(__x) & 3);
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 launch&
 operator&=(launch& __x, launch __y)
 {
     __x = __x & __y; return __x;
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 launch&
 operator|=(launch& __x, launch __y)
 {
     __x = __x | __y; return __x;
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 launch&
 operator^=(launch& __x, launch __y)
 {
     __x = __x ^ __y; return __x;
 }
 
-#endif // !_LIBCPP_CXX03_LANG
+#endif // !_LIBCUDACXX_CXX03_LANG
 
 //enum class future_status
-_LIBCPP_DECLARE_STRONG_ENUM(future_status)
+_LIBCUDACXX_DECLARE_STRONG_ENUM(future_status)
 {
     ready,
     timeout,
     deferred
 };
-_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(future_status)
+_LIBCUDACXX_DECLARE_STRONG_ENUM_EPILOG(future_status)
 
-_LIBCPP_FUNC_VIS
+_LIBCUDACXX_FUNC_VIS
 const error_category& future_category() _NOEXCEPT;
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 error_code
 make_error_code(future_errc __e) _NOEXCEPT
 {
     return error_code(static_cast<int>(__e), future_category());
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 error_condition
 make_error_condition(future_errc __e) _NOEXCEPT
 {
     return error_condition(static_cast<int>(__e), future_category());
 }
 
-class _LIBCPP_EXCEPTION_ABI _LIBCPP_AVAILABILITY_FUTURE_ERROR future_error
+class _LIBCUDACXX_EXCEPTION_ABI _LIBCUDACXX_AVAILABILITY_FUTURE_ERROR future_error
     : public logic_error
 {
     error_code __ec_;
 public:
     future_error(error_code __ec);
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const error_code& code() const _NOEXCEPT {return __ec_;}
 
     future_error(const future_error&) _NOEXCEPT = default;
     virtual ~future_error() _NOEXCEPT;
 };
 
-_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
-#ifndef _LIBCPP_NO_EXCEPTIONS
-_LIBCPP_AVAILABILITY_FUTURE_ERROR
+_LIBCUDACXX_NORETURN inline _LIBCUDACXX_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
+_LIBCUDACXX_AVAILABILITY_FUTURE_ERROR
 #endif
 void __throw_future_error(future_errc __ev)
 {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     throw future_error(make_error_code(__ev));
 #else
     ((void)__ev);
-    _VSTD::abort();
+    _CUDA_VSTD::abort();
 #endif
 }
 
-class _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_FUTURE __assoc_sub_state
+class _LIBCUDACXX_TYPE_VIS _LIBCUDACXX_AVAILABILITY_FUTURE __assoc_sub_state
     : public __shared_count
 {
 protected:
@@ -555,14 +555,14 @@ public:
         deferred = 8
     };
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __assoc_sub_state() : __state_(0) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool __has_value() const
         {return (__state_ & __constructed) || (__exception_ != nullptr);}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __attach_future() {
         lock_guard<mutex> __lk(__mut_);
         bool __has_future_attached = (__state_ & __future_attached) != 0;
@@ -572,11 +572,11 @@ public:
         __state_ |= __future_attached;
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __set_deferred() {__state_ |= deferred;}
 
     void __make_ready();
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool __is_ready() const {return (__state_ & ready) != 0;}
 
     void set_value();
@@ -590,10 +590,10 @@ public:
     void wait();
     template <class _Rep, class _Period>
         future_status
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         wait_for(const chrono::duration<_Rep, _Period>& __rel_time) const;
     template <class _Clock, class _Duration>
-        _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
+        _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
         future_status
         wait_until(const chrono::time_point<_Clock, _Duration>& __abs_time) const;
 
@@ -623,7 +623,7 @@ __assoc_sub_state::wait_for(const chrono::duration<_Rep, _Period>& __rel_time) c
 }
 
 template <class _Rp>
-class _LIBCPP_AVAILABILITY_FUTURE _LIBCPP_HIDDEN __assoc_state
+class _LIBCUDACXX_AVAILABILITY_FUTURE _LIBCUDACXX_HIDDEN __assoc_state
     : public __assoc_sub_state
 {
     typedef __assoc_sub_state base;
@@ -655,14 +655,14 @@ __assoc_state<_Rp>::__on_zero_shared() _NOEXCEPT
 
 template <class _Rp>
 template <class _Arg>
-_LIBCPP_AVAILABILITY_FUTURE
+_LIBCUDACXX_AVAILABILITY_FUTURE
 void
 __assoc_state<_Rp>::set_value(_Arg&& __arg)
 {
     unique_lock<mutex> __lk(this->__mut_);
     if (this->__has_value())
         __throw_future_error(future_errc::promise_already_satisfied);
-    ::new ((void*)&__value_) _Rp(_VSTD::forward<_Arg>(__arg));
+    ::new ((void*)&__value_) _Rp(_CUDA_VSTD::forward<_Arg>(__arg));
     this->__state_ |= base::__constructed | base::ready;
     __cv_.notify_all();
 }
@@ -675,7 +675,7 @@ __assoc_state<_Rp>::set_value_at_thread_exit(_Arg&& __arg)
     unique_lock<mutex> __lk(this->__mut_);
     if (this->__has_value())
         __throw_future_error(future_errc::promise_already_satisfied);
-    ::new ((void*)&__value_) _Rp(_VSTD::forward<_Arg>(__arg));
+    ::new ((void*)&__value_) _Rp(_CUDA_VSTD::forward<_Arg>(__arg));
     this->__state_ |= base::__constructed;
     __thread_local_data()->__make_ready_at_thread_exit(this);
 }
@@ -688,7 +688,7 @@ __assoc_state<_Rp>::move()
     this->__sub_wait(__lk);
     if (this->__exception_ != nullptr)
         rethrow_exception(this->__exception_);
-    return _VSTD::move(*reinterpret_cast<_Rp*>(&__value_));
+    return _CUDA_VSTD::move(*reinterpret_cast<_Rp*>(&__value_));
 }
 
 template <class _Rp>
@@ -703,7 +703,7 @@ __assoc_state<_Rp>::copy()
 }
 
 template <class _Rp>
-class _LIBCPP_AVAILABILITY_FUTURE __assoc_state<_Rp&>
+class _LIBCUDACXX_AVAILABILITY_FUTURE __assoc_state<_Rp&>
     : public __assoc_sub_state
 {
     typedef __assoc_sub_state base;
@@ -734,7 +734,7 @@ __assoc_state<_Rp&>::set_value(_Rp& __arg)
     unique_lock<mutex> __lk(this->__mut_);
     if (this->__has_value())
         __throw_future_error(future_errc::promise_already_satisfied);
-    __value_ = _VSTD::addressof(__arg);
+    __value_ = _CUDA_VSTD::addressof(__arg);
     this->__state_ |= base::__constructed | base::ready;
     __cv_.notify_all();
 }
@@ -746,7 +746,7 @@ __assoc_state<_Rp&>::set_value_at_thread_exit(_Rp& __arg)
     unique_lock<mutex> __lk(this->__mut_);
     if (this->__has_value())
         __throw_future_error(future_errc::promise_already_satisfied);
-    __value_ = _VSTD::addressof(__arg);
+    __value_ = _CUDA_VSTD::addressof(__arg);
     this->__state_ |= base::__constructed;
     __thread_local_data()->__make_ready_at_thread_exit(this);
 }
@@ -763,7 +763,7 @@ __assoc_state<_Rp&>::copy()
 }
 
 template <class _Rp, class _Alloc>
-class _LIBCPP_AVAILABILITY_FUTURE __assoc_state_alloc
+class _LIBCUDACXX_AVAILABILITY_FUTURE __assoc_state_alloc
     : public __assoc_state<_Rp>
 {
     typedef __assoc_state<_Rp> base;
@@ -771,7 +771,7 @@ class _LIBCPP_AVAILABILITY_FUTURE __assoc_state_alloc
 
     virtual void __on_zero_shared() _NOEXCEPT;
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __assoc_state_alloc(const _Alloc& __a)
         : __alloc_(__a) {}
 };
@@ -781,7 +781,7 @@ void
 __assoc_state_alloc<_Rp, _Alloc>::__on_zero_shared() _NOEXCEPT
 {
     if (this->__state_ & base::__constructed)
-        reinterpret_cast<_Rp*>(_VSTD::addressof(this->__value_))->~_Rp();
+        reinterpret_cast<_Rp*>(_CUDA_VSTD::addressof(this->__value_))->~_Rp();
     typedef typename __allocator_traits_rebind<_Alloc, __assoc_state_alloc>::type _Al;
     typedef allocator_traits<_Al> _ATraits;
     typedef pointer_traits<typename _ATraits::pointer> _PTraits;
@@ -791,7 +791,7 @@ __assoc_state_alloc<_Rp, _Alloc>::__on_zero_shared() _NOEXCEPT
 }
 
 template <class _Rp, class _Alloc>
-class _LIBCPP_AVAILABILITY_FUTURE __assoc_state_alloc<_Rp&, _Alloc>
+class _LIBCUDACXX_AVAILABILITY_FUTURE __assoc_state_alloc<_Rp&, _Alloc>
     : public __assoc_state<_Rp&>
 {
     typedef __assoc_state<_Rp&> base;
@@ -799,7 +799,7 @@ class _LIBCPP_AVAILABILITY_FUTURE __assoc_state_alloc<_Rp&, _Alloc>
 
     virtual void __on_zero_shared() _NOEXCEPT;
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __assoc_state_alloc(const _Alloc& __a)
         : __alloc_(__a) {}
 };
@@ -817,7 +817,7 @@ __assoc_state_alloc<_Rp&, _Alloc>::__on_zero_shared() _NOEXCEPT
 }
 
 template <class _Alloc>
-class _LIBCPP_AVAILABILITY_FUTURE __assoc_sub_state_alloc
+class _LIBCUDACXX_AVAILABILITY_FUTURE __assoc_sub_state_alloc
     : public __assoc_sub_state
 {
     typedef __assoc_sub_state base;
@@ -825,7 +825,7 @@ class _LIBCPP_AVAILABILITY_FUTURE __assoc_sub_state_alloc
 
     virtual void __on_zero_shared() _NOEXCEPT;
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __assoc_sub_state_alloc(const _Alloc& __a)
         : __alloc_(__a) {}
 };
@@ -843,7 +843,7 @@ __assoc_sub_state_alloc<_Alloc>::__on_zero_shared() _NOEXCEPT
 }
 
 template <class _Rp, class _Fp>
-class _LIBCPP_AVAILABILITY_FUTURE __deferred_assoc_state
+class _LIBCUDACXX_AVAILABILITY_FUTURE __deferred_assoc_state
     : public __assoc_state<_Rp>
 {
     typedef __assoc_state<_Rp> base;
@@ -851,7 +851,7 @@ class _LIBCPP_AVAILABILITY_FUTURE __deferred_assoc_state
     _Fp __func_;
 
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __deferred_assoc_state(_Fp&& __f);
 
     virtual void __execute();
@@ -860,7 +860,7 @@ public:
 template <class _Rp, class _Fp>
 inline
 __deferred_assoc_state<_Rp, _Fp>::__deferred_assoc_state(_Fp&& __f)
-    : __func_(_VSTD::forward<_Fp>(__f))
+    : __func_(_CUDA_VSTD::forward<_Fp>(__f))
 {
     this->__set_deferred();
 }
@@ -869,22 +869,22 @@ template <class _Rp, class _Fp>
 void
 __deferred_assoc_state<_Rp, _Fp>::__execute()
 {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     try
     {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
         this->set_value(__func_());
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     }
     catch (...)
     {
         this->set_exception(current_exception());
     }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
 }
 
 template <class _Fp>
-class _LIBCPP_AVAILABILITY_FUTURE __deferred_assoc_state<void, _Fp>
+class _LIBCUDACXX_AVAILABILITY_FUTURE __deferred_assoc_state<void, _Fp>
     : public __assoc_sub_state
 {
     typedef __assoc_sub_state base;
@@ -892,7 +892,7 @@ class _LIBCPP_AVAILABILITY_FUTURE __deferred_assoc_state<void, _Fp>
     _Fp __func_;
 
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __deferred_assoc_state(_Fp&& __f);
 
     virtual void __execute();
@@ -901,7 +901,7 @@ public:
 template <class _Fp>
 inline
 __deferred_assoc_state<void, _Fp>::__deferred_assoc_state(_Fp&& __f)
-    : __func_(_VSTD::forward<_Fp>(__f))
+    : __func_(_CUDA_VSTD::forward<_Fp>(__f))
 {
     this->__set_deferred();
 }
@@ -910,23 +910,23 @@ template <class _Fp>
 void
 __deferred_assoc_state<void, _Fp>::__execute()
 {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     try
     {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
         __func_();
         this->set_value();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     }
     catch (...)
     {
         this->set_exception(current_exception());
     }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
 }
 
 template <class _Rp, class _Fp>
-class _LIBCPP_AVAILABILITY_FUTURE __async_assoc_state
+class _LIBCUDACXX_AVAILABILITY_FUTURE __async_assoc_state
     : public __assoc_state<_Rp>
 {
     typedef __assoc_state<_Rp> base;
@@ -935,7 +935,7 @@ class _LIBCPP_AVAILABILITY_FUTURE __async_assoc_state
 
     virtual void __on_zero_shared() _NOEXCEPT;
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __async_assoc_state(_Fp&& __f);
 
     virtual void __execute();
@@ -944,7 +944,7 @@ public:
 template <class _Rp, class _Fp>
 inline
 __async_assoc_state<_Rp, _Fp>::__async_assoc_state(_Fp&& __f)
-    : __func_(_VSTD::forward<_Fp>(__f))
+    : __func_(_CUDA_VSTD::forward<_Fp>(__f))
 {
 }
 
@@ -952,18 +952,18 @@ template <class _Rp, class _Fp>
 void
 __async_assoc_state<_Rp, _Fp>::__execute()
 {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     try
     {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
         this->set_value(__func_());
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     }
     catch (...)
     {
         this->set_exception(current_exception());
     }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
 }
 
 template <class _Rp, class _Fp>
@@ -975,7 +975,7 @@ __async_assoc_state<_Rp, _Fp>::__on_zero_shared() _NOEXCEPT
 }
 
 template <class _Fp>
-class _LIBCPP_AVAILABILITY_FUTURE __async_assoc_state<void, _Fp>
+class _LIBCUDACXX_AVAILABILITY_FUTURE __async_assoc_state<void, _Fp>
     : public __assoc_sub_state
 {
     typedef __assoc_sub_state base;
@@ -984,7 +984,7 @@ class _LIBCPP_AVAILABILITY_FUTURE __async_assoc_state<void, _Fp>
 
     virtual void __on_zero_shared() _NOEXCEPT;
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __async_assoc_state(_Fp&& __f);
 
     virtual void __execute();
@@ -993,7 +993,7 @@ public:
 template <class _Fp>
 inline
 __async_assoc_state<void, _Fp>::__async_assoc_state(_Fp&& __f)
-    : __func_(_VSTD::forward<_Fp>(__f))
+    : __func_(_CUDA_VSTD::forward<_Fp>(__f))
 {
 }
 
@@ -1001,19 +1001,19 @@ template <class _Fp>
 void
 __async_assoc_state<void, _Fp>::__execute()
 {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     try
     {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
         __func_();
         this->set_value();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     }
     catch (...)
     {
         this->set_exception(current_exception());
     }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
 }
 
 template <class _Fp>
@@ -1024,23 +1024,23 @@ __async_assoc_state<void, _Fp>::__on_zero_shared() _NOEXCEPT
     base::__on_zero_shared();
 }
 
-template <class _Rp> class _LIBCPP_TEMPLATE_VIS promise;
-template <class _Rp> class _LIBCPP_TEMPLATE_VIS shared_future;
+template <class _Rp> class _LIBCUDACXX_TEMPLATE_VIS promise;
+template <class _Rp> class _LIBCUDACXX_TEMPLATE_VIS shared_future;
 
 // future
 
-template <class _Rp> class _LIBCPP_TEMPLATE_VIS future;
+template <class _Rp> class _LIBCUDACXX_TEMPLATE_VIS future;
 
 template <class _Rp, class _Fp>
-_LIBCPP_INLINE_VISIBILITY future<_Rp>
+_LIBCUDACXX_INLINE_VISIBILITY future<_Rp>
 __make_deferred_assoc_state(_Fp&& __f);
 
 template <class _Rp, class _Fp>
-_LIBCPP_INLINE_VISIBILITY future<_Rp>
+_LIBCUDACXX_INLINE_VISIBILITY future<_Rp>
 __make_async_assoc_state(_Fp&& __f);
 
 template <class _Rp>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FUTURE future
+class _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_AVAILABILITY_FUTURE future
 {
     __assoc_state<_Rp>* __state_;
 
@@ -1055,43 +1055,43 @@ class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FUTURE future
         friend future<_R1> __make_async_assoc_state(_Fp&& __f);
 
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     future() _NOEXCEPT : __state_(nullptr) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     future(future&& __rhs) _NOEXCEPT
         : __state_(__rhs.__state_) {__rhs.__state_ = nullptr;}
     future(const future&) = delete;
     future& operator=(const future&) = delete;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     future& operator=(future&& __rhs) _NOEXCEPT
         {
-            future(_VSTD::move(__rhs)).swap(*this);
+            future(_CUDA_VSTD::move(__rhs)).swap(*this);
             return *this;
         }
 
     ~future();
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     shared_future<_Rp> share() _NOEXCEPT;
 
     // retrieving the value
     _Rp get();
 
-    _LIBCPP_INLINE_VISIBILITY
-    void swap(future& __rhs) _NOEXCEPT {_VSTD::swap(__state_, __rhs.__state_);}
+    _LIBCUDACXX_INLINE_VISIBILITY
+    void swap(future& __rhs) _NOEXCEPT {_CUDA_VSTD::swap(__state_, __rhs.__state_);}
 
     // functions to check state
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool valid() const _NOEXCEPT {return __state_ != nullptr;}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void wait() const {__state_->wait();}
     template <class _Rep, class _Period>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         future_status
         wait_for(const chrono::duration<_Rep, _Period>& __rel_time) const
             {return __state_->wait_for(__rel_time);}
     template <class _Clock, class _Duration>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         future_status
         wait_until(const chrono::time_point<_Clock, _Duration>& __abs_time) const
             {return __state_->wait_until(__abs_time);}
@@ -1127,7 +1127,7 @@ future<_Rp>::get()
 }
 
 template <class _Rp>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FUTURE future<_Rp&>
+class _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_AVAILABILITY_FUTURE future<_Rp&>
 {
     __assoc_state<_Rp&>* __state_;
 
@@ -1142,43 +1142,43 @@ class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FUTURE future<_Rp&>
         friend future<_R1> __make_async_assoc_state(_Fp&& __f);
 
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     future() _NOEXCEPT : __state_(nullptr) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     future(future&& __rhs) _NOEXCEPT
         : __state_(__rhs.__state_) {__rhs.__state_ = nullptr;}
     future(const future&) = delete;
     future& operator=(const future&) = delete;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     future& operator=(future&& __rhs) _NOEXCEPT
         {
-            future(_VSTD::move(__rhs)).swap(*this);
+            future(_CUDA_VSTD::move(__rhs)).swap(*this);
             return *this;
         }
 
     ~future();
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     shared_future<_Rp&> share() _NOEXCEPT;
 
     // retrieving the value
     _Rp& get();
 
-    _LIBCPP_INLINE_VISIBILITY
-    void swap(future& __rhs) _NOEXCEPT {_VSTD::swap(__state_, __rhs.__state_);}
+    _LIBCUDACXX_INLINE_VISIBILITY
+    void swap(future& __rhs) _NOEXCEPT {_CUDA_VSTD::swap(__state_, __rhs.__state_);}
 
     // functions to check state
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool valid() const _NOEXCEPT {return __state_ != nullptr;}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void wait() const {__state_->wait();}
     template <class _Rep, class _Period>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         future_status
         wait_for(const chrono::duration<_Rep, _Period>& __rel_time) const
             {return __state_->wait_for(__rel_time);}
     template <class _Clock, class _Duration>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         future_status
         wait_until(const chrono::time_point<_Clock, _Duration>& __abs_time) const
             {return __state_->wait_until(__abs_time);}
@@ -1209,7 +1209,7 @@ future<_Rp&>::get()
 }
 
 template <>
-class _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_FUTURE future<void>
+class _LIBCUDACXX_TYPE_VIS _LIBCUDACXX_AVAILABILITY_FUTURE future<void>
 {
     __assoc_sub_state* __state_;
 
@@ -1224,50 +1224,50 @@ class _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_FUTURE future<void>
         friend future<_R1> __make_async_assoc_state(_Fp&& __f);
 
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     future() _NOEXCEPT : __state_(nullptr) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     future(future&& __rhs) _NOEXCEPT
         : __state_(__rhs.__state_) {__rhs.__state_ = nullptr;}
     future(const future&) = delete;
     future& operator=(const future&) = delete;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     future& operator=(future&& __rhs) _NOEXCEPT
         {
-            future(_VSTD::move(__rhs)).swap(*this);
+            future(_CUDA_VSTD::move(__rhs)).swap(*this);
             return *this;
         }
 
     ~future();
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     shared_future<void> share() _NOEXCEPT;
 
     // retrieving the value
     void get();
 
-    _LIBCPP_INLINE_VISIBILITY
-    void swap(future& __rhs) _NOEXCEPT {_VSTD::swap(__state_, __rhs.__state_);}
+    _LIBCUDACXX_INLINE_VISIBILITY
+    void swap(future& __rhs) _NOEXCEPT {_CUDA_VSTD::swap(__state_, __rhs.__state_);}
 
     // functions to check state
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool valid() const _NOEXCEPT {return __state_ != nullptr;}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void wait() const {__state_->wait();}
     template <class _Rep, class _Period>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         future_status
         wait_for(const chrono::duration<_Rep, _Period>& __rel_time) const
             {return __state_->wait_for(__rel_time);}
     template <class _Clock, class _Duration>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         future_status
         wait_until(const chrono::time_point<_Clock, _Duration>& __abs_time) const
             {return __state_->wait_until(__abs_time);}
 };
 
 template <class _Rp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 swap(future<_Rp>& __x, future<_Rp>& __y) _NOEXCEPT
 {
@@ -1279,11 +1279,11 @@ swap(future<_Rp>& __x, future<_Rp>& __y) _NOEXCEPT
 template <class _Callable> class packaged_task;
 
 template <class _Rp>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FUTURE promise
+class _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_AVAILABILITY_FUTURE promise
 {
     __assoc_state<_Rp>* __state_;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit promise(nullptr_t) _NOEXCEPT : __state_(nullptr) {}
 
     template <class> friend class packaged_task;
@@ -1291,23 +1291,23 @@ public:
     promise();
     template <class _Alloc>
         promise(allocator_arg_t, const _Alloc& __a);
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     promise(promise&& __rhs) _NOEXCEPT
         : __state_(__rhs.__state_) {__rhs.__state_ = nullptr;}
     promise(const promise& __rhs) = delete;
     ~promise();
 
     // assignment
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     promise& operator=(promise&& __rhs) _NOEXCEPT
         {
-            promise(_VSTD::move(__rhs)).swap(*this);
+            promise(_CUDA_VSTD::move(__rhs)).swap(*this);
             return *this;
         }
     promise& operator=(const promise& __rhs) = delete;
 
-    _LIBCPP_INLINE_VISIBILITY
-    void swap(promise& __rhs) _NOEXCEPT {_VSTD::swap(__state_, __rhs.__state_);}
+    _LIBCUDACXX_INLINE_VISIBILITY
+    void swap(promise& __rhs) _NOEXCEPT {_CUDA_VSTD::swap(__state_, __rhs.__state_);}
 
     // retrieving the result
     future<_Rp> get_future();
@@ -1338,8 +1338,8 @@ promise<_Rp>::promise(allocator_arg_t, const _Alloc& __a0)
     typedef __allocator_destructor<_A2> _D2;
     _A2 __a(__a0);
     unique_ptr<_State, _D2> __hold(__a.allocate(1), _D2(__a, 1));
-    ::new ((void*)_VSTD::addressof(*__hold.get())) _State(__a0);
-    __state_ = _VSTD::addressof(*__hold.release());
+    ::new ((void*)_CUDA_VSTD::addressof(*__hold.get())) _State(__a0);
+    __state_ = _CUDA_VSTD::addressof(*__hold.release());
 }
 
 template <class _Rp>
@@ -1379,14 +1379,14 @@ promise<_Rp>::set_value(_Rp&& __r)
 {
     if (__state_ == nullptr)
         __throw_future_error(future_errc::no_state);
-    __state_->set_value(_VSTD::move(__r));
+    __state_->set_value(_CUDA_VSTD::move(__r));
 }
 
 template <class _Rp>
 void
 promise<_Rp>::set_exception(exception_ptr __p)
 {
-    _LIBCPP_ASSERT( __p != nullptr, "promise::set_exception: received nullptr" );
+    _LIBCUDACXX_ASSERT( __p != nullptr, "promise::set_exception: received nullptr" );
     if (__state_ == nullptr)
         __throw_future_error(future_errc::no_state);
     __state_->set_exception(__p);
@@ -1407,14 +1407,14 @@ promise<_Rp>::set_value_at_thread_exit(_Rp&& __r)
 {
     if (__state_ == nullptr)
         __throw_future_error(future_errc::no_state);
-    __state_->set_value_at_thread_exit(_VSTD::move(__r));
+    __state_->set_value_at_thread_exit(_CUDA_VSTD::move(__r));
 }
 
 template <class _Rp>
 void
 promise<_Rp>::set_exception_at_thread_exit(exception_ptr __p)
 {
-    _LIBCPP_ASSERT( __p != nullptr, "promise::set_exception_at_thread_exit: received nullptr" );
+    _LIBCUDACXX_ASSERT( __p != nullptr, "promise::set_exception_at_thread_exit: received nullptr" );
     if (__state_ == nullptr)
         __throw_future_error(future_errc::no_state);
     __state_->set_exception_at_thread_exit(__p);
@@ -1423,11 +1423,11 @@ promise<_Rp>::set_exception_at_thread_exit(exception_ptr __p)
 // promise<R&>
 
 template <class _Rp>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FUTURE promise<_Rp&>
+class _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_AVAILABILITY_FUTURE promise<_Rp&>
 {
     __assoc_state<_Rp&>* __state_;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit promise(nullptr_t) _NOEXCEPT : __state_(nullptr) {}
 
     template <class> friend class packaged_task;
@@ -1436,23 +1436,23 @@ public:
     promise();
     template <class _Allocator>
         promise(allocator_arg_t, const _Allocator& __a);
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     promise(promise&& __rhs) _NOEXCEPT
         : __state_(__rhs.__state_) {__rhs.__state_ = nullptr;}
     promise(const promise& __rhs) = delete;
     ~promise();
 
     // assignment
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     promise& operator=(promise&& __rhs) _NOEXCEPT
         {
-            promise(_VSTD::move(__rhs)).swap(*this);
+            promise(_CUDA_VSTD::move(__rhs)).swap(*this);
             return *this;
         }
     promise& operator=(const promise& __rhs) = delete;
 
-    _LIBCPP_INLINE_VISIBILITY
-    void swap(promise& __rhs) _NOEXCEPT {_VSTD::swap(__state_, __rhs.__state_);}
+    _LIBCUDACXX_INLINE_VISIBILITY
+    void swap(promise& __rhs) _NOEXCEPT {_CUDA_VSTD::swap(__state_, __rhs.__state_);}
 
     // retrieving the result
     future<_Rp&> get_future();
@@ -1481,8 +1481,8 @@ promise<_Rp&>::promise(allocator_arg_t, const _Alloc& __a0)
     typedef __allocator_destructor<_A2> _D2;
     _A2 __a(__a0);
     unique_ptr<_State, _D2> __hold(__a.allocate(1), _D2(__a, 1));
-    ::new ((void*)_VSTD::addressof(*__hold.get())) _State(__a0);
-    __state_ = _VSTD::addressof(*__hold.release());
+    ::new ((void*)_CUDA_VSTD::addressof(*__hold.get())) _State(__a0);
+    __state_ = _CUDA_VSTD::addressof(*__hold.release());
 }
 
 template <class _Rp>
@@ -1520,7 +1520,7 @@ template <class _Rp>
 void
 promise<_Rp&>::set_exception(exception_ptr __p)
 {
-    _LIBCPP_ASSERT( __p != nullptr, "promise::set_exception: received nullptr" );
+    _LIBCUDACXX_ASSERT( __p != nullptr, "promise::set_exception: received nullptr" );
     if (__state_ == nullptr)
         __throw_future_error(future_errc::no_state);
     __state_->set_exception(__p);
@@ -1539,7 +1539,7 @@ template <class _Rp>
 void
 promise<_Rp&>::set_exception_at_thread_exit(exception_ptr __p)
 {
-    _LIBCPP_ASSERT( __p != nullptr, "promise::set_exception_at_thread_exit: received nullptr" );
+    _LIBCUDACXX_ASSERT( __p != nullptr, "promise::set_exception_at_thread_exit: received nullptr" );
     if (__state_ == nullptr)
         __throw_future_error(future_errc::no_state);
     __state_->set_exception_at_thread_exit(__p);
@@ -1548,11 +1548,11 @@ promise<_Rp&>::set_exception_at_thread_exit(exception_ptr __p)
 // promise<void>
 
 template <>
-class _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_FUTURE promise<void>
+class _LIBCUDACXX_TYPE_VIS _LIBCUDACXX_AVAILABILITY_FUTURE promise<void>
 {
     __assoc_sub_state* __state_;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit promise(nullptr_t) _NOEXCEPT : __state_(nullptr) {}
 
     template <class> friend class packaged_task;
@@ -1560,25 +1560,25 @@ class _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_FUTURE promise<void>
 public:
     promise();
     template <class _Allocator>
-        _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
+        _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
         promise(allocator_arg_t, const _Allocator& __a);
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     promise(promise&& __rhs) _NOEXCEPT
         : __state_(__rhs.__state_) {__rhs.__state_ = nullptr;}
     promise(const promise& __rhs) = delete;
     ~promise();
 
     // assignment
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     promise& operator=(promise&& __rhs) _NOEXCEPT
         {
-            promise(_VSTD::move(__rhs)).swap(*this);
+            promise(_CUDA_VSTD::move(__rhs)).swap(*this);
             return *this;
         }
     promise& operator=(const promise& __rhs) = delete;
 
-    _LIBCPP_INLINE_VISIBILITY
-    void swap(promise& __rhs) _NOEXCEPT {_VSTD::swap(__state_, __rhs.__state_);}
+    _LIBCUDACXX_INLINE_VISIBILITY
+    void swap(promise& __rhs) _NOEXCEPT {_CUDA_VSTD::swap(__state_, __rhs.__state_);}
 
     // retrieving the result
     future<void> get_future();
@@ -1600,12 +1600,12 @@ promise<void>::promise(allocator_arg_t, const _Alloc& __a0)
     typedef __allocator_destructor<_A2> _D2;
     _A2 __a(__a0);
     unique_ptr<_State, _D2> __hold(__a.allocate(1), _D2(__a, 1));
-    ::new ((void*)_VSTD::addressof(*__hold.get())) _State(__a0);
-    __state_ = _VSTD::addressof(*__hold.release());
+    ::new ((void*)_CUDA_VSTD::addressof(*__hold.get())) _State(__a0);
+    __state_ = _CUDA_VSTD::addressof(*__hold.release());
 }
 
 template <class _Rp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 swap(promise<_Rp>& __x, promise<_Rp>& __y) _NOEXCEPT
 {
@@ -1613,7 +1613,7 @@ swap(promise<_Rp>& __x, promise<_Rp>& __y) _NOEXCEPT
 }
 
 template <class _Rp, class _Alloc>
-    struct _LIBCPP_TEMPLATE_VIS uses_allocator<promise<_Rp>, _Alloc>
+    struct _LIBCUDACXX_TEMPLATE_VIS uses_allocator<promise<_Rp>, _Alloc>
         : public true_type {};
 
 // packaged_task
@@ -1621,14 +1621,14 @@ template <class _Rp, class _Alloc>
 template<class _Fp> class __packaged_task_base;
 
 template<class _Rp, class ..._ArgTypes>
-class _LIBCPP_AVAILABILITY_FUTURE __packaged_task_base<_Rp(_ArgTypes...)>
+class _LIBCUDACXX_AVAILABILITY_FUTURE __packaged_task_base<_Rp(_ArgTypes...)>
 {
     __packaged_task_base(const __packaged_task_base&);
     __packaged_task_base& operator=(const __packaged_task_base&);
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __packaged_task_base() {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     virtual ~__packaged_task_base() {}
     virtual void __move_to(__packaged_task_base*) _NOEXCEPT = 0;
     virtual void destroy() = 0;
@@ -1639,21 +1639,21 @@ public:
 template<class _FD, class _Alloc, class _FB> class __packaged_task_func;
 
 template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
-class _LIBCPP_AVAILABILITY_FUTURE __packaged_task_func<_Fp, _Alloc, _Rp(_ArgTypes...)>
+class _LIBCUDACXX_AVAILABILITY_FUTURE __packaged_task_func<_Fp, _Alloc, _Rp(_ArgTypes...)>
     : public  __packaged_task_base<_Rp(_ArgTypes...)>
 {
     __compressed_pair<_Fp, _Alloc> __f_;
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __packaged_task_func(const _Fp& __f) : __f_(__f, __default_init_tag()) {}
-    _LIBCPP_INLINE_VISIBILITY
-    explicit __packaged_task_func(_Fp&& __f) : __f_(_VSTD::move(__f), __default_init_tag()) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
+    explicit __packaged_task_func(_Fp&& __f) : __f_(_CUDA_VSTD::move(__f), __default_init_tag()) {}
+    _LIBCUDACXX_INLINE_VISIBILITY
     __packaged_task_func(const _Fp& __f, const _Alloc& __a)
         : __f_(__f, __a) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __packaged_task_func(_Fp&& __f, const _Alloc& __a)
-        : __f_(_VSTD::move(__f), __a) {}
+        : __f_(_CUDA_VSTD::move(__f), __a) {}
     virtual void __move_to(__packaged_task_base<_Rp(_ArgTypes...)>*) _NOEXCEPT;
     virtual void destroy();
     virtual void destroy_deallocate();
@@ -1665,7 +1665,7 @@ void
 __packaged_task_func<_Fp, _Alloc, _Rp(_ArgTypes...)>::__move_to(
                               __packaged_task_base<_Rp(_ArgTypes...)>* __p) _NOEXCEPT
 {
-    ::new ((void*)__p) __packaged_task_func(_VSTD::move(__f_.first()), _VSTD::move(__f_.second()));
+    ::new ((void*)__p) __packaged_task_func(_CUDA_VSTD::move(__f_.first()), _CUDA_VSTD::move(__f_.second()));
 }
 
 template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
@@ -1691,17 +1691,17 @@ template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
 _Rp
 __packaged_task_func<_Fp, _Alloc, _Rp(_ArgTypes...)>::operator()(_ArgTypes&& ... __arg)
 {
-    return _VSTD::__invoke(__f_.first(), _VSTD::forward<_ArgTypes>(__arg)...);
+    return _CUDA_VSTD::__invoke(__f_.first(), _CUDA_VSTD::forward<_ArgTypes>(__arg)...);
 }
 
 template <class _Callable> class __packaged_task_function;
 
 template<class _Rp, class ..._ArgTypes>
-class _LIBCPP_AVAILABILITY_FUTURE __packaged_task_function<_Rp(_ArgTypes...)>
+class _LIBCUDACXX_AVAILABILITY_FUTURE __packaged_task_function<_Rp(_ArgTypes...)>
 {
     typedef __packaged_task_base<_Rp(_ArgTypes...)> __base;
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_NO_CFI
+    _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_NO_CFI
     __base* __get_buf() { return (__base*)&__buf_; }
 
     typename aligned_storage<3*sizeof(void*)>::type __buf_;
@@ -1711,7 +1711,7 @@ public:
     typedef _Rp result_type;
 
     // construct/copy/destroy:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __packaged_task_function() _NOEXCEPT : __f_(nullptr) {}
     template<class _Fp>
       __packaged_task_function(_Fp&& __f);
@@ -1728,7 +1728,7 @@ public:
 
     void swap(__packaged_task_function&) _NOEXCEPT;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Rp operator()(_ArgTypes...) const;
 };
 
@@ -1758,7 +1758,7 @@ __packaged_task_function<_Rp(_ArgTypes...)>::__packaged_task_function(_Fp&& __f)
     typedef __packaged_task_func<_FR, allocator<_FR>, _Rp(_ArgTypes...)> _FF;
     if (sizeof(_FF) <= sizeof(__buf_))
     {
-        ::new ((void*)&__buf_) _FF(_VSTD::forward<_Fp>(__f));
+        ::new ((void*)&__buf_) _FF(_CUDA_VSTD::forward<_Fp>(__f));
         __f_ = (__base*)&__buf_;
     }
     else
@@ -1767,7 +1767,7 @@ __packaged_task_function<_Rp(_ArgTypes...)>::__packaged_task_function(_Fp&& __f)
         _Ap __a;
         typedef __allocator_destructor<_Ap> _Dp;
         unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));
-        ::new ((void*)__hold.get()) _FF(_VSTD::forward<_Fp>(__f), allocator<_FR>(__a));
+        ::new ((void*)__hold.get()) _FF(_CUDA_VSTD::forward<_Fp>(__f), allocator<_FR>(__a));
         __f_ = __hold.release();
     }
 }
@@ -1783,7 +1783,7 @@ __packaged_task_function<_Rp(_ArgTypes...)>::__packaged_task_function(
     if (sizeof(_FF) <= sizeof(__buf_))
     {
         __f_ = (__base*)&__buf_;
-        ::new ((void*)__f_) _FF(_VSTD::forward<_Fp>(__f));
+        ::new ((void*)__f_) _FF(_CUDA_VSTD::forward<_Fp>(__f));
     }
     else
     {
@@ -1791,9 +1791,9 @@ __packaged_task_function<_Rp(_ArgTypes...)>::__packaged_task_function(
         _Ap __a(__a0);
         typedef __allocator_destructor<_Ap> _Dp;
         unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));
-        ::new ((void*)_VSTD::addressof(*__hold.get()))
-            _FF(_VSTD::forward<_Fp>(__f), _Alloc(__a));
-        __f_ = _VSTD::addressof(*__hold.release());
+        ::new ((void*)_CUDA_VSTD::addressof(*__hold.get()))
+            _FF(_CUDA_VSTD::forward<_Fp>(__f), _Alloc(__a));
+        __f_ = _CUDA_VSTD::addressof(*__hold.release());
     }
 }
 
@@ -1831,7 +1831,7 @@ __packaged_task_function<_Rp(_ArgTypes...)>::~__packaged_task_function()
 }
 
 template<class _Rp, class ..._ArgTypes>
-_LIBCPP_NO_CFI
+_LIBCUDACXX_NO_CFI
 void
 __packaged_task_function<_Rp(_ArgTypes...)>::swap(__packaged_task_function& __f) _NOEXCEPT
 {
@@ -1865,7 +1865,7 @@ __packaged_task_function<_Rp(_ArgTypes...)>::swap(__packaged_task_function& __f)
         __f_ = (__base*)&__buf_;
     }
     else
-        _VSTD::swap(__f_, __f.__f_);
+        _CUDA_VSTD::swap(__f_, __f.__f_);
 }
 
 template<class _Rp, class ..._ArgTypes>
@@ -1873,11 +1873,11 @@ inline
 _Rp
 __packaged_task_function<_Rp(_ArgTypes...)>::operator()(_ArgTypes... __arg) const
 {
-    return (*__f_)(_VSTD::forward<_ArgTypes>(__arg)...);
+    return (*__f_)(_CUDA_VSTD::forward<_ArgTypes>(__arg)...);
 }
 
 template<class _Rp, class ..._ArgTypes>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FUTURE packaged_task<_Rp(_ArgTypes...)>
+class _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_AVAILABILITY_FUTURE packaged_task<_Rp(_ArgTypes...)>
 {
 public:
     typedef _Rp result_type; // extension
@@ -1888,17 +1888,17 @@ private:
 
 public:
     // construction and destruction
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     packaged_task() _NOEXCEPT : __p_(nullptr) {}
     template <class _Fp,
               class = __enable_if_t<!is_same<__uncvref_t<_Fp>, packaged_task>::value> >
-        _LIBCPP_INLINE_VISIBILITY
-        explicit packaged_task(_Fp&& __f) : __f_(_VSTD::forward<_Fp>(__f)) {}
+        _LIBCUDACXX_INLINE_VISIBILITY
+        explicit packaged_task(_Fp&& __f) : __f_(_CUDA_VSTD::forward<_Fp>(__f)) {}
     template <class _Fp, class _Allocator,
               class = __enable_if_t<!is_same<__uncvref_t<_Fp>, packaged_task>::value> >
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         packaged_task(allocator_arg_t, const _Allocator& __a, _Fp&& __f)
-             : __f_(allocator_arg, __a, _VSTD::forward<_Fp>(__f)),
+             : __f_(allocator_arg, __a, _CUDA_VSTD::forward<_Fp>(__f)),
                __p_(allocator_arg, __a) {}
     // ~packaged_task() = default;
 
@@ -1907,28 +1907,28 @@ public:
     packaged_task& operator=(const packaged_task&) = delete;
 
     // move support
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     packaged_task(packaged_task&& __other) _NOEXCEPT
-        : __f_(_VSTD::move(__other.__f_)), __p_(_VSTD::move(__other.__p_)) {}
-    _LIBCPP_INLINE_VISIBILITY
+        : __f_(_CUDA_VSTD::move(__other.__f_)), __p_(_CUDA_VSTD::move(__other.__p_)) {}
+    _LIBCUDACXX_INLINE_VISIBILITY
     packaged_task& operator=(packaged_task&& __other) _NOEXCEPT
     {
-        __f_ = _VSTD::move(__other.__f_);
-        __p_ = _VSTD::move(__other.__p_);
+        __f_ = _CUDA_VSTD::move(__other.__f_);
+        __p_ = _CUDA_VSTD::move(__other.__p_);
         return *this;
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void swap(packaged_task& __other) _NOEXCEPT
     {
         __f_.swap(__other.__f_);
         __p_.swap(__other.__p_);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool valid() const _NOEXCEPT {return __p_.__state_ != nullptr;}
 
     // result retrieval
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     future<result_type> get_future() {return __p_.get_future();}
 
     // execution
@@ -1946,18 +1946,18 @@ packaged_task<_Rp(_ArgTypes...)>::operator()(_ArgTypes... __args)
         __throw_future_error(future_errc::no_state);
     if (__p_.__state_->__has_value())
         __throw_future_error(future_errc::promise_already_satisfied);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     try
     {
-#endif // _LIBCPP_NO_EXCEPTIONS
-        __p_.set_value(__f_(_VSTD::forward<_ArgTypes>(__args)...));
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
+        __p_.set_value(__f_(_CUDA_VSTD::forward<_ArgTypes>(__args)...));
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     }
     catch (...)
     {
         __p_.set_exception(current_exception());
     }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
 }
 
 template<class _Rp, class ..._ArgTypes>
@@ -1968,18 +1968,18 @@ packaged_task<_Rp(_ArgTypes...)>::make_ready_at_thread_exit(_ArgTypes... __args)
         __throw_future_error(future_errc::no_state);
     if (__p_.__state_->__has_value())
         __throw_future_error(future_errc::promise_already_satisfied);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     try
     {
-#endif // _LIBCPP_NO_EXCEPTIONS
-        __p_.set_value_at_thread_exit(__f_(_VSTD::forward<_ArgTypes>(__args)...));
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
+        __p_.set_value_at_thread_exit(__f_(_CUDA_VSTD::forward<_ArgTypes>(__args)...));
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     }
     catch (...)
     {
         __p_.set_exception_at_thread_exit(current_exception());
     }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
 }
 
 template<class _Rp, class ..._ArgTypes>
@@ -1992,7 +1992,7 @@ packaged_task<_Rp(_ArgTypes...)>::reset()
 }
 
 template<class ..._ArgTypes>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FUTURE packaged_task<void(_ArgTypes...)>
+class _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_AVAILABILITY_FUTURE packaged_task<void(_ArgTypes...)>
 {
 public:
     typedef void result_type; // extension
@@ -2003,17 +2003,17 @@ private:
 
 public:
     // construction and destruction
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     packaged_task() _NOEXCEPT : __p_(nullptr) {}
     template <class _Fp,
               class = __enable_if_t<!is_same<__uncvref_t<_Fp>, packaged_task>::value> >
-        _LIBCPP_INLINE_VISIBILITY
-        explicit packaged_task(_Fp&& __f) : __f_(_VSTD::forward<_Fp>(__f)) {}
+        _LIBCUDACXX_INLINE_VISIBILITY
+        explicit packaged_task(_Fp&& __f) : __f_(_CUDA_VSTD::forward<_Fp>(__f)) {}
     template <class _Fp, class _Allocator,
               class = __enable_if_t<!is_same<__uncvref_t<_Fp>, packaged_task>::value> >
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         packaged_task(allocator_arg_t, const _Allocator& __a, _Fp&& __f)
-             : __f_(allocator_arg, __a, _VSTD::forward<_Fp>(__f)),
+             : __f_(allocator_arg, __a, _CUDA_VSTD::forward<_Fp>(__f)),
                __p_(allocator_arg, __a) {}
     // ~packaged_task() = default;
 
@@ -2022,28 +2022,28 @@ public:
     packaged_task& operator=(const packaged_task&) = delete;
 
     // move support
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     packaged_task(packaged_task&& __other) _NOEXCEPT
-        : __f_(_VSTD::move(__other.__f_)), __p_(_VSTD::move(__other.__p_)) {}
-    _LIBCPP_INLINE_VISIBILITY
+        : __f_(_CUDA_VSTD::move(__other.__f_)), __p_(_CUDA_VSTD::move(__other.__p_)) {}
+    _LIBCUDACXX_INLINE_VISIBILITY
     packaged_task& operator=(packaged_task&& __other) _NOEXCEPT
     {
-        __f_ = _VSTD::move(__other.__f_);
-        __p_ = _VSTD::move(__other.__p_);
+        __f_ = _CUDA_VSTD::move(__other.__f_);
+        __p_ = _CUDA_VSTD::move(__other.__p_);
         return *this;
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void swap(packaged_task& __other) _NOEXCEPT
     {
         __f_.swap(__other.__f_);
         __p_.swap(__other.__p_);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool valid() const _NOEXCEPT {return __p_.__state_ != nullptr;}
 
     // result retrieval
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     future<result_type> get_future() {return __p_.get_future();}
 
     // execution
@@ -2061,19 +2061,19 @@ packaged_task<void(_ArgTypes...)>::operator()(_ArgTypes... __args)
         __throw_future_error(future_errc::no_state);
     if (__p_.__state_->__has_value())
         __throw_future_error(future_errc::promise_already_satisfied);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     try
     {
-#endif // _LIBCPP_NO_EXCEPTIONS
-        __f_(_VSTD::forward<_ArgTypes>(__args)...);
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
+        __f_(_CUDA_VSTD::forward<_ArgTypes>(__args)...);
         __p_.set_value();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     }
     catch (...)
     {
         __p_.set_exception(current_exception());
     }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
 }
 
 template<class ..._ArgTypes>
@@ -2084,19 +2084,19 @@ packaged_task<void(_ArgTypes...)>::make_ready_at_thread_exit(_ArgTypes... __args
         __throw_future_error(future_errc::no_state);
     if (__p_.__state_->__has_value())
         __throw_future_error(future_errc::promise_already_satisfied);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     try
     {
-#endif // _LIBCPP_NO_EXCEPTIONS
-        __f_(_VSTD::forward<_ArgTypes>(__args)...);
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
+        __f_(_CUDA_VSTD::forward<_ArgTypes>(__args)...);
         __p_.set_value_at_thread_exit();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     }
     catch (...)
     {
         __p_.set_exception_at_thread_exit(current_exception());
     }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
 }
 
 template<class ..._ArgTypes>
@@ -2109,7 +2109,7 @@ packaged_task<void(_ArgTypes...)>::reset()
 }
 
 template <class _Rp, class... _ArgTypes>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 swap(packaged_task<_Rp(_ArgTypes...)>& __x, packaged_task<_Rp(_ArgTypes...)>& __y) _NOEXCEPT
 {
@@ -2117,44 +2117,44 @@ swap(packaged_task<_Rp(_ArgTypes...)>& __x, packaged_task<_Rp(_ArgTypes...)>& __
 }
 
 template <class _Callable, class _Alloc>
-struct _LIBCPP_TEMPLATE_VIS uses_allocator<packaged_task<_Callable>, _Alloc>
+struct _LIBCUDACXX_TEMPLATE_VIS uses_allocator<packaged_task<_Callable>, _Alloc>
     : public true_type {};
 
 template <class _Rp, class _Fp>
-_LIBCPP_INLINE_VISIBILITY future<_Rp>
+_LIBCUDACXX_INLINE_VISIBILITY future<_Rp>
 __make_deferred_assoc_state(_Fp&& __f)
 {
     unique_ptr<__deferred_assoc_state<_Rp, _Fp>, __release_shared_count>
-        __h(new __deferred_assoc_state<_Rp, _Fp>(_VSTD::forward<_Fp>(__f)));
+        __h(new __deferred_assoc_state<_Rp, _Fp>(_CUDA_VSTD::forward<_Fp>(__f)));
     return future<_Rp>(__h.get());
 }
 
 template <class _Rp, class _Fp>
-_LIBCPP_INLINE_VISIBILITY future<_Rp>
+_LIBCUDACXX_INLINE_VISIBILITY future<_Rp>
 __make_async_assoc_state(_Fp&& __f)
 {
     unique_ptr<__async_assoc_state<_Rp, _Fp>, __release_shared_count>
-        __h(new __async_assoc_state<_Rp, _Fp>(_VSTD::forward<_Fp>(__f)));
-    _VSTD::thread(&__async_assoc_state<_Rp, _Fp>::__execute, __h.get()).detach();
+        __h(new __async_assoc_state<_Rp, _Fp>(_CUDA_VSTD::forward<_Fp>(__f)));
+    _CUDA_VSTD::thread(&__async_assoc_state<_Rp, _Fp>::__execute, __h.get()).detach();
     return future<_Rp>(__h.get());
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
 template <class _Fp, class... _Args>
-class _LIBCPP_HIDDEN __async_func
+class _LIBCUDACXX_HIDDEN __async_func
 {
     tuple<_Fp, _Args...> __f_;
 
 public:
     typedef typename __invoke_of<_Fp, _Args...>::type _Rp;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __async_func(_Fp&& __f, _Args&&... __args)
-        : __f_(_VSTD::move(__f), _VSTD::move(__args)...) {}
+        : __f_(_CUDA_VSTD::move(__f), _CUDA_VSTD::move(__args)...) {}
 
-    _LIBCPP_INLINE_VISIBILITY
-    __async_func(__async_func&& __f) : __f_(_VSTD::move(__f.__f_)) {}
+    _LIBCUDACXX_INLINE_VISIBILITY
+    __async_func(__async_func&& __f) : __f_(_CUDA_VSTD::move(__f.__f_)) {}
 
     _Rp operator()()
     {
@@ -2166,46 +2166,46 @@ private:
     _Rp
     __execute(__tuple_indices<_Indices...>)
     {
-        return _VSTD::__invoke(_VSTD::move(_VSTD::get<0>(__f_)), _VSTD::move(_VSTD::get<_Indices>(__f_))...);
+        return _CUDA_VSTD::__invoke(_CUDA_VSTD::move(_CUDA_VSTD::get<0>(__f_)), _CUDA_VSTD::move(_CUDA_VSTD::get<_Indices>(__f_))...);
     }
 };
 
-inline _LIBCPP_INLINE_VISIBILITY bool __does_policy_contain(launch __policy, launch __value )
+inline _LIBCUDACXX_INLINE_VISIBILITY bool __does_policy_contain(launch __policy, launch __value )
 { return (int(__policy) & int(__value)) != 0; }
 
 template <class _Fp, class... _Args>
-_LIBCPP_NODISCARD_AFTER_CXX17
+_LIBCUDACXX_NODISCARD_AFTER_CXX17
 future<typename __invoke_of<typename decay<_Fp>::type, typename decay<_Args>::type...>::type>
 async(launch __policy, _Fp&& __f, _Args&&... __args)
 {
     typedef __async_func<typename decay<_Fp>::type, typename decay<_Args>::type...> _BF;
     typedef typename _BF::_Rp _Rp;
 
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     try
     {
 #endif
         if (__does_policy_contain(__policy, launch::async))
-        return _VSTD::__make_async_assoc_state<_Rp>(_BF(_LIBCPP_AUTO_CAST(_VSTD::forward<_Fp>(__f)),
-                                                        _LIBCPP_AUTO_CAST(_VSTD::forward<_Args>(__args))...));
-#ifndef _LIBCPP_NO_EXCEPTIONS
+        return _CUDA_VSTD::__make_async_assoc_state<_Rp>(_BF(_LIBCUDACXX_AUTO_CAST(_CUDA_VSTD::forward<_Fp>(__f)),
+                                                        _LIBCUDACXX_AUTO_CAST(_CUDA_VSTD::forward<_Args>(__args))...));
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     }
     catch ( ... ) { if (__policy == launch::async) throw ; }
 #endif
 
     if (__does_policy_contain(__policy, launch::deferred))
-        return _VSTD::__make_deferred_assoc_state<_Rp>(_BF(_LIBCPP_AUTO_CAST(_VSTD::forward<_Fp>(__f)),
-                                                           _LIBCPP_AUTO_CAST(_VSTD::forward<_Args>(__args))...));
+        return _CUDA_VSTD::__make_deferred_assoc_state<_Rp>(_BF(_LIBCUDACXX_AUTO_CAST(_CUDA_VSTD::forward<_Fp>(__f)),
+                                                           _LIBCUDACXX_AUTO_CAST(_CUDA_VSTD::forward<_Args>(__args))...));
     return future<_Rp>{};
 }
 
 template <class _Fp, class... _Args>
-_LIBCPP_NODISCARD_AFTER_CXX17 inline _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_NODISCARD_AFTER_CXX17 inline _LIBCUDACXX_INLINE_VISIBILITY
 future<typename __invoke_of<typename decay<_Fp>::type, typename decay<_Args>::type...>::type>
 async(_Fp&& __f, _Args&&... __args)
 {
-    return _VSTD::async(launch::any, _VSTD::forward<_Fp>(__f),
-                                    _VSTD::forward<_Args>(__args)...);
+    return _CUDA_VSTD::async(launch::any, _CUDA_VSTD::forward<_Fp>(__f),
+                                    _CUDA_VSTD::forward<_Args>(__args)...);
 }
 
 #endif // C++03
@@ -2213,51 +2213,51 @@ async(_Fp&& __f, _Args&&... __args)
 // shared_future
 
 template <class _Rp>
-class _LIBCPP_TEMPLATE_VIS shared_future
+class _LIBCUDACXX_TEMPLATE_VIS shared_future
 {
     __assoc_state<_Rp>* __state_;
 
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     shared_future() _NOEXCEPT : __state_(nullptr) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     shared_future(const shared_future& __rhs)  _NOEXCEPT : __state_(__rhs.__state_)
         {if (__state_) __state_->__add_shared();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     shared_future(future<_Rp>&& __f) _NOEXCEPT : __state_(__f.__state_)
         {__f.__state_ = nullptr;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     shared_future(shared_future&& __rhs) _NOEXCEPT : __state_(__rhs.__state_)
         {__rhs.__state_ = nullptr;}
     ~shared_future();
     shared_future& operator=(const shared_future& __rhs) _NOEXCEPT;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     shared_future& operator=(shared_future&& __rhs) _NOEXCEPT
         {
-            shared_future(_VSTD::move(__rhs)).swap(*this);
+            shared_future(_CUDA_VSTD::move(__rhs)).swap(*this);
             return *this;
         }
 
     // retrieving the value
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const _Rp& get() const {return __state_->copy();}
 
-    _LIBCPP_INLINE_VISIBILITY
-    void swap(shared_future& __rhs) _NOEXCEPT {_VSTD::swap(__state_, __rhs.__state_);}
+    _LIBCUDACXX_INLINE_VISIBILITY
+    void swap(shared_future& __rhs) _NOEXCEPT {_CUDA_VSTD::swap(__state_, __rhs.__state_);}
 
     // functions to check state
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool valid() const _NOEXCEPT {return __state_ != nullptr;}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void wait() const {__state_->wait();}
     template <class _Rep, class _Period>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         future_status
         wait_for(const chrono::duration<_Rep, _Period>& __rel_time) const
             {return __state_->wait_for(__rel_time);}
     template <class _Clock, class _Duration>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         future_status
         wait_until(const chrono::time_point<_Clock, _Duration>& __abs_time) const
             {return __state_->wait_until(__abs_time);}
@@ -2283,51 +2283,51 @@ shared_future<_Rp>::operator=(const shared_future& __rhs) _NOEXCEPT
 }
 
 template <class _Rp>
-class _LIBCPP_TEMPLATE_VIS shared_future<_Rp&>
+class _LIBCUDACXX_TEMPLATE_VIS shared_future<_Rp&>
 {
     __assoc_state<_Rp&>* __state_;
 
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     shared_future() _NOEXCEPT : __state_(nullptr) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     shared_future(const shared_future& __rhs) : __state_(__rhs.__state_)
         {if (__state_) __state_->__add_shared();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     shared_future(future<_Rp&>&& __f) _NOEXCEPT : __state_(__f.__state_)
         {__f.__state_ = nullptr;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     shared_future(shared_future&& __rhs) _NOEXCEPT : __state_(__rhs.__state_)
         {__rhs.__state_ = nullptr;}
     ~shared_future();
     shared_future& operator=(const shared_future& __rhs);
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     shared_future& operator=(shared_future&& __rhs) _NOEXCEPT
         {
-            shared_future(_VSTD::move(__rhs)).swap(*this);
+            shared_future(_CUDA_VSTD::move(__rhs)).swap(*this);
             return *this;
         }
 
     // retrieving the value
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     _Rp& get() const {return __state_->copy();}
 
-    _LIBCPP_INLINE_VISIBILITY
-    void swap(shared_future& __rhs) _NOEXCEPT {_VSTD::swap(__state_, __rhs.__state_);}
+    _LIBCUDACXX_INLINE_VISIBILITY
+    void swap(shared_future& __rhs) _NOEXCEPT {_CUDA_VSTD::swap(__state_, __rhs.__state_);}
 
     // functions to check state
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool valid() const _NOEXCEPT {return __state_ != nullptr;}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void wait() const {__state_->wait();}
     template <class _Rep, class _Period>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         future_status
         wait_for(const chrono::duration<_Rep, _Period>& __rel_time) const
             {return __state_->wait_for(__rel_time);}
     template <class _Clock, class _Duration>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         future_status
         wait_until(const chrono::time_point<_Clock, _Duration>& __abs_time) const
             {return __state_->wait_until(__abs_time);}
@@ -2353,58 +2353,58 @@ shared_future<_Rp&>::operator=(const shared_future& __rhs)
 }
 
 template <>
-class _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_FUTURE shared_future<void>
+class _LIBCUDACXX_TYPE_VIS _LIBCUDACXX_AVAILABILITY_FUTURE shared_future<void>
 {
     __assoc_sub_state* __state_;
 
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     shared_future() _NOEXCEPT : __state_(nullptr) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     shared_future(const shared_future& __rhs) : __state_(__rhs.__state_)
         {if (__state_) __state_->__add_shared();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     shared_future(future<void>&& __f) _NOEXCEPT : __state_(__f.__state_)
         {__f.__state_ = nullptr;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     shared_future(shared_future&& __rhs) _NOEXCEPT : __state_(__rhs.__state_)
         {__rhs.__state_ = nullptr;}
     ~shared_future();
     shared_future& operator=(const shared_future& __rhs);
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     shared_future& operator=(shared_future&& __rhs) _NOEXCEPT
         {
-            shared_future(_VSTD::move(__rhs)).swap(*this);
+            shared_future(_CUDA_VSTD::move(__rhs)).swap(*this);
             return *this;
         }
 
     // retrieving the value
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void get() const {__state_->copy();}
 
-    _LIBCPP_INLINE_VISIBILITY
-    void swap(shared_future& __rhs) _NOEXCEPT {_VSTD::swap(__state_, __rhs.__state_);}
+    _LIBCUDACXX_INLINE_VISIBILITY
+    void swap(shared_future& __rhs) _NOEXCEPT {_CUDA_VSTD::swap(__state_, __rhs.__state_);}
 
     // functions to check state
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool valid() const _NOEXCEPT {return __state_ != nullptr;}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void wait() const {__state_->wait();}
     template <class _Rep, class _Period>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         future_status
         wait_for(const chrono::duration<_Rep, _Period>& __rel_time) const
             {return __state_->wait_for(__rel_time);}
     template <class _Clock, class _Duration>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         future_status
         wait_until(const chrono::time_point<_Clock, _Duration>& __abs_time) const
             {return __state_->wait_until(__abs_time);}
 };
 
 template <class _Rp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 swap(shared_future<_Rp>& __x, shared_future<_Rp>& __y) _NOEXCEPT
 {
@@ -2416,7 +2416,7 @@ inline
 shared_future<_Rp>
 future<_Rp>::share() _NOEXCEPT
 {
-    return shared_future<_Rp>(_VSTD::move(*this));
+    return shared_future<_Rp>(_CUDA_VSTD::move(*this));
 }
 
 template <class _Rp>
@@ -2424,16 +2424,16 @@ inline
 shared_future<_Rp&>
 future<_Rp&>::share() _NOEXCEPT
 {
-    return shared_future<_Rp&>(_VSTD::move(*this));
+    return shared_future<_Rp&>(_CUDA_VSTD::move(*this));
 }
 
 inline
 shared_future<void>
 future<void>::share() _NOEXCEPT
 {
-    return shared_future<void>(_VSTD::move(*this));
+    return shared_future<void>(_CUDA_VSTD::move(*this));
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_FUTURE
+#endif // _LIBCUDACXX_FUTURE

diff  --git a/libcxx/include/initializer_list b/libcxx/include/initializer_list
index 02a8ec57fab3..9099b2367566 100644
--- a/libcxx/include/initializer_list
+++ b/libcxx/include/initializer_list
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_INITIALIZER_LIST
-#define _LIBCPP_INITIALIZER_LIST
+#ifndef _LIBCUDACXX_INITIALIZER_LIST
+#define _LIBCUDACXX_INITIALIZER_LIST
 
 /*
     initializer_list synopsis
@@ -46,23 +46,23 @@ template<class E> const E* end(initializer_list<E> il) noexcept; // constexpr in
 #include <__config>
 #include <cstddef>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
 namespace std  // purposefully not versioned
 {
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
 template<class _Ep>
-class _LIBCPP_TEMPLATE_VIS initializer_list
+class _LIBCUDACXX_TEMPLATE_VIS initializer_list
 {
     const _Ep* __begin_;
     size_t    __size_;
 
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR_AFTER_CXX11
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
     initializer_list(const _Ep* __b, size_t __s) _NOEXCEPT
         : __begin_(__b),
           __size_(__s)
@@ -76,26 +76,26 @@ public:
     typedef const _Ep* iterator;
     typedef const _Ep* const_iterator;
 
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR_AFTER_CXX11
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
     initializer_list() _NOEXCEPT : __begin_(nullptr), __size_(0) {}
 
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR_AFTER_CXX11
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
     size_t    size()  const _NOEXCEPT {return __size_;}
 
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR_AFTER_CXX11
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
     const _Ep* begin() const _NOEXCEPT {return __begin_;}
 
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR_AFTER_CXX11
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
     const _Ep* end()   const _NOEXCEPT {return __begin_ + __size_;}
 };
 
 template<class _Ep>
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 const _Ep*
 begin(initializer_list<_Ep> __il) _NOEXCEPT
 {
@@ -103,16 +103,16 @@ begin(initializer_list<_Ep> __il) _NOEXCEPT
 }
 
 template<class _Ep>
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX11
 const _Ep*
 end(initializer_list<_Ep> __il) _NOEXCEPT
 {
     return __il.end();
 }
 
-#endif // !defined(_LIBCPP_CXX03_LANG)
+#endif // !defined(_LIBCUDACXX_CXX03_LANG)
 
 } // namespace std
 
-#endif // _LIBCPP_INITIALIZER_LIST
+#endif // _LIBCUDACXX_INITIALIZER_LIST

diff  --git a/libcxx/include/inttypes.h b/libcxx/include/inttypes.h
index e0fd71f9b65d..c6e8ba7fcb49 100644
--- a/libcxx/include/inttypes.h
+++ b/libcxx/include/inttypes.h
@@ -7,12 +7,12 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_INTTYPES_H
+#ifndef _LIBCUDACXX_INTTYPES_H
 // AIX system headers need inttypes.h to be re-enterable while _STD_TYPES_T
 // is defined until an inclusion of it without _STD_TYPES_T occurs, in which
 // case the header guard macro is defined.
 #if !defined(_AIX) || !defined(_STD_TYPES_T)
-#define _LIBCPP_INTTYPES_H
+#define _LIBCUDACXX_INTTYPES_H
 #endif // _STD_TYPES_T
 
 /*
@@ -237,7 +237,7 @@ uintmax_t wcstoumax(const wchar_t* restrict nptr, wchar_t** restrict endptr, int
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
@@ -259,4 +259,4 @@ uintmax_t wcstoumax(const wchar_t* restrict nptr, wchar_t** restrict endptr, int
 
 #endif // __cplusplus
 
-#endif // _LIBCPP_INTTYPES_H
+#endif // _LIBCUDACXX_INTTYPES_H

diff  --git a/libcxx/include/iomanip b/libcxx/include/iomanip
index ed8334519ae8..fba5a82bf666 100644
--- a/libcxx/include/iomanip
+++ b/libcxx/include/iomanip
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_IOMANIP
-#define _LIBCPP_IOMANIP
+#ifndef _LIBCUDACXX_IOMANIP
+#define _LIBCUDACXX_IOMANIP
 
 /*
     iomanip synopsis
@@ -47,11 +47,11 @@ template <class charT, class traits, class Allocator>
 #include <istream>
 #include <version>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 // resetiosflags
 
@@ -59,12 +59,12 @@ class __iom_t1
 {
     ios_base::fmtflags __mask_;
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __iom_t1(ios_base::fmtflags __m) : __mask_(__m) {}
 
     template <class _CharT, class _Traits>
     friend
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_istream<_CharT, _Traits>&
     operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t1& __x)
     {
@@ -74,7 +74,7 @@ public:
 
     template <class _CharT, class _Traits>
     friend
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_ostream<_CharT, _Traits>&
     operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t1& __x)
     {
@@ -83,7 +83,7 @@ public:
     }
 };
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 __iom_t1
 resetiosflags(ios_base::fmtflags __mask)
 {
@@ -96,12 +96,12 @@ class __iom_t2
 {
     ios_base::fmtflags __mask_;
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __iom_t2(ios_base::fmtflags __m) : __mask_(__m) {}
 
     template <class _CharT, class _Traits>
     friend
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_istream<_CharT, _Traits>&
     operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t2& __x)
     {
@@ -111,7 +111,7 @@ public:
 
     template <class _CharT, class _Traits>
     friend
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_ostream<_CharT, _Traits>&
     operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t2& __x)
     {
@@ -120,7 +120,7 @@ public:
     }
 };
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 __iom_t2
 setiosflags(ios_base::fmtflags __mask)
 {
@@ -133,12 +133,12 @@ class __iom_t3
 {
     int __base_;
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __iom_t3(int __b) : __base_(__b) {}
 
     template <class _CharT, class _Traits>
     friend
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_istream<_CharT, _Traits>&
     operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t3& __x)
     {
@@ -151,7 +151,7 @@ public:
 
     template <class _CharT, class _Traits>
     friend
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_ostream<_CharT, _Traits>&
     operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t3& __x)
     {
@@ -163,7 +163,7 @@ public:
     }
 };
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 __iom_t3
 setbase(int __base)
 {
@@ -177,12 +177,12 @@ class __iom_t4
 {
     _CharT __fill_;
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __iom_t4(_CharT __c) : __fill_(__c) {}
 
     template <class _Traits>
     friend
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_ostream<_CharT, _Traits>&
     operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t4& __x)
     {
@@ -192,7 +192,7 @@ public:
 };
 
 template<class _CharT>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 __iom_t4<_CharT>
 setfill(_CharT __c)
 {
@@ -205,12 +205,12 @@ class __iom_t5
 {
     int __n_;
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __iom_t5(int __n) : __n_(__n) {}
 
     template <class _CharT, class _Traits>
     friend
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_istream<_CharT, _Traits>&
     operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t5& __x)
     {
@@ -220,7 +220,7 @@ public:
 
     template <class _CharT, class _Traits>
     friend
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_ostream<_CharT, _Traits>&
     operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t5& __x)
     {
@@ -229,7 +229,7 @@ public:
     }
 };
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 __iom_t5
 setprecision(int __n)
 {
@@ -242,12 +242,12 @@ class __iom_t6
 {
     int __n_;
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __iom_t6(int __n) : __n_(__n) {}
 
     template <class _CharT, class _Traits>
     friend
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_istream<_CharT, _Traits>&
     operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t6& __x)
     {
@@ -257,7 +257,7 @@ public:
 
     template <class _CharT, class _Traits>
     friend
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_ostream<_CharT, _Traits>&
     operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t6& __x)
     {
@@ -266,7 +266,7 @@ public:
     }
 };
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 __iom_t6
 setw(int __n)
 {
@@ -287,7 +287,7 @@ class __iom_t7
     _MoneyT& __mon_;
     bool __intl_;
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __iom_t7(_MoneyT& __mon, bool __intl)
         : __mon_(__mon), __intl_(__intl) {}
 
@@ -301,10 +301,10 @@ template <class _CharT, class _Traits, class _MoneyT>
 basic_istream<_CharT, _Traits>&
 operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t7<_MoneyT>& __x)
 {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     try
     {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
         typename basic_istream<_CharT, _Traits>::sentry __s(__is);
         if (__s)
         {
@@ -315,18 +315,18 @@ operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t7<_MoneyT>& __x)
             __mf.get(_Ip(__is), _Ip(), __x.__intl_, __is, __err, __x.__mon_);
             __is.setstate(__err);
         }
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     }
     catch (...)
     {
         __is.__set_badbit_and_consider_rethrow();
     }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
     return __is;
 }
 
 template <class _MoneyT>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 __iom_t7<_MoneyT>
 get_money(_MoneyT& __mon, bool __intl = false)
 {
@@ -347,7 +347,7 @@ class __iom_t8
     const _MoneyT& __mon_;
     bool __intl_;
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __iom_t8(const _MoneyT& __mon, bool __intl)
         : __mon_(__mon), __intl_(__intl) {}
 
@@ -361,10 +361,10 @@ template <class _CharT, class _Traits, class _MoneyT>
 basic_ostream<_CharT, _Traits>&
 operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t8<_MoneyT>& __x)
 {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     try
     {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
         typename basic_ostream<_CharT, _Traits>::sentry __s(__os);
         if (__s)
         {
@@ -374,18 +374,18 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t8<_MoneyT>& __x)
             if (__mf.put(_Op(__os), __x.__intl_, __os, __os.fill(), __x.__mon_).failed())
                 __os.setstate(ios_base::badbit);
         }
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     }
     catch (...)
     {
         __os.__set_badbit_and_consider_rethrow();
     }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
     return __os;
 }
 
 template <class _MoneyT>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 __iom_t8<_MoneyT>
 put_money(const _MoneyT& __mon, bool __intl = false)
 {
@@ -406,7 +406,7 @@ class __iom_t9
     tm* __tm_;
     const _CharT* __fmt_;
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __iom_t9(tm* __tm, const _CharT* __fmt)
         : __tm_(__tm), __fmt_(__fmt) {}
 
@@ -420,10 +420,10 @@ template <class _CharT, class _Traits>
 basic_istream<_CharT, _Traits>&
 operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t9<_CharT>& __x)
 {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     try
     {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
         typename basic_istream<_CharT, _Traits>::sentry __s(__is);
         if (__s)
         {
@@ -435,18 +435,18 @@ operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t9<_CharT>& __x)
                      __x.__fmt_, __x.__fmt_ + _Traits::length(__x.__fmt_));
             __is.setstate(__err);
         }
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     }
     catch (...)
     {
         __is.__set_badbit_and_consider_rethrow();
     }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
     return __is;
 }
 
 template <class _CharT>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 __iom_t9<_CharT>
 get_time(tm* __tm, const _CharT* __fmt)
 {
@@ -467,7 +467,7 @@ class __iom_t10
     const tm* __tm_;
     const _CharT* __fmt_;
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __iom_t10(const tm* __tm, const _CharT* __fmt)
         : __tm_(__tm), __fmt_(__fmt) {}
 
@@ -481,10 +481,10 @@ template <class _CharT, class _Traits>
 basic_ostream<_CharT, _Traits>&
 operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t10<_CharT>& __x)
 {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     try
     {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
         typename basic_ostream<_CharT, _Traits>::sentry __s(__os);
         if (__s)
         {
@@ -495,28 +495,28 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t10<_CharT>& __x)
                          __x.__fmt_, __x.__fmt_ + _Traits::length(__x.__fmt_)).failed())
                 __os.setstate(ios_base::badbit);
         }
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     }
     catch (...)
     {
         __os.__set_badbit_and_consider_rethrow();
     }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
     return __os;
 }
 
 template <class _CharT>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 __iom_t10<_CharT>
 put_time(const tm* __tm, const _CharT* __fmt)
 {
     return __iom_t10<_CharT>(__tm, __fmt);
 }
 
-#if _LIBCPP_STD_VER >= 11
+#if _LIBCUDACXX_STD_VER >= 11
 
 template <class _CharT, class _Traits>
-_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
+_LIBCUDACXX_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
 __quoted_output(basic_ostream<_CharT, _Traits>& __os,
                 const _CharT *__first, const _CharT *__last, _CharT __delim, _CharT __escape)
 {
@@ -528,11 +528,11 @@ __quoted_output(basic_ostream<_CharT, _Traits>& __os,
         __str.push_back(*__first);
     }
     __str.push_back(__delim);
-    return _VSTD::__put_character_sequence(__os, __str.data(), __str.size());
+    return _CUDA_VSTD::__put_character_sequence(__os, __str.data(), __str.size());
 }
 
 template <class _CharT, class _Traits, class _String>
-_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>&
+_LIBCUDACXX_HIDE_FROM_ABI basic_istream<_CharT, _Traits>&
 __quoted_input(basic_istream<_CharT, _Traits>& __is, _String& __string, _CharT __delim, _CharT __escape)
 {
     __string.clear();
@@ -566,48 +566,48 @@ __quoted_input(basic_istream<_CharT, _Traits>& __is, _String& __string, _CharT _
 }
 
 template <class _CharT, class _Traits>
-struct _LIBCPP_HIDDEN __quoted_output_proxy
+struct _LIBCUDACXX_HIDDEN __quoted_output_proxy
 {
     const _CharT *__first_;
     const _CharT *__last_;
     _CharT __delim_;
     _CharT __escape_;
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     explicit __quoted_output_proxy(const _CharT *__f, const _CharT *__l, _CharT __d, _CharT __e)
         : __first_(__f), __last_(__l), __delim_(__d), __escape_(__e) {}
 
     template<class _T2, __enable_if_t<_IsSame<_Traits, void>::value || _IsSame<_Traits, _T2>::value>* = nullptr>
-    friend _LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _T2>&
+    friend _LIBCUDACXX_HIDE_FROM_ABI basic_ostream<_CharT, _T2>&
     operator<<(basic_ostream<_CharT, _T2>& __os, const __quoted_output_proxy& __p) {
         return std::__quoted_output(__os, __p.__first_, __p.__last_, __p.__delim_, __p.__escape_);
     }
 };
 
 template <class _CharT, class _Traits, class _Allocator>
-struct _LIBCPP_HIDDEN __quoted_proxy
+struct _LIBCUDACXX_HIDDEN __quoted_proxy
 {
     basic_string<_CharT, _Traits, _Allocator>& __string_;
     _CharT __delim_;
     _CharT __escape_;
 
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     explicit __quoted_proxy(basic_string<_CharT, _Traits, _Allocator>& __s, _CharT __d, _CharT __e)
         : __string_(__s), __delim_(__d), __escape_(__e) {}
 
-    friend _LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
+    friend _LIBCUDACXX_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
     operator<<(basic_ostream<_CharT, _Traits>& __os, const __quoted_proxy& __p) {
         return std::__quoted_output(__os, __p.__string_.data(), __p.__string_.data() + __p.__string_.size(), __p.__delim_, __p.__escape_);
     }
 
-    friend _LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>&
+    friend _LIBCUDACXX_HIDE_FROM_ABI basic_istream<_CharT, _Traits>&
     operator>>(basic_istream<_CharT, _Traits>& __is, const __quoted_proxy& __p) {
         return std::__quoted_input(__is, __p.__string_, __p.__delim_, __p.__escape_);
     }
 };
 
 template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_HIDE_FROM_ABI
+_LIBCUDACXX_HIDE_FROM_ABI
 __quoted_output_proxy<_CharT, _Traits>
 __quoted(const basic_string<_CharT, _Traits, _Allocator>& __s, _CharT __delim = _CharT('"'), _CharT __escape = _CharT('\\'))
 {
@@ -615,19 +615,19 @@ __quoted(const basic_string<_CharT, _Traits, _Allocator>& __s, _CharT __delim =
 }
 
 template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_HIDE_FROM_ABI
+_LIBCUDACXX_HIDE_FROM_ABI
 __quoted_proxy<_CharT, _Traits, _Allocator>
 __quoted(basic_string<_CharT, _Traits, _Allocator>& __s, _CharT __delim = _CharT('"'), _CharT __escape = _CharT('\\'))
 {
     return __quoted_proxy<_CharT, _Traits, _Allocator>(__s, __delim, __escape);
 }
 
-#endif // _LIBCPP_STD_VER >= 11
+#endif // _LIBCUDACXX_STD_VER >= 11
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 
 template <class _CharT>
-_LIBCPP_HIDE_FROM_ABI
+_LIBCUDACXX_HIDE_FROM_ABI
 auto quoted(const _CharT *__s, _CharT __delim = _CharT('"'), _CharT __escape = _CharT('\\'))
 {
     const _CharT *__end = __s;
@@ -636,28 +636,28 @@ auto quoted(const _CharT *__s, _CharT __delim = _CharT('"'), _CharT __escape = _
 }
 
 template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_HIDE_FROM_ABI
+_LIBCUDACXX_HIDE_FROM_ABI
 auto quoted(const basic_string<_CharT, _Traits, _Allocator>& __s, _CharT __delim = _CharT('"'), _CharT __escape = _CharT('\\'))
 {
     return __quoted_output_proxy<_CharT, _Traits>(__s.data(), __s.data() + __s.size(), __delim, __escape);
 }
 
 template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_HIDE_FROM_ABI
+_LIBCUDACXX_HIDE_FROM_ABI
 auto quoted(basic_string<_CharT, _Traits, _Allocator>& __s, _CharT __delim = _CharT('"'), _CharT __escape = _CharT('\\'))
 {
     return __quoted_proxy<_CharT, _Traits, _Allocator>(__s, __delim, __escape);
 }
 
 template <class _CharT, class _Traits>
-_LIBCPP_HIDE_FROM_ABI
+_LIBCUDACXX_HIDE_FROM_ABI
 auto quoted(basic_string_view<_CharT, _Traits> __sv, _CharT __delim = _CharT('"'), _CharT __escape = _CharT('\\'))
 {
     return __quoted_output_proxy<_CharT, _Traits>(__sv.data(), __sv.data() + __sv.size(), __delim, __escape);
 }
 
-#endif // _LIBCPP_STD_VER > 11
+#endif // _LIBCUDACXX_STD_VER > 11
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_IOMANIP
+#endif // _LIBCUDACXX_IOMANIP

diff  --git a/libcxx/include/ios b/libcxx/include/ios
index 7140e00b406a..01d286685275 100644
--- a/libcxx/include/ios
+++ b/libcxx/include/ios
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_IOS
-#define _LIBCPP_IOS
+#ifndef _LIBCUDACXX_IOS
+#define _LIBCUDACXX_IOS
 
 /*
     ios synopsis
@@ -212,7 +212,7 @@ storage-class-specifier const error_category& iostream_category() noexcept;
 
 #include <__config>
 
-#if defined(_LIBCPP_HAS_NO_LOCALIZATION)
+#if defined(_LIBCUDACXX_HAS_NO_LOCALIZATION)
 #   error "The iostreams library is not supported since libc++ has been configured without support for localization."
 #endif
 
@@ -226,22 +226,22 @@ storage-class-specifier const error_category& iostream_category() noexcept;
 // standard-mandated includes
 #include <iosfwd>
 
-#if !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_ATOMIC_HEADER)
 #include <atomic>     // for __xindex_
 #endif
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 typedef ptr
diff _t streamsize;
 
-class _LIBCPP_TYPE_VIS ios_base
+class _LIBCUDACXX_TYPE_VIS ios_base
 {
 public:
-    class _LIBCPP_EXCEPTION_ABI failure;
+    class _LIBCUDACXX_EXCEPTION_ABI failure;
 
     typedef unsigned int fmtflags;
     static const fmtflags boolalpha   = 0x0001;
@@ -279,28 +279,28 @@ public:
 
     enum seekdir {beg, cur, end};
 
-#if _LIBCPP_STD_VER <= 14
+#if _LIBCUDACXX_STD_VER <= 14
     typedef iostate      io_state;
     typedef openmode     open_mode;
     typedef seekdir      seek_dir;
 
-    typedef _VSTD::streamoff streamoff;
-    typedef _VSTD::streampos streampos;
+    typedef _CUDA_VSTD::streamoff streamoff;
+    typedef _CUDA_VSTD::streampos streampos;
 #endif
 
-    class _LIBCPP_TYPE_VIS Init;
+    class _LIBCUDACXX_TYPE_VIS Init;
 
     // 27.5.2.2 fmtflags state:
-    _LIBCPP_INLINE_VISIBILITY fmtflags flags() const;
-    _LIBCPP_INLINE_VISIBILITY fmtflags flags(fmtflags __fmtfl);
-    _LIBCPP_INLINE_VISIBILITY fmtflags setf(fmtflags __fmtfl);
-    _LIBCPP_INLINE_VISIBILITY fmtflags setf(fmtflags __fmtfl, fmtflags __mask);
-    _LIBCPP_INLINE_VISIBILITY void unsetf(fmtflags __mask);
+    _LIBCUDACXX_INLINE_VISIBILITY fmtflags flags() const;
+    _LIBCUDACXX_INLINE_VISIBILITY fmtflags flags(fmtflags __fmtfl);
+    _LIBCUDACXX_INLINE_VISIBILITY fmtflags setf(fmtflags __fmtfl);
+    _LIBCUDACXX_INLINE_VISIBILITY fmtflags setf(fmtflags __fmtfl, fmtflags __mask);
+    _LIBCUDACXX_INLINE_VISIBILITY void unsetf(fmtflags __mask);
 
-    _LIBCPP_INLINE_VISIBILITY streamsize precision() const;
-    _LIBCPP_INLINE_VISIBILITY streamsize precision(streamsize __prec);
-    _LIBCPP_INLINE_VISIBILITY streamsize width() const;
-    _LIBCPP_INLINE_VISIBILITY streamsize width(streamsize __wide);
+    _LIBCUDACXX_INLINE_VISIBILITY streamsize precision() const;
+    _LIBCUDACXX_INLINE_VISIBILITY streamsize precision(streamsize __prec);
+    _LIBCUDACXX_INLINE_VISIBILITY streamsize width() const;
+    _LIBCUDACXX_INLINE_VISIBILITY streamsize width(streamsize __wide);
 
     // 27.5.2.3 locales:
     locale imbue(const locale& __loc);
@@ -324,22 +324,22 @@ public:
 
     static bool sync_with_stdio(bool __sync = true);
 
-    _LIBCPP_INLINE_VISIBILITY iostate rdstate() const;
+    _LIBCUDACXX_INLINE_VISIBILITY iostate rdstate() const;
     void clear(iostate __state = goodbit);
-    _LIBCPP_INLINE_VISIBILITY void setstate(iostate __state);
+    _LIBCUDACXX_INLINE_VISIBILITY void setstate(iostate __state);
 
-    _LIBCPP_INLINE_VISIBILITY bool good() const;
-    _LIBCPP_INLINE_VISIBILITY bool eof() const;
-    _LIBCPP_INLINE_VISIBILITY bool fail() const;
-    _LIBCPP_INLINE_VISIBILITY bool bad() const;
+    _LIBCUDACXX_INLINE_VISIBILITY bool good() const;
+    _LIBCUDACXX_INLINE_VISIBILITY bool eof() const;
+    _LIBCUDACXX_INLINE_VISIBILITY bool fail() const;
+    _LIBCUDACXX_INLINE_VISIBILITY bool bad() const;
 
-    _LIBCPP_INLINE_VISIBILITY iostate exceptions() const;
-    _LIBCPP_INLINE_VISIBILITY void exceptions(iostate __iostate);
+    _LIBCUDACXX_INLINE_VISIBILITY iostate exceptions() const;
+    _LIBCUDACXX_INLINE_VISIBILITY void exceptions(iostate __iostate);
 
     void __set_badbit_and_consider_rethrow();
     void __set_failbit_and_consider_rethrow();
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __setstate_nothrow(iostate __state)
     {
         if (__rdbuf_)
@@ -349,14 +349,14 @@ public:
     }
 
 protected:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     ios_base() {// purposefully does no initialization
                }
 
     void init(void* __sb);
-    _LIBCPP_INLINE_VISIBILITY void* rdbuf() const {return __rdbuf_;}
+    _LIBCUDACXX_INLINE_VISIBILITY void* rdbuf() const {return __rdbuf_;}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void rdbuf(void* __sb)
     {
         __rdbuf_ = __sb;
@@ -368,7 +368,7 @@ protected:
     void move(ios_base&);
     void swap(ios_base&) _NOEXCEPT;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void set_rdbuf(void* __sb)
     {
         __rdbuf_ = __sb;
@@ -389,7 +389,7 @@ private:
     size_t          __event_cap_;
 // TODO(EricWF): Enable this for both Clang and GCC. Currently it is only
 // enabled with clang.
-#if defined(_LIBCPP_HAS_C_ATOMIC_IMP) && !defined(_LIBCPP_HAS_NO_THREADS)
+#if defined(_LIBCUDACXX_HAS_C_ATOMIC_IMP) && !defined(_LIBCUDACXX_HAS_NO_THREADS)
     static atomic<int> __xindex_;
 #else
     static int      __xindex_;
@@ -403,38 +403,38 @@ private:
 };
 
 //enum class io_errc
-_LIBCPP_DECLARE_STRONG_ENUM(io_errc)
+_LIBCUDACXX_DECLARE_STRONG_ENUM(io_errc)
 {
     stream = 1
 };
-_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(io_errc)
+_LIBCUDACXX_DECLARE_STRONG_ENUM_EPILOG(io_errc)
 
 template <>
-struct _LIBCPP_TEMPLATE_VIS is_error_code_enum<io_errc> : public true_type { };
+struct _LIBCUDACXX_TEMPLATE_VIS is_error_code_enum<io_errc> : public true_type { };
 
-#ifdef _LIBCPP_CXX03_LANG
+#ifdef _LIBCUDACXX_CXX03_LANG
 template <>
-struct _LIBCPP_TEMPLATE_VIS is_error_code_enum<io_errc::__lx> : public true_type { };
+struct _LIBCUDACXX_TEMPLATE_VIS is_error_code_enum<io_errc::__lx> : public true_type { };
 #endif
 
-_LIBCPP_FUNC_VIS
+_LIBCUDACXX_FUNC_VIS
 const error_category& iostream_category() _NOEXCEPT;
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 error_code
 make_error_code(io_errc __e) _NOEXCEPT
 {
     return error_code(static_cast<int>(__e), iostream_category());
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 error_condition
 make_error_condition(io_errc __e) _NOEXCEPT
 {
     return error_condition(static_cast<int>(__e), iostream_category());
 }
 
-class _LIBCPP_EXCEPTION_ABI ios_base::failure
+class _LIBCUDACXX_EXCEPTION_ABI ios_base::failure
     : public system_error
 {
 public:
@@ -444,17 +444,17 @@ public:
     virtual ~failure() _NOEXCEPT;
 };
 
-_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_NORETURN inline _LIBCUDACXX_INLINE_VISIBILITY
 void __throw_failure(char const* __msg) {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     throw ios_base::failure(__msg);
 #else
     ((void)__msg);
-    _VSTD::abort();
+    _CUDA_VSTD::abort();
 #endif
 }
 
-class _LIBCPP_TYPE_VIS ios_base::Init
+class _LIBCUDACXX_TYPE_VIS ios_base::Init
 {
 public:
     Init();
@@ -463,14 +463,14 @@ public:
 
 // fmtflags
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 ios_base::fmtflags
 ios_base::flags() const
 {
     return __fmtflags_;
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 ios_base::fmtflags
 ios_base::flags(fmtflags __fmtfl)
 {
@@ -479,7 +479,7 @@ ios_base::flags(fmtflags __fmtfl)
     return __r;
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 ios_base::fmtflags
 ios_base::setf(fmtflags __fmtfl)
 {
@@ -488,14 +488,14 @@ ios_base::setf(fmtflags __fmtfl)
     return __r;
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 ios_base::unsetf(fmtflags __mask)
 {
     __fmtflags_ &= ~__mask;
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 ios_base::fmtflags
 ios_base::setf(fmtflags __fmtfl, fmtflags __mask)
 {
@@ -507,14 +507,14 @@ ios_base::setf(fmtflags __fmtfl, fmtflags __mask)
 
 // precision
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 streamsize
 ios_base::precision() const
 {
     return __precision_;
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 streamsize
 ios_base::precision(streamsize __prec)
 {
@@ -525,14 +525,14 @@ ios_base::precision(streamsize __prec)
 
 // width
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 streamsize
 ios_base::width() const
 {
     return __width_;
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 streamsize
 ios_base::width(streamsize __wide)
 {
@@ -543,56 +543,56 @@ ios_base::width(streamsize __wide)
 
 // iostate
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 ios_base::iostate
 ios_base::rdstate() const
 {
     return __rdstate_;
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 ios_base::setstate(iostate __state)
 {
     clear(__rdstate_ | __state);
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 ios_base::good() const
 {
     return __rdstate_ == 0;
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 ios_base::eof() const
 {
     return (__rdstate_ & eofbit) != 0;
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 ios_base::fail() const
 {
     return (__rdstate_ & (failbit | badbit)) != 0;
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 ios_base::bad() const
 {
     return (__rdstate_ & badbit) != 0;
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 ios_base::iostate
 ios_base::exceptions() const
 {
     return __exceptions_;
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 ios_base::exceptions(iostate __iostate)
 {
@@ -601,7 +601,7 @@ ios_base::exceptions(iostate __iostate)
 }
 
 template <class _CharT, class _Traits>
-class _LIBCPP_TEMPLATE_VIS basic_ios
+class _LIBCUDACXX_TEMPLATE_VIS basic_ios
     : public ios_base
 {
 public:
@@ -616,73 +616,73 @@ public:
     static_assert((is_same<_CharT, typename traits_type::char_type>::value),
                   "traits_type::char_type must be the same type as CharT");
 
-#ifdef _LIBCPP_CXX03_LANG
+#ifdef _LIBCUDACXX_CXX03_LANG
     // Preserve the ability to compare with literal 0,
     // and implicitly convert to bool, but not implicitly convert to int.
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     operator void*() const {return fail() ? nullptr : (void*)this;}
 #else
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit operator bool() const {return !fail();}
 #endif
 
-    _LIBCPP_INLINE_VISIBILITY bool operator!() const    {return  fail();}
-    _LIBCPP_INLINE_VISIBILITY iostate rdstate() const   {return ios_base::rdstate();}
-    _LIBCPP_INLINE_VISIBILITY void clear(iostate __state = goodbit) {ios_base::clear(__state);}
-    _LIBCPP_INLINE_VISIBILITY void setstate(iostate __state) {ios_base::setstate(__state);}
-    _LIBCPP_INLINE_VISIBILITY bool good() const {return ios_base::good();}
-    _LIBCPP_INLINE_VISIBILITY bool eof() const  {return ios_base::eof();}
-    _LIBCPP_INLINE_VISIBILITY bool fail() const {return ios_base::fail();}
-    _LIBCPP_INLINE_VISIBILITY bool bad() const  {return ios_base::bad();}
+    _LIBCUDACXX_INLINE_VISIBILITY bool operator!() const    {return  fail();}
+    _LIBCUDACXX_INLINE_VISIBILITY iostate rdstate() const   {return ios_base::rdstate();}
+    _LIBCUDACXX_INLINE_VISIBILITY void clear(iostate __state = goodbit) {ios_base::clear(__state);}
+    _LIBCUDACXX_INLINE_VISIBILITY void setstate(iostate __state) {ios_base::setstate(__state);}
+    _LIBCUDACXX_INLINE_VISIBILITY bool good() const {return ios_base::good();}
+    _LIBCUDACXX_INLINE_VISIBILITY bool eof() const  {return ios_base::eof();}
+    _LIBCUDACXX_INLINE_VISIBILITY bool fail() const {return ios_base::fail();}
+    _LIBCUDACXX_INLINE_VISIBILITY bool bad() const  {return ios_base::bad();}
 
-    _LIBCPP_INLINE_VISIBILITY iostate exceptions() const {return ios_base::exceptions();}
-    _LIBCPP_INLINE_VISIBILITY void exceptions(iostate __iostate) {ios_base::exceptions(__iostate);}
+    _LIBCUDACXX_INLINE_VISIBILITY iostate exceptions() const {return ios_base::exceptions();}
+    _LIBCUDACXX_INLINE_VISIBILITY void exceptions(iostate __iostate) {ios_base::exceptions(__iostate);}
 
     // 27.5.4.1 Constructor/destructor:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit basic_ios(basic_streambuf<char_type,traits_type>* __sb);
     virtual ~basic_ios();
 
     // 27.5.4.2 Members:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_ostream<char_type, traits_type>* tie() const;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_ostream<char_type, traits_type>* tie(basic_ostream<char_type, traits_type>* __tiestr);
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_streambuf<char_type, traits_type>* rdbuf() const;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_streambuf<char_type, traits_type>* rdbuf(basic_streambuf<char_type, traits_type>* __sb);
 
     basic_ios& copyfmt(const basic_ios& __rhs);
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     char_type fill() const;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     char_type fill(char_type __ch);
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     locale imbue(const locale& __loc);
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     char narrow(char_type __c, char __dfault) const;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     char_type widen(char __c) const;
 
 protected:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_ios() {// purposefully does no initialization
                 }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void init(basic_streambuf<char_type, traits_type>* __sb);
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void move(basic_ios& __rhs);
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void move(basic_ios&& __rhs) {move(__rhs);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void swap(basic_ios& __rhs) _NOEXCEPT;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void set_rdbuf(basic_streambuf<char_type, traits_type>* __sb);
 private:
     basic_ostream<char_type, traits_type>* __tie_;
@@ -690,7 +690,7 @@ private:
 };
 
 template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 basic_ios<_CharT, _Traits>::basic_ios(basic_streambuf<char_type,traits_type>* __sb)
 {
     init(__sb);
@@ -702,7 +702,7 @@ basic_ios<_CharT, _Traits>::~basic_ios()
 }
 
 template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 basic_ios<_CharT, _Traits>::init(basic_streambuf<char_type, traits_type>* __sb)
 {
@@ -712,7 +712,7 @@ basic_ios<_CharT, _Traits>::init(basic_streambuf<char_type, traits_type>* __sb)
 }
 
 template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 basic_ostream<_CharT, _Traits>*
 basic_ios<_CharT, _Traits>::tie() const
 {
@@ -720,7 +720,7 @@ basic_ios<_CharT, _Traits>::tie() const
 }
 
 template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 basic_ostream<_CharT, _Traits>*
 basic_ios<_CharT, _Traits>::tie(basic_ostream<char_type, traits_type>* __tiestr)
 {
@@ -730,7 +730,7 @@ basic_ios<_CharT, _Traits>::tie(basic_ostream<char_type, traits_type>* __tiestr)
 }
 
 template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 basic_streambuf<_CharT, _Traits>*
 basic_ios<_CharT, _Traits>::rdbuf() const
 {
@@ -738,7 +738,7 @@ basic_ios<_CharT, _Traits>::rdbuf() const
 }
 
 template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 basic_streambuf<_CharT, _Traits>*
 basic_ios<_CharT, _Traits>::rdbuf(basic_streambuf<char_type, traits_type>* __sb)
 {
@@ -748,7 +748,7 @@ basic_ios<_CharT, _Traits>::rdbuf(basic_streambuf<char_type, traits_type>* __sb)
 }
 
 template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 locale
 basic_ios<_CharT, _Traits>::imbue(const locale& __loc)
 {
@@ -760,7 +760,7 @@ basic_ios<_CharT, _Traits>::imbue(const locale& __loc)
 }
 
 template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 char
 basic_ios<_CharT, _Traits>::narrow(char_type __c, char __dfault) const
 {
@@ -768,7 +768,7 @@ basic_ios<_CharT, _Traits>::narrow(char_type __c, char __dfault) const
 }
 
 template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 _CharT
 basic_ios<_CharT, _Traits>::widen(char __c) const
 {
@@ -776,7 +776,7 @@ basic_ios<_CharT, _Traits>::widen(char __c) const
 }
 
 template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 _CharT
 basic_ios<_CharT, _Traits>::fill() const
 {
@@ -786,7 +786,7 @@ basic_ios<_CharT, _Traits>::fill() const
 }
 
 template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 _CharT
 basic_ios<_CharT, _Traits>::fill(char_type __ch)
 {
@@ -814,7 +814,7 @@ basic_ios<_CharT, _Traits>::copyfmt(const basic_ios& __rhs)
 }
 
 template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 basic_ios<_CharT, _Traits>::move(basic_ios& __rhs)
 {
@@ -825,17 +825,17 @@ basic_ios<_CharT, _Traits>::move(basic_ios& __rhs)
 }
 
 template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 basic_ios<_CharT, _Traits>::swap(basic_ios& __rhs) _NOEXCEPT
 {
     ios_base::swap(__rhs);
-    _VSTD::swap(__tie_, __rhs.__tie_);
-    _VSTD::swap(__fill_, __rhs.__fill_);
+    _CUDA_VSTD::swap(__tie_, __rhs.__tie_);
+    _CUDA_VSTD::swap(__fill_, __rhs.__fill_);
 }
 
 template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 basic_ios<_CharT, _Traits>::set_rdbuf(basic_streambuf<char_type, traits_type>* __sb)
 {
@@ -1034,6 +1034,6 @@ defaultfloat(ios_base& __str)
     return __str;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_IOS
+#endif // _LIBCUDACXX_IOS

diff  --git a/libcxx/include/iosfwd b/libcxx/include/iosfwd
index 9cd9450e62e9..2afc19a97a63 100644
--- a/libcxx/include/iosfwd
+++ b/libcxx/include/iosfwd
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_IOSFWD
-#define _LIBCPP_IOSFWD
+#ifndef _LIBCUDACXX_IOSFWD
+#define _LIBCUDACXX_IOSFWD
 
 /*
     iosfwd synopsis
@@ -99,68 +99,68 @@ using u32streampos = fpos<char_traits<char32_t>::state_type>;
 #include <__mbstate_t.h>
 #include <version>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-class _LIBCPP_TYPE_VIS ios_base;
+class _LIBCUDACXX_TYPE_VIS ios_base;
 
-template<class _CharT>  struct _LIBCPP_TEMPLATE_VIS char_traits;
+template<class _CharT>  struct _LIBCUDACXX_TEMPLATE_VIS char_traits;
 template<> struct char_traits<char>;
-#ifndef _LIBCPP_HAS_NO_CHAR8_T
+#ifndef _LIBCUDACXX_HAS_NO_CHAR8_T
 template<> struct char_traits<char8_t>;
 #endif
 template<> struct char_traits<char16_t>;
 template<> struct char_traits<char32_t>;
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 template<> struct char_traits<wchar_t>;
 #endif
 
-template<class _Tp>     class _LIBCPP_TEMPLATE_VIS allocator;
+template<class _Tp>     class _LIBCUDACXX_TEMPLATE_VIS allocator;
 
 template <class _CharT, class _Traits = char_traits<_CharT> >
-    class _LIBCPP_TEMPLATE_VIS basic_ios;
+    class _LIBCUDACXX_TEMPLATE_VIS basic_ios;
 
 template <class _CharT, class _Traits = char_traits<_CharT> >
-    class _LIBCPP_TEMPLATE_VIS basic_streambuf;
+    class _LIBCUDACXX_TEMPLATE_VIS basic_streambuf;
 template <class _CharT, class _Traits = char_traits<_CharT> >
-    class _LIBCPP_TEMPLATE_VIS basic_istream;
+    class _LIBCUDACXX_TEMPLATE_VIS basic_istream;
 template <class _CharT, class _Traits = char_traits<_CharT> >
-    class _LIBCPP_TEMPLATE_VIS basic_ostream;
+    class _LIBCUDACXX_TEMPLATE_VIS basic_ostream;
 template <class _CharT, class _Traits = char_traits<_CharT> >
-    class _LIBCPP_TEMPLATE_VIS basic_iostream;
+    class _LIBCUDACXX_TEMPLATE_VIS basic_iostream;
 
 template <class _CharT, class _Traits = char_traits<_CharT>,
           class _Allocator = allocator<_CharT> >
-    class _LIBCPP_TEMPLATE_VIS basic_stringbuf;
+    class _LIBCUDACXX_TEMPLATE_VIS basic_stringbuf;
 template <class _CharT, class _Traits = char_traits<_CharT>,
           class _Allocator = allocator<_CharT> >
-    class _LIBCPP_TEMPLATE_VIS basic_istringstream;
+    class _LIBCUDACXX_TEMPLATE_VIS basic_istringstream;
 template <class _CharT, class _Traits = char_traits<_CharT>,
           class _Allocator = allocator<_CharT> >
-    class _LIBCPP_TEMPLATE_VIS basic_ostringstream;
+    class _LIBCUDACXX_TEMPLATE_VIS basic_ostringstream;
 template <class _CharT, class _Traits = char_traits<_CharT>,
           class _Allocator = allocator<_CharT> >
-    class _LIBCPP_TEMPLATE_VIS basic_stringstream;
+    class _LIBCUDACXX_TEMPLATE_VIS basic_stringstream;
 
 template <class _CharT, class _Traits = char_traits<_CharT> >
-    class _LIBCPP_TEMPLATE_VIS basic_filebuf;
+    class _LIBCUDACXX_TEMPLATE_VIS basic_filebuf;
 template <class _CharT, class _Traits = char_traits<_CharT> >
-    class _LIBCPP_TEMPLATE_VIS basic_ifstream;
+    class _LIBCUDACXX_TEMPLATE_VIS basic_ifstream;
 template <class _CharT, class _Traits = char_traits<_CharT> >
-    class _LIBCPP_TEMPLATE_VIS basic_ofstream;
+    class _LIBCUDACXX_TEMPLATE_VIS basic_ofstream;
 template <class _CharT, class _Traits = char_traits<_CharT> >
-    class _LIBCPP_TEMPLATE_VIS basic_fstream;
+    class _LIBCUDACXX_TEMPLATE_VIS basic_fstream;
 
 template <class _CharT, class _Traits = char_traits<_CharT> >
-    class _LIBCPP_TEMPLATE_VIS istreambuf_iterator;
+    class _LIBCUDACXX_TEMPLATE_VIS istreambuf_iterator;
 template <class _CharT, class _Traits = char_traits<_CharT> >
-    class _LIBCPP_TEMPLATE_VIS ostreambuf_iterator;
+    class _LIBCUDACXX_TEMPLATE_VIS ostreambuf_iterator;
 
 typedef basic_ios<char>              ios;
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 typedef basic_ios<wchar_t>           wios;
 #endif
 
@@ -179,7 +179,7 @@ typedef basic_ifstream<char>         ifstream;
 typedef basic_ofstream<char>         ofstream;
 typedef basic_fstream<char>          fstream;
 
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 typedef basic_streambuf<wchar_t>     wstreambuf;
 typedef basic_istream<wchar_t>       wistream;
 typedef basic_ostream<wchar_t>       wostream;
@@ -197,39 +197,39 @@ typedef basic_fstream<wchar_t>       wfstream;
 #endif
 
 template <class _CharT, class _Traits>
-    class _LIBCPP_PREFERRED_NAME(ios) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wios)) basic_ios;
+    class _LIBCUDACXX_PREFERRED_NAME(ios) _LIBCUDACXX_IF_WIDE_CHARACTERS(_LIBCUDACXX_PREFERRED_NAME(wios)) basic_ios;
 
 template <class _CharT, class _Traits>
-    class _LIBCPP_PREFERRED_NAME(streambuf) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wstreambuf)) basic_streambuf;
+    class _LIBCUDACXX_PREFERRED_NAME(streambuf) _LIBCUDACXX_IF_WIDE_CHARACTERS(_LIBCUDACXX_PREFERRED_NAME(wstreambuf)) basic_streambuf;
 template <class _CharT, class _Traits>
-    class _LIBCPP_PREFERRED_NAME(istream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wistream)) basic_istream;
+    class _LIBCUDACXX_PREFERRED_NAME(istream) _LIBCUDACXX_IF_WIDE_CHARACTERS(_LIBCUDACXX_PREFERRED_NAME(wistream)) basic_istream;
 template <class _CharT, class _Traits>
-    class _LIBCPP_PREFERRED_NAME(ostream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wostream)) basic_ostream;
+    class _LIBCUDACXX_PREFERRED_NAME(ostream) _LIBCUDACXX_IF_WIDE_CHARACTERS(_LIBCUDACXX_PREFERRED_NAME(wostream)) basic_ostream;
 template <class _CharT, class _Traits>
-    class _LIBCPP_PREFERRED_NAME(iostream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wiostream)) basic_iostream;
+    class _LIBCUDACXX_PREFERRED_NAME(iostream) _LIBCUDACXX_IF_WIDE_CHARACTERS(_LIBCUDACXX_PREFERRED_NAME(wiostream)) basic_iostream;
 
 template <class _CharT, class _Traits, class _Allocator>
-    class _LIBCPP_PREFERRED_NAME(stringbuf) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wstringbuf)) basic_stringbuf;
+    class _LIBCUDACXX_PREFERRED_NAME(stringbuf) _LIBCUDACXX_IF_WIDE_CHARACTERS(_LIBCUDACXX_PREFERRED_NAME(wstringbuf)) basic_stringbuf;
 template <class _CharT, class _Traits, class _Allocator>
-    class _LIBCPP_PREFERRED_NAME(istringstream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wistringstream)) basic_istringstream;
+    class _LIBCUDACXX_PREFERRED_NAME(istringstream) _LIBCUDACXX_IF_WIDE_CHARACTERS(_LIBCUDACXX_PREFERRED_NAME(wistringstream)) basic_istringstream;
 template <class _CharT, class _Traits, class _Allocator>
-    class _LIBCPP_PREFERRED_NAME(ostringstream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wostringstream)) basic_ostringstream;
+    class _LIBCUDACXX_PREFERRED_NAME(ostringstream) _LIBCUDACXX_IF_WIDE_CHARACTERS(_LIBCUDACXX_PREFERRED_NAME(wostringstream)) basic_ostringstream;
 template <class _CharT, class _Traits, class _Allocator>
-    class _LIBCPP_PREFERRED_NAME(stringstream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wstringstream)) basic_stringstream;
+    class _LIBCUDACXX_PREFERRED_NAME(stringstream) _LIBCUDACXX_IF_WIDE_CHARACTERS(_LIBCUDACXX_PREFERRED_NAME(wstringstream)) basic_stringstream;
 
 template <class _CharT, class _Traits>
-    class _LIBCPP_PREFERRED_NAME(filebuf) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wfilebuf)) basic_filebuf;
+    class _LIBCUDACXX_PREFERRED_NAME(filebuf) _LIBCUDACXX_IF_WIDE_CHARACTERS(_LIBCUDACXX_PREFERRED_NAME(wfilebuf)) basic_filebuf;
 template <class _CharT, class _Traits>
-    class _LIBCPP_PREFERRED_NAME(ifstream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wifstream)) basic_ifstream;
+    class _LIBCUDACXX_PREFERRED_NAME(ifstream) _LIBCUDACXX_IF_WIDE_CHARACTERS(_LIBCUDACXX_PREFERRED_NAME(wifstream)) basic_ifstream;
 template <class _CharT, class _Traits>
-    class _LIBCPP_PREFERRED_NAME(ofstream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wofstream)) basic_ofstream;
+    class _LIBCUDACXX_PREFERRED_NAME(ofstream) _LIBCUDACXX_IF_WIDE_CHARACTERS(_LIBCUDACXX_PREFERRED_NAME(wofstream)) basic_ofstream;
 template <class _CharT, class _Traits>
-    class _LIBCPP_PREFERRED_NAME(fstream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wfstream)) basic_fstream;
+    class _LIBCUDACXX_PREFERRED_NAME(fstream) _LIBCUDACXX_IF_WIDE_CHARACTERS(_LIBCUDACXX_PREFERRED_NAME(wfstream)) basic_fstream;
 
-template <class _State>             class _LIBCPP_TEMPLATE_VIS fpos;
+template <class _State>             class _LIBCUDACXX_TEMPLATE_VIS fpos;
 typedef fpos<mbstate_t>    streampos;
 typedef fpos<mbstate_t>    wstreampos;
-#ifndef _LIBCPP_HAS_NO_CHAR8_T
+#ifndef _LIBCUDACXX_HAS_NO_CHAR8_T
 typedef fpos<mbstate_t>    u8streampos;
 #endif
 typedef fpos<mbstate_t>    u16streampos;
@@ -245,18 +245,18 @@ typedef long long streamoff;        // for char_traits in <string>
 template <class _CharT,             // for <stdexcept>
           class _Traits = char_traits<_CharT>,
           class _Allocator = allocator<_CharT> >
-    class _LIBCPP_TEMPLATE_VIS basic_string;
+    class _LIBCUDACXX_TEMPLATE_VIS basic_string;
 typedef basic_string<char, char_traits<char>, allocator<char> > string;
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 typedef basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> > wstring;
 #endif
 
 template <class _CharT, class _Traits, class _Allocator>
-    class _LIBCPP_PREFERRED_NAME(string) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wstring)) basic_string;
+    class _LIBCUDACXX_PREFERRED_NAME(string) _LIBCUDACXX_IF_WIDE_CHARACTERS(_LIBCUDACXX_PREFERRED_NAME(wstring)) basic_string;
 
 // Include other forward declarations here
 template <class _Tp, class _Alloc = allocator<_Tp> >
-class _LIBCPP_TEMPLATE_VIS vector;
+class _LIBCUDACXX_TEMPLATE_VIS vector;
 
 template <class _CharT, class _Traits>
 class __save_flags
@@ -271,13 +271,13 @@ class __save_flags
     __save_flags(const __save_flags&);
     __save_flags& operator=(const __save_flags&);
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __save_flags(__stream_type& __stream)
         : __stream_(__stream),
           __fmtflags_(__stream.flags()),
           __fill_(__stream.fill())
         {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     ~__save_flags()
     {
         __stream_.flags(__fmtflags_);
@@ -285,6 +285,6 @@ public:
     }
 };
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_IOSFWD
+#endif // _LIBCUDACXX_IOSFWD

diff  --git a/libcxx/include/iostream b/libcxx/include/iostream
index 13d4ac3cadae..598c4e4667ea 100644
--- a/libcxx/include/iostream
+++ b/libcxx/include/iostream
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_IOSTREAM
-#define _LIBCPP_IOSTREAM
+#ifndef _LIBCUDACXX_IOSTREAM
+#define _LIBCUDACXX_IOSTREAM
 
 /*
     iostream synopsis
@@ -43,24 +43,24 @@ extern wostream wclog;
 #include <ostream>
 #include <streambuf>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-extern _LIBCPP_FUNC_VIS istream cin;
-extern _LIBCPP_FUNC_VIS ostream cout;
-extern _LIBCPP_FUNC_VIS ostream cerr;
-extern _LIBCPP_FUNC_VIS ostream clog;
+extern _LIBCUDACXX_FUNC_VIS istream cin;
+extern _LIBCUDACXX_FUNC_VIS ostream cout;
+extern _LIBCUDACXX_FUNC_VIS ostream cerr;
+extern _LIBCUDACXX_FUNC_VIS ostream clog;
 
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-extern _LIBCPP_FUNC_VIS wistream wcin;
-extern _LIBCPP_FUNC_VIS wostream wcout;
-extern _LIBCPP_FUNC_VIS wostream wcerr;
-extern _LIBCPP_FUNC_VIS wostream wclog;
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
+extern _LIBCUDACXX_FUNC_VIS wistream wcin;
+extern _LIBCUDACXX_FUNC_VIS wostream wcout;
+extern _LIBCUDACXX_FUNC_VIS wostream wcerr;
+extern _LIBCUDACXX_FUNC_VIS wostream wclog;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_IOSTREAM
+#endif // _LIBCUDACXX_IOSTREAM

diff  --git a/libcxx/include/istream b/libcxx/include/istream
index 7af5dfa474cd..5dfa75338491 100644
--- a/libcxx/include/istream
+++ b/libcxx/include/istream
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_ISTREAM
-#define _LIBCPP_ISTREAM
+#ifndef _LIBCUDACXX_ISTREAM
+#define _LIBCUDACXX_ISTREAM
 
 /*
     istream synopsis
@@ -165,18 +165,18 @@ template <class Stream, class T>
 #include <ostream>
 #include <version>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _CharT, class _Traits>
-class _LIBCPP_TEMPLATE_VIS basic_istream
+class _LIBCUDACXX_TEMPLATE_VIS basic_istream
     : virtual public basic_ios<_CharT, _Traits>
 {
     streamsize __gc_;
@@ -189,21 +189,21 @@ public:
     typedef typename traits_type::off_type off_type;
 
     // 27.7.1.1.1 Constructor/destructor:
-    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
+    inline _LIBCUDACXX_HIDE_FROM_ABI_AFTER_V1
     explicit basic_istream(basic_streambuf<char_type, traits_type>* __sb) : __gc_(0)
     { this->init(__sb); }
     virtual ~basic_istream();
 protected:
-    inline _LIBCPP_INLINE_VISIBILITY
+    inline _LIBCUDACXX_INLINE_VISIBILITY
     basic_istream(basic_istream&& __rhs);
 
     // 27.7.1.1.2 Assign/swap:
-    inline _LIBCPP_INLINE_VISIBILITY
+    inline _LIBCUDACXX_INLINE_VISIBILITY
     basic_istream& operator=(basic_istream&& __rhs);
 
-    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
+    inline _LIBCUDACXX_HIDE_FROM_ABI_AFTER_V1
     void swap(basic_istream& __rhs) {
-      _VSTD::swap(__gc_, __rhs.__gc_);
+      _CUDA_VSTD::swap(__gc_, __rhs.__gc_);
       basic_ios<char_type, traits_type>::swap(__rhs);
     }
 
@@ -212,19 +212,19 @@ protected:
 public:
 
     // 27.7.1.1.3 Prefix/suffix:
-    class _LIBCPP_TEMPLATE_VIS sentry;
+    class _LIBCUDACXX_TEMPLATE_VIS sentry;
 
     // 27.7.1.2 Formatted input:
-    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
+    inline _LIBCUDACXX_HIDE_FROM_ABI_AFTER_V1
     basic_istream& operator>>(basic_istream& (*__pf)(basic_istream&))
     { return __pf(*this); }
 
-    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
+    inline _LIBCUDACXX_HIDE_FROM_ABI_AFTER_V1
     basic_istream& operator>>(basic_ios<char_type, traits_type>&
                               (*__pf)(basic_ios<char_type, traits_type>&))
     { __pf(*this); return *this; }
 
-    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
+    inline _LIBCUDACXX_HIDE_FROM_ABI_AFTER_V1
     basic_istream& operator>>(ios_base& (*__pf)(ios_base&))
     { __pf(*this); return *this; }
 
@@ -244,11 +244,11 @@ public:
     basic_istream& operator>>(void*& __p);
 
     // 27.7.1.3 Unformatted input:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     streamsize gcount() const {return __gc_;}
     int_type get();
 
-    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
+    inline _LIBCUDACXX_HIDE_FROM_ABI_AFTER_V1
     basic_istream& get(char_type& __c) {
       int_type __ch = get();
       if (__ch != traits_type::eof())
@@ -256,19 +256,19 @@ public:
       return *this;
     }
 
-    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
+    inline _LIBCUDACXX_HIDE_FROM_ABI_AFTER_V1
     basic_istream& get(char_type* __s, streamsize __n)
     { return get(__s, __n, this->widen('\n')); }
 
     basic_istream& get(char_type* __s, streamsize __n, char_type __dlm);
 
-    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
+    inline _LIBCUDACXX_HIDE_FROM_ABI_AFTER_V1
     basic_istream& get(basic_streambuf<char_type, traits_type>& __sb)
     { return get(__sb, this->widen('\n')); }
 
     basic_istream& get(basic_streambuf<char_type, traits_type>& __sb, char_type __dlm);
 
-    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
+    inline _LIBCUDACXX_HIDE_FROM_ABI_AFTER_V1
     basic_istream& getline(char_type* __s, streamsize __n)
     { return getline(__s, __n, this->widen('\n')); }
 
@@ -289,7 +289,7 @@ public:
 };
 
 template <class _CharT, class _Traits>
-class _LIBCPP_TEMPLATE_VIS basic_istream<_CharT, _Traits>::sentry
+class _LIBCUDACXX_TEMPLATE_VIS basic_istream<_CharT, _Traits>::sentry
 {
     bool __ok_;
 
@@ -297,7 +297,7 @@ public:
     explicit sentry(basic_istream<_CharT, _Traits>& __is, bool __noskipws = false);
 //    ~sentry() = default;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit operator bool() const {return __ok_;}
 
     sentry(const sentry&) = delete;
@@ -353,21 +353,21 @@ basic_istream<_CharT, _Traits>::~basic_istream()
 }
 
 template <class _Tp, class _CharT, class _Traits>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 basic_istream<_CharT, _Traits>&
 __input_arithmetic(basic_istream<_CharT, _Traits>& __is, _Tp& __n) {
     ios_base::iostate __state = ios_base::goodbit;
     typename basic_istream<_CharT, _Traits>::sentry __s(__is);
     if (__s)
     {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         try
         {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
             typedef istreambuf_iterator<_CharT, _Traits> _Ip;
             typedef num_get<_CharT, _Ip> _Fp;
             use_facet<_Fp>(__is.getloc()).get(_Ip(__is), _Ip(), __is, __state, __n);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         }
         catch (...)
         {
@@ -388,91 +388,91 @@ template <class _CharT, class _Traits>
 basic_istream<_CharT, _Traits>&
 basic_istream<_CharT, _Traits>::operator>>(unsigned short& __n)
 {
-    return _VSTD::__input_arithmetic<unsigned short>(*this, __n);
+    return _CUDA_VSTD::__input_arithmetic<unsigned short>(*this, __n);
 }
 
 template <class _CharT, class _Traits>
 basic_istream<_CharT, _Traits>&
 basic_istream<_CharT, _Traits>::operator>>(unsigned int& __n)
 {
-    return _VSTD::__input_arithmetic<unsigned int>(*this, __n);
+    return _CUDA_VSTD::__input_arithmetic<unsigned int>(*this, __n);
 }
 
 template <class _CharT, class _Traits>
 basic_istream<_CharT, _Traits>&
 basic_istream<_CharT, _Traits>::operator>>(long& __n)
 {
-    return _VSTD::__input_arithmetic<long>(*this, __n);
+    return _CUDA_VSTD::__input_arithmetic<long>(*this, __n);
 }
 
 template <class _CharT, class _Traits>
 basic_istream<_CharT, _Traits>&
 basic_istream<_CharT, _Traits>::operator>>(unsigned long& __n)
 {
-    return _VSTD::__input_arithmetic<unsigned long>(*this, __n);
+    return _CUDA_VSTD::__input_arithmetic<unsigned long>(*this, __n);
 }
 
 template <class _CharT, class _Traits>
 basic_istream<_CharT, _Traits>&
 basic_istream<_CharT, _Traits>::operator>>(long long& __n)
 {
-    return _VSTD::__input_arithmetic<long long>(*this, __n);
+    return _CUDA_VSTD::__input_arithmetic<long long>(*this, __n);
 }
 
 template <class _CharT, class _Traits>
 basic_istream<_CharT, _Traits>&
 basic_istream<_CharT, _Traits>::operator>>(unsigned long long& __n)
 {
-    return _VSTD::__input_arithmetic<unsigned long long>(*this, __n);
+    return _CUDA_VSTD::__input_arithmetic<unsigned long long>(*this, __n);
 }
 
 template <class _CharT, class _Traits>
 basic_istream<_CharT, _Traits>&
 basic_istream<_CharT, _Traits>::operator>>(float& __n)
 {
-    return _VSTD::__input_arithmetic<float>(*this, __n);
+    return _CUDA_VSTD::__input_arithmetic<float>(*this, __n);
 }
 
 template <class _CharT, class _Traits>
 basic_istream<_CharT, _Traits>&
 basic_istream<_CharT, _Traits>::operator>>(double& __n)
 {
-    return _VSTD::__input_arithmetic<double>(*this, __n);
+    return _CUDA_VSTD::__input_arithmetic<double>(*this, __n);
 }
 
 template <class _CharT, class _Traits>
 basic_istream<_CharT, _Traits>&
 basic_istream<_CharT, _Traits>::operator>>(long double& __n)
 {
-    return _VSTD::__input_arithmetic<long double>(*this, __n);
+    return _CUDA_VSTD::__input_arithmetic<long double>(*this, __n);
 }
 
 template <class _CharT, class _Traits>
 basic_istream<_CharT, _Traits>&
 basic_istream<_CharT, _Traits>::operator>>(bool& __n)
 {
-    return _VSTD::__input_arithmetic<bool>(*this, __n);
+    return _CUDA_VSTD::__input_arithmetic<bool>(*this, __n);
 }
 
 template <class _CharT, class _Traits>
 basic_istream<_CharT, _Traits>&
 basic_istream<_CharT, _Traits>::operator>>(void*& __n)
 {
-    return _VSTD::__input_arithmetic<void*>(*this, __n);
+    return _CUDA_VSTD::__input_arithmetic<void*>(*this, __n);
 }
 
 template <class _Tp, class _CharT, class _Traits>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 basic_istream<_CharT, _Traits>&
 __input_arithmetic_with_numeric_limits(basic_istream<_CharT, _Traits>& __is, _Tp& __n) {
     ios_base::iostate __state = ios_base::goodbit;
     typename basic_istream<_CharT, _Traits>::sentry __s(__is);
     if (__s)
     {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         try
         {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
             typedef istreambuf_iterator<_CharT, _Traits> _Ip;
             typedef num_get<_CharT, _Ip> _Fp;
             long __temp;
@@ -491,7 +491,7 @@ __input_arithmetic_with_numeric_limits(basic_istream<_CharT, _Traits>& __is, _Tp
             {
                 __n = static_cast<_Tp>(__temp);
             }
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         }
         catch (...)
         {
@@ -502,7 +502,7 @@ __input_arithmetic_with_numeric_limits(basic_istream<_CharT, _Traits>& __is, _Tp
                 throw;
             }
         }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
         __is.setstate(__state);
     }
     return __is;
@@ -512,18 +512,18 @@ template <class _CharT, class _Traits>
 basic_istream<_CharT, _Traits>&
 basic_istream<_CharT, _Traits>::operator>>(short& __n)
 {
-    return _VSTD::__input_arithmetic_with_numeric_limits<short>(*this, __n);
+    return _CUDA_VSTD::__input_arithmetic_with_numeric_limits<short>(*this, __n);
 }
 
 template <class _CharT, class _Traits>
 basic_istream<_CharT, _Traits>&
 basic_istream<_CharT, _Traits>::operator>>(int& __n)
 {
-    return _VSTD::__input_arithmetic_with_numeric_limits<int>(*this, __n);
+    return _CUDA_VSTD::__input_arithmetic_with_numeric_limits<int>(*this, __n);
 }
 
 template<class _CharT, class _Traits>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 basic_istream<_CharT, _Traits>&
 __input_c_string(basic_istream<_CharT, _Traits>& __is, _CharT* __p, size_t __n)
 {
@@ -531,7 +531,7 @@ __input_c_string(basic_istream<_CharT, _Traits>& __is, _CharT* __p, size_t __n)
     typename basic_istream<_CharT, _Traits>::sentry __sen(__is);
     if (__sen)
     {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         try
         {
 #endif
@@ -555,7 +555,7 @@ __input_c_string(basic_istream<_CharT, _Traits>& __is, _CharT* __p, size_t __n)
             __is.width(0);
             if (__s == __p)
                __state |= ios_base::failbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         }
         catch (...)
         {
@@ -572,21 +572,21 @@ __input_c_string(basic_istream<_CharT, _Traits>& __is, _CharT* __p, size_t __n)
     return __is;
 }
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 template<class _CharT, class _Traits, size_t _Np>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 basic_istream<_CharT, _Traits>&
 operator>>(basic_istream<_CharT, _Traits>& __is, _CharT (&__buf)[_Np])
 {
     size_t __n = _Np;
     if (__is.width() > 0)
-        __n = _VSTD::min(size_t(__is.width()), _Np);
-    return _VSTD::__input_c_string(__is, __buf, __n);
+        __n = _CUDA_VSTD::min(size_t(__is.width()), _Np);
+    return _CUDA_VSTD::__input_c_string(__is, __buf, __n);
 }
 
 template<class _Traits, size_t _Np>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 basic_istream<char, _Traits>&
 operator>>(basic_istream<char, _Traits>& __is, unsigned char (&__buf)[_Np])
 {
@@ -594,7 +594,7 @@ operator>>(basic_istream<char, _Traits>& __is, unsigned char (&__buf)[_Np])
 }
 
 template<class _Traits, size_t _Np>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 basic_istream<char, _Traits>&
 operator>>(basic_istream<char, _Traits>& __is, signed char (&__buf)[_Np])
 {
@@ -604,18 +604,18 @@ operator>>(basic_istream<char, _Traits>& __is, signed char (&__buf)[_Np])
 #else
 
 template<class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 basic_istream<_CharT, _Traits>&
 operator>>(basic_istream<_CharT, _Traits>& __is, _CharT* __s)
 {
     streamsize __n = __is.width();
     if (__n <= 0)
         __n = numeric_limits<streamsize>::max() / sizeof(_CharT) - 1;
-    return _VSTD::__input_c_string(__is, __s, size_t(__n));
+    return _CUDA_VSTD::__input_c_string(__is, __s, size_t(__n));
 }
 
 template<class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 basic_istream<char, _Traits>&
 operator>>(basic_istream<char, _Traits>& __is, unsigned char* __s)
 {
@@ -623,14 +623,14 @@ operator>>(basic_istream<char, _Traits>& __is, unsigned char* __s)
 }
 
 template<class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 basic_istream<char, _Traits>&
 operator>>(basic_istream<char, _Traits>& __is, signed char* __s)
 {
     return __is >> (char*)__s;
 }
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
 template<class _CharT, class _Traits>
 basic_istream<_CharT, _Traits>&
@@ -640,7 +640,7 @@ operator>>(basic_istream<_CharT, _Traits>& __is, _CharT& __c)
     typename basic_istream<_CharT, _Traits>::sentry __sen(__is);
     if (__sen)
     {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         try
         {
 #endif
@@ -649,7 +649,7 @@ operator>>(basic_istream<_CharT, _Traits>& __is, _CharT& __c)
                 __state |= ios_base::eofbit | ios_base::failbit;
             else
                 __c = _Traits::to_char_type(__i);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         }
         catch (...)
         {
@@ -667,7 +667,7 @@ operator>>(basic_istream<_CharT, _Traits>& __is, _CharT& __c)
 }
 
 template<class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 basic_istream<char, _Traits>&
 operator>>(basic_istream<char, _Traits>& __is, unsigned char& __c)
 {
@@ -675,7 +675,7 @@ operator>>(basic_istream<char, _Traits>& __is, unsigned char& __c)
 }
 
 template<class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 basic_istream<char, _Traits>&
 operator>>(basic_istream<char, _Traits>& __is, signed char& __c)
 {
@@ -693,10 +693,10 @@ basic_istream<_CharT, _Traits>::operator>>(basic_streambuf<char_type, traits_typ
     {
         if (__sb)
         {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
             try
             {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
                 while (true)
                 {
                     typename traits_type::int_type __i = this->rdbuf()->sgetc();
@@ -714,7 +714,7 @@ basic_istream<_CharT, _Traits>::operator>>(basic_streambuf<char_type, traits_typ
                 }
                 if (__gc_ == 0)
                    __state |= ios_base::failbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
             }
             catch (...)
             {
@@ -728,7 +728,7 @@ basic_istream<_CharT, _Traits>::operator>>(basic_streambuf<char_type, traits_typ
                     throw;
                 }
             }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
         }
         else
         {
@@ -749,7 +749,7 @@ basic_istream<_CharT, _Traits>::get()
     sentry __s(*this, true);
     if (__s)
     {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         try
         {
 #endif
@@ -758,7 +758,7 @@ basic_istream<_CharT, _Traits>::get()
                __state |= ios_base::failbit | ios_base::eofbit;
             else
                 __gc_ = 1;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         }
         catch (...)
         {
@@ -785,7 +785,7 @@ basic_istream<_CharT, _Traits>::get(char_type* __s, streamsize __n, char_type __
     {
         if (__n > 0)
         {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
             try
             {
 #endif
@@ -806,7 +806,7 @@ basic_istream<_CharT, _Traits>::get(char_type* __s, streamsize __n, char_type __
                 }
                 if (__gc_ == 0)
                    __state |= ios_base::failbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
             }
             catch (...)
             {
@@ -845,10 +845,10 @@ basic_istream<_CharT, _Traits>::get(basic_streambuf<char_type, traits_type>& __s
     sentry __sen(*this, true);
     if (__sen)
     {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         try
         {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
             while (true)
             {
                 typename traits_type::int_type __i = this->rdbuf()->sgetc();
@@ -865,14 +865,14 @@ basic_istream<_CharT, _Traits>::get(basic_streambuf<char_type, traits_type>& __s
                 ++__gc_;
                 this->rdbuf()->sbumpc();
             }
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         }
         catch (...)
         {
             __state |= ios_base::badbit;
             // according to the spec, exceptions here are caught but not rethrown
         }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
         if (__gc_ == 0)
            __state |= ios_base::failbit;
         this->setstate(__state);
@@ -889,10 +889,10 @@ basic_istream<_CharT, _Traits>::getline(char_type* __s, streamsize __n, char_typ
     sentry __sen(*this, true);
     if (__sen)
     {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         try
         {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
             while (true)
             {
                 typename traits_type::int_type __i = this->rdbuf()->sgetc();
@@ -917,7 +917,7 @@ basic_istream<_CharT, _Traits>::getline(char_type* __s, streamsize __n, char_typ
                 this->rdbuf()->sbumpc();
                 ++__gc_;
             }
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         }
         catch (...)
         {
@@ -932,7 +932,7 @@ basic_istream<_CharT, _Traits>::getline(char_type* __s, streamsize __n, char_typ
                 throw;
             }
         }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
     }
     if (__n > 0)
         *__s = char_type();
@@ -951,10 +951,10 @@ basic_istream<_CharT, _Traits>::ignore(streamsize __n, int_type __dlm)
     sentry __sen(*this, true);
     if (__sen)
     {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         try
         {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
             if (__n == numeric_limits<streamsize>::max())
             {
                 while (true)
@@ -985,7 +985,7 @@ basic_istream<_CharT, _Traits>::ignore(streamsize __n, int_type __dlm)
                         break;
                 }
             }
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         }
         catch (...)
         {
@@ -996,7 +996,7 @@ basic_istream<_CharT, _Traits>::ignore(streamsize __n, int_type __dlm)
                 throw;
             }
         }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
         this->setstate(__state);
     }
     return *this;
@@ -1012,14 +1012,14 @@ basic_istream<_CharT, _Traits>::peek()
     sentry __sen(*this, true);
     if (__sen)
     {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         try
         {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
             __r = this->rdbuf()->sgetc();
             if (traits_type::eq_int_type(__r, traits_type::eof()))
                 __state |= ios_base::eofbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         }
         catch (...)
         {
@@ -1030,7 +1030,7 @@ basic_istream<_CharT, _Traits>::peek()
                 throw;
             }
         }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
         this->setstate(__state);
     }
     return __r;
@@ -1045,14 +1045,14 @@ basic_istream<_CharT, _Traits>::read(char_type* __s, streamsize __n)
     sentry __sen(*this, true);
     if (__sen)
     {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         try
         {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
             __gc_ = this->rdbuf()->sgetn(__s, __n);
             if (__gc_ != __n)
                 __state |= ios_base::failbit | ios_base::eofbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         }
         catch (...)
         {
@@ -1063,7 +1063,7 @@ basic_istream<_CharT, _Traits>::read(char_type* __s, streamsize __n)
                 throw;
             }
         }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
     }
     else
     {
@@ -1082,10 +1082,10 @@ basic_istream<_CharT, _Traits>::readsome(char_type* __s, streamsize __n)
     sentry __sen(*this, true);
     if (__sen)
     {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         try
         {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
             streamsize __c = this->rdbuf()->in_avail();
             switch (__c)
             {
@@ -1095,13 +1095,13 @@ basic_istream<_CharT, _Traits>::readsome(char_type* __s, streamsize __n)
             case 0:
                 break;
             default:
-                __n = _VSTD::min(__c, __n);
+                __n = _CUDA_VSTD::min(__c, __n);
                 __gc_ = this->rdbuf()->sgetn(__s, __n);
                 if (__gc_ != __n)
                     __state |= ios_base::failbit | ios_base::eofbit;
                 break;
             }
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         }
         catch (...)
         {
@@ -1112,7 +1112,7 @@ basic_istream<_CharT, _Traits>::readsome(char_type* __s, streamsize __n)
                 throw;
             }
         }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
     }
     else
     {
@@ -1132,13 +1132,13 @@ basic_istream<_CharT, _Traits>::putback(char_type __c)
     sentry __sen(*this, true);
     if (__sen)
     {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         try
         {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
             if (this->rdbuf() == nullptr || this->rdbuf()->sputbackc(__c) == traits_type::eof())
                 __state |= ios_base::badbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         }
         catch (...)
         {
@@ -1149,7 +1149,7 @@ basic_istream<_CharT, _Traits>::putback(char_type __c)
                 throw;
             }
         }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
     }
     else
     {
@@ -1169,13 +1169,13 @@ basic_istream<_CharT, _Traits>::unget()
     sentry __sen(*this, true);
     if (__sen)
     {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         try
         {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
             if (this->rdbuf() == nullptr || this->rdbuf()->sungetc() == traits_type::eof())
                 __state |= ios_base::badbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         }
         catch (...)
         {
@@ -1186,7 +1186,7 @@ basic_istream<_CharT, _Traits>::unget()
                 throw;
             }
         }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
     }
     else
     {
@@ -1205,10 +1205,10 @@ basic_istream<_CharT, _Traits>::sync()
     sentry __sen(*this, true);
     if (__sen)
     {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         try
         {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
             if (this->rdbuf() == nullptr)
                 return -1;
             if (this->rdbuf()->pubsync() == -1)
@@ -1216,7 +1216,7 @@ basic_istream<_CharT, _Traits>::sync()
                 __state |= ios_base::badbit;
                 return -1;
             }
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         }
         catch (...)
         {
@@ -1227,7 +1227,7 @@ basic_istream<_CharT, _Traits>::sync()
                 throw;
             }
         }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
         this->setstate(__state);
     }
     return __r;
@@ -1242,12 +1242,12 @@ basic_istream<_CharT, _Traits>::tellg()
     sentry __sen(*this, true);
     if (__sen)
     {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         try
         {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
         __r = this->rdbuf()->pubseekoff(0, ios_base::cur, ios_base::in);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         }
         catch (...)
         {
@@ -1258,7 +1258,7 @@ basic_istream<_CharT, _Traits>::tellg()
                 throw;
             }
         }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
         this->setstate(__state);
     }
     return __r;
@@ -1273,13 +1273,13 @@ basic_istream<_CharT, _Traits>::seekg(pos_type __pos)
     sentry __sen(*this, true);
     if (__sen)
     {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         try
         {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
             if (this->rdbuf()->pubseekpos(__pos, ios_base::in) == pos_type(-1))
                 __state |= ios_base::failbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         }
         catch (...)
         {
@@ -1290,7 +1290,7 @@ basic_istream<_CharT, _Traits>::seekg(pos_type __pos)
                 throw;
             }
         }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
         this->setstate(__state);
     }
     return *this;
@@ -1305,13 +1305,13 @@ basic_istream<_CharT, _Traits>::seekg(off_type __off, ios_base::seekdir __dir)
     sentry __sen(*this, true);
     if (__sen)
     {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         try
         {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
             if (this->rdbuf()->pubseekoff(__off, __dir, ios_base::in) == pos_type(-1))
                 __state |= ios_base::failbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         }
         catch (...)
         {
@@ -1322,7 +1322,7 @@ basic_istream<_CharT, _Traits>::seekg(off_type __off, ios_base::seekdir __dir)
                 throw;
             }
         }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
         this->setstate(__state);
     }
     return *this;
@@ -1336,10 +1336,10 @@ ws(basic_istream<_CharT, _Traits>& __is)
     typename basic_istream<_CharT, _Traits>::sentry __sen(__is, true);
     if (__sen)
     {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         try
         {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
             const ctype<_CharT>& __ct = use_facet<ctype<_CharT> >(__is.getloc());
             while (true)
             {
@@ -1353,7 +1353,7 @@ ws(basic_istream<_CharT, _Traits>& __is)
                     break;
                 __is.rdbuf()->sbumpc();
             }
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         }
         catch (...)
         {
@@ -1364,7 +1364,7 @@ ws(basic_istream<_CharT, _Traits>& __is)
                 throw;
             }
         }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
         __is.setstate(__state);
     }
     return __is;
@@ -1382,15 +1382,15 @@ template <class _Stream, class _Tp, class = typename enable_if<
     _And<is_base_of<ios_base, _Stream>,
          __is_istreamable<_Stream&, _Tp&&> >::value
 >::type>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Stream&& operator>>(_Stream&& __is, _Tp&& __x)
 {
-    __is >> _VSTD::forward<_Tp>(__x);
-    return _VSTD::move(__is);
+    __is >> _CUDA_VSTD::forward<_Tp>(__x);
+    return _CUDA_VSTD::move(__is);
 }
 
 template <class _CharT, class _Traits>
-class _LIBCPP_TEMPLATE_VIS basic_iostream
+class _LIBCUDACXX_TEMPLATE_VIS basic_iostream
     : public basic_istream<_CharT, _Traits>,
       public basic_ostream<_CharT, _Traits>
 {
@@ -1403,28 +1403,28 @@ public:
     typedef typename traits_type::off_type off_type;
 
     // constructor/destructor
-    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
+    inline _LIBCUDACXX_HIDE_FROM_ABI_AFTER_V1
     explicit basic_iostream(basic_streambuf<char_type, traits_type>* __sb)
       : basic_istream<_CharT, _Traits>(__sb)
     {}
 
     virtual ~basic_iostream();
 protected:
-    inline _LIBCPP_INLINE_VISIBILITY
+    inline _LIBCUDACXX_INLINE_VISIBILITY
     basic_iostream(basic_iostream&& __rhs);
 
     // assign/swap
-    inline _LIBCPP_INLINE_VISIBILITY
+    inline _LIBCUDACXX_INLINE_VISIBILITY
     basic_iostream& operator=(basic_iostream&& __rhs);
 
-    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
+    inline _LIBCUDACXX_HIDE_FROM_ABI_AFTER_V1
     void swap(basic_iostream& __rhs)
     { basic_istream<char_type, traits_type>::swap(__rhs); }
 };
 
 template <class _CharT, class _Traits>
 basic_iostream<_CharT, _Traits>::basic_iostream(basic_iostream&& __rhs)
-    : basic_istream<_CharT, _Traits>(_VSTD::move(__rhs))
+    : basic_istream<_CharT, _Traits>(_CUDA_VSTD::move(__rhs))
 {
 }
 
@@ -1450,7 +1450,7 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
     typename basic_istream<_CharT, _Traits>::sentry __sen(__is);
     if (__sen)
     {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         try
         {
 #endif
@@ -1480,7 +1480,7 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
             __is.width(0);
             if (__c == 0)
                __state |= ios_base::failbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         }
         catch (...)
         {
@@ -1506,7 +1506,7 @@ getline(basic_istream<_CharT, _Traits>& __is,
     typename basic_istream<_CharT, _Traits>::sentry __sen(__is, true);
     if (__sen)
     {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         try
         {
 #endif
@@ -1533,7 +1533,7 @@ getline(basic_istream<_CharT, _Traits>& __is,
             }
             if (__extr == 0)
                __state |= ios_base::failbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         }
         catch (...)
         {
@@ -1551,7 +1551,7 @@ getline(basic_istream<_CharT, _Traits>& __is,
 }
 
 template<class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 basic_istream<_CharT, _Traits>&
 getline(basic_istream<_CharT, _Traits>& __is,
         basic_string<_CharT, _Traits, _Allocator>& __str)
@@ -1560,7 +1560,7 @@ getline(basic_istream<_CharT, _Traits>& __is,
 }
 
 template<class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 basic_istream<_CharT, _Traits>&
 getline(basic_istream<_CharT, _Traits>&& __is,
         basic_string<_CharT, _Traits, _Allocator>& __str, _CharT __dlm)
@@ -1569,7 +1569,7 @@ getline(basic_istream<_CharT, _Traits>&& __is,
 }
 
 template<class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 basic_istream<_CharT, _Traits>&
 getline(basic_istream<_CharT, _Traits>&& __is,
         basic_string<_CharT, _Traits, _Allocator>& __str)
@@ -1585,7 +1585,7 @@ operator>>(basic_istream<_CharT, _Traits>& __is, bitset<_Size>& __x)
     typename basic_istream<_CharT, _Traits>::sentry __sen(__is);
     if (__sen)
     {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         try
         {
 #endif
@@ -1612,7 +1612,7 @@ operator>>(basic_istream<_CharT, _Traits>& __is, bitset<_Size>& __x)
             __x = bitset<_Size>(__str);
             if (_Size > 0 && __c == 0)
                __state |= ios_base::failbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         }
         catch (...)
         {
@@ -1629,14 +1629,14 @@ operator>>(basic_istream<_CharT, _Traits>& __is, bitset<_Size>& __x)
     return __is;
 }
 
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_istream<char>;
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_istream<wchar_t>;
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS basic_istream<char>;
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS basic_istream<wchar_t>;
 #endif
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_iostream<char>;
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS basic_iostream<char>;
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP_ISTREAM
+#endif // _LIBCUDACXX_ISTREAM

diff  --git a/libcxx/include/iterator b/libcxx/include/iterator
index 225ae815363c..9c3ee2b87294 100644
--- a/libcxx/include/iterator
+++ b/libcxx/include/iterator
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_ITERATOR
-#define _LIBCPP_ITERATOR
+#ifndef _LIBCUDACXX_ITERATOR
+#define _LIBCUDACXX_ITERATOR
 
 /*
     iterator synopsis
@@ -724,15 +724,15 @@ template <class E> constexpr const E* data(initializer_list<E> il) noexcept;
 #include <type_traits>
 #include <version>
 
-#ifndef _LIBCPP_REMOVE_TRANSITIVE_INCLUDES
+#ifndef _LIBCUDACXX_REMOVE_TRANSITIVE_INCLUDES
 #  include <exception>
 #  include <new>
 #  include <typeinfo>
 #  include <utility>
 #endif
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#endif // _LIBCPP_ITERATOR
+#endif // _LIBCUDACXX_ITERATOR

diff  --git a/libcxx/include/latch b/libcxx/include/latch
index 85936750b4c1..6c40ba349526 100644
--- a/libcxx/include/latch
+++ b/libcxx/include/latch
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_LATCH
-#define _LIBCPP_LATCH
+#ifndef _LIBCUDACXX_LATCH
+#define _LIBCUDACXX_LATCH
 
 /*
     latch synopsis
@@ -47,20 +47,20 @@ namespace std
 #include <limits>
 #include <version>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#ifdef _LIBCPP_HAS_NO_THREADS
+#ifdef _LIBCUDACXX_HAS_NO_THREADS
 # error "<latch> is not supported since libc++ has been configured without support for threads."
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-#if _LIBCPP_STD_VER >= 14
+#if _LIBCUDACXX_STD_VER >= 14
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 class latch
 {
@@ -71,33 +71,33 @@ public:
         return numeric_limits<ptr
diff _t>::max();
     }
 
-    inline _LIBCPP_INLINE_VISIBILITY
+    inline _LIBCUDACXX_INLINE_VISIBILITY
     constexpr explicit latch(ptr
diff _t __expected) : __a(__expected) { }
 
     ~latch() = default;
     latch(const latch&) = delete;
     latch& operator=(const latch&) = delete;
 
-    inline _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
+    inline _LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_INLINE_VISIBILITY
     void count_down(ptr
diff _t __update = 1)
     {
         auto const __old = __a.fetch_sub(__update, memory_order_release);
         if(__old == __update)
             __a.notify_all();
     }
-    inline _LIBCPP_INLINE_VISIBILITY
+    inline _LIBCUDACXX_INLINE_VISIBILITY
     bool try_wait() const noexcept
     {
         return 0 == __a.load(memory_order_acquire);
     }
-    inline _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
+    inline _LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_INLINE_VISIBILITY
     void wait() const
     {
         __cxx_atomic_wait(&__a.__a_, [&]() -> bool {
             return try_wait();
         });
     }
-    inline _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
+    inline _LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_INLINE_VISIBILITY
     void arrive_and_wait(ptr
diff _t __update = 1)
     {
         count_down(__update);
@@ -105,10 +105,10 @@ public:
     }
 };
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER >= 14
+#endif // _LIBCUDACXX_STD_VER >= 14
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif //_LIBCPP_LATCH
+#endif //_LIBCUDACXX_LATCH

diff  --git a/libcxx/include/limits b/libcxx/include/limits
index 1fa3a8228fd8..03a27aa980fc 100644
--- a/libcxx/include/limits
+++ b/libcxx/include/limits
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_LIMITS
-#define _LIBCPP_LIMITS
+#ifndef _LIBCUDACXX_LIMITS
+#define _LIBCUDACXX_LIMITS
 
 /*
     limits synopsis
@@ -106,20 +106,20 @@ template<> class numeric_limits<cv long double>;
 #include <__config>
 #include <type_traits>
 
-#if defined(_LIBCPP_COMPILER_MSVC)
+#if defined(_LIBCUDACXX_COMPILER_MSVC)
 #include "__support/win32/limits_msvc_win32.h"
-#endif // _LIBCPP_MSVCRT
+#endif // _LIBCUDACXX_MSVCRT
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 #include <version>
 
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 enum float_round_style
 {
@@ -138,691 +138,691 @@ enum float_denorm_style
 };
 
 template <class _Tp, bool = is_arithmetic<_Tp>::value>
-class __libcpp_numeric_limits
+class __LIBCUDACXX_numeric_limits
 {
 protected:
     typedef _Tp type;
 
-    static _LIBCPP_CONSTEXPR const  bool is_specialized = false;
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return type();}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return type();}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT {return type();}
-
-    static _LIBCPP_CONSTEXPR const int  digits = 0;
-    static _LIBCPP_CONSTEXPR const int  digits10 = 0;
-    static _LIBCPP_CONSTEXPR const int  max_digits10 = 0;
-    static _LIBCPP_CONSTEXPR const bool is_signed = false;
-    static _LIBCPP_CONSTEXPR const bool is_integer = false;
-    static _LIBCPP_CONSTEXPR const bool is_exact = false;
-    static _LIBCPP_CONSTEXPR const int  radix = 0;
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT {return type();}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT {return type();}
-
-    static _LIBCPP_CONSTEXPR const int  min_exponent = 0;
-    static _LIBCPP_CONSTEXPR const int  min_exponent10 = 0;
-    static _LIBCPP_CONSTEXPR const int  max_exponent = 0;
-    static _LIBCPP_CONSTEXPR const int  max_exponent10 = 0;
-
-    static _LIBCPP_CONSTEXPR const bool has_infinity = false;
-    static _LIBCPP_CONSTEXPR const bool has_quiet_NaN = false;
-    static _LIBCPP_CONSTEXPR const bool has_signaling_NaN = false;
-    static _LIBCPP_CONSTEXPR const float_denorm_style has_denorm = denorm_absent;
-    static _LIBCPP_CONSTEXPR const bool has_denorm_loss = false;
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT {return type();}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT {return type();}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return type();}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return type();}
-
-    static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
-    static _LIBCPP_CONSTEXPR const bool is_bounded = false;
-    static _LIBCPP_CONSTEXPR const bool is_modulo = false;
-
-    static _LIBCPP_CONSTEXPR const bool traps = false;
-    static _LIBCPP_CONSTEXPR const bool tinyness_before = false;
-    static _LIBCPP_CONSTEXPR const float_round_style round_style = round_toward_zero;
+    static _LIBCUDACXX_CONSTEXPR const  bool is_specialized = false;
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type min() _NOEXCEPT {return type();}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type max() _NOEXCEPT {return type();}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type lowest() _NOEXCEPT {return type();}
+
+    static _LIBCUDACXX_CONSTEXPR const int  digits = 0;
+    static _LIBCUDACXX_CONSTEXPR const int  digits10 = 0;
+    static _LIBCUDACXX_CONSTEXPR const int  max_digits10 = 0;
+    static _LIBCUDACXX_CONSTEXPR const bool is_signed = false;
+    static _LIBCUDACXX_CONSTEXPR const bool is_integer = false;
+    static _LIBCUDACXX_CONSTEXPR const bool is_exact = false;
+    static _LIBCUDACXX_CONSTEXPR const int  radix = 0;
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type epsilon() _NOEXCEPT {return type();}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type round_error() _NOEXCEPT {return type();}
+
+    static _LIBCUDACXX_CONSTEXPR const int  min_exponent = 0;
+    static _LIBCUDACXX_CONSTEXPR const int  min_exponent10 = 0;
+    static _LIBCUDACXX_CONSTEXPR const int  max_exponent = 0;
+    static _LIBCUDACXX_CONSTEXPR const int  max_exponent10 = 0;
+
+    static _LIBCUDACXX_CONSTEXPR const bool has_infinity = false;
+    static _LIBCUDACXX_CONSTEXPR const bool has_quiet_NaN = false;
+    static _LIBCUDACXX_CONSTEXPR const bool has_signaling_NaN = false;
+    static _LIBCUDACXX_CONSTEXPR const float_denorm_style has_denorm = denorm_absent;
+    static _LIBCUDACXX_CONSTEXPR const bool has_denorm_loss = false;
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type infinity() _NOEXCEPT {return type();}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type quiet_NaN() _NOEXCEPT {return type();}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type signaling_NaN() _NOEXCEPT {return type();}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type denorm_min() _NOEXCEPT {return type();}
+
+    static _LIBCUDACXX_CONSTEXPR const bool is_iec559 = false;
+    static _LIBCUDACXX_CONSTEXPR const bool is_bounded = false;
+    static _LIBCUDACXX_CONSTEXPR const bool is_modulo = false;
+
+    static _LIBCUDACXX_CONSTEXPR const bool traps = false;
+    static _LIBCUDACXX_CONSTEXPR const bool tinyness_before = false;
+    static _LIBCUDACXX_CONSTEXPR const float_round_style round_style = round_toward_zero;
 };
 
 template <class _Tp, int __digits, bool _IsSigned>
-struct __libcpp_compute_min
+struct __LIBCUDACXX_compute_min
 {
-    static _LIBCPP_CONSTEXPR const _Tp value = _Tp(_Tp(1) << __digits);
+    static _LIBCUDACXX_CONSTEXPR const _Tp value = _Tp(_Tp(1) << __digits);
 };
 
 template <class _Tp, int __digits>
-struct __libcpp_compute_min<_Tp, __digits, false>
+struct __LIBCUDACXX_compute_min<_Tp, __digits, false>
 {
-    static _LIBCPP_CONSTEXPR const _Tp value = _Tp(0);
+    static _LIBCUDACXX_CONSTEXPR const _Tp value = _Tp(0);
 };
 
 template <class _Tp>
-class __libcpp_numeric_limits<_Tp, true>
+class __LIBCUDACXX_numeric_limits<_Tp, true>
 {
 protected:
     typedef _Tp type;
 
-    static _LIBCPP_CONSTEXPR const bool is_specialized = true;
-
-    static _LIBCPP_CONSTEXPR const bool is_signed = type(-1) < type(0);
-    static _LIBCPP_CONSTEXPR const int  digits = static_cast<int>(sizeof(type) * __CHAR_BIT__ - is_signed);
-    static _LIBCPP_CONSTEXPR const int  digits10 = digits * 3 / 10;
-    static _LIBCPP_CONSTEXPR const int  max_digits10 = 0;
-    static _LIBCPP_CONSTEXPR const type __min = __libcpp_compute_min<type, digits, is_signed>::value;
-    static _LIBCPP_CONSTEXPR const type __max = is_signed ? type(type(~0) ^ __min) : type(~0);
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return __min;}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __max;}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT {return min();}
-
-    static _LIBCPP_CONSTEXPR const bool is_integer = true;
-    static _LIBCPP_CONSTEXPR const bool is_exact = true;
-    static _LIBCPP_CONSTEXPR const int  radix = 2;
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT {return type(0);}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT {return type(0);}
-
-    static _LIBCPP_CONSTEXPR const int  min_exponent = 0;
-    static _LIBCPP_CONSTEXPR const int  min_exponent10 = 0;
-    static _LIBCPP_CONSTEXPR const int  max_exponent = 0;
-    static _LIBCPP_CONSTEXPR const int  max_exponent10 = 0;
-
-    static _LIBCPP_CONSTEXPR const bool has_infinity = false;
-    static _LIBCPP_CONSTEXPR const bool has_quiet_NaN = false;
-    static _LIBCPP_CONSTEXPR const bool has_signaling_NaN = false;
-    static _LIBCPP_CONSTEXPR const float_denorm_style has_denorm = denorm_absent;
-    static _LIBCPP_CONSTEXPR const bool has_denorm_loss = false;
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT {return type(0);}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT {return type(0);}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return type(0);}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return type(0);}
-
-    static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
-    static _LIBCPP_CONSTEXPR const bool is_bounded = true;
-    static _LIBCPP_CONSTEXPR const bool is_modulo = !_VSTD::is_signed<_Tp>::value;
+    static _LIBCUDACXX_CONSTEXPR const bool is_specialized = true;
+
+    static _LIBCUDACXX_CONSTEXPR const bool is_signed = type(-1) < type(0);
+    static _LIBCUDACXX_CONSTEXPR const int  digits = static_cast<int>(sizeof(type) * __CHAR_BIT__ - is_signed);
+    static _LIBCUDACXX_CONSTEXPR const int  digits10 = digits * 3 / 10;
+    static _LIBCUDACXX_CONSTEXPR const int  max_digits10 = 0;
+    static _LIBCUDACXX_CONSTEXPR const type __min = __LIBCUDACXX_compute_min<type, digits, is_signed>::value;
+    static _LIBCUDACXX_CONSTEXPR const type __max = is_signed ? type(type(~0) ^ __min) : type(~0);
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type min() _NOEXCEPT {return __min;}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type max() _NOEXCEPT {return __max;}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type lowest() _NOEXCEPT {return min();}
+
+    static _LIBCUDACXX_CONSTEXPR const bool is_integer = true;
+    static _LIBCUDACXX_CONSTEXPR const bool is_exact = true;
+    static _LIBCUDACXX_CONSTEXPR const int  radix = 2;
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type epsilon() _NOEXCEPT {return type(0);}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type round_error() _NOEXCEPT {return type(0);}
+
+    static _LIBCUDACXX_CONSTEXPR const int  min_exponent = 0;
+    static _LIBCUDACXX_CONSTEXPR const int  min_exponent10 = 0;
+    static _LIBCUDACXX_CONSTEXPR const int  max_exponent = 0;
+    static _LIBCUDACXX_CONSTEXPR const int  max_exponent10 = 0;
+
+    static _LIBCUDACXX_CONSTEXPR const bool has_infinity = false;
+    static _LIBCUDACXX_CONSTEXPR const bool has_quiet_NaN = false;
+    static _LIBCUDACXX_CONSTEXPR const bool has_signaling_NaN = false;
+    static _LIBCUDACXX_CONSTEXPR const float_denorm_style has_denorm = denorm_absent;
+    static _LIBCUDACXX_CONSTEXPR const bool has_denorm_loss = false;
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type infinity() _NOEXCEPT {return type(0);}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type quiet_NaN() _NOEXCEPT {return type(0);}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type signaling_NaN() _NOEXCEPT {return type(0);}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type denorm_min() _NOEXCEPT {return type(0);}
+
+    static _LIBCUDACXX_CONSTEXPR const bool is_iec559 = false;
+    static _LIBCUDACXX_CONSTEXPR const bool is_bounded = true;
+    static _LIBCUDACXX_CONSTEXPR const bool is_modulo = !_CUDA_VSTD::is_signed<_Tp>::value;
 
 #if defined(__i386__) || defined(__x86_64__) || defined(__pnacl__) || \
     defined(__wasm__)
-    static _LIBCPP_CONSTEXPR const bool traps = true;
+    static _LIBCUDACXX_CONSTEXPR const bool traps = true;
 #else
-    static _LIBCPP_CONSTEXPR const bool traps = false;
+    static _LIBCUDACXX_CONSTEXPR const bool traps = false;
 #endif
-    static _LIBCPP_CONSTEXPR const bool tinyness_before = false;
-    static _LIBCPP_CONSTEXPR const float_round_style round_style = round_toward_zero;
+    static _LIBCUDACXX_CONSTEXPR const bool tinyness_before = false;
+    static _LIBCUDACXX_CONSTEXPR const float_round_style round_style = round_toward_zero;
 };
 
 template <>
-class __libcpp_numeric_limits<bool, true>
+class __LIBCUDACXX_numeric_limits<bool, true>
 {
 protected:
     typedef bool type;
 
-    static _LIBCPP_CONSTEXPR const bool is_specialized = true;
-
-    static _LIBCPP_CONSTEXPR const bool is_signed = false;
-    static _LIBCPP_CONSTEXPR const int  digits = 1;
-    static _LIBCPP_CONSTEXPR const int  digits10 = 0;
-    static _LIBCPP_CONSTEXPR const int  max_digits10 = 0;
-    static _LIBCPP_CONSTEXPR const type __min = false;
-    static _LIBCPP_CONSTEXPR const type __max = true;
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return __min;}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __max;}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT {return min();}
-
-    static _LIBCPP_CONSTEXPR const bool is_integer = true;
-    static _LIBCPP_CONSTEXPR const bool is_exact = true;
-    static _LIBCPP_CONSTEXPR const int  radix = 2;
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT {return type(0);}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT {return type(0);}
-
-    static _LIBCPP_CONSTEXPR const int  min_exponent = 0;
-    static _LIBCPP_CONSTEXPR const int  min_exponent10 = 0;
-    static _LIBCPP_CONSTEXPR const int  max_exponent = 0;
-    static _LIBCPP_CONSTEXPR const int  max_exponent10 = 0;
-
-    static _LIBCPP_CONSTEXPR const bool has_infinity = false;
-    static _LIBCPP_CONSTEXPR const bool has_quiet_NaN = false;
-    static _LIBCPP_CONSTEXPR const bool has_signaling_NaN = false;
-    static _LIBCPP_CONSTEXPR const float_denorm_style has_denorm = denorm_absent;
-    static _LIBCPP_CONSTEXPR const bool has_denorm_loss = false;
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT {return type(0);}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT {return type(0);}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return type(0);}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return type(0);}
-
-    static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
-    static _LIBCPP_CONSTEXPR const bool is_bounded = true;
-    static _LIBCPP_CONSTEXPR const bool is_modulo = false;
-
-    static _LIBCPP_CONSTEXPR const bool traps = false;
-    static _LIBCPP_CONSTEXPR const bool tinyness_before = false;
-    static _LIBCPP_CONSTEXPR const float_round_style round_style = round_toward_zero;
+    static _LIBCUDACXX_CONSTEXPR const bool is_specialized = true;
+
+    static _LIBCUDACXX_CONSTEXPR const bool is_signed = false;
+    static _LIBCUDACXX_CONSTEXPR const int  digits = 1;
+    static _LIBCUDACXX_CONSTEXPR const int  digits10 = 0;
+    static _LIBCUDACXX_CONSTEXPR const int  max_digits10 = 0;
+    static _LIBCUDACXX_CONSTEXPR const type __min = false;
+    static _LIBCUDACXX_CONSTEXPR const type __max = true;
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type min() _NOEXCEPT {return __min;}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type max() _NOEXCEPT {return __max;}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type lowest() _NOEXCEPT {return min();}
+
+    static _LIBCUDACXX_CONSTEXPR const bool is_integer = true;
+    static _LIBCUDACXX_CONSTEXPR const bool is_exact = true;
+    static _LIBCUDACXX_CONSTEXPR const int  radix = 2;
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type epsilon() _NOEXCEPT {return type(0);}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type round_error() _NOEXCEPT {return type(0);}
+
+    static _LIBCUDACXX_CONSTEXPR const int  min_exponent = 0;
+    static _LIBCUDACXX_CONSTEXPR const int  min_exponent10 = 0;
+    static _LIBCUDACXX_CONSTEXPR const int  max_exponent = 0;
+    static _LIBCUDACXX_CONSTEXPR const int  max_exponent10 = 0;
+
+    static _LIBCUDACXX_CONSTEXPR const bool has_infinity = false;
+    static _LIBCUDACXX_CONSTEXPR const bool has_quiet_NaN = false;
+    static _LIBCUDACXX_CONSTEXPR const bool has_signaling_NaN = false;
+    static _LIBCUDACXX_CONSTEXPR const float_denorm_style has_denorm = denorm_absent;
+    static _LIBCUDACXX_CONSTEXPR const bool has_denorm_loss = false;
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type infinity() _NOEXCEPT {return type(0);}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type quiet_NaN() _NOEXCEPT {return type(0);}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type signaling_NaN() _NOEXCEPT {return type(0);}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type denorm_min() _NOEXCEPT {return type(0);}
+
+    static _LIBCUDACXX_CONSTEXPR const bool is_iec559 = false;
+    static _LIBCUDACXX_CONSTEXPR const bool is_bounded = true;
+    static _LIBCUDACXX_CONSTEXPR const bool is_modulo = false;
+
+    static _LIBCUDACXX_CONSTEXPR const bool traps = false;
+    static _LIBCUDACXX_CONSTEXPR const bool tinyness_before = false;
+    static _LIBCUDACXX_CONSTEXPR const float_round_style round_style = round_toward_zero;
 };
 
 template <>
-class __libcpp_numeric_limits<float, true>
+class __LIBCUDACXX_numeric_limits<float, true>
 {
 protected:
     typedef float type;
 
-    static _LIBCPP_CONSTEXPR const bool is_specialized = true;
-
-    static _LIBCPP_CONSTEXPR const bool is_signed = true;
-    static _LIBCPP_CONSTEXPR const int  digits = __FLT_MANT_DIG__;
-    static _LIBCPP_CONSTEXPR const int  digits10 = __FLT_DIG__;
-    static _LIBCPP_CONSTEXPR const int  max_digits10 = 2+(digits * 30103l)/100000l;
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return __FLT_MIN__;}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __FLT_MAX__;}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT {return -max();}
-
-    static _LIBCPP_CONSTEXPR const bool is_integer = false;
-    static _LIBCPP_CONSTEXPR const bool is_exact = false;
-    static _LIBCPP_CONSTEXPR const int  radix = __FLT_RADIX__;
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT {return __FLT_EPSILON__;}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT {return 0.5F;}
-
-    static _LIBCPP_CONSTEXPR const int  min_exponent = __FLT_MIN_EXP__;
-    static _LIBCPP_CONSTEXPR const int  min_exponent10 = __FLT_MIN_10_EXP__;
-    static _LIBCPP_CONSTEXPR const int  max_exponent = __FLT_MAX_EXP__;
-    static _LIBCPP_CONSTEXPR const int  max_exponent10 = __FLT_MAX_10_EXP__;
-
-    static _LIBCPP_CONSTEXPR const bool has_infinity = true;
-    static _LIBCPP_CONSTEXPR const bool has_quiet_NaN = true;
-    static _LIBCPP_CONSTEXPR const bool has_signaling_NaN = true;
-    static _LIBCPP_CONSTEXPR const float_denorm_style has_denorm = denorm_present;
-    static _LIBCPP_CONSTEXPR const bool has_denorm_loss = false;
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT {return __builtin_huge_valf();}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT {return __builtin_nanf("");}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansf("");}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __FLT_DENORM_MIN__;}
-
-    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
-    static _LIBCPP_CONSTEXPR const bool is_bounded = true;
-    static _LIBCPP_CONSTEXPR const bool is_modulo = false;
-
-    static _LIBCPP_CONSTEXPR const bool traps = false;
+    static _LIBCUDACXX_CONSTEXPR const bool is_specialized = true;
+
+    static _LIBCUDACXX_CONSTEXPR const bool is_signed = true;
+    static _LIBCUDACXX_CONSTEXPR const int  digits = __FLT_MANT_DIG__;
+    static _LIBCUDACXX_CONSTEXPR const int  digits10 = __FLT_DIG__;
+    static _LIBCUDACXX_CONSTEXPR const int  max_digits10 = 2+(digits * 30103l)/100000l;
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type min() _NOEXCEPT {return __FLT_MIN__;}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type max() _NOEXCEPT {return __FLT_MAX__;}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type lowest() _NOEXCEPT {return -max();}
+
+    static _LIBCUDACXX_CONSTEXPR const bool is_integer = false;
+    static _LIBCUDACXX_CONSTEXPR const bool is_exact = false;
+    static _LIBCUDACXX_CONSTEXPR const int  radix = __FLT_RADIX__;
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type epsilon() _NOEXCEPT {return __FLT_EPSILON__;}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type round_error() _NOEXCEPT {return 0.5F;}
+
+    static _LIBCUDACXX_CONSTEXPR const int  min_exponent = __FLT_MIN_EXP__;
+    static _LIBCUDACXX_CONSTEXPR const int  min_exponent10 = __FLT_MIN_10_EXP__;
+    static _LIBCUDACXX_CONSTEXPR const int  max_exponent = __FLT_MAX_EXP__;
+    static _LIBCUDACXX_CONSTEXPR const int  max_exponent10 = __FLT_MAX_10_EXP__;
+
+    static _LIBCUDACXX_CONSTEXPR const bool has_infinity = true;
+    static _LIBCUDACXX_CONSTEXPR const bool has_quiet_NaN = true;
+    static _LIBCUDACXX_CONSTEXPR const bool has_signaling_NaN = true;
+    static _LIBCUDACXX_CONSTEXPR const float_denorm_style has_denorm = denorm_present;
+    static _LIBCUDACXX_CONSTEXPR const bool has_denorm_loss = false;
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type infinity() _NOEXCEPT {return __builtin_huge_valf();}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type quiet_NaN() _NOEXCEPT {return __builtin_nanf("");}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansf("");}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type denorm_min() _NOEXCEPT {return __FLT_DENORM_MIN__;}
+
+    static _LIBCUDACXX_CONSTEXPR const bool is_iec559 = true;
+    static _LIBCUDACXX_CONSTEXPR const bool is_bounded = true;
+    static _LIBCUDACXX_CONSTEXPR const bool is_modulo = false;
+
+    static _LIBCUDACXX_CONSTEXPR const bool traps = false;
 #if (defined(__arm__) || defined(__aarch64__))
-    static _LIBCPP_CONSTEXPR const bool tinyness_before = true;
+    static _LIBCUDACXX_CONSTEXPR const bool tinyness_before = true;
 #else
-    static _LIBCPP_CONSTEXPR const bool tinyness_before = false;
+    static _LIBCUDACXX_CONSTEXPR const bool tinyness_before = false;
 #endif
-    static _LIBCPP_CONSTEXPR const float_round_style round_style = round_to_nearest;
+    static _LIBCUDACXX_CONSTEXPR const float_round_style round_style = round_to_nearest;
 };
 
 template <>
-class __libcpp_numeric_limits<double, true>
+class __LIBCUDACXX_numeric_limits<double, true>
 {
 protected:
     typedef double type;
 
-    static _LIBCPP_CONSTEXPR const bool is_specialized = true;
-
-    static _LIBCPP_CONSTEXPR const bool is_signed = true;
-    static _LIBCPP_CONSTEXPR const int  digits = __DBL_MANT_DIG__;
-    static _LIBCPP_CONSTEXPR const int  digits10 = __DBL_DIG__;
-    static _LIBCPP_CONSTEXPR const int  max_digits10 = 2+(digits * 30103l)/100000l;
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return __DBL_MIN__;}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __DBL_MAX__;}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT {return -max();}
-
-    static _LIBCPP_CONSTEXPR const bool is_integer = false;
-    static _LIBCPP_CONSTEXPR const bool is_exact = false;
-    static _LIBCPP_CONSTEXPR const int  radix = __FLT_RADIX__;
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT {return __DBL_EPSILON__;}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT {return 0.5;}
-
-    static _LIBCPP_CONSTEXPR const int  min_exponent = __DBL_MIN_EXP__;
-    static _LIBCPP_CONSTEXPR const int  min_exponent10 = __DBL_MIN_10_EXP__;
-    static _LIBCPP_CONSTEXPR const int  max_exponent = __DBL_MAX_EXP__;
-    static _LIBCPP_CONSTEXPR const int  max_exponent10 = __DBL_MAX_10_EXP__;
-
-    static _LIBCPP_CONSTEXPR const bool has_infinity = true;
-    static _LIBCPP_CONSTEXPR const bool has_quiet_NaN = true;
-    static _LIBCPP_CONSTEXPR const bool has_signaling_NaN = true;
-    static _LIBCPP_CONSTEXPR const float_denorm_style has_denorm = denorm_present;
-    static _LIBCPP_CONSTEXPR const bool has_denorm_loss = false;
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT {return __builtin_huge_val();}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT {return __builtin_nan("");}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nans("");}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __DBL_DENORM_MIN__;}
-
-    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
-    static _LIBCPP_CONSTEXPR const bool is_bounded = true;
-    static _LIBCPP_CONSTEXPR const bool is_modulo = false;
-
-    static _LIBCPP_CONSTEXPR const bool traps = false;
+    static _LIBCUDACXX_CONSTEXPR const bool is_specialized = true;
+
+    static _LIBCUDACXX_CONSTEXPR const bool is_signed = true;
+    static _LIBCUDACXX_CONSTEXPR const int  digits = __DBL_MANT_DIG__;
+    static _LIBCUDACXX_CONSTEXPR const int  digits10 = __DBL_DIG__;
+    static _LIBCUDACXX_CONSTEXPR const int  max_digits10 = 2+(digits * 30103l)/100000l;
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type min() _NOEXCEPT {return __DBL_MIN__;}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type max() _NOEXCEPT {return __DBL_MAX__;}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type lowest() _NOEXCEPT {return -max();}
+
+    static _LIBCUDACXX_CONSTEXPR const bool is_integer = false;
+    static _LIBCUDACXX_CONSTEXPR const bool is_exact = false;
+    static _LIBCUDACXX_CONSTEXPR const int  radix = __FLT_RADIX__;
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type epsilon() _NOEXCEPT {return __DBL_EPSILON__;}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type round_error() _NOEXCEPT {return 0.5;}
+
+    static _LIBCUDACXX_CONSTEXPR const int  min_exponent = __DBL_MIN_EXP__;
+    static _LIBCUDACXX_CONSTEXPR const int  min_exponent10 = __DBL_MIN_10_EXP__;
+    static _LIBCUDACXX_CONSTEXPR const int  max_exponent = __DBL_MAX_EXP__;
+    static _LIBCUDACXX_CONSTEXPR const int  max_exponent10 = __DBL_MAX_10_EXP__;
+
+    static _LIBCUDACXX_CONSTEXPR const bool has_infinity = true;
+    static _LIBCUDACXX_CONSTEXPR const bool has_quiet_NaN = true;
+    static _LIBCUDACXX_CONSTEXPR const bool has_signaling_NaN = true;
+    static _LIBCUDACXX_CONSTEXPR const float_denorm_style has_denorm = denorm_present;
+    static _LIBCUDACXX_CONSTEXPR const bool has_denorm_loss = false;
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type infinity() _NOEXCEPT {return __builtin_huge_val();}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type quiet_NaN() _NOEXCEPT {return __builtin_nan("");}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nans("");}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type denorm_min() _NOEXCEPT {return __DBL_DENORM_MIN__;}
+
+    static _LIBCUDACXX_CONSTEXPR const bool is_iec559 = true;
+    static _LIBCUDACXX_CONSTEXPR const bool is_bounded = true;
+    static _LIBCUDACXX_CONSTEXPR const bool is_modulo = false;
+
+    static _LIBCUDACXX_CONSTEXPR const bool traps = false;
 #if (defined(__arm__) || defined(__aarch64__))
-    static _LIBCPP_CONSTEXPR const bool tinyness_before = true;
+    static _LIBCUDACXX_CONSTEXPR const bool tinyness_before = true;
 #else
-    static _LIBCPP_CONSTEXPR const bool tinyness_before = false;
+    static _LIBCUDACXX_CONSTEXPR const bool tinyness_before = false;
 #endif
-    static _LIBCPP_CONSTEXPR const float_round_style round_style = round_to_nearest;
+    static _LIBCUDACXX_CONSTEXPR const float_round_style round_style = round_to_nearest;
 };
 
 template <>
-class __libcpp_numeric_limits<long double, true>
+class __LIBCUDACXX_numeric_limits<long double, true>
 {
 protected:
     typedef long double type;
 
-    static _LIBCPP_CONSTEXPR const bool is_specialized = true;
-
-    static _LIBCPP_CONSTEXPR const bool is_signed = true;
-    static _LIBCPP_CONSTEXPR const int  digits = __LDBL_MANT_DIG__;
-    static _LIBCPP_CONSTEXPR const int  digits10 = __LDBL_DIG__;
-    static _LIBCPP_CONSTEXPR const int  max_digits10 = 2+(digits * 30103l)/100000l;
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return __LDBL_MIN__;}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __LDBL_MAX__;}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT {return -max();}
-
-    static _LIBCPP_CONSTEXPR const bool is_integer = false;
-    static _LIBCPP_CONSTEXPR const bool is_exact = false;
-    static _LIBCPP_CONSTEXPR const int  radix = __FLT_RADIX__;
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT {return __LDBL_EPSILON__;}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT {return 0.5L;}
-
-    static _LIBCPP_CONSTEXPR const int  min_exponent = __LDBL_MIN_EXP__;
-    static _LIBCPP_CONSTEXPR const int  min_exponent10 = __LDBL_MIN_10_EXP__;
-    static _LIBCPP_CONSTEXPR const int  max_exponent = __LDBL_MAX_EXP__;
-    static _LIBCPP_CONSTEXPR const int  max_exponent10 = __LDBL_MAX_10_EXP__;
-
-    static _LIBCPP_CONSTEXPR const bool has_infinity = true;
-    static _LIBCPP_CONSTEXPR const bool has_quiet_NaN = true;
-    static _LIBCPP_CONSTEXPR const bool has_signaling_NaN = true;
-    static _LIBCPP_CONSTEXPR const float_denorm_style has_denorm = denorm_present;
-    static _LIBCPP_CONSTEXPR const bool has_denorm_loss = false;
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT {return __builtin_huge_vall();}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT {return __builtin_nanl("");}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
+    static _LIBCUDACXX_CONSTEXPR const bool is_specialized = true;
+
+    static _LIBCUDACXX_CONSTEXPR const bool is_signed = true;
+    static _LIBCUDACXX_CONSTEXPR const int  digits = __LDBL_MANT_DIG__;
+    static _LIBCUDACXX_CONSTEXPR const int  digits10 = __LDBL_DIG__;
+    static _LIBCUDACXX_CONSTEXPR const int  max_digits10 = 2+(digits * 30103l)/100000l;
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type min() _NOEXCEPT {return __LDBL_MIN__;}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type max() _NOEXCEPT {return __LDBL_MAX__;}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type lowest() _NOEXCEPT {return -max();}
+
+    static _LIBCUDACXX_CONSTEXPR const bool is_integer = false;
+    static _LIBCUDACXX_CONSTEXPR const bool is_exact = false;
+    static _LIBCUDACXX_CONSTEXPR const int  radix = __FLT_RADIX__;
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type epsilon() _NOEXCEPT {return __LDBL_EPSILON__;}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type round_error() _NOEXCEPT {return 0.5L;}
+
+    static _LIBCUDACXX_CONSTEXPR const int  min_exponent = __LDBL_MIN_EXP__;
+    static _LIBCUDACXX_CONSTEXPR const int  min_exponent10 = __LDBL_MIN_10_EXP__;
+    static _LIBCUDACXX_CONSTEXPR const int  max_exponent = __LDBL_MAX_EXP__;
+    static _LIBCUDACXX_CONSTEXPR const int  max_exponent10 = __LDBL_MAX_10_EXP__;
+
+    static _LIBCUDACXX_CONSTEXPR const bool has_infinity = true;
+    static _LIBCUDACXX_CONSTEXPR const bool has_quiet_NaN = true;
+    static _LIBCUDACXX_CONSTEXPR const bool has_signaling_NaN = true;
+    static _LIBCUDACXX_CONSTEXPR const float_denorm_style has_denorm = denorm_present;
+    static _LIBCUDACXX_CONSTEXPR const bool has_denorm_loss = false;
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type infinity() _NOEXCEPT {return __builtin_huge_vall();}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type quiet_NaN() _NOEXCEPT {return __builtin_nanl("");}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
 
 #if (defined(__ppc__) || defined(__ppc64__))
-    static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
+    static _LIBCUDACXX_CONSTEXPR const bool is_iec559 = false;
 #else
-    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+    static _LIBCUDACXX_CONSTEXPR const bool is_iec559 = true;
 #endif
-    static _LIBCPP_CONSTEXPR const bool is_bounded = true;
-    static _LIBCPP_CONSTEXPR const bool is_modulo = false;
+    static _LIBCUDACXX_CONSTEXPR const bool is_bounded = true;
+    static _LIBCUDACXX_CONSTEXPR const bool is_modulo = false;
 
-    static _LIBCPP_CONSTEXPR const bool traps = false;
+    static _LIBCUDACXX_CONSTEXPR const bool traps = false;
 #if (defined(__arm__) || defined(__aarch64__))
-    static _LIBCPP_CONSTEXPR const bool tinyness_before = true;
+    static _LIBCUDACXX_CONSTEXPR const bool tinyness_before = true;
 #else
-    static _LIBCPP_CONSTEXPR const bool tinyness_before = false;
+    static _LIBCUDACXX_CONSTEXPR const bool tinyness_before = false;
 #endif
-    static _LIBCPP_CONSTEXPR const float_round_style round_style = round_to_nearest;
+    static _LIBCUDACXX_CONSTEXPR const float_round_style round_style = round_to_nearest;
 };
 
 template <class _Tp>
-class _LIBCPP_TEMPLATE_VIS numeric_limits
-    : private __libcpp_numeric_limits<typename remove_cv<_Tp>::type>
+class _LIBCUDACXX_TEMPLATE_VIS numeric_limits
+    : private __LIBCUDACXX_numeric_limits<typename remove_cv<_Tp>::type>
 {
-    typedef __libcpp_numeric_limits<typename remove_cv<_Tp>::type> __base;
+    typedef __LIBCUDACXX_numeric_limits<typename remove_cv<_Tp>::type> __base;
     typedef typename __base::type type;
 public:
-    static _LIBCPP_CONSTEXPR const bool is_specialized = __base::is_specialized;
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return __base::min();}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __base::max();}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT {return __base::lowest();}
-
-    static _LIBCPP_CONSTEXPR const int  digits = __base::digits;
-    static _LIBCPP_CONSTEXPR const int  digits10 = __base::digits10;
-    static _LIBCPP_CONSTEXPR const int  max_digits10 = __base::max_digits10;
-    static _LIBCPP_CONSTEXPR const bool is_signed = __base::is_signed;
-    static _LIBCPP_CONSTEXPR const bool is_integer = __base::is_integer;
-    static _LIBCPP_CONSTEXPR const bool is_exact = __base::is_exact;
-    static _LIBCPP_CONSTEXPR const int  radix = __base::radix;
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT {return __base::epsilon();}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT {return __base::round_error();}
-
-    static _LIBCPP_CONSTEXPR const int  min_exponent = __base::min_exponent;
-    static _LIBCPP_CONSTEXPR const int  min_exponent10 = __base::min_exponent10;
-    static _LIBCPP_CONSTEXPR const int  max_exponent = __base::max_exponent;
-    static _LIBCPP_CONSTEXPR const int  max_exponent10 = __base::max_exponent10;
-
-    static _LIBCPP_CONSTEXPR const bool has_infinity = __base::has_infinity;
-    static _LIBCPP_CONSTEXPR const bool has_quiet_NaN = __base::has_quiet_NaN;
-    static _LIBCPP_CONSTEXPR const bool has_signaling_NaN = __base::has_signaling_NaN;
-    static _LIBCPP_CONSTEXPR const float_denorm_style has_denorm = __base::has_denorm;
-    static _LIBCPP_CONSTEXPR const bool has_denorm_loss = __base::has_denorm_loss;
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT {return __base::infinity();}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT {return __base::quiet_NaN();}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __base::signaling_NaN();}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __base::denorm_min();}
-
-    static _LIBCPP_CONSTEXPR const bool is_iec559 = __base::is_iec559;
-    static _LIBCPP_CONSTEXPR const bool is_bounded = __base::is_bounded;
-    static _LIBCPP_CONSTEXPR const bool is_modulo = __base::is_modulo;
-
-    static _LIBCPP_CONSTEXPR const bool traps = __base::traps;
-    static _LIBCPP_CONSTEXPR const bool tinyness_before = __base::tinyness_before;
-    static _LIBCPP_CONSTEXPR const float_round_style round_style = __base::round_style;
+    static _LIBCUDACXX_CONSTEXPR const bool is_specialized = __base::is_specialized;
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type min() _NOEXCEPT {return __base::min();}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type max() _NOEXCEPT {return __base::max();}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type lowest() _NOEXCEPT {return __base::lowest();}
+
+    static _LIBCUDACXX_CONSTEXPR const int  digits = __base::digits;
+    static _LIBCUDACXX_CONSTEXPR const int  digits10 = __base::digits10;
+    static _LIBCUDACXX_CONSTEXPR const int  max_digits10 = __base::max_digits10;
+    static _LIBCUDACXX_CONSTEXPR const bool is_signed = __base::is_signed;
+    static _LIBCUDACXX_CONSTEXPR const bool is_integer = __base::is_integer;
+    static _LIBCUDACXX_CONSTEXPR const bool is_exact = __base::is_exact;
+    static _LIBCUDACXX_CONSTEXPR const int  radix = __base::radix;
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type epsilon() _NOEXCEPT {return __base::epsilon();}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type round_error() _NOEXCEPT {return __base::round_error();}
+
+    static _LIBCUDACXX_CONSTEXPR const int  min_exponent = __base::min_exponent;
+    static _LIBCUDACXX_CONSTEXPR const int  min_exponent10 = __base::min_exponent10;
+    static _LIBCUDACXX_CONSTEXPR const int  max_exponent = __base::max_exponent;
+    static _LIBCUDACXX_CONSTEXPR const int  max_exponent10 = __base::max_exponent10;
+
+    static _LIBCUDACXX_CONSTEXPR const bool has_infinity = __base::has_infinity;
+    static _LIBCUDACXX_CONSTEXPR const bool has_quiet_NaN = __base::has_quiet_NaN;
+    static _LIBCUDACXX_CONSTEXPR const bool has_signaling_NaN = __base::has_signaling_NaN;
+    static _LIBCUDACXX_CONSTEXPR const float_denorm_style has_denorm = __base::has_denorm;
+    static _LIBCUDACXX_CONSTEXPR const bool has_denorm_loss = __base::has_denorm_loss;
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type infinity() _NOEXCEPT {return __base::infinity();}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type quiet_NaN() _NOEXCEPT {return __base::quiet_NaN();}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __base::signaling_NaN();}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type denorm_min() _NOEXCEPT {return __base::denorm_min();}
+
+    static _LIBCUDACXX_CONSTEXPR const bool is_iec559 = __base::is_iec559;
+    static _LIBCUDACXX_CONSTEXPR const bool is_bounded = __base::is_bounded;
+    static _LIBCUDACXX_CONSTEXPR const bool is_modulo = __base::is_modulo;
+
+    static _LIBCUDACXX_CONSTEXPR const bool traps = __base::traps;
+    static _LIBCUDACXX_CONSTEXPR const bool tinyness_before = __base::tinyness_before;
+    static _LIBCUDACXX_CONSTEXPR const float_round_style round_style = __base::round_style;
 };
 
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::is_specialized;
+    _LIBCUDACXX_CONSTEXPR const bool numeric_limits<_Tp>::is_specialized;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::digits;
+    _LIBCUDACXX_CONSTEXPR const int numeric_limits<_Tp>::digits;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::digits10;
+    _LIBCUDACXX_CONSTEXPR const int numeric_limits<_Tp>::digits10;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::max_digits10;
+    _LIBCUDACXX_CONSTEXPR const int numeric_limits<_Tp>::max_digits10;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::is_signed;
+    _LIBCUDACXX_CONSTEXPR const bool numeric_limits<_Tp>::is_signed;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::is_integer;
+    _LIBCUDACXX_CONSTEXPR const bool numeric_limits<_Tp>::is_integer;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::is_exact;
+    _LIBCUDACXX_CONSTEXPR const bool numeric_limits<_Tp>::is_exact;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::radix;
+    _LIBCUDACXX_CONSTEXPR const int numeric_limits<_Tp>::radix;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::min_exponent;
+    _LIBCUDACXX_CONSTEXPR const int numeric_limits<_Tp>::min_exponent;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::min_exponent10;
+    _LIBCUDACXX_CONSTEXPR const int numeric_limits<_Tp>::min_exponent10;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::max_exponent;
+    _LIBCUDACXX_CONSTEXPR const int numeric_limits<_Tp>::max_exponent;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::max_exponent10;
+    _LIBCUDACXX_CONSTEXPR const int numeric_limits<_Tp>::max_exponent10;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::has_infinity;
+    _LIBCUDACXX_CONSTEXPR const bool numeric_limits<_Tp>::has_infinity;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::has_quiet_NaN;
+    _LIBCUDACXX_CONSTEXPR const bool numeric_limits<_Tp>::has_quiet_NaN;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::has_signaling_NaN;
+    _LIBCUDACXX_CONSTEXPR const bool numeric_limits<_Tp>::has_signaling_NaN;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const float_denorm_style numeric_limits<_Tp>::has_denorm;
+    _LIBCUDACXX_CONSTEXPR const float_denorm_style numeric_limits<_Tp>::has_denorm;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::has_denorm_loss;
+    _LIBCUDACXX_CONSTEXPR const bool numeric_limits<_Tp>::has_denorm_loss;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::is_iec559;
+    _LIBCUDACXX_CONSTEXPR const bool numeric_limits<_Tp>::is_iec559;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::is_bounded;
+    _LIBCUDACXX_CONSTEXPR const bool numeric_limits<_Tp>::is_bounded;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::is_modulo;
+    _LIBCUDACXX_CONSTEXPR const bool numeric_limits<_Tp>::is_modulo;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::traps;
+    _LIBCUDACXX_CONSTEXPR const bool numeric_limits<_Tp>::traps;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::tinyness_before;
+    _LIBCUDACXX_CONSTEXPR const bool numeric_limits<_Tp>::tinyness_before;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const float_round_style numeric_limits<_Tp>::round_style;
+    _LIBCUDACXX_CONSTEXPR const float_round_style numeric_limits<_Tp>::round_style;
 
 template <class _Tp>
-class _LIBCPP_TEMPLATE_VIS numeric_limits<const _Tp>
+class _LIBCUDACXX_TEMPLATE_VIS numeric_limits<const _Tp>
     : private numeric_limits<_Tp>
 {
     typedef numeric_limits<_Tp> __base;
     typedef _Tp type;
 public:
-    static _LIBCPP_CONSTEXPR const bool is_specialized = __base::is_specialized;
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return __base::min();}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __base::max();}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT {return __base::lowest();}
-
-    static _LIBCPP_CONSTEXPR const int  digits = __base::digits;
-    static _LIBCPP_CONSTEXPR const int  digits10 = __base::digits10;
-    static _LIBCPP_CONSTEXPR const int  max_digits10 = __base::max_digits10;
-    static _LIBCPP_CONSTEXPR const bool is_signed = __base::is_signed;
-    static _LIBCPP_CONSTEXPR const bool is_integer = __base::is_integer;
-    static _LIBCPP_CONSTEXPR const bool is_exact = __base::is_exact;
-    static _LIBCPP_CONSTEXPR const int  radix = __base::radix;
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT {return __base::epsilon();}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT {return __base::round_error();}
-
-    static _LIBCPP_CONSTEXPR const int  min_exponent = __base::min_exponent;
-    static _LIBCPP_CONSTEXPR const int  min_exponent10 = __base::min_exponent10;
-    static _LIBCPP_CONSTEXPR const int  max_exponent = __base::max_exponent;
-    static _LIBCPP_CONSTEXPR const int  max_exponent10 = __base::max_exponent10;
-
-    static _LIBCPP_CONSTEXPR const bool has_infinity = __base::has_infinity;
-    static _LIBCPP_CONSTEXPR const bool has_quiet_NaN = __base::has_quiet_NaN;
-    static _LIBCPP_CONSTEXPR const bool has_signaling_NaN = __base::has_signaling_NaN;
-    static _LIBCPP_CONSTEXPR const float_denorm_style has_denorm = __base::has_denorm;
-    static _LIBCPP_CONSTEXPR const bool has_denorm_loss = __base::has_denorm_loss;
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT {return __base::infinity();}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT {return __base::quiet_NaN();}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __base::signaling_NaN();}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __base::denorm_min();}
-
-    static _LIBCPP_CONSTEXPR const bool is_iec559 = __base::is_iec559;
-    static _LIBCPP_CONSTEXPR const bool is_bounded = __base::is_bounded;
-    static _LIBCPP_CONSTEXPR const bool is_modulo = __base::is_modulo;
-
-    static _LIBCPP_CONSTEXPR const bool traps = __base::traps;
-    static _LIBCPP_CONSTEXPR const bool tinyness_before = __base::tinyness_before;
-    static _LIBCPP_CONSTEXPR const float_round_style round_style = __base::round_style;
+    static _LIBCUDACXX_CONSTEXPR const bool is_specialized = __base::is_specialized;
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type min() _NOEXCEPT {return __base::min();}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type max() _NOEXCEPT {return __base::max();}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type lowest() _NOEXCEPT {return __base::lowest();}
+
+    static _LIBCUDACXX_CONSTEXPR const int  digits = __base::digits;
+    static _LIBCUDACXX_CONSTEXPR const int  digits10 = __base::digits10;
+    static _LIBCUDACXX_CONSTEXPR const int  max_digits10 = __base::max_digits10;
+    static _LIBCUDACXX_CONSTEXPR const bool is_signed = __base::is_signed;
+    static _LIBCUDACXX_CONSTEXPR const bool is_integer = __base::is_integer;
+    static _LIBCUDACXX_CONSTEXPR const bool is_exact = __base::is_exact;
+    static _LIBCUDACXX_CONSTEXPR const int  radix = __base::radix;
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type epsilon() _NOEXCEPT {return __base::epsilon();}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type round_error() _NOEXCEPT {return __base::round_error();}
+
+    static _LIBCUDACXX_CONSTEXPR const int  min_exponent = __base::min_exponent;
+    static _LIBCUDACXX_CONSTEXPR const int  min_exponent10 = __base::min_exponent10;
+    static _LIBCUDACXX_CONSTEXPR const int  max_exponent = __base::max_exponent;
+    static _LIBCUDACXX_CONSTEXPR const int  max_exponent10 = __base::max_exponent10;
+
+    static _LIBCUDACXX_CONSTEXPR const bool has_infinity = __base::has_infinity;
+    static _LIBCUDACXX_CONSTEXPR const bool has_quiet_NaN = __base::has_quiet_NaN;
+    static _LIBCUDACXX_CONSTEXPR const bool has_signaling_NaN = __base::has_signaling_NaN;
+    static _LIBCUDACXX_CONSTEXPR const float_denorm_style has_denorm = __base::has_denorm;
+    static _LIBCUDACXX_CONSTEXPR const bool has_denorm_loss = __base::has_denorm_loss;
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type infinity() _NOEXCEPT {return __base::infinity();}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type quiet_NaN() _NOEXCEPT {return __base::quiet_NaN();}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __base::signaling_NaN();}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type denorm_min() _NOEXCEPT {return __base::denorm_min();}
+
+    static _LIBCUDACXX_CONSTEXPR const bool is_iec559 = __base::is_iec559;
+    static _LIBCUDACXX_CONSTEXPR const bool is_bounded = __base::is_bounded;
+    static _LIBCUDACXX_CONSTEXPR const bool is_modulo = __base::is_modulo;
+
+    static _LIBCUDACXX_CONSTEXPR const bool traps = __base::traps;
+    static _LIBCUDACXX_CONSTEXPR const bool tinyness_before = __base::tinyness_before;
+    static _LIBCUDACXX_CONSTEXPR const float_round_style round_style = __base::round_style;
 };
 
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::is_specialized;
+    _LIBCUDACXX_CONSTEXPR const bool numeric_limits<const _Tp>::is_specialized;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const int numeric_limits<const _Tp>::digits;
+    _LIBCUDACXX_CONSTEXPR const int numeric_limits<const _Tp>::digits;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const int numeric_limits<const _Tp>::digits10;
+    _LIBCUDACXX_CONSTEXPR const int numeric_limits<const _Tp>::digits10;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const int numeric_limits<const _Tp>::max_digits10;
+    _LIBCUDACXX_CONSTEXPR const int numeric_limits<const _Tp>::max_digits10;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::is_signed;
+    _LIBCUDACXX_CONSTEXPR const bool numeric_limits<const _Tp>::is_signed;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::is_integer;
+    _LIBCUDACXX_CONSTEXPR const bool numeric_limits<const _Tp>::is_integer;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::is_exact;
+    _LIBCUDACXX_CONSTEXPR const bool numeric_limits<const _Tp>::is_exact;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const int numeric_limits<const _Tp>::radix;
+    _LIBCUDACXX_CONSTEXPR const int numeric_limits<const _Tp>::radix;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const int numeric_limits<const _Tp>::min_exponent;
+    _LIBCUDACXX_CONSTEXPR const int numeric_limits<const _Tp>::min_exponent;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const int numeric_limits<const _Tp>::min_exponent10;
+    _LIBCUDACXX_CONSTEXPR const int numeric_limits<const _Tp>::min_exponent10;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const int numeric_limits<const _Tp>::max_exponent;
+    _LIBCUDACXX_CONSTEXPR const int numeric_limits<const _Tp>::max_exponent;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const int numeric_limits<const _Tp>::max_exponent10;
+    _LIBCUDACXX_CONSTEXPR const int numeric_limits<const _Tp>::max_exponent10;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::has_infinity;
+    _LIBCUDACXX_CONSTEXPR const bool numeric_limits<const _Tp>::has_infinity;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::has_quiet_NaN;
+    _LIBCUDACXX_CONSTEXPR const bool numeric_limits<const _Tp>::has_quiet_NaN;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::has_signaling_NaN;
+    _LIBCUDACXX_CONSTEXPR const bool numeric_limits<const _Tp>::has_signaling_NaN;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const float_denorm_style numeric_limits<const _Tp>::has_denorm;
+    _LIBCUDACXX_CONSTEXPR const float_denorm_style numeric_limits<const _Tp>::has_denorm;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::has_denorm_loss;
+    _LIBCUDACXX_CONSTEXPR const bool numeric_limits<const _Tp>::has_denorm_loss;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::is_iec559;
+    _LIBCUDACXX_CONSTEXPR const bool numeric_limits<const _Tp>::is_iec559;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::is_bounded;
+    _LIBCUDACXX_CONSTEXPR const bool numeric_limits<const _Tp>::is_bounded;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::is_modulo;
+    _LIBCUDACXX_CONSTEXPR const bool numeric_limits<const _Tp>::is_modulo;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::traps;
+    _LIBCUDACXX_CONSTEXPR const bool numeric_limits<const _Tp>::traps;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::tinyness_before;
+    _LIBCUDACXX_CONSTEXPR const bool numeric_limits<const _Tp>::tinyness_before;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const float_round_style numeric_limits<const _Tp>::round_style;
+    _LIBCUDACXX_CONSTEXPR const float_round_style numeric_limits<const _Tp>::round_style;
 
 template <class _Tp>
-class _LIBCPP_TEMPLATE_VIS numeric_limits<volatile _Tp>
+class _LIBCUDACXX_TEMPLATE_VIS numeric_limits<volatile _Tp>
     : private numeric_limits<_Tp>
 {
     typedef numeric_limits<_Tp> __base;
     typedef _Tp type;
 public:
-    static _LIBCPP_CONSTEXPR const bool is_specialized = __base::is_specialized;
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return __base::min();}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __base::max();}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT {return __base::lowest();}
-
-    static _LIBCPP_CONSTEXPR const int  digits = __base::digits;
-    static _LIBCPP_CONSTEXPR const int  digits10 = __base::digits10;
-    static _LIBCPP_CONSTEXPR const int  max_digits10 = __base::max_digits10;
-    static _LIBCPP_CONSTEXPR const bool is_signed = __base::is_signed;
-    static _LIBCPP_CONSTEXPR const bool is_integer = __base::is_integer;
-    static _LIBCPP_CONSTEXPR const bool is_exact = __base::is_exact;
-    static _LIBCPP_CONSTEXPR const int  radix = __base::radix;
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT {return __base::epsilon();}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT {return __base::round_error();}
-
-    static _LIBCPP_CONSTEXPR const int  min_exponent = __base::min_exponent;
-    static _LIBCPP_CONSTEXPR const int  min_exponent10 = __base::min_exponent10;
-    static _LIBCPP_CONSTEXPR const int  max_exponent = __base::max_exponent;
-    static _LIBCPP_CONSTEXPR const int  max_exponent10 = __base::max_exponent10;
-
-    static _LIBCPP_CONSTEXPR const bool has_infinity = __base::has_infinity;
-    static _LIBCPP_CONSTEXPR const bool has_quiet_NaN = __base::has_quiet_NaN;
-    static _LIBCPP_CONSTEXPR const bool has_signaling_NaN = __base::has_signaling_NaN;
-    static _LIBCPP_CONSTEXPR const float_denorm_style has_denorm = __base::has_denorm;
-    static _LIBCPP_CONSTEXPR const bool has_denorm_loss = __base::has_denorm_loss;
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT {return __base::infinity();}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT {return __base::quiet_NaN();}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __base::signaling_NaN();}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __base::denorm_min();}
-
-    static _LIBCPP_CONSTEXPR const bool is_iec559 = __base::is_iec559;
-    static _LIBCPP_CONSTEXPR const bool is_bounded = __base::is_bounded;
-    static _LIBCPP_CONSTEXPR const bool is_modulo = __base::is_modulo;
-
-    static _LIBCPP_CONSTEXPR const bool traps = __base::traps;
-    static _LIBCPP_CONSTEXPR const bool tinyness_before = __base::tinyness_before;
-    static _LIBCPP_CONSTEXPR const float_round_style round_style = __base::round_style;
+    static _LIBCUDACXX_CONSTEXPR const bool is_specialized = __base::is_specialized;
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type min() _NOEXCEPT {return __base::min();}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type max() _NOEXCEPT {return __base::max();}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type lowest() _NOEXCEPT {return __base::lowest();}
+
+    static _LIBCUDACXX_CONSTEXPR const int  digits = __base::digits;
+    static _LIBCUDACXX_CONSTEXPR const int  digits10 = __base::digits10;
+    static _LIBCUDACXX_CONSTEXPR const int  max_digits10 = __base::max_digits10;
+    static _LIBCUDACXX_CONSTEXPR const bool is_signed = __base::is_signed;
+    static _LIBCUDACXX_CONSTEXPR const bool is_integer = __base::is_integer;
+    static _LIBCUDACXX_CONSTEXPR const bool is_exact = __base::is_exact;
+    static _LIBCUDACXX_CONSTEXPR const int  radix = __base::radix;
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type epsilon() _NOEXCEPT {return __base::epsilon();}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type round_error() _NOEXCEPT {return __base::round_error();}
+
+    static _LIBCUDACXX_CONSTEXPR const int  min_exponent = __base::min_exponent;
+    static _LIBCUDACXX_CONSTEXPR const int  min_exponent10 = __base::min_exponent10;
+    static _LIBCUDACXX_CONSTEXPR const int  max_exponent = __base::max_exponent;
+    static _LIBCUDACXX_CONSTEXPR const int  max_exponent10 = __base::max_exponent10;
+
+    static _LIBCUDACXX_CONSTEXPR const bool has_infinity = __base::has_infinity;
+    static _LIBCUDACXX_CONSTEXPR const bool has_quiet_NaN = __base::has_quiet_NaN;
+    static _LIBCUDACXX_CONSTEXPR const bool has_signaling_NaN = __base::has_signaling_NaN;
+    static _LIBCUDACXX_CONSTEXPR const float_denorm_style has_denorm = __base::has_denorm;
+    static _LIBCUDACXX_CONSTEXPR const bool has_denorm_loss = __base::has_denorm_loss;
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type infinity() _NOEXCEPT {return __base::infinity();}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type quiet_NaN() _NOEXCEPT {return __base::quiet_NaN();}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __base::signaling_NaN();}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type denorm_min() _NOEXCEPT {return __base::denorm_min();}
+
+    static _LIBCUDACXX_CONSTEXPR const bool is_iec559 = __base::is_iec559;
+    static _LIBCUDACXX_CONSTEXPR const bool is_bounded = __base::is_bounded;
+    static _LIBCUDACXX_CONSTEXPR const bool is_modulo = __base::is_modulo;
+
+    static _LIBCUDACXX_CONSTEXPR const bool traps = __base::traps;
+    static _LIBCUDACXX_CONSTEXPR const bool tinyness_before = __base::tinyness_before;
+    static _LIBCUDACXX_CONSTEXPR const float_round_style round_style = __base::round_style;
 };
 
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::is_specialized;
+    _LIBCUDACXX_CONSTEXPR const bool numeric_limits<volatile _Tp>::is_specialized;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const int numeric_limits<volatile _Tp>::digits;
+    _LIBCUDACXX_CONSTEXPR const int numeric_limits<volatile _Tp>::digits;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const int numeric_limits<volatile _Tp>::digits10;
+    _LIBCUDACXX_CONSTEXPR const int numeric_limits<volatile _Tp>::digits10;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const int numeric_limits<volatile _Tp>::max_digits10;
+    _LIBCUDACXX_CONSTEXPR const int numeric_limits<volatile _Tp>::max_digits10;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::is_signed;
+    _LIBCUDACXX_CONSTEXPR const bool numeric_limits<volatile _Tp>::is_signed;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::is_integer;
+    _LIBCUDACXX_CONSTEXPR const bool numeric_limits<volatile _Tp>::is_integer;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::is_exact;
+    _LIBCUDACXX_CONSTEXPR const bool numeric_limits<volatile _Tp>::is_exact;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const int numeric_limits<volatile _Tp>::radix;
+    _LIBCUDACXX_CONSTEXPR const int numeric_limits<volatile _Tp>::radix;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const int numeric_limits<volatile _Tp>::min_exponent;
+    _LIBCUDACXX_CONSTEXPR const int numeric_limits<volatile _Tp>::min_exponent;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const int numeric_limits<volatile _Tp>::min_exponent10;
+    _LIBCUDACXX_CONSTEXPR const int numeric_limits<volatile _Tp>::min_exponent10;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const int numeric_limits<volatile _Tp>::max_exponent;
+    _LIBCUDACXX_CONSTEXPR const int numeric_limits<volatile _Tp>::max_exponent;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const int numeric_limits<volatile _Tp>::max_exponent10;
+    _LIBCUDACXX_CONSTEXPR const int numeric_limits<volatile _Tp>::max_exponent10;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::has_infinity;
+    _LIBCUDACXX_CONSTEXPR const bool numeric_limits<volatile _Tp>::has_infinity;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::has_quiet_NaN;
+    _LIBCUDACXX_CONSTEXPR const bool numeric_limits<volatile _Tp>::has_quiet_NaN;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::has_signaling_NaN;
+    _LIBCUDACXX_CONSTEXPR const bool numeric_limits<volatile _Tp>::has_signaling_NaN;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const float_denorm_style numeric_limits<volatile _Tp>::has_denorm;
+    _LIBCUDACXX_CONSTEXPR const float_denorm_style numeric_limits<volatile _Tp>::has_denorm;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::has_denorm_loss;
+    _LIBCUDACXX_CONSTEXPR const bool numeric_limits<volatile _Tp>::has_denorm_loss;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::is_iec559;
+    _LIBCUDACXX_CONSTEXPR const bool numeric_limits<volatile _Tp>::is_iec559;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::is_bounded;
+    _LIBCUDACXX_CONSTEXPR const bool numeric_limits<volatile _Tp>::is_bounded;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::is_modulo;
+    _LIBCUDACXX_CONSTEXPR const bool numeric_limits<volatile _Tp>::is_modulo;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::traps;
+    _LIBCUDACXX_CONSTEXPR const bool numeric_limits<volatile _Tp>::traps;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::tinyness_before;
+    _LIBCUDACXX_CONSTEXPR const bool numeric_limits<volatile _Tp>::tinyness_before;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const float_round_style numeric_limits<volatile _Tp>::round_style;
+    _LIBCUDACXX_CONSTEXPR const float_round_style numeric_limits<volatile _Tp>::round_style;
 
 template <class _Tp>
-class _LIBCPP_TEMPLATE_VIS numeric_limits<const volatile _Tp>
+class _LIBCUDACXX_TEMPLATE_VIS numeric_limits<const volatile _Tp>
     : private numeric_limits<_Tp>
 {
     typedef numeric_limits<_Tp> __base;
     typedef _Tp type;
 public:
-    static _LIBCPP_CONSTEXPR const bool is_specialized = __base::is_specialized;
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return __base::min();}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __base::max();}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT {return __base::lowest();}
-
-    static _LIBCPP_CONSTEXPR const int  digits = __base::digits;
-    static _LIBCPP_CONSTEXPR const int  digits10 = __base::digits10;
-    static _LIBCPP_CONSTEXPR const int  max_digits10 = __base::max_digits10;
-    static _LIBCPP_CONSTEXPR const bool is_signed = __base::is_signed;
-    static _LIBCPP_CONSTEXPR const bool is_integer = __base::is_integer;
-    static _LIBCPP_CONSTEXPR const bool is_exact = __base::is_exact;
-    static _LIBCPP_CONSTEXPR const int  radix = __base::radix;
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT {return __base::epsilon();}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT {return __base::round_error();}
-
-    static _LIBCPP_CONSTEXPR const int  min_exponent = __base::min_exponent;
-    static _LIBCPP_CONSTEXPR const int  min_exponent10 = __base::min_exponent10;
-    static _LIBCPP_CONSTEXPR const int  max_exponent = __base::max_exponent;
-    static _LIBCPP_CONSTEXPR const int  max_exponent10 = __base::max_exponent10;
-
-    static _LIBCPP_CONSTEXPR const bool has_infinity = __base::has_infinity;
-    static _LIBCPP_CONSTEXPR const bool has_quiet_NaN = __base::has_quiet_NaN;
-    static _LIBCPP_CONSTEXPR const bool has_signaling_NaN = __base::has_signaling_NaN;
-    static _LIBCPP_CONSTEXPR const float_denorm_style has_denorm = __base::has_denorm;
-    static _LIBCPP_CONSTEXPR const bool has_denorm_loss = __base::has_denorm_loss;
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT {return __base::infinity();}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT {return __base::quiet_NaN();}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __base::signaling_NaN();}
-    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __base::denorm_min();}
-
-    static _LIBCPP_CONSTEXPR const bool is_iec559 = __base::is_iec559;
-    static _LIBCPP_CONSTEXPR const bool is_bounded = __base::is_bounded;
-    static _LIBCPP_CONSTEXPR const bool is_modulo = __base::is_modulo;
-
-    static _LIBCPP_CONSTEXPR const bool traps = __base::traps;
-    static _LIBCPP_CONSTEXPR const bool tinyness_before = __base::tinyness_before;
-    static _LIBCPP_CONSTEXPR const float_round_style round_style = __base::round_style;
+    static _LIBCUDACXX_CONSTEXPR const bool is_specialized = __base::is_specialized;
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type min() _NOEXCEPT {return __base::min();}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type max() _NOEXCEPT {return __base::max();}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type lowest() _NOEXCEPT {return __base::lowest();}
+
+    static _LIBCUDACXX_CONSTEXPR const int  digits = __base::digits;
+    static _LIBCUDACXX_CONSTEXPR const int  digits10 = __base::digits10;
+    static _LIBCUDACXX_CONSTEXPR const int  max_digits10 = __base::max_digits10;
+    static _LIBCUDACXX_CONSTEXPR const bool is_signed = __base::is_signed;
+    static _LIBCUDACXX_CONSTEXPR const bool is_integer = __base::is_integer;
+    static _LIBCUDACXX_CONSTEXPR const bool is_exact = __base::is_exact;
+    static _LIBCUDACXX_CONSTEXPR const int  radix = __base::radix;
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type epsilon() _NOEXCEPT {return __base::epsilon();}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type round_error() _NOEXCEPT {return __base::round_error();}
+
+    static _LIBCUDACXX_CONSTEXPR const int  min_exponent = __base::min_exponent;
+    static _LIBCUDACXX_CONSTEXPR const int  min_exponent10 = __base::min_exponent10;
+    static _LIBCUDACXX_CONSTEXPR const int  max_exponent = __base::max_exponent;
+    static _LIBCUDACXX_CONSTEXPR const int  max_exponent10 = __base::max_exponent10;
+
+    static _LIBCUDACXX_CONSTEXPR const bool has_infinity = __base::has_infinity;
+    static _LIBCUDACXX_CONSTEXPR const bool has_quiet_NaN = __base::has_quiet_NaN;
+    static _LIBCUDACXX_CONSTEXPR const bool has_signaling_NaN = __base::has_signaling_NaN;
+    static _LIBCUDACXX_CONSTEXPR const float_denorm_style has_denorm = __base::has_denorm;
+    static _LIBCUDACXX_CONSTEXPR const bool has_denorm_loss = __base::has_denorm_loss;
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type infinity() _NOEXCEPT {return __base::infinity();}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type quiet_NaN() _NOEXCEPT {return __base::quiet_NaN();}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __base::signaling_NaN();}
+    _LIBCUDACXX_INLINE_VISIBILITY static _LIBCUDACXX_CONSTEXPR type denorm_min() _NOEXCEPT {return __base::denorm_min();}
+
+    static _LIBCUDACXX_CONSTEXPR const bool is_iec559 = __base::is_iec559;
+    static _LIBCUDACXX_CONSTEXPR const bool is_bounded = __base::is_bounded;
+    static _LIBCUDACXX_CONSTEXPR const bool is_modulo = __base::is_modulo;
+
+    static _LIBCUDACXX_CONSTEXPR const bool traps = __base::traps;
+    static _LIBCUDACXX_CONSTEXPR const bool tinyness_before = __base::tinyness_before;
+    static _LIBCUDACXX_CONSTEXPR const float_round_style round_style = __base::round_style;
 };
 
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::is_specialized;
+    _LIBCUDACXX_CONSTEXPR const bool numeric_limits<const volatile _Tp>::is_specialized;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const int numeric_limits<const volatile _Tp>::digits;
+    _LIBCUDACXX_CONSTEXPR const int numeric_limits<const volatile _Tp>::digits;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const int numeric_limits<const volatile _Tp>::digits10;
+    _LIBCUDACXX_CONSTEXPR const int numeric_limits<const volatile _Tp>::digits10;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const int numeric_limits<const volatile _Tp>::max_digits10;
+    _LIBCUDACXX_CONSTEXPR const int numeric_limits<const volatile _Tp>::max_digits10;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::is_signed;
+    _LIBCUDACXX_CONSTEXPR const bool numeric_limits<const volatile _Tp>::is_signed;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::is_integer;
+    _LIBCUDACXX_CONSTEXPR const bool numeric_limits<const volatile _Tp>::is_integer;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::is_exact;
+    _LIBCUDACXX_CONSTEXPR const bool numeric_limits<const volatile _Tp>::is_exact;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const int numeric_limits<const volatile _Tp>::radix;
+    _LIBCUDACXX_CONSTEXPR const int numeric_limits<const volatile _Tp>::radix;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const int numeric_limits<const volatile _Tp>::min_exponent;
+    _LIBCUDACXX_CONSTEXPR const int numeric_limits<const volatile _Tp>::min_exponent;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const int numeric_limits<const volatile _Tp>::min_exponent10;
+    _LIBCUDACXX_CONSTEXPR const int numeric_limits<const volatile _Tp>::min_exponent10;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const int numeric_limits<const volatile _Tp>::max_exponent;
+    _LIBCUDACXX_CONSTEXPR const int numeric_limits<const volatile _Tp>::max_exponent;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const int numeric_limits<const volatile _Tp>::max_exponent10;
+    _LIBCUDACXX_CONSTEXPR const int numeric_limits<const volatile _Tp>::max_exponent10;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::has_infinity;
+    _LIBCUDACXX_CONSTEXPR const bool numeric_limits<const volatile _Tp>::has_infinity;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::has_quiet_NaN;
+    _LIBCUDACXX_CONSTEXPR const bool numeric_limits<const volatile _Tp>::has_quiet_NaN;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::has_signaling_NaN;
+    _LIBCUDACXX_CONSTEXPR const bool numeric_limits<const volatile _Tp>::has_signaling_NaN;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const float_denorm_style numeric_limits<const volatile _Tp>::has_denorm;
+    _LIBCUDACXX_CONSTEXPR const float_denorm_style numeric_limits<const volatile _Tp>::has_denorm;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::has_denorm_loss;
+    _LIBCUDACXX_CONSTEXPR const bool numeric_limits<const volatile _Tp>::has_denorm_loss;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::is_iec559;
+    _LIBCUDACXX_CONSTEXPR const bool numeric_limits<const volatile _Tp>::is_iec559;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::is_bounded;
+    _LIBCUDACXX_CONSTEXPR const bool numeric_limits<const volatile _Tp>::is_bounded;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::is_modulo;
+    _LIBCUDACXX_CONSTEXPR const bool numeric_limits<const volatile _Tp>::is_modulo;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::traps;
+    _LIBCUDACXX_CONSTEXPR const bool numeric_limits<const volatile _Tp>::traps;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::tinyness_before;
+    _LIBCUDACXX_CONSTEXPR const bool numeric_limits<const volatile _Tp>::tinyness_before;
 template <class _Tp>
-    _LIBCPP_CONSTEXPR const float_round_style numeric_limits<const volatile _Tp>::round_style;
+    _LIBCUDACXX_CONSTEXPR const float_round_style numeric_limits<const volatile _Tp>::round_style;
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP_LIMITS
+#endif // _LIBCUDACXX_LIMITS

diff  --git a/libcxx/include/limits.h b/libcxx/include/limits.h
index 3e1e85a8a0b4..d50606c9ab61 100644
--- a/libcxx/include/limits.h
+++ b/libcxx/include/limits.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_LIMITS_H
-#define _LIBCPP_LIMITS_H
+#ifndef _LIBCUDACXX_LIMITS_H
+#define _LIBCUDACXX_LIMITS_H
 
 /*
     limits.h synopsis
@@ -39,7 +39,7 @@
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
@@ -61,4 +61,4 @@
 #include_next <limits.h>
 #endif // __GNUC__
 
-#endif // _LIBCPP_LIMITS_H
+#endif // _LIBCUDACXX_LIMITS_H

diff  --git a/libcxx/include/list b/libcxx/include/list
index 5fcbd67c6703..0a31a12c5c3e 100644
--- a/libcxx/include/list
+++ b/libcxx/include/list
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_LIST
-#define _LIBCPP_LIST
+#ifndef _LIBCUDACXX_LIST
+#define _LIBCUDACXX_LIST
 
 /*
     list synopsis
@@ -203,7 +203,7 @@ template <class T, class Allocator, class Predicate>
 #include <type_traits>
 #include <version>
 
-#ifndef _LIBCPP_REMOVE_TRANSITIVE_INCLUDES
+#ifndef _LIBCUDACXX_REMOVE_TRANSITIVE_INCLUDES
 #  include <algorithm>
 #  include <functional>
 #  include <iterator>
@@ -222,15 +222,15 @@ template <class T, class Allocator, class Predicate>
 #include <compare>
 #include <initializer_list>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Tp, class _VoidPtr> struct __list_node;
 template <class _Tp, class _VoidPtr> struct __list_node_base;
@@ -242,7 +242,7 @@ struct __list_node_pointer_traits {
   typedef typename __rebind_pointer<_VoidPtr, __list_node_base<_Tp, _VoidPtr> >::type
         __base_pointer;
 
-#if defined(_LIBCPP_ABI_LIST_REMOVE_NODE_POINTER_UB)
+#if defined(_LIBCUDACXX_ABI_LIST_REMOVE_NODE_POINTER_UB)
   typedef __base_pointer __link_pointer;
 #else
   typedef typename conditional<
@@ -258,12 +258,12 @@ struct __list_node_pointer_traits {
           __node_pointer
   >::type __non_link_pointer;
 
-  static _LIBCPP_INLINE_VISIBILITY
+  static _LIBCUDACXX_INLINE_VISIBILITY
   __link_pointer __unsafe_link_pointer_cast(__link_pointer __p) {
       return __p;
   }
 
-  static _LIBCPP_INLINE_VISIBILITY
+  static _LIBCUDACXX_INLINE_VISIBILITY
   __link_pointer __unsafe_link_pointer_cast(__non_link_pointer __p) {
       return static_cast<__link_pointer>(static_cast<_VoidPtr>(__p));
   }
@@ -281,23 +281,23 @@ struct __list_node_base
     __link_pointer __prev_;
     __link_pointer __next_;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __list_node_base() : __prev_(_NodeTraits::__unsafe_link_pointer_cast(__self())),
                          __next_(_NodeTraits::__unsafe_link_pointer_cast(__self())) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __base_pointer __self() {
         return pointer_traits<__base_pointer>::pointer_to(*this);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __node_pointer __as_node() {
         return static_cast<__node_pointer>(__self());
     }
 };
 
 template <class _Tp, class _VoidPtr>
-struct _LIBCPP_STANDALONE_DEBUG __list_node
+struct _LIBCUDACXX_STANDALONE_DEBUG __list_node
     : public __list_node_base<_Tp, _VoidPtr>
 {
     _Tp __value_;
@@ -305,30 +305,30 @@ struct _LIBCPP_STANDALONE_DEBUG __list_node
     typedef __list_node_base<_Tp, _VoidPtr> __base;
     typedef typename __base::__link_pointer __link_pointer;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __link_pointer __as_link() {
         return static_cast<__link_pointer>(__base::__self());
     }
 };
 
-template <class _Tp, class _Alloc = allocator<_Tp> > class _LIBCPP_TEMPLATE_VIS list;
+template <class _Tp, class _Alloc = allocator<_Tp> > class _LIBCUDACXX_TEMPLATE_VIS list;
 template <class _Tp, class _Alloc> class __list_imp;
-template <class _Tp, class _VoidPtr> class _LIBCPP_TEMPLATE_VIS __list_const_iterator;
+template <class _Tp, class _VoidPtr> class _LIBCUDACXX_TEMPLATE_VIS __list_const_iterator;
 
 template <class _Tp, class _VoidPtr>
-class _LIBCPP_TEMPLATE_VIS __list_iterator
+class _LIBCUDACXX_TEMPLATE_VIS __list_iterator
 {
     typedef __list_node_pointer_traits<_Tp, _VoidPtr> _NodeTraits;
     typedef typename _NodeTraits::__link_pointer __link_pointer;
 
     __link_pointer __ptr_;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __list_iterator(__link_pointer __p, const void* __c) _NOEXCEPT
         : __ptr_(__p)
     {
         (void)__c;
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
+#ifdef _LIBCUDACXX_ENABLE_DEBUG_MODE
         __get_db()->__insert_ic(this, __c);
 #endif
     }
@@ -343,101 +343,101 @@ public:
     typedef typename __rebind_pointer<_VoidPtr, value_type>::type pointer;
     typedef typename pointer_traits<pointer>::
diff erence_type 
diff erence_type;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __list_iterator() _NOEXCEPT : __ptr_(nullptr)
     {
-        _VSTD::__debug_db_insert_i(this);
+        _CUDA_VSTD::__debug_db_insert_i(this);
     }
 
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
+#ifdef _LIBCUDACXX_ENABLE_DEBUG_MODE
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __list_iterator(const __list_iterator& __p)
         : __ptr_(__p.__ptr_)
     {
-        __get_db()->__iterator_copy(this, _VSTD::addressof(__p));
+        __get_db()->__iterator_copy(this, _CUDA_VSTD::addressof(__p));
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     ~__list_iterator()
     {
         __get_db()->__erase_i(this);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __list_iterator& operator=(const __list_iterator& __p)
     {
-        if (this != _VSTD::addressof(__p))
+        if (this != _CUDA_VSTD::addressof(__p))
         {
-            __get_db()->__iterator_copy(this, _VSTD::addressof(__p));
+            __get_db()->__iterator_copy(this, _CUDA_VSTD::addressof(__p));
             __ptr_ = __p.__ptr_;
         }
         return *this;
     }
 
-#endif // _LIBCPP_ENABLE_DEBUG_MODE
+#endif // _LIBCUDACXX_ENABLE_DEBUG_MODE
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     reference operator*() const
     {
-        _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
+        _LIBCUDACXX_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
                              "Attempted to dereference a non-dereferenceable list::iterator");
         return __ptr_->__as_node()->__value_;
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     pointer operator->() const
     {
-        _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
+        _LIBCUDACXX_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
                              "Attempted to dereference a non-dereferenceable list::iterator");
         return pointer_traits<pointer>::pointer_to(__ptr_->__as_node()->__value_);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __list_iterator& operator++()
     {
-        _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
+        _LIBCUDACXX_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
                              "Attempted to increment a non-incrementable list::iterator");
         __ptr_ = __ptr_->__next_;
         return *this;
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __list_iterator operator++(int) {__list_iterator __t(*this); ++(*this); return __t;}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __list_iterator& operator--()
     {
-        _LIBCPP_DEBUG_ASSERT(__get_const_db()->__decrementable(this),
+        _LIBCUDACXX_DEBUG_ASSERT(__get_const_db()->__decrementable(this),
                              "Attempted to decrement a non-decrementable list::iterator");
         __ptr_ = __ptr_->__prev_;
         return *this;
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __list_iterator operator--(int) {__list_iterator __t(*this); --(*this); return __t;}
 
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
     bool operator==(const __list_iterator& __x, const __list_iterator& __y)
     {
         return __x.__ptr_ == __y.__ptr_;
     }
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
      bool operator!=(const __list_iterator& __x, const __list_iterator& __y)
         {return !(__x == __y);}
 };
 
 template <class _Tp, class _VoidPtr>
-class _LIBCPP_TEMPLATE_VIS __list_const_iterator
+class _LIBCUDACXX_TEMPLATE_VIS __list_const_iterator
 {
     typedef __list_node_pointer_traits<_Tp, _VoidPtr> _NodeTraits;
     typedef typename _NodeTraits::__link_pointer __link_pointer;
 
     __link_pointer __ptr_;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __list_const_iterator(__link_pointer __p, const void* __c) _NOEXCEPT
         : __ptr_(__p)
     {
         (void)__c;
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
+#ifdef _LIBCUDACXX_ENABLE_DEBUG_MODE
         __get_db()->__insert_ic(this, __c);
 #endif
     }
@@ -451,90 +451,90 @@ public:
     typedef typename __rebind_pointer<_VoidPtr, const value_type>::type pointer;
     typedef typename pointer_traits<pointer>::
diff erence_type 
diff erence_type;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __list_const_iterator() _NOEXCEPT : __ptr_(nullptr)
     {
-        _VSTD::__debug_db_insert_i(this);
+        _CUDA_VSTD::__debug_db_insert_i(this);
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __list_const_iterator(const __list_iterator<_Tp, _VoidPtr>& __p) _NOEXCEPT
         : __ptr_(__p.__ptr_)
     {
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
-        __get_db()->__iterator_copy(this, _VSTD::addressof(__p));
+#ifdef _LIBCUDACXX_ENABLE_DEBUG_MODE
+        __get_db()->__iterator_copy(this, _CUDA_VSTD::addressof(__p));
 #endif
     }
 
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
+#ifdef _LIBCUDACXX_ENABLE_DEBUG_MODE
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __list_const_iterator(const __list_const_iterator& __p)
         : __ptr_(__p.__ptr_)
     {
-        __get_db()->__iterator_copy(this, _VSTD::addressof(__p));
+        __get_db()->__iterator_copy(this, _CUDA_VSTD::addressof(__p));
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     ~__list_const_iterator()
     {
         __get_db()->__erase_i(this);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __list_const_iterator& operator=(const __list_const_iterator& __p)
     {
-        if (this != _VSTD::addressof(__p))
+        if (this != _CUDA_VSTD::addressof(__p))
         {
-            __get_db()->__iterator_copy(this, _VSTD::addressof(__p));
+            __get_db()->__iterator_copy(this, _CUDA_VSTD::addressof(__p));
             __ptr_ = __p.__ptr_;
         }
         return *this;
     }
 
-#endif // _LIBCPP_ENABLE_DEBUG_MODE
-    _LIBCPP_INLINE_VISIBILITY
+#endif // _LIBCUDACXX_ENABLE_DEBUG_MODE
+    _LIBCUDACXX_INLINE_VISIBILITY
     reference operator*() const
     {
-        _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
+        _LIBCUDACXX_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
                              "Attempted to dereference a non-dereferenceable list::const_iterator");
         return __ptr_->__as_node()->__value_;
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     pointer operator->() const
     {
-        _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
+        _LIBCUDACXX_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
                              "Attempted to dereference a non-dereferenceable list::const_iterator");
         return pointer_traits<pointer>::pointer_to(__ptr_->__as_node()->__value_);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __list_const_iterator& operator++()
     {
-        _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
+        _LIBCUDACXX_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
                              "Attempted to increment a non-incrementable list::const_iterator");
         __ptr_ = __ptr_->__next_;
         return *this;
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __list_const_iterator operator++(int) {__list_const_iterator __t(*this); ++(*this); return __t;}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __list_const_iterator& operator--()
     {
-        _LIBCPP_DEBUG_ASSERT(__get_const_db()->__decrementable(this),
+        _LIBCUDACXX_DEBUG_ASSERT(__get_const_db()->__decrementable(this),
                              "Attempted to decrement a non-decrementable list::const_iterator");
         __ptr_ = __ptr_->__prev_;
         return *this;
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __list_const_iterator operator--(int) {__list_const_iterator __t(*this); --(*this); return __t;}
 
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
     bool operator==(const __list_const_iterator& __x, const __list_const_iterator& __y)
     {
         return __x.__ptr_ == __y.__ptr_;
     }
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
     bool operator!=(const __list_const_iterator& __x, const __list_const_iterator& __y)
         {return !(__x == __y);}
 };
@@ -575,81 +575,81 @@ protected:
     __node_base __end_;
     __compressed_pair<size_type, __node_allocator> __size_alloc_;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __link_pointer __end_as_link() const _NOEXCEPT {
         return __node_pointer_traits::__unsafe_link_pointer_cast(
                 const_cast<__node_base&>(__end_).__self());
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
           size_type& __sz() _NOEXCEPT {return __size_alloc_.first();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const size_type& __sz() const _NOEXCEPT
         {return __size_alloc_.first();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
           __node_allocator& __node_alloc() _NOEXCEPT
           {return __size_alloc_.second();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const __node_allocator& __node_alloc() const _NOEXCEPT
         {return __size_alloc_.second();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type __node_alloc_max_size() const _NOEXCEPT {
         return __node_alloc_traits::max_size(__node_alloc());
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     static void __unlink_nodes(__link_pointer __f, __link_pointer __l) _NOEXCEPT;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __list_imp()
         _NOEXCEPT_(is_nothrow_default_constructible<__node_allocator>::value);
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __list_imp(const allocator_type& __a);
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __list_imp(const __node_allocator& __a);
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
     __list_imp(__node_allocator&& __a) _NOEXCEPT;
 #endif
     ~__list_imp();
     void clear() _NOEXCEPT;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool empty() const _NOEXCEPT {return __sz() == 0;}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator begin() _NOEXCEPT
     {
         return iterator(__end_.__next_, this);
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator begin() const  _NOEXCEPT
     {
         return const_iterator(__end_.__next_, this);
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator end() _NOEXCEPT
     {
         return iterator(__end_as_link(), this);
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator end() const _NOEXCEPT
     {
         return const_iterator(__end_as_link(), this);
     }
 
     void swap(__list_imp& __c)
-#if _LIBCPP_STD_VER >= 14
+#if _LIBCUDACXX_STD_VER >= 14
         _NOEXCEPT;
 #else
         _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
                     __is_nothrow_swappable<allocator_type>::value);
 #endif
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __copy_assign_alloc(const __list_imp& __c)
         {__copy_assign_alloc(__c, integral_constant<bool,
                       __node_alloc_traits::propagate_on_container_copy_assignment::value>());}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __move_assign_alloc(__list_imp& __c)
         _NOEXCEPT_(
             !__node_alloc_traits::propagate_on_container_move_assignment::value ||
@@ -658,7 +658,7 @@ protected:
                       __node_alloc_traits::propagate_on_container_move_assignment::value>());}
 
 private:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __copy_assign_alloc(const __list_imp& __c, true_type)
         {
             if (__node_alloc() != __c.__node_alloc())
@@ -666,18 +666,18 @@ private:
             __node_alloc() = __c.__node_alloc();
         }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __copy_assign_alloc(const __list_imp&, false_type)
         {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __move_assign_alloc(__list_imp& __c, true_type)
         _NOEXCEPT_(is_nothrow_move_assignable<__node_allocator>::value)
         {
-            __node_alloc() = _VSTD::move(__c.__node_alloc());
+            __node_alloc() = _CUDA_VSTD::move(__c.__node_alloc());
         }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __move_assign_alloc(__list_imp&, false_type)
         _NOEXCEPT
         {}
@@ -713,10 +713,10 @@ template <class _Tp, class _Alloc>
 inline __list_imp<_Tp, _Alloc>::__list_imp(const __node_allocator& __a)
     : __size_alloc_(0, __a) {}
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 template <class _Tp, class _Alloc>
 inline __list_imp<_Tp, _Alloc>::__list_imp(__node_allocator&& __a) _NOEXCEPT
-    : __size_alloc_(0, _VSTD::move(__a)) {}
+    : __size_alloc_(0, _CUDA_VSTD::move(__a)) {}
 #endif
 
 template <class _Tp, class _Alloc>
@@ -740,7 +740,7 @@ __list_imp<_Tp, _Alloc>::clear() _NOEXCEPT
         {
             __node_pointer __np = __f->__as_node();
             __f = __f->__next_;
-            __node_alloc_traits::destroy(__na, _VSTD::addressof(__np->__value_));
+            __node_alloc_traits::destroy(__na, _CUDA_VSTD::addressof(__np->__value_));
             __node_alloc_traits::deallocate(__na, __np, 1);
         }
         std::__debug_db_invalidate_all(this);
@@ -750,19 +750,19 @@ __list_imp<_Tp, _Alloc>::clear() _NOEXCEPT
 template <class _Tp, class _Alloc>
 void
 __list_imp<_Tp, _Alloc>::swap(__list_imp& __c)
-#if _LIBCPP_STD_VER >= 14
+#if _LIBCUDACXX_STD_VER >= 14
         _NOEXCEPT
 #else
         _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
                     __is_nothrow_swappable<allocator_type>::value)
 #endif
 {
-    _LIBCPP_ASSERT(__alloc_traits::propagate_on_container_swap::value ||
+    _LIBCUDACXX_ASSERT(__alloc_traits::propagate_on_container_swap::value ||
                    this->__node_alloc() == __c.__node_alloc(),
                    "list::swap: Either propagate_on_container_swap must be true"
                    " or the allocators must compare equal");
-    using _VSTD::swap;
-    _VSTD::__swap_allocator(__node_alloc(), __c.__node_alloc());
+    using _CUDA_VSTD::swap;
+    _CUDA_VSTD::__swap_allocator(__node_alloc(), __c.__node_alloc());
     swap(__sz(), __c.__sz());
     swap(__end_, __c.__end_);
     if (__sz() == 0)
@@ -774,13 +774,13 @@ __list_imp<_Tp, _Alloc>::swap(__list_imp& __c)
     else
         __c.__end_.__prev_->__next_ = __c.__end_.__next_->__prev_ = __c.__end_as_link();
 
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
-    __libcpp_db* __db = __get_db();
+#ifdef _LIBCUDACXX_ENABLE_DEBUG_MODE
+    __LIBCUDACXX_db* __db = __get_db();
     __c_node* __cn1 = __db->__find_c_and_lock(this);
-    __c_node* __cn2 = __db->__find_c(_VSTD::addressof(__c));
-    _VSTD::swap(__cn1->beg_, __cn2->beg_);
-    _VSTD::swap(__cn1->end_, __cn2->end_);
-    _VSTD::swap(__cn1->cap_, __cn2->cap_);
+    __c_node* __cn2 = __db->__find_c(_CUDA_VSTD::addressof(__c));
+    _CUDA_VSTD::swap(__cn1->beg_, __cn2->beg_);
+    _CUDA_VSTD::swap(__cn1->end_, __cn2->end_);
+    _CUDA_VSTD::swap(__cn1->cap_, __cn2->cap_);
     for (__i_node** __p = __cn1->end_; __p != __cn1->beg_;)
     {
         --__p;
@@ -789,7 +789,7 @@ __list_imp<_Tp, _Alloc>::swap(__list_imp& __c)
         {
             __cn2->__add(*__p);
             if (--__cn1->end_ != __p)
-                _VSTD::memmove(__p, __p+1, (__cn1->end_ - __p)*sizeof(__i_node*));
+                _CUDA_VSTD::memmove(__p, __p+1, (__cn1->end_ - __p)*sizeof(__i_node*));
         }
         else
             (*__p)->__c_ = __cn1;
@@ -802,7 +802,7 @@ __list_imp<_Tp, _Alloc>::swap(__list_imp& __c)
         {
             __cn1->__add(*__p);
             if (--__cn2->end_ != __p)
-                _VSTD::memmove(__p, __p+1, (__cn2->end_ - __p)*sizeof(__i_node*));
+                _CUDA_VSTD::memmove(__p, __p+1, (__cn2->end_ - __p)*sizeof(__i_node*));
         }
         else
             (*__p)->__c_ = __cn2;
@@ -812,7 +812,7 @@ __list_imp<_Tp, _Alloc>::swap(__list_imp& __c)
 }
 
 template <class _Tp, class _Alloc /*= allocator<_Tp>*/>
-class _LIBCPP_TEMPLATE_VIS list
+class _LIBCUDACXX_TEMPLATE_VIS list
     : private __list_imp<_Tp, _Alloc>
 {
     typedef __list_imp<_Tp, _Alloc> base;
@@ -837,34 +837,34 @@ public:
     typedef typename base::
diff erence_type                 
diff erence_type;
     typedef typename base::iterator                        iterator;
     typedef typename base::const_iterator                  const_iterator;
-    typedef _VSTD::reverse_iterator<iterator>              reverse_iterator;
-    typedef _VSTD::reverse_iterator<const_iterator>        const_reverse_iterator;
-#if _LIBCPP_STD_VER > 17
+    typedef _CUDA_VSTD::reverse_iterator<iterator>              reverse_iterator;
+    typedef _CUDA_VSTD::reverse_iterator<const_iterator>        const_reverse_iterator;
+#if _LIBCUDACXX_STD_VER > 17
     typedef size_type                                      __remove_return_type;
 #else
     typedef void                                           __remove_return_type;
 #endif
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     list()
         _NOEXCEPT_(is_nothrow_default_constructible<__node_allocator>::value)
     {
-        _VSTD::__debug_db_insert_c(this);
+        _CUDA_VSTD::__debug_db_insert_c(this);
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit list(const allocator_type& __a) : base(__a)
     {
-        _VSTD::__debug_db_insert_c(this);
+        _CUDA_VSTD::__debug_db_insert_c(this);
     }
     explicit list(size_type __n);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
     explicit list(size_type __n, const allocator_type& __a);
 #endif
     list(size_type __n, const value_type& __x);
     template <class = __enable_if_t<__is_allocator<_Alloc>::value> >
     list(size_type __n, const value_type& __x, const allocator_type& __a) : base(__a)
     {
-        _VSTD::__debug_db_insert_c(this);
+        _CUDA_VSTD::__debug_db_insert_c(this);
         for (; __n > 0; --__n)
             push_back(__x);
     }
@@ -878,121 +878,121 @@ public:
 
     list(const list& __c);
     list(const list& __c, const __type_identity_t<allocator_type>& __a);
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     list& operator=(const list& __c);
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
     list(initializer_list<value_type> __il);
     list(initializer_list<value_type> __il, const allocator_type& __a);
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     list(list&& __c)
         _NOEXCEPT_(is_nothrow_move_constructible<__node_allocator>::value);
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     list(list&& __c, const __type_identity_t<allocator_type>& __a);
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     list& operator=(list&& __c)
         _NOEXCEPT_(
             __node_alloc_traits::propagate_on_container_move_assignment::value &&
             is_nothrow_move_assignable<__node_allocator>::value);
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     list& operator=(initializer_list<value_type> __il)
         {assign(__il.begin(), __il.end()); return *this;}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void assign(initializer_list<value_type> __il)
         {assign(__il.begin(), __il.end());}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
     template <class _InpIter>
         void assign(_InpIter __f, _InpIter __l,
                     __enable_if_t<__is_cpp17_input_iterator<_InpIter>::value>* = 0);
     void assign(size_type __n, const value_type& __x);
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     allocator_type get_allocator() const _NOEXCEPT;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type size() const _NOEXCEPT     {return base::__sz();}
-    _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_NODISCARD_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY
     bool empty() const _NOEXCEPT         {return base::empty();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type max_size() const _NOEXCEPT
         {
-            return _VSTD::min<size_type>(
+            return _CUDA_VSTD::min<size_type>(
                 base::__node_alloc_max_size(),
                 numeric_limits<
diff erence_type >::max());
         }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
           iterator begin() _NOEXCEPT        {return base::begin();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator begin()  const _NOEXCEPT {return base::begin();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
           iterator end() _NOEXCEPT          {return base::end();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator end()    const _NOEXCEPT {return base::end();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator cbegin() const _NOEXCEPT {return base::begin();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator cend()   const _NOEXCEPT {return base::end();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
           reverse_iterator rbegin() _NOEXCEPT
             {return       reverse_iterator(end());}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_reverse_iterator rbegin()  const _NOEXCEPT
         {return const_reverse_iterator(end());}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
           reverse_iterator rend() _NOEXCEPT
             {return       reverse_iterator(begin());}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_reverse_iterator rend()    const _NOEXCEPT
         {return const_reverse_iterator(begin());}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_reverse_iterator crbegin() const _NOEXCEPT
         {return const_reverse_iterator(end());}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_reverse_iterator crend()   const _NOEXCEPT
         {return const_reverse_iterator(begin());}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     reference front()
     {
-        _LIBCPP_ASSERT(!empty(), "list::front called on empty list");
+        _LIBCUDACXX_ASSERT(!empty(), "list::front called on empty list");
         return base::__end_.__next_->__as_node()->__value_;
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_reference front() const
     {
-        _LIBCPP_ASSERT(!empty(), "list::front called on empty list");
+        _LIBCUDACXX_ASSERT(!empty(), "list::front called on empty list");
         return base::__end_.__next_->__as_node()->__value_;
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     reference back()
     {
-        _LIBCPP_ASSERT(!empty(), "list::back called on empty list");
+        _LIBCUDACXX_ASSERT(!empty(), "list::back called on empty list");
         return base::__end_.__prev_->__as_node()->__value_;
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_reference back() const
     {
-        _LIBCPP_ASSERT(!empty(), "list::back called on empty list");
+        _LIBCUDACXX_ASSERT(!empty(), "list::back called on empty list");
         return base::__end_.__prev_->__as_node()->__value_;
     }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
     void push_front(value_type&& __x);
     void push_back(value_type&& __x);
 
     template <class... _Args>
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
        reference emplace_front(_Args&&... __args);
 #else
        void      emplace_front(_Args&&... __args);
 #endif
     template <class... _Args>
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
         reference emplace_back(_Args&&... __args);
 #else
        void       emplace_back(_Args&&... __args);
@@ -1002,20 +1002,20 @@ public:
 
     iterator insert(const_iterator __p, value_type&& __x);
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator insert(const_iterator __p, initializer_list<value_type> __il)
         {return insert(__p, __il.begin(), __il.end());}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
     void push_front(const value_type& __x);
     void push_back(const value_type& __x);
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
     template <class _Arg>
-    _LIBCPP_INLINE_VISIBILITY
-    void __emplace_back(_Arg&& __arg) { emplace_back(_VSTD::forward<_Arg>(__arg)); }
+    _LIBCUDACXX_INLINE_VISIBILITY
+    void __emplace_back(_Arg&& __arg) { emplace_back(_CUDA_VSTD::forward<_Arg>(__arg)); }
 #else
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __emplace_back(value_type const& __arg) { push_back(__arg); }
 #endif
 
@@ -1025,16 +1025,16 @@ public:
         iterator insert(const_iterator __p, _InpIter __f, _InpIter __l,
                         __enable_if_t<__is_cpp17_input_iterator<_InpIter>::value>* = 0);
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void swap(list& __c)
-#if _LIBCPP_STD_VER >= 14
+#if _LIBCUDACXX_STD_VER >= 14
         _NOEXCEPT
 #else
         _NOEXCEPT_(!__node_alloc_traits::propagate_on_container_swap::value ||
                    __is_nothrow_swappable<__node_allocator>::value)
 #endif
         {base::swap(__c);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void clear() _NOEXCEPT {base::clear();}
 
     void pop_front();
@@ -1047,13 +1047,13 @@ public:
     void resize(size_type __n, const value_type& __x);
 
     void splice(const_iterator __p, list& __c);
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     void splice(const_iterator __p, list&& __c) {splice(__p, __c);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void splice(const_iterator __p, list&& __c, const_iterator __i)
         {splice(__p, __c, __i);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void splice(const_iterator __p, list&& __c, const_iterator __f, const_iterator __l)
         {splice(__p, __c, __f, __l);}
 #endif
@@ -1062,27 +1062,27 @@ public:
 
     __remove_return_type remove(const value_type& __x);
     template <class _Pred> __remove_return_type remove_if(_Pred __pred);
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __remove_return_type unique() { return unique(__equal_to<value_type>()); }
     template <class _BinaryPred>
         __remove_return_type unique(_BinaryPred __binary_pred);
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void merge(list& __c);
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     void merge(list&& __c) {merge(__c);}
 
     template <class _Comp>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
         void merge(list&& __c, _Comp __comp) {merge(__c, __comp);}
 #endif
     template <class _Comp>
         void merge(list& __c, _Comp __comp);
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void sort();
     template <class _Comp>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         void sort(_Comp __comp);
 
     void reverse() _NOEXCEPT;
@@ -1092,28 +1092,28 @@ public:
     typedef __allocator_destructor<__node_allocator> __node_destructor;
     typedef unique_ptr<__node, __node_destructor> __hold_pointer;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __hold_pointer __allocate_node(__node_allocator& __na) {
       __node_pointer __p = __node_alloc_traits::allocate(__na, 1);
       __p->__prev_ = nullptr;
       return __hold_pointer(__p, __node_destructor(__na, 1));
     }
 
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
+#ifdef _LIBCUDACXX_ENABLE_DEBUG_MODE
 
     bool __dereferenceable(const const_iterator* __i) const;
     bool __decrementable(const const_iterator* __i) const;
     bool __addable(const const_iterator* __i, ptr
diff _t __n) const;
     bool __subscriptable(const const_iterator* __i, ptr
diff _t __n) const;
 
-#endif // _LIBCPP_ENABLE_DEBUG_MODE
+#endif // _LIBCUDACXX_ENABLE_DEBUG_MODE
 
 private:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     static void __link_nodes  (__link_pointer __p, __link_pointer __f, __link_pointer __l);
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __link_nodes_at_front(__link_pointer __f, __link_pointer __l);
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __link_nodes_at_back (__link_pointer __f, __link_pointer __l);
     iterator __iterator(size_type __n);
     template <class _Comp>
@@ -1124,7 +1124,7 @@ private:
     void __move_assign(list& __c, false_type);
 };
 
-#if _LIBCPP_STD_VER >= 17
+#if _LIBCUDACXX_STD_VER >= 17
 template<class _InputIterator,
          class _Alloc = allocator<__iter_value_type<_InputIterator>>,
          class = enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>,
@@ -1184,27 +1184,27 @@ inline
 typename list<_Tp, _Alloc>::iterator
 list<_Tp, _Alloc>::__iterator(size_type __n)
 {
-    return __n <= base::__sz() / 2 ? _VSTD::next(begin(), __n)
-                                   : _VSTD::prev(end(), base::__sz() - __n);
+    return __n <= base::__sz() / 2 ? _CUDA_VSTD::next(begin(), __n)
+                                   : _CUDA_VSTD::prev(end(), base::__sz() - __n);
 }
 
 template <class _Tp, class _Alloc>
 list<_Tp, _Alloc>::list(size_type __n)
 {
-    _VSTD::__debug_db_insert_c(this);
+    _CUDA_VSTD::__debug_db_insert_c(this);
     for (; __n > 0; --__n)
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
         emplace_back();
 #else
         push_back(value_type());
 #endif
 }
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <class _Tp, class _Alloc>
 list<_Tp, _Alloc>::list(size_type __n, const allocator_type& __a) : base(__a)
 {
-    _VSTD::__debug_db_insert_c(this);
+    _CUDA_VSTD::__debug_db_insert_c(this);
     for (; __n > 0; --__n)
         emplace_back();
 }
@@ -1213,7 +1213,7 @@ list<_Tp, _Alloc>::list(size_type __n, const allocator_type& __a) : base(__a)
 template <class _Tp, class _Alloc>
 list<_Tp, _Alloc>::list(size_type __n, const value_type& __x)
 {
-    _VSTD::__debug_db_insert_c(this);
+    _CUDA_VSTD::__debug_db_insert_c(this);
     for (; __n > 0; --__n)
         push_back(__x);
 }
@@ -1223,7 +1223,7 @@ template <class _InpIter>
 list<_Tp, _Alloc>::list(_InpIter __f, _InpIter __l,
                         __enable_if_t<__is_cpp17_input_iterator<_InpIter>::value>*)
 {
-    _VSTD::__debug_db_insert_c(this);
+    _CUDA_VSTD::__debug_db_insert_c(this);
     for (; __f != __l; ++__f)
         __emplace_back(*__f);
 }
@@ -1234,7 +1234,7 @@ list<_Tp, _Alloc>::list(_InpIter __f, _InpIter __l, const allocator_type& __a,
                         __enable_if_t<__is_cpp17_input_iterator<_InpIter>::value>*)
     : base(__a)
 {
-    _VSTD::__debug_db_insert_c(this);
+    _CUDA_VSTD::__debug_db_insert_c(this);
     for (; __f != __l; ++__f)
         __emplace_back(*__f);
 }
@@ -1243,7 +1243,7 @@ template <class _Tp, class _Alloc>
 list<_Tp, _Alloc>::list(const list& __c)
     : base(__node_alloc_traits::select_on_container_copy_construction(
           __c.__node_alloc())) {
-    _VSTD::__debug_db_insert_c(this);
+    _CUDA_VSTD::__debug_db_insert_c(this);
     for (const_iterator __i = __c.begin(), __e = __c.end(); __i != __e; ++__i)
         push_back(*__i);
 }
@@ -1252,18 +1252,18 @@ template <class _Tp, class _Alloc>
 list<_Tp, _Alloc>::list(const list& __c, const __type_identity_t<allocator_type>& __a)
     : base(__a)
 {
-    _VSTD::__debug_db_insert_c(this);
+    _CUDA_VSTD::__debug_db_insert_c(this);
     for (const_iterator __i = __c.begin(), __e = __c.end(); __i != __e; ++__i)
         push_back(*__i);
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
 template <class _Tp, class _Alloc>
 list<_Tp, _Alloc>::list(initializer_list<value_type> __il, const allocator_type& __a)
     : base(__a)
 {
-    _VSTD::__debug_db_insert_c(this);
+    _CUDA_VSTD::__debug_db_insert_c(this);
     for (typename initializer_list<value_type>::const_iterator __i = __il.begin(),
             __e = __il.end(); __i != __e; ++__i)
         push_back(*__i);
@@ -1272,7 +1272,7 @@ list<_Tp, _Alloc>::list(initializer_list<value_type> __il, const allocator_type&
 template <class _Tp, class _Alloc>
 list<_Tp, _Alloc>::list(initializer_list<value_type> __il)
 {
-    _VSTD::__debug_db_insert_c(this);
+    _CUDA_VSTD::__debug_db_insert_c(this);
     for (typename initializer_list<value_type>::const_iterator __i = __il.begin(),
             __e = __il.end(); __i != __e; ++__i)
         push_back(*__i);
@@ -1281,8 +1281,8 @@ list<_Tp, _Alloc>::list(initializer_list<value_type> __il)
 template <class _Tp, class _Alloc>
 inline list<_Tp, _Alloc>::list(list&& __c)
         _NOEXCEPT_(is_nothrow_move_constructible<__node_allocator>::value)
-        : base(_VSTD::move(__c.__node_alloc())) {
-    _VSTD::__debug_db_insert_c(this);
+        : base(_CUDA_VSTD::move(__c.__node_alloc())) {
+    _CUDA_VSTD::__debug_db_insert_c(this);
     splice(end(), __c);
 }
 
@@ -1291,7 +1291,7 @@ inline
 list<_Tp, _Alloc>::list(list&& __c, const __type_identity_t<allocator_type>& __a)
     : base(__a)
 {
-    _VSTD::__debug_db_insert_c(this);
+    _CUDA_VSTD::__debug_db_insert_c(this);
     if (__a == __c.get_allocator())
         splice(end(), __c);
     else
@@ -1337,14 +1337,14 @@ list<_Tp, _Alloc>::__move_assign(list& __c, true_type)
     splice(end(), __c);
 }
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
 template <class _Tp, class _Alloc>
 inline
 list<_Tp, _Alloc>&
 list<_Tp, _Alloc>::operator=(const list& __c)
 {
-    if (this != _VSTD::addressof(__c))
+    if (this != _CUDA_VSTD::addressof(__c))
     {
         base::__copy_assign_alloc(__c);
         assign(__c.begin(), __c.end());
@@ -1396,11 +1396,11 @@ template <class _Tp, class _Alloc>
 typename list<_Tp, _Alloc>::iterator
 list<_Tp, _Alloc>::insert(const_iterator __p, const value_type& __x)
 {
-    _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__p)) == this,
+    _LIBCUDACXX_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_CUDA_VSTD::addressof(__p)) == this,
                          "list::insert(iterator, x) called with an iterator not referring to this list");
     __node_allocator& __na = base::__node_alloc();
     __hold_pointer __hold = __allocate_node(__na);
-    __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
+    __node_alloc_traits::construct(__na, _CUDA_VSTD::addressof(__hold->__value_), __x);
     __link_nodes(__p.__ptr_, __hold->__as_link(), __hold->__as_link());
     ++base::__sz();
     return iterator(__hold.release()->__as_link(), this);
@@ -1410,7 +1410,7 @@ template <class _Tp, class _Alloc>
 typename list<_Tp, _Alloc>::iterator
 list<_Tp, _Alloc>::insert(const_iterator __p, size_type __n, const value_type& __x)
 {
-    _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__p)) == this,
+    _LIBCUDACXX_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_CUDA_VSTD::addressof(__p)) == this,
                          "list::insert(iterator, n, x) called with an iterator not referring to this list");
     iterator __r(__p.__ptr_, this);
     if (__n > 0)
@@ -1418,30 +1418,30 @@ list<_Tp, _Alloc>::insert(const_iterator __p, size_type __n, const value_type& _
         size_type __ds = 0;
         __node_allocator& __na = base::__node_alloc();
         __hold_pointer __hold = __allocate_node(__na);
-        __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
+        __node_alloc_traits::construct(__na, _CUDA_VSTD::addressof(__hold->__value_), __x);
         ++__ds;
         __r = iterator(__hold->__as_link(), this);
         __hold.release();
         iterator __e = __r;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         try
         {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
             for (--__n; __n != 0; --__n, (void) ++__e, ++__ds)
             {
                 __hold.reset(__node_alloc_traits::allocate(__na, 1));
-                __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
+                __node_alloc_traits::construct(__na, _CUDA_VSTD::addressof(__hold->__value_), __x);
                 __e.__ptr_->__next_ = __hold->__as_link();
                 __hold->__prev_ = __e.__ptr_;
                 __hold.release();
             }
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         }
         catch (...)
         {
             while (true)
             {
-                __node_alloc_traits::destroy(__na, _VSTD::addressof(*__e));
+                __node_alloc_traits::destroy(__na, _CUDA_VSTD::addressof(*__e));
                 __link_pointer __prev = __e.__ptr_->__prev_;
                 __node_alloc_traits::deallocate(__na, __e.__ptr_->__as_node(), 1);
                 if (__prev == 0)
@@ -1450,7 +1450,7 @@ list<_Tp, _Alloc>::insert(const_iterator __p, size_type __n, const value_type& _
             }
             throw;
         }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
         __link_nodes(__p.__ptr_, __r.__ptr_, __e.__ptr_);
         base::__sz() += __ds;
     }
@@ -1463,7 +1463,7 @@ typename list<_Tp, _Alloc>::iterator
 list<_Tp, _Alloc>::insert(const_iterator __p, _InpIter __f, _InpIter __l,
                           __enable_if_t<__is_cpp17_input_iterator<_InpIter>::value>*)
 {
-    _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__p)) == this,
+    _LIBCUDACXX_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_CUDA_VSTD::addressof(__p)) == this,
                          "list::insert(iterator, range) called with an iterator not referring to this list");
     iterator __r(__p.__ptr_, this);
     if (__f != __l)
@@ -1471,30 +1471,30 @@ list<_Tp, _Alloc>::insert(const_iterator __p, _InpIter __f, _InpIter __l,
         size_type __ds = 0;
         __node_allocator& __na = base::__node_alloc();
         __hold_pointer __hold = __allocate_node(__na);
-        __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), *__f);
+        __node_alloc_traits::construct(__na, _CUDA_VSTD::addressof(__hold->__value_), *__f);
         ++__ds;
         __r = iterator(__hold.get()->__as_link(), this);
         __hold.release();
         iterator __e = __r;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         try
         {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
             for (++__f; __f != __l; ++__f, (void) ++__e, ++__ds)
             {
                 __hold.reset(__node_alloc_traits::allocate(__na, 1));
-                __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), *__f);
+                __node_alloc_traits::construct(__na, _CUDA_VSTD::addressof(__hold->__value_), *__f);
                 __e.__ptr_->__next_ = __hold.get()->__as_link();
                 __hold->__prev_ = __e.__ptr_;
                 __hold.release();
             }
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         }
         catch (...)
         {
             while (true)
             {
-                __node_alloc_traits::destroy(__na, _VSTD::addressof(*__e));
+                __node_alloc_traits::destroy(__na, _CUDA_VSTD::addressof(*__e));
                 __link_pointer __prev = __e.__ptr_->__prev_;
                 __node_alloc_traits::deallocate(__na, __e.__ptr_->__as_node(), 1);
                 if (__prev == 0)
@@ -1503,7 +1503,7 @@ list<_Tp, _Alloc>::insert(const_iterator __p, _InpIter __f, _InpIter __l,
             }
             throw;
         }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
         __link_nodes(__p.__ptr_, __r.__ptr_, __e.__ptr_);
         base::__sz() += __ds;
     }
@@ -1516,7 +1516,7 @@ list<_Tp, _Alloc>::push_front(const value_type& __x)
 {
     __node_allocator& __na = base::__node_alloc();
     __hold_pointer __hold = __allocate_node(__na);
-    __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
+    __node_alloc_traits::construct(__na, _CUDA_VSTD::addressof(__hold->__value_), __x);
     __link_pointer __nl = __hold->__as_link();
     __link_nodes_at_front(__nl, __nl);
     ++base::__sz();
@@ -1529,13 +1529,13 @@ list<_Tp, _Alloc>::push_back(const value_type& __x)
 {
     __node_allocator& __na = base::__node_alloc();
     __hold_pointer __hold = __allocate_node(__na);
-    __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
+    __node_alloc_traits::construct(__na, _CUDA_VSTD::addressof(__hold->__value_), __x);
     __link_nodes_at_back(__hold.get()->__as_link(), __hold.get()->__as_link());
     ++base::__sz();
     __hold.release();
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
 template <class _Tp, class _Alloc>
 void
@@ -1543,7 +1543,7 @@ list<_Tp, _Alloc>::push_front(value_type&& __x)
 {
     __node_allocator& __na = base::__node_alloc();
     __hold_pointer __hold = __allocate_node(__na);
-    __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::move(__x));
+    __node_alloc_traits::construct(__na, _CUDA_VSTD::addressof(__hold->__value_), _CUDA_VSTD::move(__x));
     __link_nodes_at_front(__hold.get()->__as_link(), __hold.get()->__as_link());
     ++base::__sz();
     __hold.release();
@@ -1555,7 +1555,7 @@ list<_Tp, _Alloc>::push_back(value_type&& __x)
 {
     __node_allocator& __na = base::__node_alloc();
     __hold_pointer __hold = __allocate_node(__na);
-    __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::move(__x));
+    __node_alloc_traits::construct(__na, _CUDA_VSTD::addressof(__hold->__value_), _CUDA_VSTD::move(__x));
     __link_nodes_at_back(__hold.get()->__as_link(), __hold.get()->__as_link());
     ++base::__sz();
     __hold.release();
@@ -1563,7 +1563,7 @@ list<_Tp, _Alloc>::push_back(value_type&& __x)
 
 template <class _Tp, class _Alloc>
 template <class... _Args>
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 typename list<_Tp, _Alloc>::reference
 #else
 void
@@ -1572,10 +1572,10 @@ list<_Tp, _Alloc>::emplace_front(_Args&&... __args)
 {
     __node_allocator& __na = base::__node_alloc();
     __hold_pointer __hold = __allocate_node(__na);
-    __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::forward<_Args>(__args)...);
+    __node_alloc_traits::construct(__na, _CUDA_VSTD::addressof(__hold->__value_), _CUDA_VSTD::forward<_Args>(__args)...);
     __link_nodes_at_front(__hold.get()->__as_link(), __hold.get()->__as_link());
     ++base::__sz();
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
     return __hold.release()->__value_;
 #else
     __hold.release();
@@ -1584,7 +1584,7 @@ list<_Tp, _Alloc>::emplace_front(_Args&&... __args)
 
 template <class _Tp, class _Alloc>
 template <class... _Args>
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 typename list<_Tp, _Alloc>::reference
 #else
 void
@@ -1593,11 +1593,11 @@ list<_Tp, _Alloc>::emplace_back(_Args&&... __args)
 {
     __node_allocator& __na = base::__node_alloc();
     __hold_pointer __hold = __allocate_node(__na);
-    __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::forward<_Args>(__args)...);
+    __node_alloc_traits::construct(__na, _CUDA_VSTD::addressof(__hold->__value_), _CUDA_VSTD::forward<_Args>(__args)...);
     __link_pointer __nl = __hold->__as_link();
     __link_nodes_at_back(__nl, __nl);
     ++base::__sz();
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
     return __hold.release()->__value_;
 #else
     __hold.release();
@@ -1609,11 +1609,11 @@ template <class... _Args>
 typename list<_Tp, _Alloc>::iterator
 list<_Tp, _Alloc>::emplace(const_iterator __p, _Args&&... __args)
 {
-    _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__p)) == this,
+    _LIBCUDACXX_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_CUDA_VSTD::addressof(__p)) == this,
                          "list::emplace(iterator, args...) called with an iterator not referring to this list");
     __node_allocator& __na = base::__node_alloc();
     __hold_pointer __hold = __allocate_node(__na);
-    __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::forward<_Args>(__args)...);
+    __node_alloc_traits::construct(__na, _CUDA_VSTD::addressof(__hold->__value_), _CUDA_VSTD::forward<_Args>(__args)...);
     __link_pointer __nl = __hold.get()->__as_link();
     __link_nodes(__p.__ptr_, __nl, __nl);
     ++base::__sz();
@@ -1625,11 +1625,11 @@ template <class _Tp, class _Alloc>
 typename list<_Tp, _Alloc>::iterator
 list<_Tp, _Alloc>::insert(const_iterator __p, value_type&& __x)
 {
-    _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__p)) == this,
+    _LIBCUDACXX_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_CUDA_VSTD::addressof(__p)) == this,
                          "list::insert(iterator, x) called with an iterator not referring to this list");
     __node_allocator& __na = base::__node_alloc();
     __hold_pointer __hold = __allocate_node(__na);
-    __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::move(__x));
+    __node_alloc_traits::construct(__na, _CUDA_VSTD::addressof(__hold->__value_), _CUDA_VSTD::move(__x));
     __link_pointer __nl = __hold->__as_link();
     __link_nodes(__p.__ptr_, __nl, __nl);
     ++base::__sz();
@@ -1637,18 +1637,18 @@ list<_Tp, _Alloc>::insert(const_iterator __p, value_type&& __x)
     return iterator(__nl, this);
 }
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
 template <class _Tp, class _Alloc>
 void
 list<_Tp, _Alloc>::pop_front()
 {
-    _LIBCPP_ASSERT(!empty(), "list::pop_front() called with empty list");
+    _LIBCUDACXX_ASSERT(!empty(), "list::pop_front() called with empty list");
     __node_allocator& __na = base::__node_alloc();
     __link_pointer __n = base::__end_.__next_;
     base::__unlink_nodes(__n, __n);
     --base::__sz();
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
+#ifdef _LIBCUDACXX_ENABLE_DEBUG_MODE
     __c_node* __c = __get_db()->__find_c_and_lock(this);
     for (__i_node** __p = __c->end_; __p != __c->beg_; )
     {
@@ -1658,13 +1658,13 @@ list<_Tp, _Alloc>::pop_front()
         {
             (*__p)->__c_ = nullptr;
             if (--__c->end_ != __p)
-                _VSTD::memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));
+                _CUDA_VSTD::memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));
         }
     }
     __get_db()->unlock();
 #endif
     __node_pointer __np = __n->__as_node();
-    __node_alloc_traits::destroy(__na, _VSTD::addressof(__np->__value_));
+    __node_alloc_traits::destroy(__na, _CUDA_VSTD::addressof(__np->__value_));
     __node_alloc_traits::deallocate(__na, __np, 1);
 }
 
@@ -1672,12 +1672,12 @@ template <class _Tp, class _Alloc>
 void
 list<_Tp, _Alloc>::pop_back()
 {
-    _LIBCPP_ASSERT(!empty(), "list::pop_back() called on an empty list");
+    _LIBCUDACXX_ASSERT(!empty(), "list::pop_back() called on an empty list");
     __node_allocator& __na = base::__node_alloc();
     __link_pointer __n = base::__end_.__prev_;
     base::__unlink_nodes(__n, __n);
     --base::__sz();
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
+#ifdef _LIBCUDACXX_ENABLE_DEBUG_MODE
     __c_node* __c = __get_db()->__find_c_and_lock(this);
     for (__i_node** __p = __c->end_; __p != __c->beg_; )
     {
@@ -1687,13 +1687,13 @@ list<_Tp, _Alloc>::pop_back()
         {
             (*__p)->__c_ = nullptr;
             if (--__c->end_ != __p)
-                _VSTD::memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));
+                _CUDA_VSTD::memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));
         }
     }
     __get_db()->unlock();
 #endif
     __node_pointer __np = __n->__as_node();
-    __node_alloc_traits::destroy(__na, _VSTD::addressof(__np->__value_));
+    __node_alloc_traits::destroy(__na, _CUDA_VSTD::addressof(__np->__value_));
     __node_alloc_traits::deallocate(__na, __np, 1);
 }
 
@@ -1701,16 +1701,16 @@ template <class _Tp, class _Alloc>
 typename list<_Tp, _Alloc>::iterator
 list<_Tp, _Alloc>::erase(const_iterator __p)
 {
-    _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__p)) == this,
+    _LIBCUDACXX_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_CUDA_VSTD::addressof(__p)) == this,
                          "list::erase(iterator) called with an iterator not referring to this list");
-    _LIBCPP_ASSERT(__p != end(),
+    _LIBCUDACXX_ASSERT(__p != end(),
         "list::erase(iterator) called with a non-dereferenceable iterator");
     __node_allocator& __na = base::__node_alloc();
     __link_pointer __n = __p.__ptr_;
     __link_pointer __r = __n->__next_;
     base::__unlink_nodes(__n, __n);
     --base::__sz();
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
+#ifdef _LIBCUDACXX_ENABLE_DEBUG_MODE
     __c_node* __c = __get_db()->__find_c_and_lock(this);
     for (__i_node** __ip = __c->end_; __ip != __c->beg_; )
     {
@@ -1720,13 +1720,13 @@ list<_Tp, _Alloc>::erase(const_iterator __p)
         {
             (*__ip)->__c_ = nullptr;
             if (--__c->end_ != __ip)
-                _VSTD::memmove(__ip, __ip+1, (__c->end_ - __ip)*sizeof(__i_node*));
+                _CUDA_VSTD::memmove(__ip, __ip+1, (__c->end_ - __ip)*sizeof(__i_node*));
         }
     }
     __get_db()->unlock();
 #endif
     __node_pointer __np = __n->__as_node();
-    __node_alloc_traits::destroy(__na, _VSTD::addressof(__np->__value_));
+    __node_alloc_traits::destroy(__na, _CUDA_VSTD::addressof(__np->__value_));
     __node_alloc_traits::deallocate(__na, __np, 1);
     return iterator(__r, this);
 }
@@ -1735,9 +1735,9 @@ template <class _Tp, class _Alloc>
 typename list<_Tp, _Alloc>::iterator
 list<_Tp, _Alloc>::erase(const_iterator __f, const_iterator __l)
 {
-    _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__f)) == this,
+    _LIBCUDACXX_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_CUDA_VSTD::addressof(__f)) == this,
                          "list::erase(iterator, iterator) called with an iterator not referring to this list");
-    _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__l)) == this,
+    _LIBCUDACXX_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_CUDA_VSTD::addressof(__l)) == this,
                          "list::erase(iterator, iterator) called with an iterator not referring to this list");
     if (__f != __l)
     {
@@ -1748,7 +1748,7 @@ list<_Tp, _Alloc>::erase(const_iterator __f, const_iterator __l)
             __link_pointer __n = __f.__ptr_;
             ++__f;
             --base::__sz();
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
+#ifdef _LIBCUDACXX_ENABLE_DEBUG_MODE
             __c_node* __c = __get_db()->__find_c_and_lock(this);
             for (__i_node** __p = __c->end_; __p != __c->beg_; )
             {
@@ -1758,13 +1758,13 @@ list<_Tp, _Alloc>::erase(const_iterator __f, const_iterator __l)
                 {
                     (*__p)->__c_ = nullptr;
                     if (--__c->end_ != __p)
-                        _VSTD::memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));
+                        _CUDA_VSTD::memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));
                 }
             }
             __get_db()->unlock();
 #endif
             __node_pointer __np = __n->__as_node();
-            __node_alloc_traits::destroy(__na, _VSTD::addressof(__np->__value_));
+            __node_alloc_traits::destroy(__na, _CUDA_VSTD::addressof(__np->__value_));
             __node_alloc_traits::deallocate(__na, __np, 1);
         }
     }
@@ -1783,29 +1783,29 @@ list<_Tp, _Alloc>::resize(size_type __n)
         size_type __ds = 0;
         __node_allocator& __na = base::__node_alloc();
         __hold_pointer __hold = __allocate_node(__na);
-        __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_));
+        __node_alloc_traits::construct(__na, _CUDA_VSTD::addressof(__hold->__value_));
         ++__ds;
         iterator __r = iterator(__hold.release()->__as_link(), this);
         iterator __e = __r;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         try
         {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
             for (--__n; __n != 0; --__n, (void) ++__e, ++__ds)
             {
                 __hold.reset(__node_alloc_traits::allocate(__na, 1));
-                __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_));
+                __node_alloc_traits::construct(__na, _CUDA_VSTD::addressof(__hold->__value_));
                 __e.__ptr_->__next_ = __hold.get()->__as_link();
                 __hold->__prev_ = __e.__ptr_;
                 __hold.release();
             }
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         }
         catch (...)
         {
             while (true)
             {
-                __node_alloc_traits::destroy(__na, _VSTD::addressof(*__e));
+                __node_alloc_traits::destroy(__na, _CUDA_VSTD::addressof(*__e));
                 __link_pointer __prev = __e.__ptr_->__prev_;
                 __node_alloc_traits::deallocate(__na, __e.__ptr_->__as_node(), 1);
                 if (__prev == 0)
@@ -1814,7 +1814,7 @@ list<_Tp, _Alloc>::resize(size_type __n)
             }
             throw;
         }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
         __link_nodes_at_back(__r.__ptr_, __e.__ptr_);
         base::__sz() += __ds;
     }
@@ -1832,30 +1832,30 @@ list<_Tp, _Alloc>::resize(size_type __n, const value_type& __x)
         size_type __ds = 0;
         __node_allocator& __na = base::__node_alloc();
         __hold_pointer __hold = __allocate_node(__na);
-        __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
+        __node_alloc_traits::construct(__na, _CUDA_VSTD::addressof(__hold->__value_), __x);
         ++__ds;
         __link_pointer __nl = __hold.release()->__as_link();
         iterator __r = iterator(__nl, this);
         iterator __e = __r;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         try
         {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
             for (--__n; __n != 0; --__n, (void) ++__e, ++__ds)
             {
                 __hold.reset(__node_alloc_traits::allocate(__na, 1));
-                __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
+                __node_alloc_traits::construct(__na, _CUDA_VSTD::addressof(__hold->__value_), __x);
                 __e.__ptr_->__next_ = __hold.get()->__as_link();
                 __hold->__prev_ = __e.__ptr_;
                 __hold.release();
             }
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         }
         catch (...)
         {
             while (true)
             {
-                __node_alloc_traits::destroy(__na, _VSTD::addressof(*__e));
+                __node_alloc_traits::destroy(__na, _CUDA_VSTD::addressof(*__e));
                 __link_pointer __prev = __e.__ptr_->__prev_;
                 __node_alloc_traits::deallocate(__na, __e.__ptr_->__as_node(), 1);
                 if (__prev == 0)
@@ -1864,7 +1864,7 @@ list<_Tp, _Alloc>::resize(size_type __n, const value_type& __x)
             }
             throw;
         }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
         __link_nodes(base::__end_as_link(), __r.__ptr_, __e.__ptr_);
         base::__sz() += __ds;
     }
@@ -1874,9 +1874,9 @@ template <class _Tp, class _Alloc>
 void
 list<_Tp, _Alloc>::splice(const_iterator __p, list& __c)
 {
-    _LIBCPP_ASSERT(this != _VSTD::addressof(__c),
+    _LIBCUDACXX_ASSERT(this != _CUDA_VSTD::addressof(__c),
                    "list::splice(iterator, list) called with this == &list");
-    _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__p)) == this,
+    _LIBCUDACXX_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_CUDA_VSTD::addressof(__p)) == this,
                          "list::splice(iterator, list) called with an iterator not referring to this list");
     if (!__c.empty())
     {
@@ -1886,11 +1886,11 @@ list<_Tp, _Alloc>::splice(const_iterator __p, list& __c)
         __link_nodes(__p.__ptr_, __f, __l);
         base::__sz() += __c.__sz();
         __c.__sz() = 0;
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
-        if (_VSTD::addressof(__c) != this) {
-            __libcpp_db* __db = __get_db();
+#ifdef _LIBCUDACXX_ENABLE_DEBUG_MODE
+        if (_CUDA_VSTD::addressof(__c) != this) {
+            __LIBCUDACXX_db* __db = __get_db();
             __c_node* __cn1 = __db->__find_c_and_lock(this);
-            __c_node* __cn2 = __db->__find_c(_VSTD::addressof(__c));
+            __c_node* __cn2 = __db->__find_c(_CUDA_VSTD::addressof(__c));
             for (__i_node** __ip = __cn2->end_; __ip != __cn2->beg_;)
             {
                 --__ip;
@@ -1900,7 +1900,7 @@ list<_Tp, _Alloc>::splice(const_iterator __p, list& __c)
                     __cn1->__add(*__ip);
                     (*__ip)->__c_ = __cn1;
                     if (--__cn2->end_ != __ip)
-                        _VSTD::memmove(__ip, __ip+1, (__cn2->end_ - __ip)*sizeof(__i_node*));
+                        _CUDA_VSTD::memmove(__ip, __ip+1, (__cn2->end_ - __ip)*sizeof(__i_node*));
                 }
             }
             __db->unlock();
@@ -1913,11 +1913,11 @@ template <class _Tp, class _Alloc>
 void
 list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __i)
 {
-    _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__p)) == this,
+    _LIBCUDACXX_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_CUDA_VSTD::addressof(__p)) == this,
         "list::splice(iterator, list, iterator) called with the first iterator not referring to this list");
-    _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__i)) == _VSTD::addressof(__c),
+    _LIBCUDACXX_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_CUDA_VSTD::addressof(__i)) == _CUDA_VSTD::addressof(__c),
         "list::splice(iterator, list, iterator) called with the second iterator not referring to the list argument");
-    _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(_VSTD::addressof(__i)),
+    _LIBCUDACXX_DEBUG_ASSERT(__get_const_db()->__dereferenceable(_CUDA_VSTD::addressof(__i)),
         "list::splice(iterator, list, iterator) called with the second iterator not dereferenceable");
 
     if (__p.__ptr_ != __i.__ptr_ && __p.__ptr_ != __i.__ptr_->__next_)
@@ -1927,11 +1927,11 @@ list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __i)
         __link_nodes(__p.__ptr_, __f, __f);
         --__c.__sz();
         ++base::__sz();
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
-        if (_VSTD::addressof(__c) != this) {
-            __libcpp_db* __db = __get_db();
+#ifdef _LIBCUDACXX_ENABLE_DEBUG_MODE
+        if (_CUDA_VSTD::addressof(__c) != this) {
+            __LIBCUDACXX_db* __db = __get_db();
             __c_node* __cn1 = __db->__find_c_and_lock(this);
-            __c_node* __cn2 = __db->__find_c(_VSTD::addressof(__c));
+            __c_node* __cn2 = __db->__find_c(_CUDA_VSTD::addressof(__c));
             for (__i_node** __ip = __cn2->end_; __ip != __cn2->beg_;)
             {
                 --__ip;
@@ -1941,7 +1941,7 @@ list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __i)
                     __cn1->__add(*__ip);
                     (*__ip)->__c_ = __cn1;
                     if (--__cn2->end_ != __ip)
-                        _VSTD::memmove(__ip, __ip+1, (__cn2->end_ - __ip)*sizeof(__i_node*));
+                        _CUDA_VSTD::memmove(__ip, __ip+1, (__cn2->end_ - __ip)*sizeof(__i_node*));
                 }
             }
             __db->unlock();
@@ -1951,7 +1951,7 @@ list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __i)
 }
 
 template <class _Iterator>
-_LIBCPP_HIDE_FROM_ABI
+_LIBCUDACXX_HIDE_FROM_ABI
 bool __iterator_in_range(_Iterator __first, _Iterator __last, _Iterator __it) {
     for (_Iterator __p = __first; __p != __last; ++__p) {
         if (__p == __it) {
@@ -1965,13 +1965,13 @@ template <class _Tp, class _Alloc>
 void
 list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __f, const_iterator __l)
 {
-    _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__p)) == this,
+    _LIBCUDACXX_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_CUDA_VSTD::addressof(__p)) == this,
         "list::splice(iterator, list, iterator, iterator) called with first iterator not referring to this list");
-    _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__f)) == _VSTD::addressof(__c),
+    _LIBCUDACXX_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_CUDA_VSTD::addressof(__f)) == _CUDA_VSTD::addressof(__c),
         "list::splice(iterator, list, iterator, iterator) called with second iterator not referring to the list argument");
-    _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__l)) == _VSTD::addressof(__c),
+    _LIBCUDACXX_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_CUDA_VSTD::addressof(__l)) == _CUDA_VSTD::addressof(__c),
         "list::splice(iterator, list, iterator, iterator) called with third iterator not referring to the list argument");
-    _LIBCPP_DEBUG_ASSERT(this != std::addressof(__c) || !std::__iterator_in_range(__f, __l, __p),
+    _LIBCUDACXX_DEBUG_ASSERT(this != std::addressof(__c) || !std::__iterator_in_range(__f, __l, __p),
         "list::splice(iterator, list, iterator, iterator)"
         " called with the first iterator within the range of the second and third iterators");
 
@@ -1980,19 +1980,19 @@ list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __f, con
         __link_pointer __first = __f.__ptr_;
         --__l;
         __link_pointer __last = __l.__ptr_;
-        if (this != _VSTD::addressof(__c))
+        if (this != _CUDA_VSTD::addressof(__c))
         {
-            size_type __s = _VSTD::distance(__f, __l) + 1;
+            size_type __s = _CUDA_VSTD::distance(__f, __l) + 1;
             __c.__sz() -= __s;
             base::__sz() += __s;
         }
         base::__unlink_nodes(__first, __last);
         __link_nodes(__p.__ptr_, __first, __last);
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
-        if (_VSTD::addressof(__c) != this) {
-            __libcpp_db* __db = __get_db();
+#ifdef _LIBCUDACXX_ENABLE_DEBUG_MODE
+        if (_CUDA_VSTD::addressof(__c) != this) {
+            __LIBCUDACXX_db* __db = __get_db();
             __c_node* __cn1 = __db->__find_c_and_lock(this);
-            __c_node* __cn2 = __db->__find_c(_VSTD::addressof(__c));
+            __c_node* __cn2 = __db->__find_c(_CUDA_VSTD::addressof(__c));
             for (__i_node** __ip = __cn2->end_; __ip != __cn2->beg_;)
             {
                 --__ip;
@@ -2005,7 +2005,7 @@ list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __f, con
                         __cn1->__add(*__ip);
                         (*__ip)->__c_ = __cn1;
                         if (--__cn2->end_ != __ip)
-                            _VSTD::memmove(__ip, __ip+1, (__cn2->end_ - __ip)*sizeof(__i_node*));
+                            _CUDA_VSTD::memmove(__ip, __ip+1, (__cn2->end_ - __ip)*sizeof(__i_node*));
                     }
                 }
             }
@@ -2024,7 +2024,7 @@ list<_Tp, _Alloc>::remove(const value_type& __x)
     {
         if (*__i == __x)
         {
-            const_iterator __j = _VSTD::next(__i);
+            const_iterator __j = _CUDA_VSTD::next(__i);
             for (; __j != __e && *__j == __x; ++__j)
                 ;
             __deleted_nodes.splice(__deleted_nodes.end(), *this, __i, __j);
@@ -2049,7 +2049,7 @@ list<_Tp, _Alloc>::remove_if(_Pred __pred)
     {
         if (__pred(*__i))
         {
-            iterator __j = _VSTD::next(__i);
+            iterator __j = _CUDA_VSTD::next(__i);
             for (; __j != __e && __pred(*__j); ++__j)
                 ;
             __deleted_nodes.splice(__deleted_nodes.end(), *this, __i, __j);
@@ -2072,7 +2072,7 @@ list<_Tp, _Alloc>::unique(_BinaryPred __binary_pred)
     list<_Tp, _Alloc> __deleted_nodes(get_allocator()); // collect the nodes we're removing
     for (iterator __i = begin(), __e = end(); __i != __e;)
     {
-        iterator __j = _VSTD::next(__i);
+        iterator __j = _CUDA_VSTD::next(__i);
         for (; __j != __e && __binary_pred(*__i, *__j); ++__j)
             ;
         if (++__i != __j) {
@@ -2097,7 +2097,7 @@ template <class _Comp>
 void
 list<_Tp, _Alloc>::merge(list& __c, _Comp __comp)
 {
-    if (this != _VSTD::addressof(__c))
+    if (this != _CUDA_VSTD::addressof(__c))
     {
         iterator __f1 = begin();
         iterator __e1 = end();
@@ -2108,7 +2108,7 @@ list<_Tp, _Alloc>::merge(list& __c, _Comp __comp)
             if (__comp(*__f2, *__f1))
             {
                 size_type __ds = 1;
-                iterator __m2 = _VSTD::next(__f2);
+                iterator __m2 = _CUDA_VSTD::next(__f2);
                 for (; __m2 != __e2 && __comp(*__m2, *__f1); ++__m2, (void) ++__ds)
                     ;
                 base::__sz() += __ds;
@@ -2117,7 +2117,7 @@ list<_Tp, _Alloc>::merge(list& __c, _Comp __comp)
                 __link_pointer __l = __m2.__ptr_->__prev_;
                 __f2 = __m2;
                 base::__unlink_nodes(__f, __l);
-                __m2 = _VSTD::next(__f1);
+                __m2 = _CUDA_VSTD::next(__f1);
                 __link_nodes(__f1.__ptr_, __f, __l);
                 __f1 = __m2;
             }
@@ -2125,10 +2125,10 @@ list<_Tp, _Alloc>::merge(list& __c, _Comp __comp)
                 ++__f1;
         }
         splice(__e1, __c);
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
-        __libcpp_db* __db = __get_db();
+#ifdef _LIBCUDACXX_ENABLE_DEBUG_MODE
+        __LIBCUDACXX_db* __db = __get_db();
         __c_node* __cn1 = __db->__find_c_and_lock(this);
-        __c_node* __cn2 = __db->__find_c(_VSTD::addressof(__c));
+        __c_node* __cn2 = __db->__find_c(_CUDA_VSTD::addressof(__c));
         for (__i_node** __p = __cn2->end_; __p != __cn2->beg_;)
         {
             --__p;
@@ -2138,7 +2138,7 @@ list<_Tp, _Alloc>::merge(list& __c, _Comp __comp)
                 __cn1->__add(*__p);
                 (*__p)->__c_ = __cn1;
                 if (--__cn2->end_ != __p)
-                    _VSTD::memmove(__p, __p+1, (__cn2->end_ - __p)*sizeof(__i_node*));
+                    _CUDA_VSTD::memmove(__p, __p+1, (__cn2->end_ - __p)*sizeof(__i_node*));
             }
         }
         __db->unlock();
@@ -2184,12 +2184,12 @@ list<_Tp, _Alloc>::__sort(iterator __f1, iterator __e2, size_type __n, _Comp& __
         return __f1;
     }
     size_type __n2 = __n / 2;
-    iterator __e1 = _VSTD::next(__f1, __n2);
+    iterator __e1 = _CUDA_VSTD::next(__f1, __n2);
     iterator  __r = __f1 = __sort(__f1, __e1, __n2, __comp);
     iterator __f2 = __e1 = __sort(__e1, __e2, __n - __n2, __comp);
     if (__comp(*__f2, *__f1))
     {
-        iterator __m2 = _VSTD::next(__f2);
+        iterator __m2 = _CUDA_VSTD::next(__f2);
         for (; __m2 != __e2 && __comp(*__m2, *__f1); ++__m2)
             ;
         __link_pointer __f = __f2.__ptr_;
@@ -2197,7 +2197,7 @@ list<_Tp, _Alloc>::__sort(iterator __f1, iterator __e2, size_type __n, _Comp& __
         __r = __f2;
         __e1 = __f2 = __m2;
         base::__unlink_nodes(__f, __l);
-        __m2 = _VSTD::next(__f1);
+        __m2 = _CUDA_VSTD::next(__f1);
         __link_nodes(__f1.__ptr_, __f, __l);
         __f1 = __m2;
     }
@@ -2207,7 +2207,7 @@ list<_Tp, _Alloc>::__sort(iterator __f1, iterator __e2, size_type __n, _Comp& __
     {
         if (__comp(*__f2, *__f1))
         {
-            iterator __m2 = _VSTD::next(__f2);
+            iterator __m2 = _CUDA_VSTD::next(__f2);
             for (; __m2 != __e2 && __comp(*__m2, *__f1); ++__m2)
                 ;
             __link_pointer __f = __f2.__ptr_;
@@ -2216,7 +2216,7 @@ list<_Tp, _Alloc>::__sort(iterator __f1, iterator __e2, size_type __n, _Comp& __
                 __e1 = __m2;
             __f2 = __m2;
             base::__unlink_nodes(__f, __l);
-            __m2 = _VSTD::next(__f1);
+            __m2 = _CUDA_VSTD::next(__f1);
             __link_nodes(__f1.__ptr_, __f, __l);
             __f1 = __m2;
         }
@@ -2235,10 +2235,10 @@ list<_Tp, _Alloc>::reverse() _NOEXCEPT
         iterator __e = end();
         for (iterator __i = begin(); __i.__ptr_ != __e.__ptr_;)
         {
-            _VSTD::swap(__i.__ptr_->__prev_, __i.__ptr_->__next_);
+            _CUDA_VSTD::swap(__i.__ptr_->__prev_, __i.__ptr_->__next_);
             __i.__ptr_ = __i.__ptr_->__prev_;
         }
-        _VSTD::swap(__e.__ptr_->__prev_, __e.__ptr_->__next_);
+        _CUDA_VSTD::swap(__e.__ptr_->__prev_, __e.__ptr_->__next_);
     }
 }
 
@@ -2246,10 +2246,10 @@ template <class _Tp, class _Alloc>
 bool
 list<_Tp, _Alloc>::__invariants() const
 {
-    return size() == _VSTD::distance(begin(), end());
+    return size() == _CUDA_VSTD::distance(begin(), end());
 }
 
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
+#ifdef _LIBCUDACXX_ENABLE_DEBUG_MODE
 
 template <class _Tp, class _Alloc>
 bool
@@ -2279,26 +2279,26 @@ list<_Tp, _Alloc>::__subscriptable(const const_iterator*, ptr
diff _t) const
     return false;
 }
 
-#endif // _LIBCPP_ENABLE_DEBUG_MODE
+#endif // _LIBCUDACXX_ENABLE_DEBUG_MODE
 
 template <class _Tp, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator==(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
 {
-    return __x.size() == __y.size() && _VSTD::equal(__x.begin(), __x.end(), __y.begin());
+    return __x.size() == __y.size() && _CUDA_VSTD::equal(__x.begin(), __x.end(), __y.begin());
 }
 
 template <class _Tp, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator< (const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
 {
-    return _VSTD::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());
+    return _CUDA_VSTD::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());
 }
 
 template <class _Tp, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator!=(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
 {
@@ -2306,7 +2306,7 @@ operator!=(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
 }
 
 template <class _Tp, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator> (const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
 {
@@ -2314,7 +2314,7 @@ operator> (const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
 }
 
 template <class _Tp, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator>=(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
 {
@@ -2322,7 +2322,7 @@ operator>=(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
 }
 
 template <class _Tp, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator<=(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
 {
@@ -2330,7 +2330,7 @@ operator<=(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
 }
 
 template <class _Tp, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 swap(list<_Tp, _Alloc>& __x, list<_Tp, _Alloc>& __y)
     _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
@@ -2338,30 +2338,30 @@ swap(list<_Tp, _Alloc>& __x, list<_Tp, _Alloc>& __y)
     __x.swap(__y);
 }
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 template <class _Tp, class _Allocator, class _Predicate>
-inline _LIBCPP_INLINE_VISIBILITY typename list<_Tp, _Allocator>::size_type
+inline _LIBCUDACXX_INLINE_VISIBILITY typename list<_Tp, _Allocator>::size_type
 erase_if(list<_Tp, _Allocator>& __c, _Predicate __pred) {
   return __c.remove_if(__pred);
 }
 
 template <class _Tp, class _Allocator, class _Up>
-inline _LIBCPP_INLINE_VISIBILITY typename list<_Tp, _Allocator>::size_type
+inline _LIBCUDACXX_INLINE_VISIBILITY typename list<_Tp, _Allocator>::size_type
 erase(list<_Tp, _Allocator>& __c, const _Up& __v) {
-  return _VSTD::erase_if(__c, [&](auto& __elem) { return __elem == __v; });
+  return _CUDA_VSTD::erase_if(__c, [&](auto& __elem) { return __elem == __v; });
 }
 
 template <>
 inline constexpr bool __format::__enable_insertable<std::list<char>> = true;
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 template <>
 inline constexpr bool __format::__enable_insertable<std::list<wchar_t>> = true;
 #endif
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP_LIST
+#endif // _LIBCUDACXX_LIST

diff  --git a/libcxx/include/locale b/libcxx/include/locale
index b01c66d0430f..34eeaba06894 100644
--- a/libcxx/include/locale
+++ b/libcxx/include/locale
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_LOCALE
-#define _LIBCPP_LOCALE
+#ifndef _LIBCUDACXX_LOCALE
+#define _LIBCUDACXX_LOCALE
 
 /*
     locale synopsis
@@ -211,42 +211,42 @@ template <class charT> class messages_byname;
 #include <streambuf>
 #include <version>
 
-#ifndef _LIBCPP_REMOVE_TRANSITIVE_INCLUDES
+#ifndef _LIBCUDACXX_REMOVE_TRANSITIVE_INCLUDES
 #  include <iterator>
 #endif
 
 #if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
 // Most unix variants have catopen.  These are the specific ones that don't.
 #  if !defined(__BIONIC__) && !defined(_NEWLIB_VERSION) && !defined(__EMSCRIPTEN__)
-#    define _LIBCPP_HAS_CATOPEN 1
+#    define _LIBCUDACXX_HAS_CATOPEN 1
 #    include <nl_types.h>
 #  endif
 #endif
 
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
+#ifdef _LIBCUDACXX_LOCALE__L_EXTENSIONS
 #include <__bsd_locale_defaults.h>
 #else
 #include <__bsd_locale_fallbacks.h>
 #endif
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 #if defined(__APPLE__) || defined(__FreeBSD__)
-#  define _LIBCPP_GET_C_LOCALE 0
+#  define _LIBCUDACXX_GET_C_LOCALE 0
 #elif defined(__NetBSD__)
-#  define _LIBCPP_GET_C_LOCALE LC_C_LOCALE
+#  define _LIBCUDACXX_GET_C_LOCALE LC_C_LOCALE
 #else
-#  define _LIBCPP_GET_C_LOCALE __cloc()
+#  define _LIBCUDACXX_GET_C_LOCALE __cloc()
    // Get the C locale object
-   _LIBCPP_FUNC_VIS locale_t __cloc();
+   _LIBCUDACXX_FUNC_VIS locale_t __cloc();
 #define __cloc_defined
 #endif
 
@@ -269,7 +269,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 //  If the input is "a", the first keyword matches and eofbit is set.
 //  If the input is "abc", no match is found and "ab" are consumed.
 template <class _InputIterator, class _ForwardIterator, class _Ctype>
-_LIBCPP_HIDDEN
+_LIBCUDACXX_HIDDEN
 _ForwardIterator
 __scan_keyword(_InputIterator& __b, _InputIterator __e,
                _ForwardIterator __kb, _ForwardIterator __ke,
@@ -277,7 +277,7 @@ __scan_keyword(_InputIterator& __b, _InputIterator __e,
                bool __case_sensitive = true)
 {
     typedef typename iterator_traits<_InputIterator>::value_type _CharT;
-    size_t __nkw = static_cast<size_t>(_VSTD::distance(__kb, __ke));
+    size_t __nkw = static_cast<size_t>(_CUDA_VSTD::distance(__kb, __ke));
     const unsigned char __doesnt_match = '\0';
     const unsigned char __might_match = '\1';
     const unsigned char __does_match = '\2';
@@ -378,7 +378,7 @@ __scan_keyword(_InputIterator& __b, _InputIterator __e,
     return __kb;
 }
 
-struct _LIBCPP_TYPE_VIS __num_get_base
+struct _LIBCUDACXX_TYPE_VIS __num_get_base
 {
     static const int __num_get_buf_sz = 40;
 
@@ -386,7 +386,7 @@ struct _LIBCPP_TYPE_VIS __num_get_base
     static const char __src[33];
 };
 
-_LIBCPP_FUNC_VIS
+_LIBCUDACXX_FUNC_VIS
 void __check_grouping(const string& __grouping, unsigned* __g, unsigned* __g_end,
                       ios_base::iostate& __err);
 
@@ -402,7 +402,7 @@ struct __num_get
                                    _CharT __decimal_point, _CharT __thousands_sep,
                                    const string& __grouping, unsigned* __g,
                                    unsigned*& __g_end, unsigned& __dc, _CharT* __atoms);
-#ifndef _LIBCPP_ABI_OPTIMIZED_LOCALE_NUM_GET
+#ifndef _LIBCUDACXX_ABI_OPTIMIZED_LOCALE_NUM_GET
     static string __stage2_int_prep(ios_base& __iob, _CharT* __atoms, _CharT& __thousands_sep);
     static int __stage2_int_loop(_CharT __ct, int __base, char* __a, char*& __a_end,
                   unsigned& __dc, _CharT __thousands_sep, const string& __grouping,
@@ -444,7 +444,7 @@ private:
 #endif
 };
 
-#ifndef _LIBCPP_ABI_OPTIMIZED_LOCALE_NUM_GET
+#ifndef _LIBCUDACXX_ABI_OPTIMIZED_LOCALE_NUM_GET
 template <class _CharT>
 string
 __num_get<_CharT>::__stage2_int_prep(ios_base& __iob, _CharT* __atoms, _CharT& __thousands_sep)
@@ -472,7 +472,7 @@ __num_get<_CharT>::__stage2_float_prep(ios_base& __iob, _CharT* __atoms, _CharT&
 
 template <class _CharT>
 int
-#ifndef _LIBCPP_ABI_OPTIMIZED_LOCALE_NUM_GET
+#ifndef _LIBCUDACXX_ABI_OPTIMIZED_LOCALE_NUM_GET
 __num_get<_CharT>::__stage2_int_loop(_CharT __ct, int __base, char* __a, char*& __a_end,
                   unsigned& __dc, _CharT __thousands_sep, const string& __grouping,
                   unsigned* __g, unsigned*& __g_end, _CharT* __atoms)
@@ -583,13 +583,13 @@ __num_get<_CharT>::__stage2_float_loop(_CharT __ct, bool& __in_units, char& __ex
     return 0;
 }
 
-extern template struct _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __num_get<char>;
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-extern template struct _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __num_get<wchar_t>;
+extern template struct _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS __num_get<char>;
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
+extern template struct _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS __num_get<wchar_t>;
 #endif
 
 template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> >
-class _LIBCPP_TEMPLATE_VIS num_get
+class _LIBCUDACXX_TEMPLATE_VIS num_get
     : public locale::facet,
       private __num_get<_CharT>
 {
@@ -597,81 +597,81 @@ public:
     typedef _CharT char_type;
     typedef _InputIterator iter_type;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit num_get(size_t __refs = 0)
         : locale::facet(__refs) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iter_type get(iter_type __b, iter_type __e, ios_base& __iob,
                   ios_base::iostate& __err, bool& __v) const
     {
         return do_get(__b, __e, __iob, __err, __v);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iter_type get(iter_type __b, iter_type __e, ios_base& __iob,
                   ios_base::iostate& __err, long& __v) const
     {
         return do_get(__b, __e, __iob, __err, __v);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iter_type get(iter_type __b, iter_type __e, ios_base& __iob,
                   ios_base::iostate& __err, long long& __v) const
     {
         return do_get(__b, __e, __iob, __err, __v);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iter_type get(iter_type __b, iter_type __e, ios_base& __iob,
                   ios_base::iostate& __err, unsigned short& __v) const
     {
         return do_get(__b, __e, __iob, __err, __v);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iter_type get(iter_type __b, iter_type __e, ios_base& __iob,
                   ios_base::iostate& __err, unsigned int& __v) const
     {
         return do_get(__b, __e, __iob, __err, __v);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iter_type get(iter_type __b, iter_type __e, ios_base& __iob,
                   ios_base::iostate& __err, unsigned long& __v) const
     {
         return do_get(__b, __e, __iob, __err, __v);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iter_type get(iter_type __b, iter_type __e, ios_base& __iob,
                   ios_base::iostate& __err, unsigned long long& __v) const
     {
         return do_get(__b, __e, __iob, __err, __v);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iter_type get(iter_type __b, iter_type __e, ios_base& __iob,
                   ios_base::iostate& __err, float& __v) const
     {
         return do_get(__b, __e, __iob, __err, __v);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iter_type get(iter_type __b, iter_type __e, ios_base& __iob,
                   ios_base::iostate& __err, double& __v) const
     {
         return do_get(__b, __e, __iob, __err, __v);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iter_type get(iter_type __b, iter_type __e, ios_base& __iob,
                   ios_base::iostate& __err, long double& __v) const
     {
         return do_get(__b, __e, __iob, __err, __v);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iter_type get(iter_type __b, iter_type __e, ios_base& __iob,
                   ios_base::iostate& __err, void*& __v) const
     {
@@ -681,23 +681,23 @@ public:
     static locale::id id;
 
 protected:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     ~num_get() {}
 
     template <class _Fp>
-    _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
+    _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
     iter_type __do_get_floating_point
                             (iter_type __b, iter_type __e, ios_base& __iob,
                              ios_base::iostate& __err, _Fp& __v) const;
 
     template <class _Signed>
-    _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
+    _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
     iter_type __do_get_signed
                             (iter_type __b, iter_type __e, ios_base& __iob,
                              ios_base::iostate& __err, _Signed& __v) const;
 
     template <class _Unsigned>
-    _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
+    _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
     iter_type __do_get_unsigned
                             (iter_type __b, iter_type __e, ios_base& __iob,
                              ios_base::iostate& __err, _Unsigned& __v) const;
@@ -751,7 +751,7 @@ locale::id
 num_get<_CharT, _InputIterator>::id;
 
 template <class _Tp>
-_LIBCPP_HIDDEN _Tp
+_LIBCUDACXX_HIDDEN _Tp
 __num_get_signed_integral(const char* __a, const char* __a_end,
                           ios_base::iostate& __err, int __base)
 {
@@ -760,7 +760,7 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
         typename remove_reference<decltype(errno)>::type __save_errno = errno;
         errno = 0;
         char *__p2;
-        long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
+        long long __ll = strtoll_l(__a, &__p2, __base, _LIBCUDACXX_GET_C_LOCALE);
         typename remove_reference<decltype(errno)>::type __current_errno = errno;
         if (__current_errno == 0)
             errno = __save_errno;
@@ -786,7 +786,7 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
 }
 
 template <class _Tp>
-_LIBCPP_HIDDEN _Tp
+_LIBCUDACXX_HIDDEN _Tp
 __num_get_unsigned_integral(const char* __a, const char* __a_end,
                             ios_base::iostate& __err, int __base)
 {
@@ -800,7 +800,7 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
         typename remove_reference<decltype(errno)>::type __save_errno = errno;
         errno = 0;
         char *__p2;
-        unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
+        unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCUDACXX_GET_C_LOCALE);
         typename remove_reference<decltype(errno)>::type __current_errno = errno;
         if (__current_errno == 0)
             errno = __save_errno;
@@ -823,29 +823,29 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
 }
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Tp __do_strtod(const char* __a, char** __p2);
 
 template <>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 float __do_strtod<float>(const char* __a, char** __p2) {
-    return strtof_l(__a, __p2, _LIBCPP_GET_C_LOCALE);
+    return strtof_l(__a, __p2, _LIBCUDACXX_GET_C_LOCALE);
 }
 
 template <>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 double __do_strtod<double>(const char* __a, char** __p2) {
-    return strtod_l(__a, __p2, _LIBCPP_GET_C_LOCALE);
+    return strtod_l(__a, __p2, _LIBCUDACXX_GET_C_LOCALE);
 }
 
 template <>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 long double __do_strtod<long double>(const char* __a, char** __p2) {
-    return strtold_l(__a, __p2, _LIBCPP_GET_C_LOCALE);
+    return strtold_l(__a, __p2, _LIBCUDACXX_GET_C_LOCALE);
 }
 
 template <class _Tp>
-_LIBCPP_HIDDEN
+_LIBCUDACXX_HIDDEN
 _Tp
 __num_get_float(const char* __a, const char* __a_end, ios_base::iostate& __err)
 {
@@ -901,7 +901,7 @@ num_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
     const numpunct<_CharT>& __np = use_facet<numpunct<_CharT> >(__iob.getloc());
     typedef typename numpunct<_CharT>::string_type string_type;
     const string_type __names[2] = {__np.truename(), __np.falsename()};
-    const string_type* __i = _VSTD::__scan_keyword(__b, __e, __names, __names+2,
+    const string_type* __i = _CUDA_VSTD::__scan_keyword(__b, __e, __names, __names+2,
                                                    __ct, __err);
     __v = __i == __names;
     return __b;
@@ -922,7 +922,7 @@ num_get<_CharT, _InputIterator>::__do_get_signed(iter_type __b, iter_type __e,
     // Stage 2
     char_type __thousands_sep;
     const int __atoms_size = 26;
-#ifdef _LIBCPP_ABI_OPTIMIZED_LOCALE_NUM_GET
+#ifdef _LIBCUDACXX_ABI_OPTIMIZED_LOCALE_NUM_GET
     char_type __atoms1[__atoms_size];
     const char_type *__atoms = this->__do_widen(__iob, __atoms1);
     string __grouping = this->__stage2_int_prep(__iob, __thousands_sep);
@@ -979,7 +979,7 @@ num_get<_CharT, _InputIterator>::__do_get_unsigned(iter_type __b, iter_type __e,
     // Stage 2
     char_type __thousands_sep;
     const int __atoms_size = 26;
-#ifdef _LIBCPP_ABI_OPTIMIZED_LOCALE_NUM_GET
+#ifdef _LIBCUDACXX_ABI_OPTIMIZED_LOCALE_NUM_GET
     char_type __atoms1[__atoms_size];
     const char_type *__atoms = this->__do_widen(__iob, __atoms1);
     string __grouping = this->__stage2_int_prep(__iob, __thousands_sep);
@@ -1115,7 +1115,7 @@ num_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
     }
     // Stage 3
     __buf.resize(__a_end - __a);
-    if (__libcpp_sscanf_l(__buf.c_str(), _LIBCPP_GET_C_LOCALE, "%p", &__v) != 1)
+    if (__LIBCUDACXX_sscanf_l(__buf.c_str(), _LIBCUDACXX_GET_C_LOCALE, "%p", &__v) != 1)
         __err = ios_base::failbit;
     // EOF checked
     if (__b == __e)
@@ -1123,12 +1123,12 @@ num_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
     return __b;
 }
 
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_get<char>;
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_get<wchar_t>;
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS num_get<char>;
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS num_get<wchar_t>;
 #endif
 
-struct _LIBCPP_TYPE_VIS __num_put_base
+struct _LIBCUDACXX_TYPE_VIS __num_put_base
 {
 protected:
     static void __format_int(char* __fmt, const char* __len, bool __signd,
@@ -1222,13 +1222,13 @@ __num_put<_CharT>::__widen_and_group_float(char* __nb, char* __np, char* __ne,
         *__oe++ = __ct.widen(*__nf++);
         *__oe++ = __ct.widen(*__nf++);
         for (__ns = __nf; __ns < __ne; ++__ns)
-            if (!isxdigit_l(*__ns, _LIBCPP_GET_C_LOCALE))
+            if (!isxdigit_l(*__ns, _LIBCUDACXX_GET_C_LOCALE))
                 break;
     }
     else
     {
         for (__ns = __nf; __ns < __ne; ++__ns)
-            if (!isdigit_l(*__ns, _LIBCPP_GET_C_LOCALE))
+            if (!isdigit_l(*__ns, _LIBCUDACXX_GET_C_LOCALE))
                 break;
     }
     if (__grouping.empty())
@@ -1275,13 +1275,13 @@ __num_put<_CharT>::__widen_and_group_float(char* __nb, char* __np, char* __ne,
         __op = __ob + (__np - __nb);
 }
 
-extern template struct _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __num_put<char>;
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-extern template struct _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __num_put<wchar_t>;
+extern template struct _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS __num_put<char>;
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
+extern template struct _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS __num_put<wchar_t>;
 #endif
 
 template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> >
-class _LIBCPP_TEMPLATE_VIS num_put
+class _LIBCUDACXX_TEMPLATE_VIS num_put
     : public locale::facet,
       private __num_put<_CharT>
 {
@@ -1289,60 +1289,60 @@ public:
     typedef _CharT char_type;
     typedef _OutputIterator iter_type;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit num_put(size_t __refs = 0)
         : locale::facet(__refs) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iter_type put(iter_type __s, ios_base& __iob, char_type __fl,
                   bool __v) const
     {
         return do_put(__s, __iob, __fl, __v);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iter_type put(iter_type __s, ios_base& __iob, char_type __fl,
                   long __v) const
     {
         return do_put(__s, __iob, __fl, __v);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iter_type put(iter_type __s, ios_base& __iob, char_type __fl,
                   long long __v) const
     {
         return do_put(__s, __iob, __fl, __v);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iter_type put(iter_type __s, ios_base& __iob, char_type __fl,
                   unsigned long __v) const
     {
         return do_put(__s, __iob, __fl, __v);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iter_type put(iter_type __s, ios_base& __iob, char_type __fl,
                   unsigned long long __v) const
     {
         return do_put(__s, __iob, __fl, __v);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iter_type put(iter_type __s, ios_base& __iob, char_type __fl,
                   double __v) const
     {
         return do_put(__s, __iob, __fl, __v);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iter_type put(iter_type __s, ios_base& __iob, char_type __fl,
                   long double __v) const
     {
         return do_put(__s, __iob, __fl, __v);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iter_type put(iter_type __s, ios_base& __iob, char_type __fl,
                   const void* __v) const
     {
@@ -1352,7 +1352,7 @@ public:
     static locale::id id;
 
 protected:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     ~num_put() {}
 
     virtual iter_type do_put(iter_type __s, ios_base& __iob, char_type __fl,
@@ -1373,13 +1373,13 @@ protected:
                              const void* __v) const;
 
     template <class _Integral>
-    _LIBCPP_HIDE_FROM_ABI inline
+    _LIBCUDACXX_HIDE_FROM_ABI inline
     _OutputIterator __do_put_integral(iter_type __s, ios_base& __iob,
                                       char_type __fl, _Integral __v,
                                       char const* __len) const;
 
     template <class _Float>
-    _LIBCPP_HIDE_FROM_ABI inline
+    _LIBCUDACXX_HIDE_FROM_ABI inline
     _OutputIterator __do_put_floating_point(iter_type __s, ios_base& __iob,
                                             char_type __fl, _Float __v,
                                             char const* __len) const;
@@ -1390,7 +1390,7 @@ locale::id
 num_put<_CharT, _OutputIterator>::id;
 
 template <class _CharT, class _OutputIterator>
-_LIBCPP_HIDDEN
+_LIBCUDACXX_HIDDEN
 _OutputIterator
 __pad_and_output(_OutputIterator __s,
                  const _CharT* __ob, const _CharT* __op, const _CharT* __oe,
@@ -1413,7 +1413,7 @@ __pad_and_output(_OutputIterator __s,
 }
 
 template <class _CharT, class _Traits>
-_LIBCPP_HIDDEN
+_LIBCUDACXX_HIDDEN
 ostreambuf_iterator<_CharT, _Traits>
 __pad_and_output(ostreambuf_iterator<_CharT, _Traits> __s,
                  const _CharT* __ob, const _CharT* __op, const _CharT* __oe,
@@ -1467,9 +1467,9 @@ num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob,
         return do_put(__s, __iob, __fl, (unsigned long)__v);
     const numpunct<char_type>& __np = use_facet<numpunct<char_type> >(__iob.getloc());
     typedef typename numpunct<char_type>::string_type string_type;
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
+#ifdef _LIBCUDACXX_ENABLE_DEBUG_MODE
     string_type __tmp(__v ? __np.truename() : __np.falsename());
-    string_type __nm = _VSTD::move(__tmp);
+    string_type __nm = _CUDA_VSTD::move(__tmp);
 #else
     string_type __nm = __v ? __np.truename() : __np.falsename();
 #endif
@@ -1480,7 +1480,7 @@ num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob,
 
 template <class _CharT, class _OutputIterator>
 template <class _Integral>
-_LIBCPP_HIDE_FROM_ABI inline
+_LIBCUDACXX_HIDE_FROM_ABI inline
 _OutputIterator
 num_put<_CharT, _OutputIterator>::__do_put_integral(iter_type __s, ios_base& __iob,
                                                     char_type __fl, _Integral __v,
@@ -1492,16 +1492,16 @@ num_put<_CharT, _OutputIterator>::__do_put_integral(iter_type __s, ios_base& __i
     // Worst case is octal, with showbase enabled. Note that octal is always
     // printed as an unsigned value.
     using _Unsigned = typename make_unsigned<_Integral>::type;
-    _LIBCPP_CONSTEXPR const unsigned __nbuf
+    _LIBCUDACXX_CONSTEXPR const unsigned __nbuf
         = (numeric_limits<_Unsigned>::digits / 3)        // 1 char per 3 bits
         + ((numeric_limits<_Unsigned>::digits % 3) != 0) // round up
         + 2; // base prefix + terminating null character
     char __nar[__nbuf];
-    _LIBCPP_DIAGNOSTIC_PUSH
-    _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wformat-nonliteral")
-    _LIBCPP_GCC_DIAGNOSTIC_IGNORED("-Wformat-nonliteral")
-    int __nc = __libcpp_snprintf_l(__nar, sizeof(__nar), _LIBCPP_GET_C_LOCALE, __fmt, __v);
-    _LIBCPP_DIAGNOSTIC_POP
+    _LIBCUDACXX_DIAGNOSTIC_PUSH
+    _LIBCUDACXX_CLANG_DIAGNOSTIC_IGNORED("-Wformat-nonliteral")
+    _LIBCUDACXX_GCC_DIAGNOSTIC_IGNORED("-Wformat-nonliteral")
+    int __nc = __LIBCUDACXX_snprintf_l(__nar, sizeof(__nar), _LIBCUDACXX_GET_C_LOCALE, __fmt, __v);
+    _LIBCUDACXX_DIAGNOSTIC_POP
     char* __ne = __nar + __nc;
     char* __np = this->__identify_padding(__nar, __ne, __iob);
     // Stage 2 - Widen __nar while adding thousands separators
@@ -1548,7 +1548,7 @@ num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob,
 
 template <class _CharT, class _OutputIterator>
 template <class _Float>
-_LIBCPP_HIDE_FROM_ABI inline
+_LIBCUDACXX_HIDE_FROM_ABI inline
 _OutputIterator
 num_put<_CharT, _OutputIterator>::__do_put_floating_point(iter_type __s, ios_base& __iob,
                                                           char_type __fl, _Float __v,
@@ -1561,26 +1561,26 @@ num_put<_CharT, _OutputIterator>::__do_put_floating_point(iter_type __s, ios_bas
     char __nar[__nbuf];
     char* __nb = __nar;
     int __nc;
-    _LIBCPP_DIAGNOSTIC_PUSH
-    _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wformat-nonliteral")
-    _LIBCPP_GCC_DIAGNOSTIC_IGNORED("-Wformat-nonliteral")
+    _LIBCUDACXX_DIAGNOSTIC_PUSH
+    _LIBCUDACXX_CLANG_DIAGNOSTIC_IGNORED("-Wformat-nonliteral")
+    _LIBCUDACXX_GCC_DIAGNOSTIC_IGNORED("-Wformat-nonliteral")
     if (__specify_precision)
-        __nc = __libcpp_snprintf_l(__nb, __nbuf, _LIBCPP_GET_C_LOCALE, __fmt,
+        __nc = __LIBCUDACXX_snprintf_l(__nb, __nbuf, _LIBCUDACXX_GET_C_LOCALE, __fmt,
                                    (int)__iob.precision(), __v);
     else
-        __nc = __libcpp_snprintf_l(__nb, __nbuf, _LIBCPP_GET_C_LOCALE, __fmt, __v);
+        __nc = __LIBCUDACXX_snprintf_l(__nb, __nbuf, _LIBCUDACXX_GET_C_LOCALE, __fmt, __v);
     unique_ptr<char, void(*)(void*)> __nbh(nullptr, free);
     if (__nc > static_cast<int>(__nbuf-1))
     {
         if (__specify_precision)
-            __nc = __libcpp_asprintf_l(&__nb, _LIBCPP_GET_C_LOCALE, __fmt, (int)__iob.precision(), __v);
+            __nc = __LIBCUDACXX_asprintf_l(&__nb, _LIBCUDACXX_GET_C_LOCALE, __fmt, (int)__iob.precision(), __v);
         else
-            __nc = __libcpp_asprintf_l(&__nb, _LIBCPP_GET_C_LOCALE, __fmt, __v);
+            __nc = __LIBCUDACXX_asprintf_l(&__nb, _LIBCUDACXX_GET_C_LOCALE, __fmt, __v);
         if (__nc == -1)
             __throw_bad_alloc();
         __nbh.reset(__nb);
     }
-    _LIBCPP_DIAGNOSTIC_POP
+    _LIBCUDACXX_DIAGNOSTIC_POP
     char* __ne = __nb + __nc;
     char* __np = this->__identify_padding(__nb, __ne, __iob);
     // Stage 2 - Widen __nar while adding thousands separators
@@ -1627,7 +1627,7 @@ num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob,
     // Stage 1 - Get pointer in narrow char
     const unsigned __nbuf = 20;
     char __nar[__nbuf];
-    int __nc = __libcpp_snprintf_l(__nar, sizeof(__nar), _LIBCPP_GET_C_LOCALE, "%p", __v);
+    int __nc = __LIBCUDACXX_snprintf_l(__nar, sizeof(__nar), _LIBCUDACXX_GET_C_LOCALE, "%p", __v);
     char* __ne = __nar + __nc;
     char* __np = this->__identify_padding(__nar, __ne, __iob);
     // Stage 2 - Widen __nar
@@ -1646,13 +1646,13 @@ num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob,
     return __pad_and_output(__s, __o, __op, __oe, __iob, __fl);
 }
 
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_put<char>;
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_put<wchar_t>;
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS num_put<char>;
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS num_put<wchar_t>;
 #endif
 
 template <class _CharT, class _InputIterator>
-_LIBCPP_HIDDEN
+_LIBCUDACXX_HIDDEN
 int
 __get_up_to_n_digits(_InputIterator& __b, _InputIterator __e,
                      ios_base::iostate& __err, const ctype<_CharT>& __ct, int __n)
@@ -1684,14 +1684,14 @@ __get_up_to_n_digits(_InputIterator& __b, _InputIterator __e,
     return __r;
 }
 
-class _LIBCPP_TYPE_VIS time_base
+class _LIBCUDACXX_TYPE_VIS time_base
 {
 public:
     enum dateorder {no_order, dmy, mdy, ymd, ydm};
 };
 
 template <class _CharT>
-class _LIBCPP_TEMPLATE_VIS __time_get_c_storage
+class _LIBCUDACXX_TEMPLATE_VIS __time_get_c_storage
 {
 protected:
     typedef basic_string<_CharT> string_type;
@@ -1704,30 +1704,30 @@ protected:
     virtual const string_type& __x() const;
     virtual const string_type& __X() const;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     ~__time_get_c_storage() {}
 };
 
-template <> _LIBCPP_FUNC_VIS const string* __time_get_c_storage<char>::__weeks() const;
-template <> _LIBCPP_FUNC_VIS const string* __time_get_c_storage<char>::__months() const;
-template <> _LIBCPP_FUNC_VIS const string* __time_get_c_storage<char>::__am_pm() const;
-template <> _LIBCPP_FUNC_VIS const string& __time_get_c_storage<char>::__c() const;
-template <> _LIBCPP_FUNC_VIS const string& __time_get_c_storage<char>::__r() const;
-template <> _LIBCPP_FUNC_VIS const string& __time_get_c_storage<char>::__x() const;
-template <> _LIBCPP_FUNC_VIS const string& __time_get_c_storage<char>::__X() const;
-
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-template <> _LIBCPP_FUNC_VIS const wstring* __time_get_c_storage<wchar_t>::__weeks() const;
-template <> _LIBCPP_FUNC_VIS const wstring* __time_get_c_storage<wchar_t>::__months() const;
-template <> _LIBCPP_FUNC_VIS const wstring* __time_get_c_storage<wchar_t>::__am_pm() const;
-template <> _LIBCPP_FUNC_VIS const wstring& __time_get_c_storage<wchar_t>::__c() const;
-template <> _LIBCPP_FUNC_VIS const wstring& __time_get_c_storage<wchar_t>::__r() const;
-template <> _LIBCPP_FUNC_VIS const wstring& __time_get_c_storage<wchar_t>::__x() const;
-template <> _LIBCPP_FUNC_VIS const wstring& __time_get_c_storage<wchar_t>::__X() const;
+template <> _LIBCUDACXX_FUNC_VIS const string* __time_get_c_storage<char>::__weeks() const;
+template <> _LIBCUDACXX_FUNC_VIS const string* __time_get_c_storage<char>::__months() const;
+template <> _LIBCUDACXX_FUNC_VIS const string* __time_get_c_storage<char>::__am_pm() const;
+template <> _LIBCUDACXX_FUNC_VIS const string& __time_get_c_storage<char>::__c() const;
+template <> _LIBCUDACXX_FUNC_VIS const string& __time_get_c_storage<char>::__r() const;
+template <> _LIBCUDACXX_FUNC_VIS const string& __time_get_c_storage<char>::__x() const;
+template <> _LIBCUDACXX_FUNC_VIS const string& __time_get_c_storage<char>::__X() const;
+
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
+template <> _LIBCUDACXX_FUNC_VIS const wstring* __time_get_c_storage<wchar_t>::__weeks() const;
+template <> _LIBCUDACXX_FUNC_VIS const wstring* __time_get_c_storage<wchar_t>::__months() const;
+template <> _LIBCUDACXX_FUNC_VIS const wstring* __time_get_c_storage<wchar_t>::__am_pm() const;
+template <> _LIBCUDACXX_FUNC_VIS const wstring& __time_get_c_storage<wchar_t>::__c() const;
+template <> _LIBCUDACXX_FUNC_VIS const wstring& __time_get_c_storage<wchar_t>::__r() const;
+template <> _LIBCUDACXX_FUNC_VIS const wstring& __time_get_c_storage<wchar_t>::__x() const;
+template <> _LIBCUDACXX_FUNC_VIS const wstring& __time_get_c_storage<wchar_t>::__X() const;
 #endif
 
 template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> >
-class _LIBCPP_TEMPLATE_VIS time_get
+class _LIBCUDACXX_TEMPLATE_VIS time_get
     : public locale::facet,
       public time_base,
       private __time_get_c_storage<_CharT>
@@ -1738,52 +1738,52 @@ public:
     typedef time_base::dateorder    dateorder;
     typedef basic_string<char_type> string_type;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit time_get(size_t __refs = 0)
         : locale::facet(__refs) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     dateorder date_order() const
     {
         return this->do_date_order();
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iter_type get_time(iter_type __b, iter_type __e, ios_base& __iob,
                        ios_base::iostate& __err, tm* __tm) const
     {
         return do_get_time(__b, __e, __iob, __err, __tm);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iter_type get_date(iter_type __b, iter_type __e, ios_base& __iob,
                        ios_base::iostate& __err, tm* __tm) const
     {
         return do_get_date(__b, __e, __iob, __err, __tm);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iter_type get_weekday(iter_type __b, iter_type __e, ios_base& __iob,
                           ios_base::iostate& __err, tm* __tm) const
     {
         return do_get_weekday(__b, __e, __iob, __err, __tm);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iter_type get_monthname(iter_type __b, iter_type __e, ios_base& __iob,
                             ios_base::iostate& __err, tm* __tm) const
     {
         return do_get_monthname(__b, __e, __iob, __err, __tm);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iter_type get_year(iter_type __b, iter_type __e, ios_base& __iob,
                        ios_base::iostate& __err, tm* __tm) const
     {
         return do_get_year(__b, __e, __iob, __err, __tm);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iter_type get(iter_type __b, iter_type __e, ios_base& __iob,
                   ios_base::iostate& __err, tm *__tm,
                   char __fmt, char __mod = 0) const
@@ -1798,7 +1798,7 @@ public:
     static locale::id id;
 
 protected:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     ~time_get() {}
 
     virtual dateorder do_date_order() const;
@@ -1890,7 +1890,7 @@ time_get<_CharT, _InputIterator>::__get_weekdayname(int& __w,
 {
     // Note:  ignoring case comes from the POSIX strptime spec
     const string_type* __wk = this->__weeks();
-    ptr
diff _t __i = _VSTD::__scan_keyword(__b, __e, __wk, __wk+14, __ct, __err, false) - __wk;
+    ptr
diff _t __i = _CUDA_VSTD::__scan_keyword(__b, __e, __wk, __wk+14, __ct, __err, false) - __wk;
     if (__i < 14)
         __w = __i % 7;
 }
@@ -1904,7 +1904,7 @@ time_get<_CharT, _InputIterator>::__get_monthname(int& __m,
 {
     // Note:  ignoring case comes from the POSIX strptime spec
     const string_type* __month = this->__months();
-    ptr
diff _t __i = _VSTD::__scan_keyword(__b, __e, __month, __month+24, __ct, __err, false) - __month;
+    ptr
diff _t __i = _CUDA_VSTD::__scan_keyword(__b, __e, __month, __month+24, __ct, __err, false) - __month;
     if (__i < 24)
         __m = __i % 12;
 }
@@ -1916,7 +1916,7 @@ time_get<_CharT, _InputIterator>::__get_day(int& __d,
                                             ios_base::iostate& __err,
                                             const ctype<char_type>& __ct) const
 {
-    int __t = _VSTD::__get_up_to_n_digits(__b, __e, __err, __ct, 2);
+    int __t = _CUDA_VSTD::__get_up_to_n_digits(__b, __e, __err, __ct, 2);
     if (!(__err & ios_base::failbit) && 1 <= __t && __t <= 31)
         __d = __t;
     else
@@ -2076,7 +2076,7 @@ time_get<_CharT, _InputIterator>::__get_am_pm(int& __h,
         __err |= ios_base::failbit;
         return;
     }
-    ptr
diff _t __i = _VSTD::__scan_keyword(__b, __e, __ap, __ap+2, __ct, __err, false) - __ap;
+    ptr
diff _t __i = _CUDA_VSTD::__scan_keyword(__b, __e, __ap, __ap+2, __ct, __err, false) - __ap;
     if (__i == 0 && __h == 12)
         __h = 0;
     else if (__i == 1 && __h < 12)
@@ -2336,12 +2336,12 @@ time_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
     return __b;
 }
 
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_get<char>;
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_get<wchar_t>;
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS time_get<char>;
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS time_get<wchar_t>;
 #endif
 
-class _LIBCPP_TYPE_VIS __time_get
+class _LIBCUDACXX_TYPE_VIS __time_get
 {
 protected:
     locale_t __loc_;
@@ -2352,7 +2352,7 @@ protected:
 };
 
 template <class _CharT>
-class _LIBCPP_TEMPLATE_VIS __time_get_storage
+class _LIBCUDACXX_TEMPLATE_VIS __time_get_storage
     : public __time_get
 {
 protected:
@@ -2369,7 +2369,7 @@ protected:
     explicit __time_get_storage(const char* __nm);
     explicit __time_get_storage(const string& __nm);
 
-    _LIBCPP_INLINE_VISIBILITY ~__time_get_storage() {}
+    _LIBCUDACXX_INLINE_VISIBILITY ~__time_get_storage() {}
 
     time_base::dateorder __do_date_order() const;
 
@@ -2378,25 +2378,25 @@ private:
     string_type __analyze(char __fmt, const ctype<_CharT>&);
 };
 
-#define _LIBCPP_TIME_GET_STORAGE_EXPLICIT_INSTANTIATION(_CharT) \
-template <> _LIBCPP_FUNC_VIS time_base::dateorder __time_get_storage<_CharT>::__do_date_order() const; \
-template <> _LIBCPP_FUNC_VIS __time_get_storage<_CharT>::__time_get_storage(const char*); \
-template <> _LIBCPP_FUNC_VIS __time_get_storage<_CharT>::__time_get_storage(const string&); \
-template <> _LIBCPP_FUNC_VIS void __time_get_storage<_CharT>::init(const ctype<_CharT>&); \
-template <> _LIBCPP_FUNC_VIS __time_get_storage<_CharT>::string_type __time_get_storage<_CharT>::__analyze(char, const ctype<_CharT>&); \
-extern template _LIBCPP_FUNC_VIS time_base::dateorder __time_get_storage<_CharT>::__do_date_order() const; \
-extern template _LIBCPP_FUNC_VIS __time_get_storage<_CharT>::__time_get_storage(const char*); \
-extern template _LIBCPP_FUNC_VIS __time_get_storage<_CharT>::__time_get_storage(const string&); \
-extern template _LIBCPP_FUNC_VIS void __time_get_storage<_CharT>::init(const ctype<_CharT>&); \
-extern template _LIBCPP_FUNC_VIS __time_get_storage<_CharT>::string_type __time_get_storage<_CharT>::__analyze(char, const ctype<_CharT>&); \
+#define _LIBCUDACXX_TIME_GET_STORAGE_EXPLICIT_INSTANTIATION(_CharT) \
+template <> _LIBCUDACXX_FUNC_VIS time_base::dateorder __time_get_storage<_CharT>::__do_date_order() const; \
+template <> _LIBCUDACXX_FUNC_VIS __time_get_storage<_CharT>::__time_get_storage(const char*); \
+template <> _LIBCUDACXX_FUNC_VIS __time_get_storage<_CharT>::__time_get_storage(const string&); \
+template <> _LIBCUDACXX_FUNC_VIS void __time_get_storage<_CharT>::init(const ctype<_CharT>&); \
+template <> _LIBCUDACXX_FUNC_VIS __time_get_storage<_CharT>::string_type __time_get_storage<_CharT>::__analyze(char, const ctype<_CharT>&); \
+extern template _LIBCUDACXX_FUNC_VIS time_base::dateorder __time_get_storage<_CharT>::__do_date_order() const; \
+extern template _LIBCUDACXX_FUNC_VIS __time_get_storage<_CharT>::__time_get_storage(const char*); \
+extern template _LIBCUDACXX_FUNC_VIS __time_get_storage<_CharT>::__time_get_storage(const string&); \
+extern template _LIBCUDACXX_FUNC_VIS void __time_get_storage<_CharT>::init(const ctype<_CharT>&); \
+extern template _LIBCUDACXX_FUNC_VIS __time_get_storage<_CharT>::string_type __time_get_storage<_CharT>::__analyze(char, const ctype<_CharT>&); \
 /**/
 
-_LIBCPP_TIME_GET_STORAGE_EXPLICIT_INSTANTIATION(char)
-_LIBCPP_TIME_GET_STORAGE_EXPLICIT_INSTANTIATION(wchar_t)
-#undef _LIBCPP_TIME_GET_STORAGE_EXPLICIT_INSTANTIATION
+_LIBCUDACXX_TIME_GET_STORAGE_EXPLICIT_INSTANTIATION(char)
+_LIBCUDACXX_TIME_GET_STORAGE_EXPLICIT_INSTANTIATION(wchar_t)
+#undef _LIBCUDACXX_TIME_GET_STORAGE_EXPLICIT_INSTANTIATION
 
 template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> >
-class _LIBCPP_TEMPLATE_VIS time_get_byname
+class _LIBCUDACXX_TEMPLATE_VIS time_get_byname
     : public time_get<_CharT, _InputIterator>,
       private __time_get_storage<_CharT>
 {
@@ -2406,48 +2406,48 @@ public:
     typedef _CharT                  char_type;
     typedef basic_string<char_type> string_type;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit time_get_byname(const char* __nm, size_t __refs = 0)
         : time_get<_CharT, _InputIterator>(__refs),
           __time_get_storage<_CharT>(__nm) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit time_get_byname(const string& __nm, size_t __refs = 0)
         : time_get<_CharT, _InputIterator>(__refs),
           __time_get_storage<_CharT>(__nm) {}
 
 protected:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     ~time_get_byname() {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     virtual dateorder do_date_order() const {return this->__do_date_order();}
 private:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     virtual const string_type* __weeks() const  {return this->__weeks_;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     virtual const string_type* __months() const {return this->__months_;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     virtual const string_type* __am_pm() const  {return this->__am_pm_;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     virtual const string_type& __c() const      {return this->__c_;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     virtual const string_type& __r() const      {return this->__r_;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     virtual const string_type& __x() const      {return this->__x_;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     virtual const string_type& __X() const      {return this->__X_;}
 };
 
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_get_byname<char>;
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_get_byname<wchar_t>;
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS time_get_byname<char>;
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS time_get_byname<wchar_t>;
 #endif
 
-class _LIBCPP_TYPE_VIS __time_put
+class _LIBCUDACXX_TYPE_VIS __time_put
 {
     locale_t __loc_;
 protected:
-    _LIBCPP_INLINE_VISIBILITY __time_put() : __loc_(_LIBCPP_GET_C_LOCALE) {}
+    _LIBCUDACXX_INLINE_VISIBILITY __time_put() : __loc_(_LIBCUDACXX_GET_C_LOCALE) {}
     __time_put(const char* __nm);
     __time_put(const string& __nm);
     ~__time_put();
@@ -2458,7 +2458,7 @@ protected:
 };
 
 template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> >
-class _LIBCPP_TEMPLATE_VIS time_put
+class _LIBCUDACXX_TEMPLATE_VIS time_put
     : public locale::facet,
       private __time_put
 {
@@ -2466,14 +2466,14 @@ public:
     typedef _CharT char_type;
     typedef _OutputIterator iter_type;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit time_put(size_t __refs = 0)
         : locale::facet(__refs) {}
 
     iter_type put(iter_type __s, ios_base& __iob, char_type __fl, const tm* __tm,
                   const char_type* __pb, const char_type* __pe) const;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iter_type put(iter_type __s, ios_base& __iob, char_type __fl,
                   const tm* __tm, char __fmt, char __mod = 0) const
     {
@@ -2483,16 +2483,16 @@ public:
     static locale::id id;
 
 protected:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     ~time_put() {}
     virtual iter_type do_put(iter_type __s, ios_base&, char_type, const tm* __tm,
                              char __fmt, char __mod) const;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit time_put(const char* __nm, size_t __refs)
         : locale::facet(__refs),
           __time_put(__nm) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit time_put(const string& __nm, size_t __refs)
         : locale::facet(__refs),
           __time_put(__nm) {}
@@ -2550,52 +2550,52 @@ time_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base&,
     char_type* __nb = __nar;
     char_type* __ne = __nb + 100;
     __do_put(__nb, __ne, __tm, __fmt, __mod);
-    return _VSTD::copy(__nb, __ne, __s);
+    return _CUDA_VSTD::copy(__nb, __ne, __s);
 }
 
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put<char>;
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put<wchar_t>;
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS time_put<char>;
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS time_put<wchar_t>;
 #endif
 
 template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> >
-class _LIBCPP_TEMPLATE_VIS time_put_byname
+class _LIBCUDACXX_TEMPLATE_VIS time_put_byname
     : public time_put<_CharT, _OutputIterator>
 {
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit time_put_byname(const char* __nm, size_t __refs = 0)
         : time_put<_CharT, _OutputIterator>(__nm, __refs) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit time_put_byname(const string& __nm, size_t __refs = 0)
         : time_put<_CharT, _OutputIterator>(__nm, __refs) {}
 
 protected:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     ~time_put_byname() {}
 };
 
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put_byname<char>;
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put_byname<wchar_t>;
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS time_put_byname<char>;
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS time_put_byname<wchar_t>;
 #endif
 
 // money_base
 
-class _LIBCPP_TYPE_VIS money_base
+class _LIBCUDACXX_TYPE_VIS money_base
 {
 public:
     enum part {none, space, symbol, sign, value};
     struct pattern {char field[4];};
 
-    _LIBCPP_INLINE_VISIBILITY money_base() {}
+    _LIBCUDACXX_INLINE_VISIBILITY money_base() {}
 };
 
 // moneypunct
 
 template <class _CharT, bool _International = false>
-class _LIBCPP_TEMPLATE_VIS moneypunct
+class _LIBCUDACXX_TEMPLATE_VIS moneypunct
     : public locale::facet,
       public money_base
 {
@@ -2603,25 +2603,25 @@ public:
     typedef _CharT                  char_type;
     typedef basic_string<char_type> string_type;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit moneypunct(size_t __refs = 0)
         : locale::facet(__refs) {}
 
-    _LIBCPP_INLINE_VISIBILITY char_type   decimal_point() const {return do_decimal_point();}
-    _LIBCPP_INLINE_VISIBILITY char_type   thousands_sep() const {return do_thousands_sep();}
-    _LIBCPP_INLINE_VISIBILITY string      grouping()      const {return do_grouping();}
-    _LIBCPP_INLINE_VISIBILITY string_type curr_symbol()   const {return do_curr_symbol();}
-    _LIBCPP_INLINE_VISIBILITY string_type positive_sign() const {return do_positive_sign();}
-    _LIBCPP_INLINE_VISIBILITY string_type negative_sign() const {return do_negative_sign();}
-    _LIBCPP_INLINE_VISIBILITY int         frac_digits()   const {return do_frac_digits();}
-    _LIBCPP_INLINE_VISIBILITY pattern     pos_format()    const {return do_pos_format();}
-    _LIBCPP_INLINE_VISIBILITY pattern     neg_format()    const {return do_neg_format();}
+    _LIBCUDACXX_INLINE_VISIBILITY char_type   decimal_point() const {return do_decimal_point();}
+    _LIBCUDACXX_INLINE_VISIBILITY char_type   thousands_sep() const {return do_thousands_sep();}
+    _LIBCUDACXX_INLINE_VISIBILITY string      grouping()      const {return do_grouping();}
+    _LIBCUDACXX_INLINE_VISIBILITY string_type curr_symbol()   const {return do_curr_symbol();}
+    _LIBCUDACXX_INLINE_VISIBILITY string_type positive_sign() const {return do_positive_sign();}
+    _LIBCUDACXX_INLINE_VISIBILITY string_type negative_sign() const {return do_negative_sign();}
+    _LIBCUDACXX_INLINE_VISIBILITY int         frac_digits()   const {return do_frac_digits();}
+    _LIBCUDACXX_INLINE_VISIBILITY pattern     pos_format()    const {return do_pos_format();}
+    _LIBCUDACXX_INLINE_VISIBILITY pattern     neg_format()    const {return do_neg_format();}
 
     static locale::id id;
     static const bool intl = _International;
 
 protected:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     ~moneypunct() {}
 
     virtual char_type   do_decimal_point() const {return numeric_limits<char_type>::max();}
@@ -2645,17 +2645,17 @@ template <class _CharT, bool _International>
 const bool
 moneypunct<_CharT, _International>::intl;
 
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct<char, false>;
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct<char, true>;
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct<wchar_t, false>;
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct<wchar_t, true>;
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS moneypunct<char, false>;
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS moneypunct<char, true>;
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS moneypunct<wchar_t, false>;
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS moneypunct<wchar_t, true>;
 #endif
 
 // moneypunct_byname
 
 template <class _CharT, bool _International = false>
-class _LIBCPP_TEMPLATE_VIS moneypunct_byname
+class _LIBCUDACXX_TEMPLATE_VIS moneypunct_byname
     : public moneypunct<_CharT, _International>
 {
 public:
@@ -2663,16 +2663,16 @@ public:
     typedef _CharT                  char_type;
     typedef basic_string<char_type> string_type;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit moneypunct_byname(const char* __nm, size_t __refs = 0)
         : moneypunct<_CharT, _International>(__refs) {init(__nm);}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit moneypunct_byname(const string& __nm, size_t __refs = 0)
         : moneypunct<_CharT, _International>(__refs) {init(__nm.c_str());}
 
 protected:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     ~moneypunct_byname() {}
 
     virtual char_type   do_decimal_point() const {return __decimal_point_;}
@@ -2699,16 +2699,16 @@ private:
     void init(const char*);
 };
 
-template<> _LIBCPP_FUNC_VIS void moneypunct_byname<char, false>::init(const char*);
-template<> _LIBCPP_FUNC_VIS void moneypunct_byname<char, true>::init(const char*);
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname<char, false>;
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname<char, true>;
+template<> _LIBCUDACXX_FUNC_VIS void moneypunct_byname<char, false>::init(const char*);
+template<> _LIBCUDACXX_FUNC_VIS void moneypunct_byname<char, true>::init(const char*);
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname<char, false>;
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname<char, true>;
 
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-template<> _LIBCPP_FUNC_VIS void moneypunct_byname<wchar_t, false>::init(const char*);
-template<> _LIBCPP_FUNC_VIS void moneypunct_byname<wchar_t, true>::init(const char*);
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname<wchar_t, false>;
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname<wchar_t, true>;
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
+template<> _LIBCUDACXX_FUNC_VIS void moneypunct_byname<wchar_t, false>::init(const char*);
+template<> _LIBCUDACXX_FUNC_VIS void moneypunct_byname<wchar_t, true>::init(const char*);
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname<wchar_t, false>;
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname<wchar_t, true>;
 #endif
 
 // money_get
@@ -2720,7 +2720,7 @@ protected:
     typedef _CharT                  char_type;
     typedef basic_string<char_type> string_type;
 
-    _LIBCPP_INLINE_VISIBILITY __money_get() {}
+    _LIBCUDACXX_INLINE_VISIBILITY __money_get() {}
 
     static void __gather_info(bool __intl, const locale& __loc,
                               money_base::pattern& __pat, char_type& __dp,
@@ -2765,13 +2765,13 @@ __money_get<_CharT>::__gather_info(bool __intl, const locale& __loc,
     }
 }
 
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __money_get<char>;
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __money_get<wchar_t>;
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS __money_get<char>;
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS __money_get<wchar_t>;
 #endif
 
 template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> >
-class _LIBCPP_TEMPLATE_VIS money_get
+class _LIBCUDACXX_TEMPLATE_VIS money_get
     : public locale::facet,
       private __money_get<_CharT>
 {
@@ -2780,18 +2780,18 @@ public:
     typedef _InputIterator          iter_type;
     typedef basic_string<char_type> string_type;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit money_get(size_t __refs = 0)
         : locale::facet(__refs) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iter_type get(iter_type __b, iter_type __e, bool __intl, ios_base& __iob,
                   ios_base::iostate& __err, long double& __v) const
     {
         return do_get(__b, __e, __intl, __iob, __err, __v);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iter_type get(iter_type __b, iter_type __e, bool __intl, ios_base& __iob,
                   ios_base::iostate& __err, string_type& __v) const
     {
@@ -2802,7 +2802,7 @@ public:
 
 protected:
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     ~money_get() {}
 
     virtual iter_type do_get(iter_type __b, iter_type __e, bool __intl,
@@ -2825,10 +2825,10 @@ template <class _CharT, class _InputIterator>
 locale::id
 money_get<_CharT, _InputIterator>::id;
 
-_LIBCPP_FUNC_VIS void __do_nothing(void*);
+_LIBCUDACXX_FUNC_VIS void __do_nothing(void*);
 
 template <class _Tp>
-_LIBCPP_HIDDEN
+_LIBCUDACXX_HIDDEN
 void
 __double_or_nothing(unique_ptr<_Tp, void(*)(void*)>& __b, _Tp*& __n, _Tp*& __e)
 {
@@ -2901,7 +2901,7 @@ money_get<_CharT, _InputIterator>::__do_get(iter_type& __b, iter_type __e,
                     return false;
                 }
             }
-            _LIBCPP_FALLTHROUGH();
+            _LIBCUDACXX_FALLTHROUGH();
         case money_base::none:
             if (__p != 3)
             {
@@ -3091,7 +3091,7 @@ money_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
         if (__neg)
             *__nc++ = '-';
         for (const char_type* __w = __wb.get(); __w < __wn; ++__w, ++__nc)
-            *__nc = __src[find(__atoms, _VSTD::end(__atoms), *__w) - __atoms];
+            *__nc = __src[find(__atoms, _CUDA_VSTD::end(__atoms), *__w) - __atoms];
         *__nc = char();
         if (sscanf(__nbuf, "%Lf", &__v) != 1)
             __throw_runtime_error("money_get error");
@@ -3134,9 +3134,9 @@ money_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
     return __b;
 }
 
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_get<char>;
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_get<wchar_t>;
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS money_get<char>;
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS money_get<wchar_t>;
 #endif
 
 // money_put
@@ -3148,7 +3148,7 @@ protected:
     typedef _CharT                  char_type;
     typedef basic_string<char_type> string_type;
 
-    _LIBCPP_INLINE_VISIBILITY __money_put() {}
+    _LIBCUDACXX_INLINE_VISIBILITY __money_put() {}
 
     static void __gather_info(bool __intl, bool __neg, const locale& __loc,
                               money_base::pattern& __pat, char_type& __dp,
@@ -3244,7 +3244,7 @@ __money_put<_CharT>::__format(char_type* __mb, char_type*& __mi, char_type*& __m
             break;
         case money_base::symbol:
             if (!__sym.empty() && (__flags & ios_base::showbase))
-                __me = _VSTD::copy(__sym.begin(), __sym.end(), __me);
+                __me = _CUDA_VSTD::copy(__sym.begin(), __sym.end(), __me);
             break;
         case money_base::value:
             {
@@ -3303,7 +3303,7 @@ __money_put<_CharT>::__format(char_type* __mb, char_type*& __mi, char_type*& __m
     }
     // print rest of sign, if any
     if (__sn.size() > 1)
-        __me = _VSTD::copy(__sn.begin()+1, __sn.end(), __me);
+        __me = _CUDA_VSTD::copy(__sn.begin()+1, __sn.end(), __me);
     // set alignment
     if ((__flags & ios_base::adjustfield) == ios_base::left)
         __mi = __me;
@@ -3311,13 +3311,13 @@ __money_put<_CharT>::__format(char_type* __mb, char_type*& __mi, char_type*& __m
         __mi = __mb;
 }
 
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __money_put<char>;
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __money_put<wchar_t>;
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS __money_put<char>;
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS __money_put<wchar_t>;
 #endif
 
 template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> >
-class _LIBCPP_TEMPLATE_VIS money_put
+class _LIBCUDACXX_TEMPLATE_VIS money_put
     : public locale::facet,
       private __money_put<_CharT>
 {
@@ -3326,18 +3326,18 @@ public:
     typedef _OutputIterator         iter_type;
     typedef basic_string<char_type> string_type;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit money_put(size_t __refs = 0)
         : locale::facet(__refs) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iter_type put(iter_type __s, bool __intl, ios_base& __iob, char_type __fl,
                   long double __units) const
     {
         return do_put(__s, __intl, __iob, __fl, __units);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iter_type put(iter_type __s, bool __intl, ios_base& __iob, char_type __fl,
                   const string_type& __digits) const
     {
@@ -3347,7 +3347,7 @@ public:
     static locale::id id;
 
 protected:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     ~money_put() {}
 
     virtual iter_type do_put(iter_type __s, bool __intl, ios_base& __iob,
@@ -3378,7 +3378,7 @@ money_put<_CharT, _OutputIterator>::do_put(iter_type __s, bool __intl,
     // secure memory for digit storage
     if (static_cast<size_t>(__n) > __bs-1)
     {
-        __n = __libcpp_asprintf_l(&__bb, _LIBCPP_GET_C_LOCALE, "%.0Lf", __units);
+        __n = __LIBCUDACXX_asprintf_l(&__bb, _LIBCUDACXX_GET_C_LOCALE, "%.0Lf", __units);
         if (__n == -1)
             __throw_bad_alloc();
         __hn.reset(__bb);
@@ -3466,23 +3466,23 @@ money_put<_CharT, _OutputIterator>::do_put(iter_type __s, bool __intl,
     return __pad_and_output(__s, __mb, __mi, __me, __iob, __fl);
 }
 
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_put<char>;
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_put<wchar_t>;
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS money_put<char>;
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS money_put<wchar_t>;
 #endif
 
 // messages
 
-class _LIBCPP_TYPE_VIS messages_base
+class _LIBCUDACXX_TYPE_VIS messages_base
 {
 public:
     typedef ptr
diff _t catalog;
 
-    _LIBCPP_INLINE_VISIBILITY messages_base() {}
+    _LIBCUDACXX_INLINE_VISIBILITY messages_base() {}
 };
 
 template <class _CharT>
-class _LIBCPP_TEMPLATE_VIS messages
+class _LIBCUDACXX_TEMPLATE_VIS messages
     : public locale::facet,
       public messages_base
 {
@@ -3490,24 +3490,24 @@ public:
     typedef _CharT               char_type;
     typedef basic_string<_CharT> string_type;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit messages(size_t __refs = 0)
         : locale::facet(__refs) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     catalog open(const basic_string<char>& __nm, const locale& __loc) const
     {
         return do_open(__nm, __loc);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     string_type get(catalog __c, int __set, int __msgid,
                     const string_type& __dflt) const
     {
         return do_get(__c, __set, __msgid, __dflt);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void close(catalog __c) const
     {
         do_close(__c);
@@ -3516,7 +3516,7 @@ public:
     static locale::id id;
 
 protected:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     ~messages() {}
 
     virtual catalog do_open(const basic_string<char>&, const locale&) const;
@@ -3533,15 +3533,15 @@ template <class _CharT>
 typename messages<_CharT>::catalog
 messages<_CharT>::do_open(const basic_string<char>& __nm, const locale&) const
 {
-#ifdef _LIBCPP_HAS_CATOPEN
+#ifdef _LIBCUDACXX_HAS_CATOPEN
     catalog __cat = (catalog)catopen(__nm.c_str(), NL_CAT_LOCALE);
     if (__cat != -1)
         __cat = static_cast<catalog>((static_cast<size_t>(__cat) >> 1));
     return __cat;
-#else // !_LIBCPP_HAS_CATOPEN
+#else // !_LIBCUDACXX_HAS_CATOPEN
     (void)__nm;
     return -1;
-#endif // _LIBCPP_HAS_CATOPEN
+#endif // _LIBCUDACXX_HAS_CATOPEN
 }
 
 template <class _CharT>
@@ -3549,7 +3549,7 @@ typename messages<_CharT>::string_type
 messages<_CharT>::do_get(catalog __c, int __set, int __msgid,
                          const string_type& __dflt) const
 {
-#ifdef _LIBCPP_HAS_CATOPEN
+#ifdef _LIBCUDACXX_HAS_CATOPEN
     string __ndflt;
     __narrow_to_utf8<sizeof(char_type)*__CHAR_BIT__>()(back_inserter(__ndflt),
                                                        __dflt.c_str(),
@@ -3560,65 +3560,65 @@ messages<_CharT>::do_get(catalog __c, int __set, int __msgid,
     char* __n = catgets(__cat, __set, __msgid, __ndflt.c_str());
     string_type __w;
     __widen_from_utf8<sizeof(char_type)*__CHAR_BIT__>()(back_inserter(__w),
-                                                        __n, __n + _VSTD::strlen(__n));
+                                                        __n, __n + _CUDA_VSTD::strlen(__n));
     return __w;
-#else // !_LIBCPP_HAS_CATOPEN
+#else // !_LIBCUDACXX_HAS_CATOPEN
     (void)__c;
     (void)__set;
     (void)__msgid;
     return __dflt;
-#endif // _LIBCPP_HAS_CATOPEN
+#endif // _LIBCUDACXX_HAS_CATOPEN
 }
 
 template <class _CharT>
 void
 messages<_CharT>::do_close(catalog __c) const
 {
-#ifdef _LIBCPP_HAS_CATOPEN
+#ifdef _LIBCUDACXX_HAS_CATOPEN
     if (__c != -1)
         __c <<= 1;
     nl_catd __cat = (nl_catd)__c;
     catclose(__cat);
-#else // !_LIBCPP_HAS_CATOPEN
+#else // !_LIBCUDACXX_HAS_CATOPEN
     (void)__c;
-#endif // _LIBCPP_HAS_CATOPEN
+#endif // _LIBCUDACXX_HAS_CATOPEN
 }
 
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages<char>;
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages<wchar_t>;
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS messages<char>;
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS messages<wchar_t>;
 #endif
 
 template <class _CharT>
-class _LIBCPP_TEMPLATE_VIS messages_byname
+class _LIBCUDACXX_TEMPLATE_VIS messages_byname
     : public messages<_CharT>
 {
 public:
     typedef messages_base::catalog catalog;
     typedef basic_string<_CharT> string_type;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit messages_byname(const char*, size_t __refs = 0)
         : messages<_CharT>(__refs) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit messages_byname(const string&, size_t __refs = 0)
         : messages<_CharT>(__refs) {}
 
 protected:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     ~messages_byname() {}
 };
 
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages_byname<char>;
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages_byname<wchar_t>;
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS messages_byname<char>;
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS messages_byname<wchar_t>;
 #endif
 
 template<class _Codecvt, class _Elem = wchar_t,
          class _Wide_alloc = allocator<_Elem>,
          class _Byte_alloc = allocator<char> >
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 wstring_convert
+class _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_DEPRECATED_IN_CXX17 wstring_convert
 {
 public:
     typedef basic_string<char, char_traits<char>, _Byte_alloc>   byte_string;
@@ -3636,56 +3636,56 @@ private:
     wstring_convert(const wstring_convert& __wc);
     wstring_convert& operator=(const wstring_convert& __wc);
 public:
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     wstring_convert() : wstring_convert(new _Codecvt) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit wstring_convert(_Codecvt* __pcvt);
 #else
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_EXPLICIT_AFTER_CXX11
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_EXPLICIT_AFTER_CXX11
     wstring_convert(_Codecvt* __pcvt = new _Codecvt);
 #endif
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     wstring_convert(_Codecvt* __pcvt, state_type __state);
-    _LIBCPP_EXPLICIT_AFTER_CXX11 wstring_convert(const byte_string& __byte_err,
+    _LIBCUDACXX_EXPLICIT_AFTER_CXX11 wstring_convert(const byte_string& __byte_err,
                     const wide_string& __wide_err = wide_string());
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     wstring_convert(wstring_convert&& __wc);
 #endif
     ~wstring_convert();
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     wide_string from_bytes(char __byte)
         {return from_bytes(&__byte, &__byte+1);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     wide_string from_bytes(const char* __ptr)
         {return from_bytes(__ptr, __ptr + char_traits<char>::length(__ptr));}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     wide_string from_bytes(const byte_string& __str)
         {return from_bytes(__str.data(), __str.data() + __str.size());}
     wide_string from_bytes(const char* __first, const char* __last);
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     byte_string to_bytes(_Elem __wchar)
         {return to_bytes(&__wchar, &__wchar+1);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     byte_string to_bytes(const _Elem* __wptr)
         {return to_bytes(__wptr, __wptr + char_traits<_Elem>::length(__wptr));}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     byte_string to_bytes(const wide_string& __wstr)
         {return to_bytes(__wstr.data(), __wstr.data() + __wstr.size());}
     byte_string to_bytes(const _Elem* __first, const _Elem* __last);
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t converted() const _NOEXCEPT {return __cvtcount_;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     state_type state() const {return __cvtstate_;}
 };
 
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+_LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
 template<class _Codecvt, class _Elem, class _Wide_alloc, class _Byte_alloc>
 inline
 wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::
@@ -3693,7 +3693,7 @@ wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::
         : __cvtptr_(__pcvt), __cvtstate_(), __cvtcount_(0)
 {
 }
-_LIBCPP_SUPPRESS_DEPRECATED_POP
+_LIBCUDACXX_SUPPRESS_DEPRECATED_POP
 
 template<class _Codecvt, class _Elem, class _Wide_alloc, class _Byte_alloc>
 inline
@@ -3712,23 +3712,23 @@ wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::
     __cvtptr_ = new _Codecvt;
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
 template<class _Codecvt, class _Elem, class _Wide_alloc, class _Byte_alloc>
 inline
 wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::
     wstring_convert(wstring_convert&& __wc)
-        : __byte_err_string_(_VSTD::move(__wc.__byte_err_string_)),
-          __wide_err_string_(_VSTD::move(__wc.__wide_err_string_)),
+        : __byte_err_string_(_CUDA_VSTD::move(__wc.__byte_err_string_)),
+          __wide_err_string_(_CUDA_VSTD::move(__wc.__wide_err_string_)),
           __cvtptr_(__wc.__cvtptr_),
           __cvtstate_(__wc.__cvtstate_), __cvtcount_(__wc.__cvtcount_)
 {
     __wc.__cvtptr_ = nullptr;
 }
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+_LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
 template<class _Codecvt, class _Elem, class _Wide_alloc, class _Byte_alloc>
 wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::~wstring_convert()
 {
@@ -3740,7 +3740,7 @@ typename wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::wide_string
 wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::
     from_bytes(const char* __frm, const char* __frm_end)
 {
-_LIBCPP_SUPPRESS_DEPRECATED_POP
+_LIBCUDACXX_SUPPRESS_DEPRECATED_POP
     __cvtcount_ = 0;
     if (__cvtptr_ != nullptr)
     {
@@ -3887,7 +3887,7 @@ wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::
 }
 
 template <class _Codecvt, class _Elem = wchar_t, class _Tr = char_traits<_Elem> >
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 wbuffer_convert
+class _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_DEPRECATED_IN_CXX17 wbuffer_convert
     : public basic_streambuf<_Elem, _Tr>
 {
 public:
@@ -3919,13 +3919,13 @@ private:
     wbuffer_convert& operator=(const wbuffer_convert&);
 
 public:
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
     wbuffer_convert() : wbuffer_convert(nullptr) {}
     explicit wbuffer_convert(streambuf* __bytebuf,
                              _Codecvt* __pcvt = new _Codecvt,
                              state_type __state = state_type());
 #else
-    _LIBCPP_EXPLICIT_AFTER_CXX11
+    _LIBCUDACXX_EXPLICIT_AFTER_CXX11
     wbuffer_convert(streambuf* __bytebuf = nullptr,
                     _Codecvt* __pcvt = new _Codecvt,
                     state_type __state = state_type());
@@ -3933,9 +3933,9 @@ public:
 
     ~wbuffer_convert();
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     streambuf* rdbuf() const {return __bufptr_;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     streambuf* rdbuf(streambuf* __bytebuf)
     {
         streambuf* __r = __bufptr_;
@@ -3943,7 +3943,7 @@ public:
         return __r;
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     state_type state() const {return __st_;}
 
 protected:
@@ -3964,7 +3964,7 @@ private:
     wbuffer_convert* __close();
 };
 
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+_LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
 template <class _Codecvt, class _Elem, class _Tr>
 wbuffer_convert<_Codecvt, _Elem, _Tr>::
     wbuffer_convert(streambuf* __bytebuf, _Codecvt* __pcvt, state_type __state)
@@ -4000,7 +4000,7 @@ template <class _Codecvt, class _Elem, class _Tr>
 typename wbuffer_convert<_Codecvt, _Elem, _Tr>::int_type
 wbuffer_convert<_Codecvt, _Elem, _Tr>::underflow()
 {
-_LIBCPP_SUPPRESS_DEPRECATED_POP
+_LIBCUDACXX_SUPPRESS_DEPRECATED_POP
     if (__cv_ == 0 || __bufptr_ == 0)
         return traits_type::eof();
     bool __initial = __read_mode();
@@ -4011,7 +4011,7 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
     int_type __c = traits_type::eof();
     if (this->gptr() == this->egptr())
     {
-        _VSTD::memmove(this->eback(), this->egptr() - __unget_sz, __unget_sz * sizeof(char_type));
+        _CUDA_VSTD::memmove(this->eback(), this->egptr() - __unget_sz, __unget_sz * sizeof(char_type));
         if (__always_noconv_)
         {
             streamsize __nmemb = static_cast<streamsize>(this->egptr() - this->eback() - __unget_sz);
@@ -4026,12 +4026,12 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
         }
         else
         {
-             _LIBCPP_ASSERT(!(__extbufnext_ == NULL && (__extbufend_ != __extbufnext_)), "underflow moving from NULL" );
+             _LIBCUDACXX_ASSERT(!(__extbufnext_ == NULL && (__extbufend_ != __extbufnext_)), "underflow moving from NULL" );
              if (__extbufend_ != __extbufnext_)
-                _VSTD::memmove(__extbuf_, __extbufnext_, __extbufend_ - __extbufnext_);
+                _CUDA_VSTD::memmove(__extbuf_, __extbufnext_, __extbufend_ - __extbufnext_);
             __extbufnext_ = __extbuf_ + (__extbufend_ - __extbufnext_);
             __extbufend_ = __extbuf_ + (__extbuf_ == __extbuf_min_ ? sizeof(__extbuf_min_) : __ebs_);
-            streamsize __nmemb = _VSTD::min(static_cast<streamsize>(this->egptr() - this->eback() - __unget_sz),
+            streamsize __nmemb = _CUDA_VSTD::min(static_cast<streamsize>(this->egptr() - this->eback() - __unget_sz),
                                  static_cast<streamsize>(__extbufend_ - __extbufnext_));
             codecvt_base::result __r;
             // FIXME: Do we ever need to restore the state here?
@@ -4065,12 +4065,12 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
     return __c;
 }
 
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+_LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
 template <class _Codecvt, class _Elem, class _Tr>
 typename wbuffer_convert<_Codecvt, _Elem, _Tr>::int_type
 wbuffer_convert<_Codecvt, _Elem, _Tr>::pbackfail(int_type __c)
 {
-_LIBCPP_SUPPRESS_DEPRECATED_POP
+_LIBCUDACXX_SUPPRESS_DEPRECATED_POP
     if (__cv_ != 0 && __bufptr_ != 0 && this->eback() < this->gptr())
     {
         if (traits_type::eq_int_type(__c, traits_type::eof()))
@@ -4088,12 +4088,12 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
     return traits_type::eof();
 }
 
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+_LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
 template <class _Codecvt, class _Elem, class _Tr>
 typename wbuffer_convert<_Codecvt, _Elem, _Tr>::int_type
 wbuffer_convert<_Codecvt, _Elem, _Tr>::overflow(int_type __c)
 {
-_LIBCPP_SUPPRESS_DEPRECATED_POP
+_LIBCUDACXX_SUPPRESS_DEPRECATED_POP
     if (__cv_ == 0 || __bufptr_ == 0)
         return traits_type::eof();
     __write_mode();
@@ -4152,12 +4152,12 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
     return traits_type::not_eof(__c);
 }
 
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+_LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
 template <class _Codecvt, class _Elem, class _Tr>
 basic_streambuf<_Elem, _Tr>*
 wbuffer_convert<_Codecvt, _Elem, _Tr>::setbuf(char_type* __s, streamsize __n)
 {
-_LIBCPP_SUPPRESS_DEPRECATED_POP
+_LIBCUDACXX_SUPPRESS_DEPRECATED_POP
     this->setg(0, 0, 0);
     this->setp(0, 0);
     if (__owns_eb_)
@@ -4207,7 +4207,7 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
     return this;
 }
 
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+_LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
 template <class _Codecvt, class _Elem, class _Tr>
 typename wbuffer_convert<_Codecvt, _Elem, _Tr>::pos_type
 wbuffer_convert<_Codecvt, _Elem, _Tr>::seekoff(off_type __off, ios_base::seekdir __way,
@@ -4239,7 +4239,7 @@ template <class _Codecvt, class _Elem, class _Tr>
 int
 wbuffer_convert<_Codecvt, _Elem, _Tr>::sync()
 {
-_LIBCPP_SUPPRESS_DEPRECATED_POP
+_LIBCUDACXX_SUPPRESS_DEPRECATED_POP
     if (__cv_ == 0 || __bufptr_ == 0)
         return 0;
     if (__cm_ & ios_base::out)
@@ -4308,7 +4308,7 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
     return 0;
 }
 
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+_LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
 template <class _Codecvt, class _Elem, class _Tr>
 bool
 wbuffer_convert<_Codecvt, _Elem, _Tr>::__read_mode()
@@ -4363,10 +4363,10 @@ wbuffer_convert<_Codecvt, _Elem, _Tr>::__close()
     return __rt;
 }
 
-_LIBCPP_SUPPRESS_DEPRECATED_POP
+_LIBCUDACXX_SUPPRESS_DEPRECATED_POP
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP_LOCALE
+#endif // _LIBCUDACXX_LOCALE

diff  --git a/libcxx/include/locale.h b/libcxx/include/locale.h
index 17c0a705a009..e53549a5f9fa 100644
--- a/libcxx/include/locale.h
+++ b/libcxx/include/locale.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_LOCALE_H
-#define _LIBCPP_LOCALE_H
+#ifndef _LIBCUDACXX_LOCALE_H
+#define _LIBCUDACXX_LOCALE_H
 
 /*
     locale.h synopsis
@@ -35,14 +35,14 @@
 
 #include <__config>
 
-#if defined(_LIBCPP_HAS_NO_LOCALIZATION)
+#if defined(_LIBCUDACXX_HAS_NO_LOCALIZATION)
 #   error "<locale.h> is not supported since libc++ has been configured without support for localization."
 #endif
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
 #include_next <locale.h>
 
-#endif // _LIBCPP_LOCALE_H
+#endif // _LIBCUDACXX_LOCALE_H

diff  --git a/libcxx/include/map b/libcxx/include/map
index e1d5fa8a25d8..9cf644901060 100644
--- a/libcxx/include/map
+++ b/libcxx/include/map
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_MAP
-#define _LIBCPP_MAP
+#ifndef _LIBCUDACXX_MAP
+#define _LIBCUDACXX_MAP
 
 /*
 
@@ -546,7 +546,7 @@ erase_if(multimap<Key, T, Compare, Allocator>& c, Predicate pred);  // C++20
 #include <type_traits>
 #include <version>
 
-#ifndef _LIBCPP_REMOVE_TRANSITIVE_INCLUDES
+#ifndef _LIBCUDACXX_REMOVE_TRANSITIVE_INCLUDES
 #  include <functional>
 #  include <iterator>
 #  include <utility>
@@ -565,52 +565,52 @@ erase_if(multimap<Key, T, Compare, Allocator>& c, Predicate pred);  // C++20
 #include <compare>
 #include <initializer_list>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Key, class _CP, class _Compare,
-          bool = is_empty<_Compare>::value && !__libcpp_is_final<_Compare>::value>
+          bool = is_empty<_Compare>::value && !__LIBCUDACXX_is_final<_Compare>::value>
 class __map_value_compare
     : private _Compare
 {
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __map_value_compare()
         _NOEXCEPT_(is_nothrow_default_constructible<_Compare>::value)
         : _Compare() {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __map_value_compare(_Compare __c)
         _NOEXCEPT_(is_nothrow_copy_constructible<_Compare>::value)
         : _Compare(__c) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const _Compare& key_comp() const _NOEXCEPT {return *this;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool operator()(const _CP& __x, const _CP& __y) const
         {return static_cast<const _Compare&>(*this)(__x.__get_value().first, __y.__get_value().first);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool operator()(const _CP& __x, const _Key& __y) const
         {return static_cast<const _Compare&>(*this)(__x.__get_value().first, __y);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool operator()(const _Key& __x, const _CP& __y) const
         {return static_cast<const _Compare&>(*this)(__x, __y.__get_value().first);}
     void swap(__map_value_compare& __y)
         _NOEXCEPT_(__is_nothrow_swappable<_Compare>::value)
     {
-      using _VSTD::swap;
+      using _CUDA_VSTD::swap;
       swap(static_cast<_Compare&>(*this), static_cast<_Compare&>(__y));
     }
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
     template <typename _K2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool operator()(const _K2& __x, const _CP& __y) const
         {return static_cast<const _Compare&>(*this)(__x, __y.__get_value().first);}
 
     template <typename _K2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool operator()(const _CP& __x, const _K2& __y) const
         {return static_cast<const _Compare&>(*this)(__x.__get_value().first, __y);}
 #endif
@@ -622,48 +622,48 @@ class __map_value_compare<_Key, _CP, _Compare, false>
     _Compare comp;
 
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __map_value_compare()
         _NOEXCEPT_(is_nothrow_default_constructible<_Compare>::value)
         : comp() {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __map_value_compare(_Compare __c)
         _NOEXCEPT_(is_nothrow_copy_constructible<_Compare>::value)
         : comp(__c) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const _Compare& key_comp() const _NOEXCEPT {return comp;}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool operator()(const _CP& __x, const _CP& __y) const
         {return comp(__x.__get_value().first, __y.__get_value().first);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool operator()(const _CP& __x, const _Key& __y) const
         {return comp(__x.__get_value().first, __y);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool operator()(const _Key& __x, const _CP& __y) const
         {return comp(__x, __y.__get_value().first);}
     void swap(__map_value_compare& __y)
         _NOEXCEPT_(__is_nothrow_swappable<_Compare>::value)
     {
-        using _VSTD::swap;
+        using _CUDA_VSTD::swap;
         swap(comp, __y.comp);
     }
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
     template <typename _K2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool operator()(const _K2& __x, const _CP& __y) const
         {return comp(__x, __y.__get_value().first);}
 
     template <typename _K2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool operator()(const _CP& __x, const _K2& __y) const
         {return comp(__x.__get_value().first, __y);}
 #endif
 };
 
 template <class _Key, class _CP, class _Compare, bool __b>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 swap(__map_value_compare<_Key, _CP, _Compare, __b>& __x,
      __map_value_compare<_Key, _CP, _Compare, __b>& __y)
@@ -690,15 +690,15 @@ public:
     bool __first_constructed;
     bool __second_constructed;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __map_node_destructor(allocator_type& __na) _NOEXCEPT
         : __na_(__na),
           __first_constructed(false),
           __second_constructed(false)
         {}
 
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     __map_node_destructor(__tree_node_destructor<allocator_type>&& __x) _NOEXCEPT
         : __na_(__x.__na_),
           __first_constructed(__x.__value_constructed),
@@ -706,15 +706,15 @@ public:
         {
             __x.__value_constructed = false;
         }
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void operator()(pointer __p) _NOEXCEPT
     {
         if (__second_constructed)
-            __alloc_traits::destroy(__na_, _VSTD::addressof(__p->__value_.__get_value().second));
+            __alloc_traits::destroy(__na_, _CUDA_VSTD::addressof(__p->__value_.__get_value().second));
         if (__first_constructed)
-            __alloc_traits::destroy(__na_, _VSTD::addressof(__p->__value_.__get_value().first));
+            __alloc_traits::destroy(__na_, _CUDA_VSTD::addressof(__p->__value_.__get_value().first));
         if (__p)
             __alloc_traits::deallocate(__na_, __p, 1);
     }
@@ -726,10 +726,10 @@ template <class _Key, class _Tp, class _Compare, class _Allocator>
     class multimap;
 template <class _TreeIterator> class __map_const_iterator;
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
 template <class _Key, class _Tp>
-struct _LIBCPP_STANDALONE_DEBUG __value_type
+struct _LIBCUDACXX_STANDALONE_DEBUG __value_type
 {
     typedef _Key                                     key_type;
     typedef _Tp                                      mapped_type;
@@ -741,50 +741,50 @@ private:
     value_type __cc;
 
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     value_type& __get_value()
     {
-#if _LIBCPP_STD_VER > 14
-        return *_VSTD::launder(_VSTD::addressof(__cc));
+#if _LIBCUDACXX_STD_VER > 14
+        return *_CUDA_VSTD::launder(_CUDA_VSTD::addressof(__cc));
 #else
         return __cc;
 #endif
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const value_type& __get_value() const
     {
-#if _LIBCPP_STD_VER > 14
-        return *_VSTD::launder(_VSTD::addressof(__cc));
+#if _LIBCUDACXX_STD_VER > 14
+        return *_CUDA_VSTD::launder(_CUDA_VSTD::addressof(__cc));
 #else
         return __cc;
 #endif
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __nc_ref_pair_type __ref()
     {
         value_type& __v = __get_value();
         return __nc_ref_pair_type(const_cast<key_type&>(__v.first), __v.second);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __nc_rref_pair_type __move()
     {
         value_type& __v = __get_value();
         return __nc_rref_pair_type(
-            _VSTD::move(const_cast<key_type&>(__v.first)),
-            _VSTD::move(__v.second));
+            _CUDA_VSTD::move(const_cast<key_type&>(__v.first)),
+            _CUDA_VSTD::move(__v.second));
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __value_type& operator=(const __value_type& __v)
     {
         __ref() = __v.__get_value();
         return *this;
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __value_type& operator=(__value_type&& __v)
     {
         __ref() = __v.__move();
@@ -794,10 +794,10 @@ public:
     template <class _ValueTp,
               class = __enable_if_t<__is_same_uncvref<_ValueTp, value_type>::value>
              >
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __value_type& operator=(_ValueTp&& __v)
     {
-        __ref() = _VSTD::forward<_ValueTp>(__v);
+        __ref() = _CUDA_VSTD::forward<_ValueTp>(__v);
         return *this;
     }
 
@@ -821,9 +821,9 @@ private:
     value_type __cc;
 
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     value_type& __get_value() { return __cc; }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const value_type& __get_value() const { return __cc; }
 
 private:
@@ -833,7 +833,7 @@ private:
    ~__value_type();
 };
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
 template <class _Tp>
 struct __extract_key_value_types;
@@ -846,7 +846,7 @@ struct __extract_key_value_types<__value_type<_Key, _Tp> >
 };
 
 template <class _TreeIterator>
-class _LIBCPP_TEMPLATE_VIS __map_iterator
+class _LIBCUDACXX_TEMPLATE_VIS __map_iterator
 {
     typedef typename _TreeIterator::_NodeTypes                   _NodeTypes;
     typedef typename _TreeIterator::__pointer_traits             __pointer_traits;
@@ -860,20 +860,20 @@ public:
     typedef value_type&                                          reference;
     typedef typename _NodeTypes::__map_value_type_pointer        pointer;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __map_iterator() _NOEXCEPT {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __map_iterator(_TreeIterator __i) _NOEXCEPT : __i_(__i) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     reference operator*() const {return __i_->__get_value();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     pointer operator->() const {return pointer_traits<pointer>::pointer_to(__i_->__get_value());}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __map_iterator& operator++() {++__i_; return *this;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __map_iterator operator++(int)
     {
         __map_iterator __t(*this);
@@ -881,9 +881,9 @@ public:
         return __t;
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __map_iterator& operator--() {--__i_; return *this;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __map_iterator operator--(int)
     {
         __map_iterator __t(*this);
@@ -891,21 +891,21 @@ public:
         return __t;
     }
 
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
     bool operator==(const __map_iterator& __x, const __map_iterator& __y)
         {return __x.__i_ == __y.__i_;}
     friend
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool operator!=(const __map_iterator& __x, const __map_iterator& __y)
         {return __x.__i_ != __y.__i_;}
 
-    template <class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS map;
-    template <class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS multimap;
-    template <class> friend class _LIBCPP_TEMPLATE_VIS __map_const_iterator;
+    template <class, class, class, class> friend class _LIBCUDACXX_TEMPLATE_VIS map;
+    template <class, class, class, class> friend class _LIBCUDACXX_TEMPLATE_VIS multimap;
+    template <class> friend class _LIBCUDACXX_TEMPLATE_VIS __map_const_iterator;
 };
 
 template <class _TreeIterator>
-class _LIBCPP_TEMPLATE_VIS __map_const_iterator
+class _LIBCUDACXX_TEMPLATE_VIS __map_const_iterator
 {
     typedef typename _TreeIterator::_NodeTypes                   _NodeTypes;
     typedef typename _TreeIterator::__pointer_traits             __pointer_traits;
@@ -919,24 +919,24 @@ public:
     typedef const value_type&                                    reference;
     typedef typename _NodeTypes::__const_map_value_type_pointer  pointer;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __map_const_iterator() _NOEXCEPT {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __map_const_iterator(_TreeIterator __i) _NOEXCEPT : __i_(__i) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __map_const_iterator(__map_iterator<
         typename _TreeIterator::__non_const_iterator> __i) _NOEXCEPT
         : __i_(__i.__i_) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     reference operator*() const {return __i_->__get_value();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     pointer operator->() const {return pointer_traits<pointer>::pointer_to(__i_->__get_value());}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __map_const_iterator& operator++() {++__i_; return *this;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __map_const_iterator operator++(int)
     {
         __map_const_iterator __t(*this);
@@ -944,9 +944,9 @@ public:
         return __t;
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __map_const_iterator& operator--() {--__i_; return *this;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __map_const_iterator operator--(int)
     {
         __map_const_iterator __t(*this);
@@ -954,21 +954,21 @@ public:
         return __t;
     }
 
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
     bool operator==(const __map_const_iterator& __x, const __map_const_iterator& __y)
         {return __x.__i_ == __y.__i_;}
-    friend _LIBCPP_INLINE_VISIBILITY
+    friend _LIBCUDACXX_INLINE_VISIBILITY
     bool operator!=(const __map_const_iterator& __x, const __map_const_iterator& __y)
         {return __x.__i_ != __y.__i_;}
 
-    template <class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS map;
-    template <class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS multimap;
-    template <class, class, class> friend class _LIBCPP_TEMPLATE_VIS __tree_const_iterator;
+    template <class, class, class, class> friend class _LIBCUDACXX_TEMPLATE_VIS map;
+    template <class, class, class, class> friend class _LIBCUDACXX_TEMPLATE_VIS multimap;
+    template <class, class, class> friend class _LIBCUDACXX_TEMPLATE_VIS __tree_const_iterator;
 };
 
 template <class _Key, class _Tp, class _Compare = less<_Key>,
           class _Allocator = allocator<pair<const _Key, _Tp> > >
-class _LIBCPP_TEMPLATE_VIS map
+class _LIBCUDACXX_TEMPLATE_VIS map
 {
 public:
     // types:
@@ -983,23 +983,23 @@ public:
     static_assert((is_same<typename allocator_type::value_type, value_type>::value),
                   "Allocator::value_type must be same type as value_type");
 
-    class _LIBCPP_TEMPLATE_VIS value_compare
+    class _LIBCUDACXX_TEMPLATE_VIS value_compare
         : public __binary_function<value_type, value_type, bool>
     {
         friend class map;
     protected:
         key_compare comp;
 
-        _LIBCPP_INLINE_VISIBILITY value_compare(key_compare __c) : comp(__c) {}
+        _LIBCUDACXX_INLINE_VISIBILITY value_compare(key_compare __c) : comp(__c) {}
     public:
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         bool operator()(const value_type& __x, const value_type& __y) const
             {return comp(__x.first, __y.first);}
     };
 
 private:
 
-    typedef _VSTD::__value_type<key_type, mapped_type>             __value_type;
+    typedef _CUDA_VSTD::__value_type<key_type, mapped_type>             __value_type;
     typedef __map_value_compare<key_type, __value_type, key_compare> __vc;
     typedef typename __rebind_alloc_helper<allocator_traits<allocator_type>,
                                                  __value_type>::type __allocator_type;
@@ -1016,20 +1016,20 @@ public:
     typedef typename __alloc_traits::
diff erence_type       
diff erence_type;
     typedef __map_iterator<typename __base::iterator>             iterator;
     typedef __map_const_iterator<typename __base::const_iterator> const_iterator;
-    typedef _VSTD::reverse_iterator<iterator>               reverse_iterator;
-    typedef _VSTD::reverse_iterator<const_iterator>         const_reverse_iterator;
+    typedef _CUDA_VSTD::reverse_iterator<iterator>               reverse_iterator;
+    typedef _CUDA_VSTD::reverse_iterator<const_iterator>         const_reverse_iterator;
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
     typedef __map_node_handle<typename __base::__node, allocator_type> node_type;
     typedef __insert_return_type<iterator, node_type> insert_return_type;
 #endif
 
     template <class _Key2, class _Value2, class _Comp2, class _Alloc2>
-        friend class _LIBCPP_TEMPLATE_VIS map;
+        friend class _LIBCUDACXX_TEMPLATE_VIS map;
     template <class _Key2, class _Value2, class _Comp2, class _Alloc2>
-        friend class _LIBCPP_TEMPLATE_VIS multimap;
+        friend class _LIBCUDACXX_TEMPLATE_VIS multimap;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     map()
         _NOEXCEPT_(
             is_nothrow_default_constructible<allocator_type>::value &&
@@ -1037,19 +1037,19 @@ public:
             is_nothrow_copy_constructible<key_compare>::value)
         : __tree_(__vc(key_compare())) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit map(const key_compare& __comp)
         _NOEXCEPT_(
             is_nothrow_default_constructible<allocator_type>::value &&
             is_nothrow_copy_constructible<key_compare>::value)
         : __tree_(__vc(__comp)) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit map(const key_compare& __comp, const allocator_type& __a)
         : __tree_(__vc(__comp), typename __base::allocator_type(__a)) {}
 
     template <class _InputIterator>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
         map(_InputIterator __f, _InputIterator __l,
             const key_compare& __comp = key_compare())
         : __tree_(__vc(__comp))
@@ -1058,7 +1058,7 @@ public:
         }
 
     template <class _InputIterator>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
         map(_InputIterator __f, _InputIterator __l,
             const key_compare& __comp, const allocator_type& __a)
         : __tree_(__vc(__comp), typename __base::allocator_type(__a))
@@ -1066,27 +1066,27 @@ public:
             insert(__f, __l);
         }
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
     template <class _InputIterator>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     map(_InputIterator __f, _InputIterator __l, const allocator_type& __a)
         : map(__f, __l, key_compare(), __a) {}
 #endif
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     map(const map& __m)
         : __tree_(__m.__tree_)
         {
             insert(__m.begin(), __m.end());
         }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     map& operator=(const map& __m)
         {
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
             __tree_ = __m.__tree_;
 #else
-            if (this != _VSTD::addressof(__m)) {
+            if (this != _CUDA_VSTD::addressof(__m)) {
                 __tree_.clear();
                 __tree_.value_comp() = __m.__tree_.value_comp();
                 __tree_.__copy_assign_alloc(__m.__tree_);
@@ -1096,439 +1096,439 @@ public:
             return *this;
         }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     map(map&& __m)
         _NOEXCEPT_(is_nothrow_move_constructible<__base>::value)
-        : __tree_(_VSTD::move(__m.__tree_))
+        : __tree_(_CUDA_VSTD::move(__m.__tree_))
         {
         }
 
     map(map&& __m, const allocator_type& __a);
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     map& operator=(map&& __m)
         _NOEXCEPT_(is_nothrow_move_assignable<__base>::value)
         {
-            __tree_ = _VSTD::move(__m.__tree_);
+            __tree_ = _CUDA_VSTD::move(__m.__tree_);
             return *this;
         }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     map(initializer_list<value_type> __il, const key_compare& __comp = key_compare())
         : __tree_(__vc(__comp))
         {
             insert(__il.begin(), __il.end());
         }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     map(initializer_list<value_type> __il, const key_compare& __comp, const allocator_type& __a)
         : __tree_(__vc(__comp), typename __base::allocator_type(__a))
         {
             insert(__il.begin(), __il.end());
         }
 
-#if _LIBCPP_STD_VER > 11
-    _LIBCPP_INLINE_VISIBILITY
+#if _LIBCUDACXX_STD_VER > 11
+    _LIBCUDACXX_INLINE_VISIBILITY
     map(initializer_list<value_type> __il, const allocator_type& __a)
         : map(__il, key_compare(), __a) {}
 #endif
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     map& operator=(initializer_list<value_type> __il)
         {
             __tree_.__assign_unique(__il.begin(), __il.end());
             return *this;
         }
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit map(const allocator_type& __a)
         : __tree_(typename __base::allocator_type(__a))
         {
         }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     map(const map& __m, const allocator_type& __a)
         : __tree_(__m.__tree_.value_comp(), typename __base::allocator_type(__a))
         {
             insert(__m.begin(), __m.end());
         }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     ~map() {
         static_assert(sizeof(__diagnose_non_const_comparator<_Key, _Compare>()), "");
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
           iterator begin() _NOEXCEPT {return __tree_.begin();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator begin() const _NOEXCEPT {return __tree_.begin();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
           iterator end() _NOEXCEPT {return __tree_.end();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator end() const _NOEXCEPT {return __tree_.end();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
           reverse_iterator rbegin() _NOEXCEPT {return reverse_iterator(end());}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_reverse_iterator rbegin() const _NOEXCEPT
         {return const_reverse_iterator(end());}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
           reverse_iterator rend() _NOEXCEPT
             {return       reverse_iterator(begin());}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_reverse_iterator rend() const _NOEXCEPT
         {return const_reverse_iterator(begin());}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator cbegin() const _NOEXCEPT {return begin();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator cend() const _NOEXCEPT {return end();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_reverse_iterator crbegin() const _NOEXCEPT {return rbegin();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_reverse_iterator crend() const _NOEXCEPT {return rend();}
 
-    _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_NODISCARD_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY
     bool      empty() const _NOEXCEPT {return __tree_.size() == 0;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type size() const _NOEXCEPT {return __tree_.size();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type max_size() const _NOEXCEPT {return __tree_.max_size();}
 
     mapped_type& operator[](const key_type& __k);
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
     mapped_type& operator[](key_type&& __k);
 #endif
 
           mapped_type& at(const key_type& __k);
     const mapped_type& at(const key_type& __k) const;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     allocator_type get_allocator() const _NOEXCEPT {return allocator_type(__tree_.__alloc());}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     key_compare    key_comp()      const {return __tree_.value_comp().key_comp();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     value_compare  value_comp()    const {return value_compare(__tree_.value_comp().key_comp());}
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
     template <class ..._Args>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     pair<iterator, bool> emplace(_Args&& ...__args) {
-        return __tree_.__emplace_unique(_VSTD::forward<_Args>(__args)...);
+        return __tree_.__emplace_unique(_CUDA_VSTD::forward<_Args>(__args)...);
     }
 
     template <class ..._Args>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator emplace_hint(const_iterator __p, _Args&& ...__args) {
-        return __tree_.__emplace_hint_unique(__p.__i_, _VSTD::forward<_Args>(__args)...);
+        return __tree_.__emplace_hint_unique(__p.__i_, _CUDA_VSTD::forward<_Args>(__args)...);
     }
 
     template <class _Pp,
               class = __enable_if_t<is_constructible<value_type, _Pp>::value> >
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         pair<iterator, bool> insert(_Pp&& __p)
-            {return __tree_.__insert_unique(_VSTD::forward<_Pp>(__p));}
+            {return __tree_.__insert_unique(_CUDA_VSTD::forward<_Pp>(__p));}
 
     template <class _Pp,
               class = __enable_if_t<is_constructible<value_type, _Pp>::value> >
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         iterator insert(const_iterator __pos, _Pp&& __p)
-            {return __tree_.__insert_unique(__pos.__i_, _VSTD::forward<_Pp>(__p));}
+            {return __tree_.__insert_unique(__pos.__i_, _CUDA_VSTD::forward<_Pp>(__p));}
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     pair<iterator, bool>
         insert(const value_type& __v) {return __tree_.__insert_unique(__v);}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator
         insert(const_iterator __p, const value_type& __v)
             {return __tree_.__insert_unique(__p.__i_, __v);}
 
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     pair<iterator, bool>
-    insert(value_type&& __v) {return __tree_.__insert_unique(_VSTD::move(__v));}
+    insert(value_type&& __v) {return __tree_.__insert_unique(_CUDA_VSTD::move(__v));}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator insert(const_iterator __p,  value_type&& __v)
-    {return __tree_.__insert_unique(__p.__i_, _VSTD::move(__v));}
+    {return __tree_.__insert_unique(__p.__i_, _CUDA_VSTD::move(__v));}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void insert(initializer_list<value_type> __il)
         {insert(__il.begin(), __il.end());}
 #endif
 
     template <class _InputIterator>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         void insert(_InputIterator __f, _InputIterator __l)
         {
             for (const_iterator __e = cend(); __f != __l; ++__f)
                 insert(__e.__i_, *__f);
         }
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 
     template <class... _Args>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         pair<iterator, bool> try_emplace(const key_type& __k, _Args&&... __args)
     {
         return __tree_.__emplace_unique_key_args(__k,
-            _VSTD::piecewise_construct,
-            _VSTD::forward_as_tuple(__k),
-            _VSTD::forward_as_tuple(_VSTD::forward<_Args>(__args)...));
+            _CUDA_VSTD::piecewise_construct,
+            _CUDA_VSTD::forward_as_tuple(__k),
+            _CUDA_VSTD::forward_as_tuple(_CUDA_VSTD::forward<_Args>(__args)...));
     }
 
     template <class... _Args>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         pair<iterator, bool> try_emplace(key_type&& __k, _Args&&... __args)
     {
         return __tree_.__emplace_unique_key_args(__k,
-            _VSTD::piecewise_construct,
-            _VSTD::forward_as_tuple(_VSTD::move(__k)),
-            _VSTD::forward_as_tuple(_VSTD::forward<_Args>(__args)...));
+            _CUDA_VSTD::piecewise_construct,
+            _CUDA_VSTD::forward_as_tuple(_CUDA_VSTD::move(__k)),
+            _CUDA_VSTD::forward_as_tuple(_CUDA_VSTD::forward<_Args>(__args)...));
     }
 
     template <class... _Args>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         iterator try_emplace(const_iterator __h, const key_type& __k, _Args&&... __args)
     {
         return __tree_.__emplace_hint_unique_key_args(__h.__i_, __k,
-            _VSTD::piecewise_construct,
-            _VSTD::forward_as_tuple(__k),
-            _VSTD::forward_as_tuple(_VSTD::forward<_Args>(__args)...)).first;
+            _CUDA_VSTD::piecewise_construct,
+            _CUDA_VSTD::forward_as_tuple(__k),
+            _CUDA_VSTD::forward_as_tuple(_CUDA_VSTD::forward<_Args>(__args)...)).first;
     }
 
     template <class... _Args>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         iterator try_emplace(const_iterator __h, key_type&& __k, _Args&&... __args)
     {
         return __tree_.__emplace_hint_unique_key_args(__h.__i_, __k,
-            _VSTD::piecewise_construct,
-            _VSTD::forward_as_tuple(_VSTD::move(__k)),
-            _VSTD::forward_as_tuple(_VSTD::forward<_Args>(__args)...)).first;
+            _CUDA_VSTD::piecewise_construct,
+            _CUDA_VSTD::forward_as_tuple(_CUDA_VSTD::move(__k)),
+            _CUDA_VSTD::forward_as_tuple(_CUDA_VSTD::forward<_Args>(__args)...)).first;
     }
 
     template <class _Vp>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         pair<iterator, bool> insert_or_assign(const key_type& __k, _Vp&& __v)
     {
         iterator __p = lower_bound(__k);
         if ( __p != end() && !key_comp()(__k, __p->first))
         {
-            __p->second = _VSTD::forward<_Vp>(__v);
-            return _VSTD::make_pair(__p, false);
+            __p->second = _CUDA_VSTD::forward<_Vp>(__v);
+            return _CUDA_VSTD::make_pair(__p, false);
         }
-        return _VSTD::make_pair(emplace_hint(__p, __k, _VSTD::forward<_Vp>(__v)), true);
+        return _CUDA_VSTD::make_pair(emplace_hint(__p, __k, _CUDA_VSTD::forward<_Vp>(__v)), true);
     }
 
     template <class _Vp>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         pair<iterator, bool> insert_or_assign(key_type&& __k, _Vp&& __v)
     {
         iterator __p = lower_bound(__k);
         if ( __p != end() && !key_comp()(__k, __p->first))
         {
-            __p->second = _VSTD::forward<_Vp>(__v);
-            return _VSTD::make_pair(__p, false);
+            __p->second = _CUDA_VSTD::forward<_Vp>(__v);
+            return _CUDA_VSTD::make_pair(__p, false);
         }
-        return _VSTD::make_pair(emplace_hint(__p, _VSTD::move(__k), _VSTD::forward<_Vp>(__v)), true);
+        return _CUDA_VSTD::make_pair(emplace_hint(__p, _CUDA_VSTD::move(__k), _CUDA_VSTD::forward<_Vp>(__v)), true);
     }
 
     template <class _Vp>
-    _LIBCPP_INLINE_VISIBILITY iterator insert_or_assign(const_iterator __h,
+    _LIBCUDACXX_INLINE_VISIBILITY iterator insert_or_assign(const_iterator __h,
                                                         const key_type& __k,
                                                         _Vp&& __v) {
       auto [__r, __inserted] = __tree_.__emplace_hint_unique_key_args(
-          __h.__i_, __k, __k, _VSTD::forward<_Vp>(__v));
+          __h.__i_, __k, __k, _CUDA_VSTD::forward<_Vp>(__v));
 
       if (!__inserted)
-        __r->__get_value().second = _VSTD::forward<_Vp>(__v);
+        __r->__get_value().second = _CUDA_VSTD::forward<_Vp>(__v);
 
       return __r;
     }
 
     template <class _Vp>
-    _LIBCPP_INLINE_VISIBILITY iterator insert_or_assign(const_iterator __h,
+    _LIBCUDACXX_INLINE_VISIBILITY iterator insert_or_assign(const_iterator __h,
                                                         key_type&& __k,
                                                         _Vp&& __v) {
       auto [__r, __inserted] = __tree_.__emplace_hint_unique_key_args(
-          __h.__i_, __k, _VSTD::move(__k), _VSTD::forward<_Vp>(__v));
+          __h.__i_, __k, _CUDA_VSTD::move(__k), _CUDA_VSTD::forward<_Vp>(__v));
 
       if (!__inserted)
-        __r->__get_value().second = _VSTD::forward<_Vp>(__v);
+        __r->__get_value().second = _CUDA_VSTD::forward<_Vp>(__v);
 
       return __r;
     }
 
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCUDACXX_STD_VER > 14
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator erase(const_iterator __p) {return __tree_.erase(__p.__i_);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator erase(iterator __p)       {return __tree_.erase(__p.__i_);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type erase(const key_type& __k)
         {return __tree_.__erase_unique(__k);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator  erase(const_iterator __f, const_iterator __l)
         {return __tree_.erase(__f.__i_, __l.__i_);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void clear() _NOEXCEPT {__tree_.clear();}
 
-#if _LIBCPP_STD_VER > 14
-    _LIBCPP_INLINE_VISIBILITY
+#if _LIBCUDACXX_STD_VER > 14
+    _LIBCUDACXX_INLINE_VISIBILITY
     insert_return_type insert(node_type&& __nh)
     {
-        _LIBCPP_ASSERT(__nh.empty() || __nh.get_allocator() == get_allocator(),
+        _LIBCUDACXX_ASSERT(__nh.empty() || __nh.get_allocator() == get_allocator(),
             "node_type with incompatible allocator passed to map::insert()");
         return __tree_.template __node_handle_insert_unique<
-            node_type, insert_return_type>(_VSTD::move(__nh));
+            node_type, insert_return_type>(_CUDA_VSTD::move(__nh));
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator insert(const_iterator __hint, node_type&& __nh)
     {
-        _LIBCPP_ASSERT(__nh.empty() || __nh.get_allocator() == get_allocator(),
+        _LIBCUDACXX_ASSERT(__nh.empty() || __nh.get_allocator() == get_allocator(),
             "node_type with incompatible allocator passed to map::insert()");
         return __tree_.template __node_handle_insert_unique<node_type>(
-            __hint.__i_, _VSTD::move(__nh));
+            __hint.__i_, _CUDA_VSTD::move(__nh));
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     node_type extract(key_type const& __key)
     {
         return __tree_.template __node_handle_extract<node_type>(__key);
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     node_type extract(const_iterator __it)
     {
         return __tree_.template __node_handle_extract<node_type>(__it.__i_);
     }
     template <class _Compare2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void merge(map<key_type, mapped_type, _Compare2, allocator_type>& __source)
     {
-        _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
+        _LIBCUDACXX_ASSERT(__source.get_allocator() == get_allocator(),
                        "merging container with incompatible allocator");
         __tree_.__node_handle_merge_unique(__source.__tree_);
     }
     template <class _Compare2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void merge(map<key_type, mapped_type, _Compare2, allocator_type>&& __source)
     {
-        _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
+        _LIBCUDACXX_ASSERT(__source.get_allocator() == get_allocator(),
                        "merging container with incompatible allocator");
         __tree_.__node_handle_merge_unique(__source.__tree_);
     }
     template <class _Compare2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void merge(multimap<key_type, mapped_type, _Compare2, allocator_type>& __source)
     {
-        _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
+        _LIBCUDACXX_ASSERT(__source.get_allocator() == get_allocator(),
                        "merging container with incompatible allocator");
         __tree_.__node_handle_merge_unique(__source.__tree_);
     }
     template <class _Compare2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void merge(multimap<key_type, mapped_type, _Compare2, allocator_type>&& __source)
     {
-        _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
+        _LIBCUDACXX_ASSERT(__source.get_allocator() == get_allocator(),
                        "merging container with incompatible allocator");
         __tree_.__node_handle_merge_unique(__source.__tree_);
     }
 #endif
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void swap(map& __m)
         _NOEXCEPT_(__is_nothrow_swappable<__base>::value)
         {__tree_.swap(__m.__tree_);}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator find(const key_type& __k)             {return __tree_.find(__k);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator find(const key_type& __k) const {return __tree_.find(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
     template <typename _K2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __enable_if_t<__is_transparent<_Compare, _K2>::value, iterator>
     find(const _K2& __k)                           {return __tree_.find(__k);}
     template <typename _K2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __enable_if_t<__is_transparent<_Compare, _K2>::value, const_iterator>
     find(const _K2& __k) const                     {return __tree_.find(__k);}
 #endif
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type      count(const key_type& __k) const
         {return __tree_.__count_unique(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
     template <typename _K2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __enable_if_t<__is_transparent<_Compare, _K2>::value, size_type>
     count(const _K2& __k) const {return __tree_.__count_multi(__k);}
 #endif
 
-#if _LIBCPP_STD_VER > 17
-    _LIBCPP_INLINE_VISIBILITY
+#if _LIBCUDACXX_STD_VER > 17
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool contains(const key_type& __k) const {return find(__k) != end();}
     template <typename _K2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __enable_if_t<__is_transparent<_Compare, _K2>::value, bool>
     contains(const _K2& __k) const { return find(__k) != end(); }
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator lower_bound(const key_type& __k)
         {return __tree_.lower_bound(__k);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator lower_bound(const key_type& __k) const
         {return __tree_.lower_bound(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
     template <typename _K2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __enable_if_t<__is_transparent<_Compare, _K2>::value, iterator>
     lower_bound(const _K2& __k)       {return __tree_.lower_bound(__k);}
 
     template <typename _K2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __enable_if_t<__is_transparent<_Compare, _K2>::value, const_iterator>
     lower_bound(const _K2& __k) const {return __tree_.lower_bound(__k);}
 #endif
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator upper_bound(const key_type& __k)
         {return __tree_.upper_bound(__k);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator upper_bound(const key_type& __k) const
         {return __tree_.upper_bound(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
     template <typename _K2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __enable_if_t<__is_transparent<_Compare, _K2>::value, iterator>
     upper_bound(const _K2& __k)       {return __tree_.upper_bound(__k);}
     template <typename _K2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __enable_if_t<__is_transparent<_Compare, _K2>::value, const_iterator>
     upper_bound(const _K2& __k) const {return __tree_.upper_bound(__k);}
 #endif
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     pair<iterator,iterator> equal_range(const key_type& __k)
         {return __tree_.__equal_range_unique(__k);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     pair<const_iterator,const_iterator> equal_range(const key_type& __k) const
         {return __tree_.__equal_range_unique(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
     template <typename _K2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __enable_if_t<__is_transparent<_Compare, _K2>::value, pair<iterator,iterator>>
     equal_range(const _K2& __k)       {return __tree_.__equal_range_multi(__k);}
     template <typename _K2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __enable_if_t<__is_transparent<_Compare, _K2>::value, pair<const_iterator,const_iterator>>
     equal_range(const _K2& __k) const {return __tree_.__equal_range_multi(__k);}
 #endif
@@ -1543,12 +1543,12 @@ private:
     typedef __map_node_destructor<__node_allocator> _Dp;
     typedef unique_ptr<__node, _Dp> __node_holder;
 
-#ifdef _LIBCPP_CXX03_LANG
+#ifdef _LIBCUDACXX_CXX03_LANG
     __node_holder __construct_node_with_key(const key_type& __k);
 #endif
 };
 
-#if _LIBCPP_STD_VER >= 17
+#if _LIBCUDACXX_STD_VER >= 17
 template<class _InputIterator, class _Compare = less<__iter_key_type<_InputIterator>>,
          class _Allocator = allocator<__iter_to_alloc_type<_InputIterator>>,
          class = enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value, void>,
@@ -1577,10 +1577,10 @@ map(initializer_list<pair<_Key, _Tp>>, _Allocator)
   -> map<remove_const_t<_Key>, _Tp, less<remove_const_t<_Key>>, _Allocator>;
 #endif
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 template <class _Key, class _Tp, class _Compare, class _Allocator>
 map<_Key, _Tp, _Compare, _Allocator>::map(map&& __m, const allocator_type& __a)
-    : __tree_(_VSTD::move(__m.__tree_), typename __base::allocator_type(__a))
+    : __tree_(_CUDA_VSTD::move(__m.__tree_), typename __base::allocator_type(__a))
 {
     if (__a != __m.get_allocator())
     {
@@ -1596,9 +1596,9 @@ _Tp&
 map<_Key, _Tp, _Compare, _Allocator>::operator[](const key_type& __k)
 {
     return __tree_.__emplace_unique_key_args(__k,
-        _VSTD::piecewise_construct,
-        _VSTD::forward_as_tuple(__k),
-        _VSTD::forward_as_tuple()).first->__get_value().second;
+        _CUDA_VSTD::piecewise_construct,
+        _CUDA_VSTD::forward_as_tuple(__k),
+        _CUDA_VSTD::forward_as_tuple()).first->__get_value().second;
 }
 
 template <class _Key, class _Tp, class _Compare, class _Allocator>
@@ -1606,12 +1606,12 @@ _Tp&
 map<_Key, _Tp, _Compare, _Allocator>::operator[](key_type&& __k)
 {
     return __tree_.__emplace_unique_key_args(__k,
-        _VSTD::piecewise_construct,
-        _VSTD::forward_as_tuple(_VSTD::move(__k)),
-        _VSTD::forward_as_tuple()).first->__get_value().second;
+        _CUDA_VSTD::piecewise_construct,
+        _CUDA_VSTD::forward_as_tuple(_CUDA_VSTD::move(__k)),
+        _CUDA_VSTD::forward_as_tuple()).first->__get_value().second;
 }
 
-#else // _LIBCPP_CXX03_LANG
+#else // _LIBCUDACXX_CXX03_LANG
 
 template <class _Key, class _Tp, class _Compare, class _Allocator>
 typename map<_Key, _Tp, _Compare, _Allocator>::__node_holder
@@ -1619,9 +1619,9 @@ map<_Key, _Tp, _Compare, _Allocator>::__construct_node_with_key(const key_type&
 {
     __node_allocator& __na = __tree_.__node_alloc();
     __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
-    __node_traits::construct(__na, _VSTD::addressof(__h->__value_.__get_value().first), __k);
+    __node_traits::construct(__na, _CUDA_VSTD::addressof(__h->__value_.__get_value().first), __k);
     __h.get_deleter().__first_constructed = true;
-    __node_traits::construct(__na, _VSTD::addressof(__h->__value_.__get_value().second));
+    __node_traits::construct(__na, _CUDA_VSTD::addressof(__h->__value_.__get_value().second));
     __h.get_deleter().__second_constructed = true;
     return __h;
 }
@@ -1642,7 +1642,7 @@ map<_Key, _Tp, _Compare, _Allocator>::operator[](const key_type& __k)
     return __r->__value_.__get_value().second;
 }
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
 template <class _Key, class _Tp, class _Compare, class _Allocator>
 _Tp&
@@ -1668,25 +1668,25 @@ map<_Key, _Tp, _Compare, _Allocator>::at(const key_type& __k) const
 
 
 template <class _Key, class _Tp, class _Compare, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator==(const map<_Key, _Tp, _Compare, _Allocator>& __x,
            const map<_Key, _Tp, _Compare, _Allocator>& __y)
 {
-    return __x.size() == __y.size() && _VSTD::equal(__x.begin(), __x.end(), __y.begin());
+    return __x.size() == __y.size() && _CUDA_VSTD::equal(__x.begin(), __x.end(), __y.begin());
 }
 
 template <class _Key, class _Tp, class _Compare, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator< (const map<_Key, _Tp, _Compare, _Allocator>& __x,
            const map<_Key, _Tp, _Compare, _Allocator>& __y)
 {
-    return _VSTD::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());
+    return _CUDA_VSTD::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());
 }
 
 template <class _Key, class _Tp, class _Compare, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator!=(const map<_Key, _Tp, _Compare, _Allocator>& __x,
            const map<_Key, _Tp, _Compare, _Allocator>& __y)
@@ -1695,7 +1695,7 @@ operator!=(const map<_Key, _Tp, _Compare, _Allocator>& __x,
 }
 
 template <class _Key, class _Tp, class _Compare, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator> (const map<_Key, _Tp, _Compare, _Allocator>& __x,
            const map<_Key, _Tp, _Compare, _Allocator>& __y)
@@ -1704,7 +1704,7 @@ operator> (const map<_Key, _Tp, _Compare, _Allocator>& __x,
 }
 
 template <class _Key, class _Tp, class _Compare, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator>=(const map<_Key, _Tp, _Compare, _Allocator>& __x,
            const map<_Key, _Tp, _Compare, _Allocator>& __y)
@@ -1713,7 +1713,7 @@ operator>=(const map<_Key, _Tp, _Compare, _Allocator>& __x,
 }
 
 template <class _Key, class _Tp, class _Compare, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator<=(const map<_Key, _Tp, _Compare, _Allocator>& __x,
            const map<_Key, _Tp, _Compare, _Allocator>& __y)
@@ -1722,7 +1722,7 @@ operator<=(const map<_Key, _Tp, _Compare, _Allocator>& __x,
 }
 
 template <class _Key, class _Tp, class _Compare, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 swap(map<_Key, _Tp, _Compare, _Allocator>& __x,
      map<_Key, _Tp, _Compare, _Allocator>& __y)
@@ -1731,20 +1731,20 @@ swap(map<_Key, _Tp, _Compare, _Allocator>& __x,
     __x.swap(__y);
 }
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 template <class _Key, class _Tp, class _Compare, class _Allocator,
           class _Predicate>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
     typename map<_Key, _Tp, _Compare, _Allocator>::size_type
     erase_if(map<_Key, _Tp, _Compare, _Allocator>& __c, _Predicate __pred) {
-  return _VSTD::__libcpp_erase_if_container(__c, __pred);
+  return _CUDA_VSTD::__LIBCUDACXX_erase_if_container(__c, __pred);
 }
 #endif
 
 
 template <class _Key, class _Tp, class _Compare = less<_Key>,
           class _Allocator = allocator<pair<const _Key, _Tp> > >
-class _LIBCPP_TEMPLATE_VIS multimap
+class _LIBCUDACXX_TEMPLATE_VIS multimap
 {
 public:
     // types:
@@ -1759,24 +1759,24 @@ public:
     static_assert((is_same<typename allocator_type::value_type, value_type>::value),
                   "Allocator::value_type must be same type as value_type");
 
-    class _LIBCPP_TEMPLATE_VIS value_compare
+    class _LIBCUDACXX_TEMPLATE_VIS value_compare
         : public __binary_function<value_type, value_type, bool>
     {
         friend class multimap;
     protected:
         key_compare comp;
 
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         value_compare(key_compare __c) : comp(__c) {}
     public:
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         bool operator()(const value_type& __x, const value_type& __y) const
             {return comp(__x.first, __y.first);}
     };
 
 private:
 
-    typedef _VSTD::__value_type<key_type, mapped_type>             __value_type;
+    typedef _CUDA_VSTD::__value_type<key_type, mapped_type>             __value_type;
     typedef __map_value_compare<key_type, __value_type, key_compare> __vc;
     typedef typename __rebind_alloc_helper<allocator_traits<allocator_type>,
                                                  __value_type>::type __allocator_type;
@@ -1793,19 +1793,19 @@ public:
     typedef typename __alloc_traits::
diff erence_type       
diff erence_type;
     typedef __map_iterator<typename __base::iterator>      iterator;
     typedef __map_const_iterator<typename __base::const_iterator> const_iterator;
-    typedef _VSTD::reverse_iterator<iterator>               reverse_iterator;
-    typedef _VSTD::reverse_iterator<const_iterator>         const_reverse_iterator;
+    typedef _CUDA_VSTD::reverse_iterator<iterator>               reverse_iterator;
+    typedef _CUDA_VSTD::reverse_iterator<const_iterator>         const_reverse_iterator;
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
     typedef __map_node_handle<typename __base::__node, allocator_type> node_type;
 #endif
 
     template <class _Key2, class _Value2, class _Comp2, class _Alloc2>
-        friend class _LIBCPP_TEMPLATE_VIS map;
+        friend class _LIBCUDACXX_TEMPLATE_VIS map;
     template <class _Key2, class _Value2, class _Comp2, class _Alloc2>
-        friend class _LIBCPP_TEMPLATE_VIS multimap;
+        friend class _LIBCUDACXX_TEMPLATE_VIS multimap;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     multimap()
         _NOEXCEPT_(
             is_nothrow_default_constructible<allocator_type>::value &&
@@ -1813,19 +1813,19 @@ public:
             is_nothrow_copy_constructible<key_compare>::value)
         : __tree_(__vc(key_compare())) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit multimap(const key_compare& __comp)
         _NOEXCEPT_(
             is_nothrow_default_constructible<allocator_type>::value &&
             is_nothrow_copy_constructible<key_compare>::value)
         : __tree_(__vc(__comp)) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit multimap(const key_compare& __comp, const allocator_type& __a)
         : __tree_(__vc(__comp), typename __base::allocator_type(__a)) {}
 
     template <class _InputIterator>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         multimap(_InputIterator __f, _InputIterator __l,
             const key_compare& __comp = key_compare())
         : __tree_(__vc(__comp))
@@ -1834,7 +1834,7 @@ public:
         }
 
     template <class _InputIterator>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         multimap(_InputIterator __f, _InputIterator __l,
             const key_compare& __comp, const allocator_type& __a)
         : __tree_(__vc(__comp), typename __base::allocator_type(__a))
@@ -1842,14 +1842,14 @@ public:
             insert(__f, __l);
         }
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
     template <class _InputIterator>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     multimap(_InputIterator __f, _InputIterator __l, const allocator_type& __a)
         : multimap(__f, __l, key_compare(), __a) {}
 #endif
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     multimap(const multimap& __m)
         : __tree_(__m.__tree_.value_comp(),
           __alloc_traits::select_on_container_copy_construction(__m.__tree_.__alloc()))
@@ -1857,13 +1857,13 @@ public:
             insert(__m.begin(), __m.end());
         }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     multimap& operator=(const multimap& __m)
         {
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
             __tree_ = __m.__tree_;
 #else
-            if (this != _VSTD::addressof(__m)) {
+            if (this != _CUDA_VSTD::addressof(__m)) {
                 __tree_.clear();
                 __tree_.value_comp() = __m.__tree_.value_comp();
                 __tree_.__copy_assign_alloc(__m.__tree_);
@@ -1873,334 +1873,334 @@ public:
             return *this;
         }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     multimap(multimap&& __m)
         _NOEXCEPT_(is_nothrow_move_constructible<__base>::value)
-        : __tree_(_VSTD::move(__m.__tree_))
+        : __tree_(_CUDA_VSTD::move(__m.__tree_))
         {
         }
 
     multimap(multimap&& __m, const allocator_type& __a);
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     multimap& operator=(multimap&& __m)
         _NOEXCEPT_(is_nothrow_move_assignable<__base>::value)
         {
-            __tree_ = _VSTD::move(__m.__tree_);
+            __tree_ = _CUDA_VSTD::move(__m.__tree_);
             return *this;
         }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     multimap(initializer_list<value_type> __il, const key_compare& __comp = key_compare())
         : __tree_(__vc(__comp))
         {
             insert(__il.begin(), __il.end());
         }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     multimap(initializer_list<value_type> __il, const key_compare& __comp, const allocator_type& __a)
         : __tree_(__vc(__comp), typename __base::allocator_type(__a))
         {
             insert(__il.begin(), __il.end());
         }
 
-#if _LIBCPP_STD_VER > 11
-    _LIBCPP_INLINE_VISIBILITY
+#if _LIBCUDACXX_STD_VER > 11
+    _LIBCUDACXX_INLINE_VISIBILITY
     multimap(initializer_list<value_type> __il, const allocator_type& __a)
         : multimap(__il, key_compare(), __a) {}
 #endif
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     multimap& operator=(initializer_list<value_type> __il)
         {
             __tree_.__assign_multi(__il.begin(), __il.end());
             return *this;
         }
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit multimap(const allocator_type& __a)
         : __tree_(typename __base::allocator_type(__a))
         {
         }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     multimap(const multimap& __m, const allocator_type& __a)
         : __tree_(__m.__tree_.value_comp(), typename __base::allocator_type(__a))
         {
             insert(__m.begin(), __m.end());
         }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     ~multimap() {
         static_assert(sizeof(__diagnose_non_const_comparator<_Key, _Compare>()), "");
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
           iterator begin() _NOEXCEPT {return __tree_.begin();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator begin() const _NOEXCEPT {return __tree_.begin();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
           iterator end() _NOEXCEPT {return __tree_.end();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator end() const _NOEXCEPT {return __tree_.end();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
           reverse_iterator rbegin() _NOEXCEPT {return reverse_iterator(end());}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_reverse_iterator rbegin() const _NOEXCEPT
         {return const_reverse_iterator(end());}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
           reverse_iterator rend() _NOEXCEPT {return reverse_iterator(begin());}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_reverse_iterator rend() const _NOEXCEPT
         {return const_reverse_iterator(begin());}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator cbegin()  const _NOEXCEPT {return begin();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator cend() const _NOEXCEPT {return end();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_reverse_iterator crbegin() const _NOEXCEPT {return rbegin();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_reverse_iterator crend() const _NOEXCEPT {return rend();}
 
-    _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_NODISCARD_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY
     bool empty() const _NOEXCEPT {return __tree_.size() == 0;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type size() const _NOEXCEPT {return __tree_.size();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type max_size() const _NOEXCEPT {return __tree_.max_size();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     allocator_type get_allocator() const _NOEXCEPT {return allocator_type(__tree_.__alloc());}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     key_compare    key_comp() const {return __tree_.value_comp().key_comp();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     value_compare  value_comp() const
         {return value_compare(__tree_.value_comp().key_comp());}
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
     template <class ..._Args>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator emplace(_Args&& ...__args) {
-        return __tree_.__emplace_multi(_VSTD::forward<_Args>(__args)...);
+        return __tree_.__emplace_multi(_CUDA_VSTD::forward<_Args>(__args)...);
     }
 
     template <class ..._Args>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator emplace_hint(const_iterator __p, _Args&& ...__args) {
-        return __tree_.__emplace_hint_multi(__p.__i_, _VSTD::forward<_Args>(__args)...);
+        return __tree_.__emplace_hint_multi(__p.__i_, _CUDA_VSTD::forward<_Args>(__args)...);
     }
 
     template <class _Pp,
               class = __enable_if_t<is_constructible<value_type, _Pp>::value>>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         iterator insert(_Pp&& __p)
-            {return __tree_.__insert_multi(_VSTD::forward<_Pp>(__p));}
+            {return __tree_.__insert_multi(_CUDA_VSTD::forward<_Pp>(__p));}
 
     template <class _Pp,
               class = __enable_if_t<is_constructible<value_type, _Pp>::value>>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         iterator insert(const_iterator __pos, _Pp&& __p)
-            {return __tree_.__insert_multi(__pos.__i_, _VSTD::forward<_Pp>(__p));}
+            {return __tree_.__insert_multi(__pos.__i_, _CUDA_VSTD::forward<_Pp>(__p));}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator insert(value_type&& __v)
-        {return __tree_.__insert_multi(_VSTD::move(__v));}
+        {return __tree_.__insert_multi(_CUDA_VSTD::move(__v));}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator insert(const_iterator __p, value_type&& __v)
-        {return __tree_.__insert_multi(__p.__i_, _VSTD::move(__v));}
+        {return __tree_.__insert_multi(__p.__i_, _CUDA_VSTD::move(__v));}
 
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void insert(initializer_list<value_type> __il)
         {insert(__il.begin(), __il.end());}
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator insert(const value_type& __v) {return __tree_.__insert_multi(__v);}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator insert(const_iterator __p, const value_type& __v)
             {return __tree_.__insert_multi(__p.__i_, __v);}
 
     template <class _InputIterator>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         void insert(_InputIterator __f, _InputIterator __l)
         {
             for (const_iterator __e = cend(); __f != __l; ++__f)
                 __tree_.__insert_multi(__e.__i_, *__f);
         }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator erase(const_iterator __p) {return __tree_.erase(__p.__i_);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator erase(iterator __p)       {return __tree_.erase(__p.__i_);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type erase(const key_type& __k) {return __tree_.__erase_multi(__k);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator  erase(const_iterator __f, const_iterator __l)
         {return __tree_.erase(__f.__i_, __l.__i_);}
 
-#if _LIBCPP_STD_VER > 14
-    _LIBCPP_INLINE_VISIBILITY
+#if _LIBCUDACXX_STD_VER > 14
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator insert(node_type&& __nh)
     {
-        _LIBCPP_ASSERT(__nh.empty() || __nh.get_allocator() == get_allocator(),
+        _LIBCUDACXX_ASSERT(__nh.empty() || __nh.get_allocator() == get_allocator(),
             "node_type with incompatible allocator passed to multimap::insert()");
         return __tree_.template __node_handle_insert_multi<node_type>(
-            _VSTD::move(__nh));
+            _CUDA_VSTD::move(__nh));
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator insert(const_iterator __hint, node_type&& __nh)
     {
-        _LIBCPP_ASSERT(__nh.empty() || __nh.get_allocator() == get_allocator(),
+        _LIBCUDACXX_ASSERT(__nh.empty() || __nh.get_allocator() == get_allocator(),
             "node_type with incompatible allocator passed to multimap::insert()");
         return __tree_.template __node_handle_insert_multi<node_type>(
-            __hint.__i_, _VSTD::move(__nh));
+            __hint.__i_, _CUDA_VSTD::move(__nh));
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     node_type extract(key_type const& __key)
     {
         return __tree_.template __node_handle_extract<node_type>(__key);
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     node_type extract(const_iterator __it)
     {
         return __tree_.template __node_handle_extract<node_type>(
             __it.__i_);
     }
     template <class _Compare2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void merge(multimap<key_type, mapped_type, _Compare2, allocator_type>& __source)
     {
-        _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
+        _LIBCUDACXX_ASSERT(__source.get_allocator() == get_allocator(),
                        "merging container with incompatible allocator");
         return __tree_.__node_handle_merge_multi(__source.__tree_);
     }
     template <class _Compare2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void merge(multimap<key_type, mapped_type, _Compare2, allocator_type>&& __source)
     {
-        _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
+        _LIBCUDACXX_ASSERT(__source.get_allocator() == get_allocator(),
                        "merging container with incompatible allocator");
         return __tree_.__node_handle_merge_multi(__source.__tree_);
     }
     template <class _Compare2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void merge(map<key_type, mapped_type, _Compare2, allocator_type>& __source)
     {
-        _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
+        _LIBCUDACXX_ASSERT(__source.get_allocator() == get_allocator(),
                        "merging container with incompatible allocator");
         return __tree_.__node_handle_merge_multi(__source.__tree_);
     }
     template <class _Compare2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void merge(map<key_type, mapped_type, _Compare2, allocator_type>&& __source)
     {
-        _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
+        _LIBCUDACXX_ASSERT(__source.get_allocator() == get_allocator(),
                        "merging container with incompatible allocator");
         return __tree_.__node_handle_merge_multi(__source.__tree_);
     }
 #endif
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void clear() _NOEXCEPT {__tree_.clear();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void swap(multimap& __m)
         _NOEXCEPT_(__is_nothrow_swappable<__base>::value)
         {__tree_.swap(__m.__tree_);}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator find(const key_type& __k)             {return __tree_.find(__k);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator find(const key_type& __k) const {return __tree_.find(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
     template <typename _K2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __enable_if_t<__is_transparent<_Compare, _K2>::value, iterator>
     find(const _K2& __k)                           {return __tree_.find(__k);}
     template <typename _K2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __enable_if_t<__is_transparent<_Compare, _K2>::value, const_iterator>
     find(const _K2& __k) const                     {return __tree_.find(__k);}
 #endif
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type      count(const key_type& __k) const
         {return __tree_.__count_multi(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
     template <typename _K2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __enable_if_t<__is_transparent<_Compare, _K2>::value, size_type>
     count(const _K2& __k) const {return __tree_.__count_multi(__k);}
 #endif
 
-#if _LIBCPP_STD_VER > 17
-    _LIBCPP_INLINE_VISIBILITY
+#if _LIBCUDACXX_STD_VER > 17
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool contains(const key_type& __k) const {return find(__k) != end();}
     template <typename _K2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __enable_if_t<__is_transparent<_Compare, _K2>::value, bool>
     contains(const _K2& __k) const { return find(__k) != end(); }
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator lower_bound(const key_type& __k)
         {return __tree_.lower_bound(__k);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator lower_bound(const key_type& __k) const
             {return __tree_.lower_bound(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
     template <typename _K2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __enable_if_t<__is_transparent<_Compare, _K2>::value, iterator>
     lower_bound(const _K2& __k)       {return __tree_.lower_bound(__k);}
 
     template <typename _K2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __enable_if_t<__is_transparent<_Compare, _K2>::value, const_iterator>
     lower_bound(const _K2& __k) const {return __tree_.lower_bound(__k);}
 #endif
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator upper_bound(const key_type& __k)
             {return __tree_.upper_bound(__k);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator upper_bound(const key_type& __k) const
             {return __tree_.upper_bound(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
     template <typename _K2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __enable_if_t<__is_transparent<_Compare, _K2>::value, iterator>
     upper_bound(const _K2& __k)       {return __tree_.upper_bound(__k);}
     template <typename _K2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __enable_if_t<__is_transparent<_Compare, _K2>::value, const_iterator>
     upper_bound(const _K2& __k) const {return __tree_.upper_bound(__k);}
 #endif
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     pair<iterator,iterator>             equal_range(const key_type& __k)
             {return __tree_.__equal_range_multi(__k);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     pair<const_iterator,const_iterator> equal_range(const key_type& __k) const
             {return __tree_.__equal_range_multi(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
     template <typename _K2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __enable_if_t<__is_transparent<_Compare, _K2>::value, pair<iterator,iterator>>
     equal_range(const _K2& __k)       {return __tree_.__equal_range_multi(__k);}
     template <typename _K2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __enable_if_t<__is_transparent<_Compare, _K2>::value, pair<const_iterator,const_iterator>>
     equal_range(const _K2& __k) const {return __tree_.__equal_range_multi(__k);}
 #endif
@@ -2214,7 +2214,7 @@ private:
     typedef unique_ptr<__node, _Dp> __node_holder;
 };
 
-#if _LIBCPP_STD_VER >= 17
+#if _LIBCUDACXX_STD_VER >= 17
 template<class _InputIterator, class _Compare = less<__iter_key_type<_InputIterator>>,
          class _Allocator = allocator<__iter_to_alloc_type<_InputIterator>>,
          class = enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value, void>,
@@ -2243,41 +2243,41 @@ multimap(initializer_list<pair<_Key, _Tp>>, _Allocator)
   -> multimap<remove_const_t<_Key>, _Tp, less<remove_const_t<_Key>>, _Allocator>;
 #endif
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 template <class _Key, class _Tp, class _Compare, class _Allocator>
 multimap<_Key, _Tp, _Compare, _Allocator>::multimap(multimap&& __m, const allocator_type& __a)
-    : __tree_(_VSTD::move(__m.__tree_), typename __base::allocator_type(__a))
+    : __tree_(_CUDA_VSTD::move(__m.__tree_), typename __base::allocator_type(__a))
 {
     if (__a != __m.get_allocator())
     {
         const_iterator __e = cend();
         while (!__m.empty())
             __tree_.__insert_multi(__e.__i_,
-                    _VSTD::move(__m.__tree_.remove(__m.begin().__i_)->__value_.__move()));
+                    _CUDA_VSTD::move(__m.__tree_.remove(__m.begin().__i_)->__value_.__move()));
     }
 }
 #endif
 
 template <class _Key, class _Tp, class _Compare, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator==(const multimap<_Key, _Tp, _Compare, _Allocator>& __x,
            const multimap<_Key, _Tp, _Compare, _Allocator>& __y)
 {
-    return __x.size() == __y.size() && _VSTD::equal(__x.begin(), __x.end(), __y.begin());
+    return __x.size() == __y.size() && _CUDA_VSTD::equal(__x.begin(), __x.end(), __y.begin());
 }
 
 template <class _Key, class _Tp, class _Compare, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator< (const multimap<_Key, _Tp, _Compare, _Allocator>& __x,
            const multimap<_Key, _Tp, _Compare, _Allocator>& __y)
 {
-    return _VSTD::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());
+    return _CUDA_VSTD::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());
 }
 
 template <class _Key, class _Tp, class _Compare, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator!=(const multimap<_Key, _Tp, _Compare, _Allocator>& __x,
            const multimap<_Key, _Tp, _Compare, _Allocator>& __y)
@@ -2286,7 +2286,7 @@ operator!=(const multimap<_Key, _Tp, _Compare, _Allocator>& __x,
 }
 
 template <class _Key, class _Tp, class _Compare, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator> (const multimap<_Key, _Tp, _Compare, _Allocator>& __x,
            const multimap<_Key, _Tp, _Compare, _Allocator>& __y)
@@ -2295,7 +2295,7 @@ operator> (const multimap<_Key, _Tp, _Compare, _Allocator>& __x,
 }
 
 template <class _Key, class _Tp, class _Compare, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator>=(const multimap<_Key, _Tp, _Compare, _Allocator>& __x,
            const multimap<_Key, _Tp, _Compare, _Allocator>& __y)
@@ -2304,7 +2304,7 @@ operator>=(const multimap<_Key, _Tp, _Compare, _Allocator>& __x,
 }
 
 template <class _Key, class _Tp, class _Compare, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator<=(const multimap<_Key, _Tp, _Compare, _Allocator>& __x,
            const multimap<_Key, _Tp, _Compare, _Allocator>& __y)
@@ -2313,7 +2313,7 @@ operator<=(const multimap<_Key, _Tp, _Compare, _Allocator>& __x,
 }
 
 template <class _Key, class _Tp, class _Compare, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 swap(multimap<_Key, _Tp, _Compare, _Allocator>& __x,
      multimap<_Key, _Tp, _Compare, _Allocator>& __y)
@@ -2322,17 +2322,17 @@ swap(multimap<_Key, _Tp, _Compare, _Allocator>& __x,
     __x.swap(__y);
 }
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 template <class _Key, class _Tp, class _Compare, class _Allocator,
           class _Predicate>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
     typename multimap<_Key, _Tp, _Compare, _Allocator>::size_type
     erase_if(multimap<_Key, _Tp, _Compare, _Allocator>& __c,
              _Predicate __pred) {
-  return _VSTD::__libcpp_erase_if_container(__c, __pred);
+  return _CUDA_VSTD::__LIBCUDACXX_erase_if_container(__c, __pred);
 }
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_MAP
+#endif // _LIBCUDACXX_MAP

diff  --git a/libcxx/include/math.h b/libcxx/include/math.h
index 0ec584af9dbe..e6223c2af09d 100644
--- a/libcxx/include/math.h
+++ b/libcxx/include/math.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_MATH_H
-#define _LIBCPP_MATH_H
+#ifndef _LIBCUDACXX_MATH_H
+#define _LIBCUDACXX_MATH_H
 
 /*
     math.h synopsis
@@ -293,7 +293,7 @@ long double    truncl(long double x);
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
@@ -315,9 +315,9 @@ extern "C++" {
 #ifdef signbit
 
 template <class _A1>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 bool
-__libcpp_signbit(_A1 __lcpp_x) _NOEXCEPT
+__LIBCUDACXX_signbit(_A1 __lcpp_x) _NOEXCEPT
 {
 #if __has_builtin(__builtin_signbit)
     return __builtin_signbit(__lcpp_x);
@@ -329,31 +329,31 @@ __libcpp_signbit(_A1 __lcpp_x) _NOEXCEPT
 #undef signbit
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
 signbit(_A1 __lcpp_x) _NOEXCEPT
 {
-    return __libcpp_signbit((typename std::__promote<_A1>::type)__lcpp_x);
+    return __LIBCUDACXX_signbit((typename std::__promote<_A1>::type)__lcpp_x);
 }
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<
     std::is_integral<_A1>::value && std::is_signed<_A1>::value, bool>::type
 signbit(_A1 __lcpp_x) _NOEXCEPT
 { return __lcpp_x < 0; }
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<
     std::is_integral<_A1>::value && !std::is_signed<_A1>::value, bool>::type
 signbit(_A1) _NOEXCEPT
 { return false; }
 
-#elif defined(_LIBCPP_MSVCRT)
+#elif defined(_LIBCUDACXX_MSVCRT)
 
 template <typename _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
 signbit(_A1 __lcpp_x) _NOEXCEPT
 {
@@ -361,14 +361,14 @@ signbit(_A1 __lcpp_x) _NOEXCEPT
 }
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<
     std::is_integral<_A1>::value && std::is_signed<_A1>::value, bool>::type
 signbit(_A1 __lcpp_x) _NOEXCEPT
 { return __lcpp_x < 0; }
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<
     std::is_integral<_A1>::value && !std::is_signed<_A1>::value, bool>::type
 signbit(_A1) _NOEXCEPT
@@ -381,9 +381,9 @@ signbit(_A1) _NOEXCEPT
 #ifdef fpclassify
 
 template <class _A1>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 int
-__libcpp_fpclassify(_A1 __lcpp_x) _NOEXCEPT
+__LIBCUDACXX_fpclassify(_A1 __lcpp_x) _NOEXCEPT
 {
 #if __has_builtin(__builtin_fpclassify)
   return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL,
@@ -396,23 +396,23 @@ __libcpp_fpclassify(_A1 __lcpp_x) _NOEXCEPT
 #undef fpclassify
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_floating_point<_A1>::value, int>::type
 fpclassify(_A1 __lcpp_x) _NOEXCEPT
 {
-    return __libcpp_fpclassify((typename std::__promote<_A1>::type)__lcpp_x);
+    return __LIBCUDACXX_fpclassify((typename std::__promote<_A1>::type)__lcpp_x);
 }
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_integral<_A1>::value, int>::type
 fpclassify(_A1 __lcpp_x) _NOEXCEPT
 { return __lcpp_x == 0 ? FP_ZERO : FP_NORMAL; }
 
-#elif defined(_LIBCPP_MSVCRT)
+#elif defined(_LIBCUDACXX_MSVCRT)
 
 template <typename _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
 fpclassify(_A1 __lcpp_x) _NOEXCEPT
 {
@@ -420,7 +420,7 @@ fpclassify(_A1 __lcpp_x) _NOEXCEPT
 }
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_integral<_A1>::value, int>::type
 fpclassify(_A1 __lcpp_x) _NOEXCEPT
 { return __lcpp_x == 0 ? FP_ZERO : FP_NORMAL; }
@@ -432,9 +432,9 @@ fpclassify(_A1 __lcpp_x) _NOEXCEPT
 #ifdef isfinite
 
 template <class _A1>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 bool
-__libcpp_isfinite(_A1 __lcpp_x) _NOEXCEPT
+__LIBCUDACXX_isfinite(_A1 __lcpp_x) _NOEXCEPT
 {
 #if __has_builtin(__builtin_isfinite)
     return __builtin_isfinite(__lcpp_x);
@@ -446,17 +446,17 @@ __libcpp_isfinite(_A1 __lcpp_x) _NOEXCEPT
 #undef isfinite
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<
     std::is_arithmetic<_A1>::value && std::numeric_limits<_A1>::has_infinity,
     bool>::type
 isfinite(_A1 __lcpp_x) _NOEXCEPT
 {
-    return __libcpp_isfinite((typename std::__promote<_A1>::type)__lcpp_x);
+    return __LIBCUDACXX_isfinite((typename std::__promote<_A1>::type)__lcpp_x);
 }
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<
     std::is_arithmetic<_A1>::value && !std::numeric_limits<_A1>::has_infinity,
     bool>::type
@@ -470,9 +470,9 @@ isfinite(_A1) _NOEXCEPT
 #ifdef isinf
 
 template <class _A1>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 bool
-__libcpp_isinf(_A1 __lcpp_x) _NOEXCEPT
+__LIBCUDACXX_isinf(_A1 __lcpp_x) _NOEXCEPT
 {
 #if __has_builtin(__builtin_isinf)
     return __builtin_isinf(__lcpp_x);
@@ -484,35 +484,35 @@ __libcpp_isinf(_A1 __lcpp_x) _NOEXCEPT
 #undef isinf
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<
     std::is_arithmetic<_A1>::value && std::numeric_limits<_A1>::has_infinity,
     bool>::type
 isinf(_A1 __lcpp_x) _NOEXCEPT
 {
-    return __libcpp_isinf((typename std::__promote<_A1>::type)__lcpp_x);
+    return __LIBCUDACXX_isinf((typename std::__promote<_A1>::type)__lcpp_x);
 }
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<
     std::is_arithmetic<_A1>::value && !std::numeric_limits<_A1>::has_infinity,
     bool>::type
 isinf(_A1) _NOEXCEPT
 { return false; }
 
-#ifdef _LIBCPP_PREFERRED_OVERLOAD
-inline _LIBCPP_INLINE_VISIBILITY
+#ifdef _LIBCUDACXX_PREFERRED_OVERLOAD
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
-isinf(float __lcpp_x) _NOEXCEPT { return __libcpp_isinf(__lcpp_x); }
+isinf(float __lcpp_x) _NOEXCEPT { return __LIBCUDACXX_isinf(__lcpp_x); }
 
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_PREFERRED_OVERLOAD
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_PREFERRED_OVERLOAD
 bool
-isinf(double __lcpp_x) _NOEXCEPT { return __libcpp_isinf(__lcpp_x); }
+isinf(double __lcpp_x) _NOEXCEPT { return __LIBCUDACXX_isinf(__lcpp_x); }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
-isinf(long double __lcpp_x) _NOEXCEPT { return __libcpp_isinf(__lcpp_x); }
+isinf(long double __lcpp_x) _NOEXCEPT { return __LIBCUDACXX_isinf(__lcpp_x); }
 #endif
 
 #endif // isinf
@@ -522,9 +522,9 @@ isinf(long double __lcpp_x) _NOEXCEPT { return __libcpp_isinf(__lcpp_x); }
 #ifdef isnan
 
 template <class _A1>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 bool
-__libcpp_isnan(_A1 __lcpp_x) _NOEXCEPT
+__LIBCUDACXX_isnan(_A1 __lcpp_x) _NOEXCEPT
 {
 #if __has_builtin(__builtin_isnan)
     return __builtin_isnan(__lcpp_x);
@@ -536,31 +536,31 @@ __libcpp_isnan(_A1 __lcpp_x) _NOEXCEPT
 #undef isnan
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
 isnan(_A1 __lcpp_x) _NOEXCEPT
 {
-    return __libcpp_isnan((typename std::__promote<_A1>::type)__lcpp_x);
+    return __LIBCUDACXX_isnan((typename std::__promote<_A1>::type)__lcpp_x);
 }
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_integral<_A1>::value, bool>::type
 isnan(_A1) _NOEXCEPT
 { return false; }
 
-#ifdef _LIBCPP_PREFERRED_OVERLOAD
-inline _LIBCPP_INLINE_VISIBILITY
+#ifdef _LIBCUDACXX_PREFERRED_OVERLOAD
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
-isnan(float __lcpp_x) _NOEXCEPT { return __libcpp_isnan(__lcpp_x); }
+isnan(float __lcpp_x) _NOEXCEPT { return __LIBCUDACXX_isnan(__lcpp_x); }
 
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_PREFERRED_OVERLOAD
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_PREFERRED_OVERLOAD
 bool
-isnan(double __lcpp_x) _NOEXCEPT { return __libcpp_isnan(__lcpp_x); }
+isnan(double __lcpp_x) _NOEXCEPT { return __LIBCUDACXX_isnan(__lcpp_x); }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
-isnan(long double __lcpp_x) _NOEXCEPT { return __libcpp_isnan(__lcpp_x); }
+isnan(long double __lcpp_x) _NOEXCEPT { return __LIBCUDACXX_isnan(__lcpp_x); }
 #endif
 
 #endif // isnan
@@ -570,9 +570,9 @@ isnan(long double __lcpp_x) _NOEXCEPT { return __libcpp_isnan(__lcpp_x); }
 #ifdef isnormal
 
 template <class _A1>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 bool
-__libcpp_isnormal(_A1 __lcpp_x) _NOEXCEPT
+__LIBCUDACXX_isnormal(_A1 __lcpp_x) _NOEXCEPT
 {
 #if __has_builtin(__builtin_isnormal)
     return __builtin_isnormal(__lcpp_x);
@@ -584,15 +584,15 @@ __libcpp_isnormal(_A1 __lcpp_x) _NOEXCEPT
 #undef isnormal
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
 isnormal(_A1 __lcpp_x) _NOEXCEPT
 {
-    return __libcpp_isnormal((typename std::__promote<_A1>::type)__lcpp_x);
+    return __LIBCUDACXX_isnormal((typename std::__promote<_A1>::type)__lcpp_x);
 }
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_integral<_A1>::value, bool>::type
 isnormal(_A1 __lcpp_x) _NOEXCEPT
 { return __lcpp_x != 0; }
@@ -604,9 +604,9 @@ isnormal(_A1 __lcpp_x) _NOEXCEPT
 #ifdef isgreater
 
 template <class _A1, class _A2>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 bool
-__libcpp_isgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
+__LIBCUDACXX_isgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
 {
     return isgreater(__lcpp_x, __lcpp_y);
 }
@@ -614,7 +614,7 @@ __libcpp_isgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
 #undef isgreater
 
 template <class _A1, class _A2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if
 <
     std::is_arithmetic<_A1>::value &&
@@ -624,7 +624,7 @@ typename std::enable_if
 isgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
 {
     typedef typename std::__promote<_A1, _A2>::type type;
-    return __libcpp_isgreater((type)__lcpp_x, (type)__lcpp_y);
+    return __LIBCUDACXX_isgreater((type)__lcpp_x, (type)__lcpp_y);
 }
 
 #endif // isgreater
@@ -634,9 +634,9 @@ isgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
 #ifdef isgreaterequal
 
 template <class _A1, class _A2>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 bool
-__libcpp_isgreaterequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
+__LIBCUDACXX_isgreaterequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
 {
     return isgreaterequal(__lcpp_x, __lcpp_y);
 }
@@ -644,7 +644,7 @@ __libcpp_isgreaterequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
 #undef isgreaterequal
 
 template <class _A1, class _A2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if
 <
     std::is_arithmetic<_A1>::value &&
@@ -654,7 +654,7 @@ typename std::enable_if
 isgreaterequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
 {
     typedef typename std::__promote<_A1, _A2>::type type;
-    return __libcpp_isgreaterequal((type)__lcpp_x, (type)__lcpp_y);
+    return __LIBCUDACXX_isgreaterequal((type)__lcpp_x, (type)__lcpp_y);
 }
 
 #endif // isgreaterequal
@@ -664,9 +664,9 @@ isgreaterequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
 #ifdef isless
 
 template <class _A1, class _A2>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 bool
-__libcpp_isless(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
+__LIBCUDACXX_isless(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
 {
     return isless(__lcpp_x, __lcpp_y);
 }
@@ -674,7 +674,7 @@ __libcpp_isless(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
 #undef isless
 
 template <class _A1, class _A2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if
 <
     std::is_arithmetic<_A1>::value &&
@@ -684,7 +684,7 @@ typename std::enable_if
 isless(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
 {
     typedef typename std::__promote<_A1, _A2>::type type;
-    return __libcpp_isless((type)__lcpp_x, (type)__lcpp_y);
+    return __LIBCUDACXX_isless((type)__lcpp_x, (type)__lcpp_y);
 }
 
 #endif // isless
@@ -694,9 +694,9 @@ isless(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
 #ifdef islessequal
 
 template <class _A1, class _A2>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 bool
-__libcpp_islessequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
+__LIBCUDACXX_islessequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
 {
     return islessequal(__lcpp_x, __lcpp_y);
 }
@@ -704,7 +704,7 @@ __libcpp_islessequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
 #undef islessequal
 
 template <class _A1, class _A2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if
 <
     std::is_arithmetic<_A1>::value &&
@@ -714,7 +714,7 @@ typename std::enable_if
 islessequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
 {
     typedef typename std::__promote<_A1, _A2>::type type;
-    return __libcpp_islessequal((type)__lcpp_x, (type)__lcpp_y);
+    return __LIBCUDACXX_islessequal((type)__lcpp_x, (type)__lcpp_y);
 }
 
 #endif // islessequal
@@ -724,9 +724,9 @@ islessequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
 #ifdef islessgreater
 
 template <class _A1, class _A2>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 bool
-__libcpp_islessgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
+__LIBCUDACXX_islessgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
 {
     return islessgreater(__lcpp_x, __lcpp_y);
 }
@@ -734,7 +734,7 @@ __libcpp_islessgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
 #undef islessgreater
 
 template <class _A1, class _A2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if
 <
     std::is_arithmetic<_A1>::value &&
@@ -744,7 +744,7 @@ typename std::enable_if
 islessgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
 {
     typedef typename std::__promote<_A1, _A2>::type type;
-    return __libcpp_islessgreater((type)__lcpp_x, (type)__lcpp_y);
+    return __LIBCUDACXX_islessgreater((type)__lcpp_x, (type)__lcpp_y);
 }
 
 #endif // islessgreater
@@ -754,9 +754,9 @@ islessgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
 #ifdef isunordered
 
 template <class _A1, class _A2>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 bool
-__libcpp_isunordered(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
+__LIBCUDACXX_isunordered(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
 {
     return isunordered(__lcpp_x, __lcpp_y);
 }
@@ -764,7 +764,7 @@ __libcpp_isunordered(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
 #undef isunordered
 
 template <class _A1, class _A2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if
 <
     std::is_arithmetic<_A1>::value &&
@@ -774,7 +774,7 @@ typename std::enable_if
 isunordered(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
 {
     typedef typename std::__promote<_A1, _A2>::type type;
-    return __libcpp_isunordered((type)__lcpp_x, (type)__lcpp_y);
+    return __LIBCUDACXX_isunordered((type)__lcpp_x, (type)__lcpp_y);
 }
 
 #endif // isunordered
@@ -790,48 +790,48 @@ isunordered(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
 // acos
 
 #    if !defined(__sun__)
-inline _LIBCPP_INLINE_VISIBILITY float       acos(float __lcpp_x) _NOEXCEPT       {return ::acosf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double acos(long double __lcpp_x) _NOEXCEPT {return ::acosl(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY float       acos(float __lcpp_x) _NOEXCEPT       {return ::acosf(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY long double acos(long double __lcpp_x) _NOEXCEPT {return ::acosl(__lcpp_x);}
 #    endif
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_integral<_A1>::value, double>::type
 acos(_A1 __lcpp_x) _NOEXCEPT {return ::acos((double)__lcpp_x);}
 
 // asin
 
 #    if !defined(__sun__)
-inline _LIBCPP_INLINE_VISIBILITY float       asin(float __lcpp_x) _NOEXCEPT       {return ::asinf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double asin(long double __lcpp_x) _NOEXCEPT {return ::asinl(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY float       asin(float __lcpp_x) _NOEXCEPT       {return ::asinf(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY long double asin(long double __lcpp_x) _NOEXCEPT {return ::asinl(__lcpp_x);}
 #    endif
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_integral<_A1>::value, double>::type
 asin(_A1 __lcpp_x) _NOEXCEPT {return ::asin((double)__lcpp_x);}
 
 // atan
 
 #    if !defined(__sun__)
-inline _LIBCPP_INLINE_VISIBILITY float       atan(float __lcpp_x) _NOEXCEPT       {return ::atanf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double atan(long double __lcpp_x) _NOEXCEPT {return ::atanl(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY float       atan(float __lcpp_x) _NOEXCEPT       {return ::atanf(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY long double atan(long double __lcpp_x) _NOEXCEPT {return ::atanl(__lcpp_x);}
 #    endif
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_integral<_A1>::value, double>::type
 atan(_A1 __lcpp_x) _NOEXCEPT {return ::atan((double)__lcpp_x);}
 
 // atan2
 
 #    if !defined(__sun__)
-inline _LIBCPP_INLINE_VISIBILITY float       atan2(float __lcpp_y, float __lcpp_x) _NOEXCEPT             {return ::atan2f(__lcpp_y, __lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double atan2(long double __lcpp_y, long double __lcpp_x) _NOEXCEPT {return ::atan2l(__lcpp_y, __lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY float       atan2(float __lcpp_y, float __lcpp_x) _NOEXCEPT             {return ::atan2f(__lcpp_y, __lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY long double atan2(long double __lcpp_y, long double __lcpp_x) _NOEXCEPT {return ::atan2l(__lcpp_y, __lcpp_x);}
 #    endif
 
 template <class _A1, class _A2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::__enable_if_t
 <
     std::is_arithmetic<_A1>::value &&
@@ -849,84 +849,84 @@ atan2(_A1 __lcpp_y, _A2 __lcpp_x) _NOEXCEPT
 // ceil
 
 #    if !defined(__sun__)
-inline _LIBCPP_INLINE_VISIBILITY float       ceil(float __lcpp_x) _NOEXCEPT       {return ::ceilf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double ceil(long double __lcpp_x) _NOEXCEPT {return ::ceill(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY float       ceil(float __lcpp_x) _NOEXCEPT       {return ::ceilf(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY long double ceil(long double __lcpp_x) _NOEXCEPT {return ::ceill(__lcpp_x);}
 #    endif
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_integral<_A1>::value, double>::type
 ceil(_A1 __lcpp_x) _NOEXCEPT {return ::ceil((double)__lcpp_x);}
 
 // cos
 
 #    if !defined(__sun__)
-inline _LIBCPP_INLINE_VISIBILITY float       cos(float __lcpp_x) _NOEXCEPT       {return ::cosf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double cos(long double __lcpp_x) _NOEXCEPT {return ::cosl(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY float       cos(float __lcpp_x) _NOEXCEPT       {return ::cosf(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY long double cos(long double __lcpp_x) _NOEXCEPT {return ::cosl(__lcpp_x);}
 #    endif
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_integral<_A1>::value, double>::type
 cos(_A1 __lcpp_x) _NOEXCEPT {return ::cos((double)__lcpp_x);}
 
 // cosh
 
 #    if !defined(__sun__)
-inline _LIBCPP_INLINE_VISIBILITY float       cosh(float __lcpp_x) _NOEXCEPT       {return ::coshf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double cosh(long double __lcpp_x) _NOEXCEPT {return ::coshl(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY float       cosh(float __lcpp_x) _NOEXCEPT       {return ::coshf(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY long double cosh(long double __lcpp_x) _NOEXCEPT {return ::coshl(__lcpp_x);}
 #    endif
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_integral<_A1>::value, double>::type
 cosh(_A1 __lcpp_x) _NOEXCEPT {return ::cosh((double)__lcpp_x);}
 
 // exp
 
 #    if !defined(__sun__)
-inline _LIBCPP_INLINE_VISIBILITY float       exp(float __lcpp_x) _NOEXCEPT       {return ::expf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double exp(long double __lcpp_x) _NOEXCEPT {return ::expl(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY float       exp(float __lcpp_x) _NOEXCEPT       {return ::expf(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY long double exp(long double __lcpp_x) _NOEXCEPT {return ::expl(__lcpp_x);}
 #    endif
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_integral<_A1>::value, double>::type
 exp(_A1 __lcpp_x) _NOEXCEPT {return ::exp((double)__lcpp_x);}
 
 // fabs
 
 #    if !defined(__sun__)
-inline _LIBCPP_INLINE_VISIBILITY float       fabs(float __lcpp_x) _NOEXCEPT       {return ::fabsf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double fabs(long double __lcpp_x) _NOEXCEPT {return ::fabsl(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY float       fabs(float __lcpp_x) _NOEXCEPT       {return ::fabsf(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY long double fabs(long double __lcpp_x) _NOEXCEPT {return ::fabsl(__lcpp_x);}
 #    endif
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_integral<_A1>::value, double>::type
 fabs(_A1 __lcpp_x) _NOEXCEPT {return ::fabs((double)__lcpp_x);}
 
 // floor
 
 #    if !defined(__sun__)
-inline _LIBCPP_INLINE_VISIBILITY float       floor(float __lcpp_x) _NOEXCEPT       {return ::floorf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double floor(long double __lcpp_x) _NOEXCEPT {return ::floorl(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY float       floor(float __lcpp_x) _NOEXCEPT       {return ::floorf(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY long double floor(long double __lcpp_x) _NOEXCEPT {return ::floorl(__lcpp_x);}
 #    endif
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_integral<_A1>::value, double>::type
 floor(_A1 __lcpp_x) _NOEXCEPT {return ::floor((double)__lcpp_x);}
 
 // fmod
 
 #    if !defined(__sun__)
-inline _LIBCPP_INLINE_VISIBILITY float       fmod(float __lcpp_x, float __lcpp_y) _NOEXCEPT             {return ::fmodf(__lcpp_x, __lcpp_y);}
-inline _LIBCPP_INLINE_VISIBILITY long double fmod(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::fmodl(__lcpp_x, __lcpp_y);}
+inline _LIBCUDACXX_INLINE_VISIBILITY float       fmod(float __lcpp_x, float __lcpp_y) _NOEXCEPT             {return ::fmodf(__lcpp_x, __lcpp_y);}
+inline _LIBCUDACXX_INLINE_VISIBILITY long double fmod(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::fmodl(__lcpp_x, __lcpp_y);}
 #    endif
 
 template <class _A1, class _A2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::__enable_if_t
 <
     std::is_arithmetic<_A1>::value &&
@@ -944,67 +944,67 @@ fmod(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
 // frexp
 
 #    if !defined(__sun__)
-inline _LIBCPP_INLINE_VISIBILITY float       frexp(float __lcpp_x, int* __lcpp_e) _NOEXCEPT       {return ::frexpf(__lcpp_x, __lcpp_e);}
-inline _LIBCPP_INLINE_VISIBILITY long double frexp(long double __lcpp_x, int* __lcpp_e) _NOEXCEPT {return ::frexpl(__lcpp_x, __lcpp_e);}
+inline _LIBCUDACXX_INLINE_VISIBILITY float       frexp(float __lcpp_x, int* __lcpp_e) _NOEXCEPT       {return ::frexpf(__lcpp_x, __lcpp_e);}
+inline _LIBCUDACXX_INLINE_VISIBILITY long double frexp(long double __lcpp_x, int* __lcpp_e) _NOEXCEPT {return ::frexpl(__lcpp_x, __lcpp_e);}
 #    endif
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_integral<_A1>::value, double>::type
 frexp(_A1 __lcpp_x, int* __lcpp_e) _NOEXCEPT {return ::frexp((double)__lcpp_x, __lcpp_e);}
 
 // ldexp
 
 #    if !defined(__sun__)
-inline _LIBCPP_INLINE_VISIBILITY float       ldexp(float __lcpp_x, int __lcpp_e) _NOEXCEPT       {return ::ldexpf(__lcpp_x, __lcpp_e);}
-inline _LIBCPP_INLINE_VISIBILITY long double ldexp(long double __lcpp_x, int __lcpp_e) _NOEXCEPT {return ::ldexpl(__lcpp_x, __lcpp_e);}
+inline _LIBCUDACXX_INLINE_VISIBILITY float       ldexp(float __lcpp_x, int __lcpp_e) _NOEXCEPT       {return ::ldexpf(__lcpp_x, __lcpp_e);}
+inline _LIBCUDACXX_INLINE_VISIBILITY long double ldexp(long double __lcpp_x, int __lcpp_e) _NOEXCEPT {return ::ldexpl(__lcpp_x, __lcpp_e);}
 #    endif
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_integral<_A1>::value, double>::type
 ldexp(_A1 __lcpp_x, int __lcpp_e) _NOEXCEPT {return ::ldexp((double)__lcpp_x, __lcpp_e);}
 
 // log
 
 #    if !defined(__sun__)
-inline _LIBCPP_INLINE_VISIBILITY float       log(float __lcpp_x) _NOEXCEPT       {return ::logf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double log(long double __lcpp_x) _NOEXCEPT {return ::logl(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY float       log(float __lcpp_x) _NOEXCEPT       {return ::logf(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY long double log(long double __lcpp_x) _NOEXCEPT {return ::logl(__lcpp_x);}
 #    endif
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_integral<_A1>::value, double>::type
 log(_A1 __lcpp_x) _NOEXCEPT {return ::log((double)__lcpp_x);}
 
 // log10
 
 #    if !defined(__sun__)
-inline _LIBCPP_INLINE_VISIBILITY float       log10(float __lcpp_x) _NOEXCEPT       {return ::log10f(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double log10(long double __lcpp_x) _NOEXCEPT {return ::log10l(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY float       log10(float __lcpp_x) _NOEXCEPT       {return ::log10f(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY long double log10(long double __lcpp_x) _NOEXCEPT {return ::log10l(__lcpp_x);}
 #    endif
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_integral<_A1>::value, double>::type
 log10(_A1 __lcpp_x) _NOEXCEPT {return ::log10((double)__lcpp_x);}
 
 // modf
 
 #    if !defined(__sun__)
-inline _LIBCPP_INLINE_VISIBILITY float       modf(float __lcpp_x, float* __lcpp_y) _NOEXCEPT             {return ::modff(__lcpp_x, __lcpp_y);}
-inline _LIBCPP_INLINE_VISIBILITY long double modf(long double __lcpp_x, long double* __lcpp_y) _NOEXCEPT {return ::modfl(__lcpp_x, __lcpp_y);}
+inline _LIBCUDACXX_INLINE_VISIBILITY float       modf(float __lcpp_x, float* __lcpp_y) _NOEXCEPT             {return ::modff(__lcpp_x, __lcpp_y);}
+inline _LIBCUDACXX_INLINE_VISIBILITY long double modf(long double __lcpp_x, long double* __lcpp_y) _NOEXCEPT {return ::modfl(__lcpp_x, __lcpp_y);}
 #    endif
 
 // pow
 
 #    if !defined(__sun__)
-inline _LIBCPP_INLINE_VISIBILITY float       pow(float __lcpp_x, float __lcpp_y) _NOEXCEPT             {return ::powf(__lcpp_x, __lcpp_y);}
-inline _LIBCPP_INLINE_VISIBILITY long double pow(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::powl(__lcpp_x, __lcpp_y);}
+inline _LIBCUDACXX_INLINE_VISIBILITY float       pow(float __lcpp_x, float __lcpp_y) _NOEXCEPT             {return ::powf(__lcpp_x, __lcpp_y);}
+inline _LIBCUDACXX_INLINE_VISIBILITY long double pow(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::powl(__lcpp_x, __lcpp_y);}
 #    endif
 
 template <class _A1, class _A2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::__enable_if_t
 <
     std::is_arithmetic<_A1>::value &&
@@ -1022,109 +1022,109 @@ pow(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
 // sin
 
 #    if !defined(__sun__)
-inline _LIBCPP_INLINE_VISIBILITY float       sin(float __lcpp_x) _NOEXCEPT       {return ::sinf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double sin(long double __lcpp_x) _NOEXCEPT {return ::sinl(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY float       sin(float __lcpp_x) _NOEXCEPT       {return ::sinf(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY long double sin(long double __lcpp_x) _NOEXCEPT {return ::sinl(__lcpp_x);}
 #endif
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_integral<_A1>::value, double>::type
 sin(_A1 __lcpp_x) _NOEXCEPT {return ::sin((double)__lcpp_x);}
 
 // sinh
 
 #    if !defined(__sun__)
-inline _LIBCPP_INLINE_VISIBILITY float       sinh(float __lcpp_x) _NOEXCEPT       {return ::sinhf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double sinh(long double __lcpp_x) _NOEXCEPT {return ::sinhl(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY float       sinh(float __lcpp_x) _NOEXCEPT       {return ::sinhf(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY long double sinh(long double __lcpp_x) _NOEXCEPT {return ::sinhl(__lcpp_x);}
 #    endif
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_integral<_A1>::value, double>::type
 sinh(_A1 __lcpp_x) _NOEXCEPT {return ::sinh((double)__lcpp_x);}
 
 // sqrt
 
 #    if !defined(__sun__)
-inline _LIBCPP_INLINE_VISIBILITY float       sqrt(float __lcpp_x) _NOEXCEPT       {return ::sqrtf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double sqrt(long double __lcpp_x) _NOEXCEPT {return ::sqrtl(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY float       sqrt(float __lcpp_x) _NOEXCEPT       {return ::sqrtf(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY long double sqrt(long double __lcpp_x) _NOEXCEPT {return ::sqrtl(__lcpp_x);}
 #    endif
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_integral<_A1>::value, double>::type
 sqrt(_A1 __lcpp_x) _NOEXCEPT {return ::sqrt((double)__lcpp_x);}
 
 // tan
 
 #    if !defined(__sun__)
-inline _LIBCPP_INLINE_VISIBILITY float       tan(float __lcpp_x) _NOEXCEPT       {return ::tanf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double tan(long double __lcpp_x) _NOEXCEPT {return ::tanl(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY float       tan(float __lcpp_x) _NOEXCEPT       {return ::tanf(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY long double tan(long double __lcpp_x) _NOEXCEPT {return ::tanl(__lcpp_x);}
 #    endif
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_integral<_A1>::value, double>::type
 tan(_A1 __lcpp_x) _NOEXCEPT {return ::tan((double)__lcpp_x);}
 
 // tanh
 
 #    if !defined(__sun__)
-inline _LIBCPP_INLINE_VISIBILITY float       tanh(float __lcpp_x) _NOEXCEPT       {return ::tanhf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double tanh(long double __lcpp_x) _NOEXCEPT {return ::tanhl(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY float       tanh(float __lcpp_x) _NOEXCEPT       {return ::tanhf(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY long double tanh(long double __lcpp_x) _NOEXCEPT {return ::tanhl(__lcpp_x);}
 #    endif
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_integral<_A1>::value, double>::type
 tanh(_A1 __lcpp_x) _NOEXCEPT {return ::tanh((double)__lcpp_x);}
 
 // acosh
 
-inline _LIBCPP_INLINE_VISIBILITY float       acosh(float __lcpp_x) _NOEXCEPT       {return ::acoshf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double acosh(long double __lcpp_x) _NOEXCEPT {return ::acoshl(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY float       acosh(float __lcpp_x) _NOEXCEPT       {return ::acoshf(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY long double acosh(long double __lcpp_x) _NOEXCEPT {return ::acoshl(__lcpp_x);}
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_integral<_A1>::value, double>::type
 acosh(_A1 __lcpp_x) _NOEXCEPT {return ::acosh((double)__lcpp_x);}
 
 // asinh
 
-inline _LIBCPP_INLINE_VISIBILITY float       asinh(float __lcpp_x) _NOEXCEPT       {return ::asinhf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double asinh(long double __lcpp_x) _NOEXCEPT {return ::asinhl(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY float       asinh(float __lcpp_x) _NOEXCEPT       {return ::asinhf(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY long double asinh(long double __lcpp_x) _NOEXCEPT {return ::asinhl(__lcpp_x);}
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_integral<_A1>::value, double>::type
 asinh(_A1 __lcpp_x) _NOEXCEPT {return ::asinh((double)__lcpp_x);}
 
 // atanh
 
-inline _LIBCPP_INLINE_VISIBILITY float       atanh(float __lcpp_x) _NOEXCEPT       {return ::atanhf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double atanh(long double __lcpp_x) _NOEXCEPT {return ::atanhl(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY float       atanh(float __lcpp_x) _NOEXCEPT       {return ::atanhf(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY long double atanh(long double __lcpp_x) _NOEXCEPT {return ::atanhl(__lcpp_x);}
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_integral<_A1>::value, double>::type
 atanh(_A1 __lcpp_x) _NOEXCEPT {return ::atanh((double)__lcpp_x);}
 
 // cbrt
 
-inline _LIBCPP_INLINE_VISIBILITY float       cbrt(float __lcpp_x) _NOEXCEPT       {return ::cbrtf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double cbrt(long double __lcpp_x) _NOEXCEPT {return ::cbrtl(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY float       cbrt(float __lcpp_x) _NOEXCEPT       {return ::cbrtf(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY long double cbrt(long double __lcpp_x) _NOEXCEPT {return ::cbrtl(__lcpp_x);}
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_integral<_A1>::value, double>::type
 cbrt(_A1 __lcpp_x) _NOEXCEPT {return ::cbrt((double)__lcpp_x);}
 
 // copysign
 
 #if __has_builtin(__builtin_copysignf)
-_LIBCPP_CONSTEXPR
+_LIBCUDACXX_CONSTEXPR
 #endif
-inline _LIBCPP_INLINE_VISIBILITY float __libcpp_copysign(float __lcpp_x, float __lcpp_y) _NOEXCEPT {
+inline _LIBCUDACXX_INLINE_VISIBILITY float __LIBCUDACXX_copysign(float __lcpp_x, float __lcpp_y) _NOEXCEPT {
 #if __has_builtin(__builtin_copysignf)
   return __builtin_copysignf(__lcpp_x, __lcpp_y);
 #else
@@ -1133,9 +1133,9 @@ inline _LIBCPP_INLINE_VISIBILITY float __libcpp_copysign(float __lcpp_x, float _
 }
 
 #if __has_builtin(__builtin_copysign)
-_LIBCPP_CONSTEXPR
+_LIBCUDACXX_CONSTEXPR
 #endif
-inline _LIBCPP_INLINE_VISIBILITY double __libcpp_copysign(double __lcpp_x, double __lcpp_y) _NOEXCEPT {
+inline _LIBCUDACXX_INLINE_VISIBILITY double __LIBCUDACXX_copysign(double __lcpp_x, double __lcpp_y) _NOEXCEPT {
 #if __has_builtin(__builtin_copysign)
   return __builtin_copysign(__lcpp_x, __lcpp_y);
 #else
@@ -1144,9 +1144,9 @@ inline _LIBCPP_INLINE_VISIBILITY double __libcpp_copysign(double __lcpp_x, doubl
 }
 
 #if __has_builtin(__builtin_copysignl)
-_LIBCPP_CONSTEXPR
+_LIBCUDACXX_CONSTEXPR
 #endif
-inline _LIBCPP_INLINE_VISIBILITY long double __libcpp_copysign(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {
+inline _LIBCUDACXX_INLINE_VISIBILITY long double __LIBCUDACXX_copysign(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {
 #if __has_builtin(__builtin_copysignl)
   return __builtin_copysignl(__lcpp_x, __lcpp_y);
 #else
@@ -1156,16 +1156,16 @@ inline _LIBCPP_INLINE_VISIBILITY long double __libcpp_copysign(long double __lcp
 
 template <class _A1, class _A2>
 #if __has_builtin(__builtin_copysign)
-_LIBCPP_CONSTEXPR
+_LIBCUDACXX_CONSTEXPR
 #endif
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::__enable_if_t
 <
     std::is_arithmetic<_A1>::value &&
     std::is_arithmetic<_A2>::value,
     std::__promote<_A1, _A2>
 >::type
-__libcpp_copysign(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT {
+__LIBCUDACXX_copysign(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT {
     typedef typename std::__promote<_A1, _A2>::type __result_type;
     static_assert((!(std::_IsSame<_A1, __result_type>::value &&
                      std::_IsSame<_A2, __result_type>::value)), "");
@@ -1176,16 +1176,16 @@ __libcpp_copysign(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT {
 #endif
 }
 
-inline _LIBCPP_INLINE_VISIBILITY float copysign(float __lcpp_x, float __lcpp_y) _NOEXCEPT {
-  return ::__libcpp_copysign(__lcpp_x, __lcpp_y);
+inline _LIBCUDACXX_INLINE_VISIBILITY float copysign(float __lcpp_x, float __lcpp_y) _NOEXCEPT {
+  return ::__LIBCUDACXX_copysign(__lcpp_x, __lcpp_y);
 }
 
-inline _LIBCPP_INLINE_VISIBILITY long double copysign(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {
-  return ::__libcpp_copysign(__lcpp_x, __lcpp_y);
+inline _LIBCUDACXX_INLINE_VISIBILITY long double copysign(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {
+  return ::__LIBCUDACXX_copysign(__lcpp_x, __lcpp_y);
 }
 
 template <class _A1, class _A2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::__enable_if_t
 <
     std::is_arithmetic<_A1>::value &&
@@ -1193,56 +1193,56 @@ typename std::__enable_if_t
     std::__promote<_A1, _A2>
 >::type
     copysign(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT {
-  return ::__libcpp_copysign(__lcpp_x, __lcpp_y);
+  return ::__LIBCUDACXX_copysign(__lcpp_x, __lcpp_y);
 }
 
 // erf
 
-inline _LIBCPP_INLINE_VISIBILITY float       erf(float __lcpp_x) _NOEXCEPT       {return ::erff(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double erf(long double __lcpp_x) _NOEXCEPT {return ::erfl(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY float       erf(float __lcpp_x) _NOEXCEPT       {return ::erff(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY long double erf(long double __lcpp_x) _NOEXCEPT {return ::erfl(__lcpp_x);}
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_integral<_A1>::value, double>::type
 erf(_A1 __lcpp_x) _NOEXCEPT {return ::erf((double)__lcpp_x);}
 
 // erfc
 
-inline _LIBCPP_INLINE_VISIBILITY float       erfc(float __lcpp_x) _NOEXCEPT       {return ::erfcf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double erfc(long double __lcpp_x) _NOEXCEPT {return ::erfcl(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY float       erfc(float __lcpp_x) _NOEXCEPT       {return ::erfcf(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY long double erfc(long double __lcpp_x) _NOEXCEPT {return ::erfcl(__lcpp_x);}
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_integral<_A1>::value, double>::type
 erfc(_A1 __lcpp_x) _NOEXCEPT {return ::erfc((double)__lcpp_x);}
 
 // exp2
 
-inline _LIBCPP_INLINE_VISIBILITY float       exp2(float __lcpp_x) _NOEXCEPT       {return ::exp2f(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double exp2(long double __lcpp_x) _NOEXCEPT {return ::exp2l(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY float       exp2(float __lcpp_x) _NOEXCEPT       {return ::exp2f(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY long double exp2(long double __lcpp_x) _NOEXCEPT {return ::exp2l(__lcpp_x);}
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_integral<_A1>::value, double>::type
 exp2(_A1 __lcpp_x) _NOEXCEPT {return ::exp2((double)__lcpp_x);}
 
 // expm1
 
-inline _LIBCPP_INLINE_VISIBILITY float       expm1(float __lcpp_x) _NOEXCEPT       {return ::expm1f(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double expm1(long double __lcpp_x) _NOEXCEPT {return ::expm1l(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY float       expm1(float __lcpp_x) _NOEXCEPT       {return ::expm1f(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY long double expm1(long double __lcpp_x) _NOEXCEPT {return ::expm1l(__lcpp_x);}
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_integral<_A1>::value, double>::type
 expm1(_A1 __lcpp_x) _NOEXCEPT {return ::expm1((double)__lcpp_x);}
 
 // fdim
 
-inline _LIBCPP_INLINE_VISIBILITY float       fdim(float __lcpp_x, float __lcpp_y) _NOEXCEPT             {return ::fdimf(__lcpp_x, __lcpp_y);}
-inline _LIBCPP_INLINE_VISIBILITY long double fdim(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::fdiml(__lcpp_x, __lcpp_y);}
+inline _LIBCUDACXX_INLINE_VISIBILITY float       fdim(float __lcpp_x, float __lcpp_y) _NOEXCEPT             {return ::fdimf(__lcpp_x, __lcpp_y);}
+inline _LIBCUDACXX_INLINE_VISIBILITY long double fdim(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::fdiml(__lcpp_x, __lcpp_y);}
 
 template <class _A1, class _A2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::__enable_if_t
 <
     std::is_arithmetic<_A1>::value &&
@@ -1259,7 +1259,7 @@ fdim(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
 
 // fma
 
-inline _LIBCPP_INLINE_VISIBILITY float       fma(float __lcpp_x, float __lcpp_y, float __lcpp_z) _NOEXCEPT
+inline _LIBCUDACXX_INLINE_VISIBILITY float       fma(float __lcpp_x, float __lcpp_y, float __lcpp_z) _NOEXCEPT
 {
 #if __has_builtin(__builtin_fmaf)
     return __builtin_fmaf(__lcpp_x, __lcpp_y, __lcpp_z);
@@ -1267,7 +1267,7 @@ inline _LIBCPP_INLINE_VISIBILITY float       fma(float __lcpp_x, float __lcpp_y,
     return ::fmaf(__lcpp_x, __lcpp_y, __lcpp_z);
 #endif
 }
-inline _LIBCPP_INLINE_VISIBILITY long double fma(long double __lcpp_x, long double __lcpp_y, long double __lcpp_z) _NOEXCEPT
+inline _LIBCUDACXX_INLINE_VISIBILITY long double fma(long double __lcpp_x, long double __lcpp_y, long double __lcpp_z) _NOEXCEPT
 {
 #if __has_builtin(__builtin_fmal)
     return __builtin_fmal(__lcpp_x, __lcpp_y, __lcpp_z);
@@ -1277,7 +1277,7 @@ inline _LIBCPP_INLINE_VISIBILITY long double fma(long double __lcpp_x, long doub
 }
 
 template <class _A1, class _A2, class _A3>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::__enable_if_t
 <
     std::is_arithmetic<_A1>::value &&
@@ -1300,11 +1300,11 @@ fma(_A1 __lcpp_x, _A2 __lcpp_y, _A3 __lcpp_z) _NOEXCEPT
 
 // fmax
 
-inline _LIBCPP_INLINE_VISIBILITY float       fmax(float __lcpp_x, float __lcpp_y) _NOEXCEPT             {return ::fmaxf(__lcpp_x, __lcpp_y);}
-inline _LIBCPP_INLINE_VISIBILITY long double fmax(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::fmaxl(__lcpp_x, __lcpp_y);}
+inline _LIBCUDACXX_INLINE_VISIBILITY float       fmax(float __lcpp_x, float __lcpp_y) _NOEXCEPT             {return ::fmaxf(__lcpp_x, __lcpp_y);}
+inline _LIBCUDACXX_INLINE_VISIBILITY long double fmax(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::fmaxl(__lcpp_x, __lcpp_y);}
 
 template <class _A1, class _A2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::__enable_if_t
 <
     std::is_arithmetic<_A1>::value &&
@@ -1321,11 +1321,11 @@ fmax(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
 
 // fmin
 
-inline _LIBCPP_INLINE_VISIBILITY float       fmin(float __lcpp_x, float __lcpp_y) _NOEXCEPT             {return ::fminf(__lcpp_x, __lcpp_y);}
-inline _LIBCPP_INLINE_VISIBILITY long double fmin(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::fminl(__lcpp_x, __lcpp_y);}
+inline _LIBCUDACXX_INLINE_VISIBILITY float       fmin(float __lcpp_x, float __lcpp_y) _NOEXCEPT             {return ::fminf(__lcpp_x, __lcpp_y);}
+inline _LIBCUDACXX_INLINE_VISIBILITY long double fmin(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::fminl(__lcpp_x, __lcpp_y);}
 
 template <class _A1, class _A2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::__enable_if_t
 <
     std::is_arithmetic<_A1>::value &&
@@ -1342,11 +1342,11 @@ fmin(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
 
 // hypot
 
-inline _LIBCPP_INLINE_VISIBILITY float       hypot(float __lcpp_x, float __lcpp_y) _NOEXCEPT             {return ::hypotf(__lcpp_x, __lcpp_y);}
-inline _LIBCPP_INLINE_VISIBILITY long double hypot(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::hypotl(__lcpp_x, __lcpp_y);}
+inline _LIBCUDACXX_INLINE_VISIBILITY float       hypot(float __lcpp_x, float __lcpp_y) _NOEXCEPT             {return ::hypotf(__lcpp_x, __lcpp_y);}
+inline _LIBCUDACXX_INLINE_VISIBILITY long double hypot(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::hypotl(__lcpp_x, __lcpp_y);}
 
 template <class _A1, class _A2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::__enable_if_t
 <
     std::is_arithmetic<_A1>::value &&
@@ -1363,27 +1363,27 @@ hypot(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
 
 // ilogb
 
-inline _LIBCPP_INLINE_VISIBILITY int ilogb(float __lcpp_x) _NOEXCEPT       {return ::ilogbf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY int ilogb(long double __lcpp_x) _NOEXCEPT {return ::ilogbl(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY int ilogb(float __lcpp_x) _NOEXCEPT       {return ::ilogbf(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY int ilogb(long double __lcpp_x) _NOEXCEPT {return ::ilogbl(__lcpp_x);}
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_integral<_A1>::value, int>::type
 ilogb(_A1 __lcpp_x) _NOEXCEPT {return ::ilogb((double)__lcpp_x);}
 
 // lgamma
 
-inline _LIBCPP_INLINE_VISIBILITY float       lgamma(float __lcpp_x) _NOEXCEPT       {return ::lgammaf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double lgamma(long double __lcpp_x) _NOEXCEPT {return ::lgammal(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY float       lgamma(float __lcpp_x) _NOEXCEPT       {return ::lgammaf(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY long double lgamma(long double __lcpp_x) _NOEXCEPT {return ::lgammal(__lcpp_x);}
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_integral<_A1>::value, double>::type
 lgamma(_A1 __lcpp_x) _NOEXCEPT {return ::lgamma((double)__lcpp_x);}
 
 // llrint
 
-inline _LIBCPP_INLINE_VISIBILITY long long llrint(float __lcpp_x) _NOEXCEPT
+inline _LIBCUDACXX_INLINE_VISIBILITY long long llrint(float __lcpp_x) _NOEXCEPT
 {
 #if __has_builtin(__builtin_llrintf)
     return __builtin_llrintf(__lcpp_x);
@@ -1391,7 +1391,7 @@ inline _LIBCPP_INLINE_VISIBILITY long long llrint(float __lcpp_x) _NOEXCEPT
     return ::llrintf(__lcpp_x);
 #endif
 }
-inline _LIBCPP_INLINE_VISIBILITY long long llrint(long double __lcpp_x) _NOEXCEPT
+inline _LIBCUDACXX_INLINE_VISIBILITY long long llrint(long double __lcpp_x) _NOEXCEPT
 {
 #if __has_builtin(__builtin_llrintl)
     return __builtin_llrintl(__lcpp_x);
@@ -1401,7 +1401,7 @@ inline _LIBCPP_INLINE_VISIBILITY long long llrint(long double __lcpp_x) _NOEXCEP
 }
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_integral<_A1>::value, long long>::type
 llrint(_A1 __lcpp_x) _NOEXCEPT
 {
@@ -1414,7 +1414,7 @@ llrint(_A1 __lcpp_x) _NOEXCEPT
 
 // llround
 
-inline _LIBCPP_INLINE_VISIBILITY long long llround(float __lcpp_x) _NOEXCEPT
+inline _LIBCUDACXX_INLINE_VISIBILITY long long llround(float __lcpp_x) _NOEXCEPT
 {
 #if __has_builtin(__builtin_llroundf)
     return __builtin_llroundf(__lcpp_x);
@@ -1422,7 +1422,7 @@ inline _LIBCPP_INLINE_VISIBILITY long long llround(float __lcpp_x) _NOEXCEPT
     return ::llroundf(__lcpp_x);
 #endif
 }
-inline _LIBCPP_INLINE_VISIBILITY long long llround(long double __lcpp_x) _NOEXCEPT
+inline _LIBCUDACXX_INLINE_VISIBILITY long long llround(long double __lcpp_x) _NOEXCEPT
 {
 #if __has_builtin(__builtin_llroundl)
     return __builtin_llroundl(__lcpp_x);
@@ -1432,7 +1432,7 @@ inline _LIBCPP_INLINE_VISIBILITY long long llround(long double __lcpp_x) _NOEXCE
 }
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_integral<_A1>::value, long long>::type
 llround(_A1 __lcpp_x) _NOEXCEPT
 {
@@ -1445,37 +1445,37 @@ llround(_A1 __lcpp_x) _NOEXCEPT
 
 // log1p
 
-inline _LIBCPP_INLINE_VISIBILITY float       log1p(float __lcpp_x) _NOEXCEPT       {return ::log1pf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double log1p(long double __lcpp_x) _NOEXCEPT {return ::log1pl(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY float       log1p(float __lcpp_x) _NOEXCEPT       {return ::log1pf(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY long double log1p(long double __lcpp_x) _NOEXCEPT {return ::log1pl(__lcpp_x);}
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_integral<_A1>::value, double>::type
 log1p(_A1 __lcpp_x) _NOEXCEPT {return ::log1p((double)__lcpp_x);}
 
 // log2
 
-inline _LIBCPP_INLINE_VISIBILITY float       log2(float __lcpp_x) _NOEXCEPT       {return ::log2f(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double log2(long double __lcpp_x) _NOEXCEPT {return ::log2l(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY float       log2(float __lcpp_x) _NOEXCEPT       {return ::log2f(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY long double log2(long double __lcpp_x) _NOEXCEPT {return ::log2l(__lcpp_x);}
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_integral<_A1>::value, double>::type
 log2(_A1 __lcpp_x) _NOEXCEPT {return ::log2((double)__lcpp_x);}
 
 // logb
 
-inline _LIBCPP_INLINE_VISIBILITY float       logb(float __lcpp_x) _NOEXCEPT       {return ::logbf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double logb(long double __lcpp_x) _NOEXCEPT {return ::logbl(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY float       logb(float __lcpp_x) _NOEXCEPT       {return ::logbf(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY long double logb(long double __lcpp_x) _NOEXCEPT {return ::logbl(__lcpp_x);}
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_integral<_A1>::value, double>::type
 logb(_A1 __lcpp_x) _NOEXCEPT {return ::logb((double)__lcpp_x);}
 
 // lrint
 
-inline _LIBCPP_INLINE_VISIBILITY long lrint(float __lcpp_x) _NOEXCEPT
+inline _LIBCUDACXX_INLINE_VISIBILITY long lrint(float __lcpp_x) _NOEXCEPT
 {
 #if __has_builtin(__builtin_lrintf)
     return __builtin_lrintf(__lcpp_x);
@@ -1483,7 +1483,7 @@ inline _LIBCPP_INLINE_VISIBILITY long lrint(float __lcpp_x) _NOEXCEPT
     return ::lrintf(__lcpp_x);
 #endif
 }
-inline _LIBCPP_INLINE_VISIBILITY long lrint(long double __lcpp_x) _NOEXCEPT
+inline _LIBCUDACXX_INLINE_VISIBILITY long lrint(long double __lcpp_x) _NOEXCEPT
 {
 #if __has_builtin(__builtin_lrintl)
     return __builtin_lrintl(__lcpp_x);
@@ -1493,7 +1493,7 @@ inline _LIBCPP_INLINE_VISIBILITY long lrint(long double __lcpp_x) _NOEXCEPT
 }
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_integral<_A1>::value, long>::type
 lrint(_A1 __lcpp_x) _NOEXCEPT
 {
@@ -1506,7 +1506,7 @@ lrint(_A1 __lcpp_x) _NOEXCEPT
 
 // lround
 
-inline _LIBCPP_INLINE_VISIBILITY long lround(float __lcpp_x) _NOEXCEPT
+inline _LIBCUDACXX_INLINE_VISIBILITY long lround(float __lcpp_x) _NOEXCEPT
 {
 #if __has_builtin(__builtin_lroundf)
     return __builtin_lroundf(__lcpp_x);
@@ -1514,7 +1514,7 @@ inline _LIBCPP_INLINE_VISIBILITY long lround(float __lcpp_x) _NOEXCEPT
     return ::lroundf(__lcpp_x);
 #endif
 }
-inline _LIBCPP_INLINE_VISIBILITY long lround(long double __lcpp_x) _NOEXCEPT
+inline _LIBCUDACXX_INLINE_VISIBILITY long lround(long double __lcpp_x) _NOEXCEPT
 {
 #if __has_builtin(__builtin_lroundl)
     return __builtin_lroundl(__lcpp_x);
@@ -1524,7 +1524,7 @@ inline _LIBCPP_INLINE_VISIBILITY long lround(long double __lcpp_x) _NOEXCEPT
 }
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_integral<_A1>::value, long>::type
 lround(_A1 __lcpp_x) _NOEXCEPT
 {
@@ -1539,21 +1539,21 @@ lround(_A1 __lcpp_x) _NOEXCEPT
 
 // nearbyint
 
-inline _LIBCPP_INLINE_VISIBILITY float       nearbyint(float __lcpp_x) _NOEXCEPT       {return ::nearbyintf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double nearbyint(long double __lcpp_x) _NOEXCEPT {return ::nearbyintl(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY float       nearbyint(float __lcpp_x) _NOEXCEPT       {return ::nearbyintf(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY long double nearbyint(long double __lcpp_x) _NOEXCEPT {return ::nearbyintl(__lcpp_x);}
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_integral<_A1>::value, double>::type
 nearbyint(_A1 __lcpp_x) _NOEXCEPT {return ::nearbyint((double)__lcpp_x);}
 
 // nextafter
 
-inline _LIBCPP_INLINE_VISIBILITY float       nextafter(float __lcpp_x, float __lcpp_y) _NOEXCEPT             {return ::nextafterf(__lcpp_x, __lcpp_y);}
-inline _LIBCPP_INLINE_VISIBILITY long double nextafter(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::nextafterl(__lcpp_x, __lcpp_y);}
+inline _LIBCUDACXX_INLINE_VISIBILITY float       nextafter(float __lcpp_x, float __lcpp_y) _NOEXCEPT             {return ::nextafterf(__lcpp_x, __lcpp_y);}
+inline _LIBCUDACXX_INLINE_VISIBILITY long double nextafter(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::nextafterl(__lcpp_x, __lcpp_y);}
 
 template <class _A1, class _A2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::__enable_if_t
 <
     std::is_arithmetic<_A1>::value &&
@@ -1570,21 +1570,21 @@ nextafter(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
 
 // nexttoward
 
-inline _LIBCPP_INLINE_VISIBILITY float       nexttoward(float __lcpp_x, long double __lcpp_y) _NOEXCEPT       {return ::nexttowardf(__lcpp_x, __lcpp_y);}
-inline _LIBCPP_INLINE_VISIBILITY long double nexttoward(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::nexttowardl(__lcpp_x, __lcpp_y);}
+inline _LIBCUDACXX_INLINE_VISIBILITY float       nexttoward(float __lcpp_x, long double __lcpp_y) _NOEXCEPT       {return ::nexttowardf(__lcpp_x, __lcpp_y);}
+inline _LIBCUDACXX_INLINE_VISIBILITY long double nexttoward(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::nexttowardl(__lcpp_x, __lcpp_y);}
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_integral<_A1>::value, double>::type
 nexttoward(_A1 __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::nexttoward((double)__lcpp_x, __lcpp_y);}
 
 // remainder
 
-inline _LIBCPP_INLINE_VISIBILITY float       remainder(float __lcpp_x, float __lcpp_y) _NOEXCEPT             {return ::remainderf(__lcpp_x, __lcpp_y);}
-inline _LIBCPP_INLINE_VISIBILITY long double remainder(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::remainderl(__lcpp_x, __lcpp_y);}
+inline _LIBCUDACXX_INLINE_VISIBILITY float       remainder(float __lcpp_x, float __lcpp_y) _NOEXCEPT             {return ::remainderf(__lcpp_x, __lcpp_y);}
+inline _LIBCUDACXX_INLINE_VISIBILITY long double remainder(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::remainderl(__lcpp_x, __lcpp_y);}
 
 template <class _A1, class _A2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::__enable_if_t
 <
     std::is_arithmetic<_A1>::value &&
@@ -1601,11 +1601,11 @@ remainder(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
 
 // remquo
 
-inline _LIBCPP_INLINE_VISIBILITY float       remquo(float __lcpp_x, float __lcpp_y, int* __lcpp_z) _NOEXCEPT             {return ::remquof(__lcpp_x, __lcpp_y, __lcpp_z);}
-inline _LIBCPP_INLINE_VISIBILITY long double remquo(long double __lcpp_x, long double __lcpp_y, int* __lcpp_z) _NOEXCEPT {return ::remquol(__lcpp_x, __lcpp_y, __lcpp_z);}
+inline _LIBCUDACXX_INLINE_VISIBILITY float       remquo(float __lcpp_x, float __lcpp_y, int* __lcpp_z) _NOEXCEPT             {return ::remquof(__lcpp_x, __lcpp_y, __lcpp_z);}
+inline _LIBCUDACXX_INLINE_VISIBILITY long double remquo(long double __lcpp_x, long double __lcpp_y, int* __lcpp_z) _NOEXCEPT {return ::remquol(__lcpp_x, __lcpp_y, __lcpp_z);}
 
 template <class _A1, class _A2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::__enable_if_t
 <
     std::is_arithmetic<_A1>::value &&
@@ -1622,7 +1622,7 @@ remquo(_A1 __lcpp_x, _A2 __lcpp_y, int* __lcpp_z) _NOEXCEPT
 
 // rint
 
-inline _LIBCPP_INLINE_VISIBILITY float       rint(float __lcpp_x) _NOEXCEPT
+inline _LIBCUDACXX_INLINE_VISIBILITY float       rint(float __lcpp_x) _NOEXCEPT
 {
 #if __has_builtin(__builtin_rintf)
     return __builtin_rintf(__lcpp_x);
@@ -1630,7 +1630,7 @@ inline _LIBCPP_INLINE_VISIBILITY float       rint(float __lcpp_x) _NOEXCEPT
     return ::rintf(__lcpp_x);
 #endif
 }
-inline _LIBCPP_INLINE_VISIBILITY long double rint(long double __lcpp_x) _NOEXCEPT
+inline _LIBCUDACXX_INLINE_VISIBILITY long double rint(long double __lcpp_x) _NOEXCEPT
 {
 #if __has_builtin(__builtin_rintl)
     return __builtin_rintl(__lcpp_x);
@@ -1640,7 +1640,7 @@ inline _LIBCPP_INLINE_VISIBILITY long double rint(long double __lcpp_x) _NOEXCEP
 }
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_integral<_A1>::value, double>::type
 rint(_A1 __lcpp_x) _NOEXCEPT
 {
@@ -1653,7 +1653,7 @@ rint(_A1 __lcpp_x) _NOEXCEPT
 
 // round
 
-inline _LIBCPP_INLINE_VISIBILITY float       round(float __lcpp_x) _NOEXCEPT
+inline _LIBCUDACXX_INLINE_VISIBILITY float       round(float __lcpp_x) _NOEXCEPT
 {
 #if __has_builtin(__builtin_round)
     return __builtin_round(__lcpp_x);
@@ -1661,7 +1661,7 @@ inline _LIBCPP_INLINE_VISIBILITY float       round(float __lcpp_x) _NOEXCEPT
     return ::round(__lcpp_x);
 #endif
 }
-inline _LIBCPP_INLINE_VISIBILITY long double round(long double __lcpp_x) _NOEXCEPT
+inline _LIBCUDACXX_INLINE_VISIBILITY long double round(long double __lcpp_x) _NOEXCEPT
 {
 #if __has_builtin(__builtin_roundl)
     return __builtin_roundl(__lcpp_x);
@@ -1671,7 +1671,7 @@ inline _LIBCPP_INLINE_VISIBILITY long double round(long double __lcpp_x) _NOEXCE
 }
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_integral<_A1>::value, double>::type
 round(_A1 __lcpp_x) _NOEXCEPT
 {
@@ -1684,37 +1684,37 @@ round(_A1 __lcpp_x) _NOEXCEPT
 
 // scalbln
 
-inline _LIBCPP_INLINE_VISIBILITY float       scalbln(float __lcpp_x, long __lcpp_y) _NOEXCEPT       {return ::scalblnf(__lcpp_x, __lcpp_y);}
-inline _LIBCPP_INLINE_VISIBILITY long double scalbln(long double __lcpp_x, long __lcpp_y) _NOEXCEPT {return ::scalblnl(__lcpp_x, __lcpp_y);}
+inline _LIBCUDACXX_INLINE_VISIBILITY float       scalbln(float __lcpp_x, long __lcpp_y) _NOEXCEPT       {return ::scalblnf(__lcpp_x, __lcpp_y);}
+inline _LIBCUDACXX_INLINE_VISIBILITY long double scalbln(long double __lcpp_x, long __lcpp_y) _NOEXCEPT {return ::scalblnl(__lcpp_x, __lcpp_y);}
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_integral<_A1>::value, double>::type
 scalbln(_A1 __lcpp_x, long __lcpp_y) _NOEXCEPT {return ::scalbln((double)__lcpp_x, __lcpp_y);}
 
 // scalbn
 
-inline _LIBCPP_INLINE_VISIBILITY float       scalbn(float __lcpp_x, int __lcpp_y) _NOEXCEPT       {return ::scalbnf(__lcpp_x, __lcpp_y);}
-inline _LIBCPP_INLINE_VISIBILITY long double scalbn(long double __lcpp_x, int __lcpp_y) _NOEXCEPT {return ::scalbnl(__lcpp_x, __lcpp_y);}
+inline _LIBCUDACXX_INLINE_VISIBILITY float       scalbn(float __lcpp_x, int __lcpp_y) _NOEXCEPT       {return ::scalbnf(__lcpp_x, __lcpp_y);}
+inline _LIBCUDACXX_INLINE_VISIBILITY long double scalbn(long double __lcpp_x, int __lcpp_y) _NOEXCEPT {return ::scalbnl(__lcpp_x, __lcpp_y);}
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_integral<_A1>::value, double>::type
 scalbn(_A1 __lcpp_x, int __lcpp_y) _NOEXCEPT {return ::scalbn((double)__lcpp_x, __lcpp_y);}
 
 // tgamma
 
-inline _LIBCPP_INLINE_VISIBILITY float       tgamma(float __lcpp_x) _NOEXCEPT       {return ::tgammaf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double tgamma(long double __lcpp_x) _NOEXCEPT {return ::tgammal(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY float       tgamma(float __lcpp_x) _NOEXCEPT       {return ::tgammaf(__lcpp_x);}
+inline _LIBCUDACXX_INLINE_VISIBILITY long double tgamma(long double __lcpp_x) _NOEXCEPT {return ::tgammal(__lcpp_x);}
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_integral<_A1>::value, double>::type
 tgamma(_A1 __lcpp_x) _NOEXCEPT {return ::tgamma((double)__lcpp_x);}
 
 // trunc
 
-inline _LIBCPP_INLINE_VISIBILITY float       trunc(float __lcpp_x) _NOEXCEPT
+inline _LIBCUDACXX_INLINE_VISIBILITY float       trunc(float __lcpp_x) _NOEXCEPT
 {
 #if __has_builtin(__builtin_trunc)
     return __builtin_trunc(__lcpp_x);
@@ -1722,7 +1722,7 @@ inline _LIBCPP_INLINE_VISIBILITY float       trunc(float __lcpp_x) _NOEXCEPT
     return ::trunc(__lcpp_x);
 #endif
 }
-inline _LIBCPP_INLINE_VISIBILITY long double trunc(long double __lcpp_x) _NOEXCEPT
+inline _LIBCUDACXX_INLINE_VISIBILITY long double trunc(long double __lcpp_x) _NOEXCEPT
 {
 #if __has_builtin(__builtin_truncl)
     return __builtin_truncl(__lcpp_x);
@@ -1732,7 +1732,7 @@ inline _LIBCPP_INLINE_VISIBILITY long double trunc(long double __lcpp_x) _NOEXCE
 }
 
 template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename std::enable_if<std::is_integral<_A1>::value, double>::type
 trunc(_A1 __lcpp_x) _NOEXCEPT
 {
@@ -1747,7 +1747,7 @@ trunc(_A1 __lcpp_x) _NOEXCEPT
 
 #endif // __cplusplus
 
-#else // _LIBCPP_MATH_H
+#else // _LIBCUDACXX_MATH_H
 
 // This include lives outside the header guard in order to support an MSVC
 // extension which allows users to do:
@@ -1757,8 +1757,8 @@ trunc(_A1 __lcpp_x) _NOEXCEPT
 //
 // and receive the definitions of mathematical constants, even if <math.h>
 // has previously been included.
-#if defined(_LIBCPP_MSVCRT) && defined(_USE_MATH_DEFINES)
+#if defined(_LIBCUDACXX_MSVCRT) && defined(_USE_MATH_DEFINES)
 #include_next <math.h>
 #endif
 
-#endif // _LIBCPP_MATH_H
+#endif // _LIBCUDACXX_MATH_H

diff  --git a/libcxx/include/memory b/libcxx/include/memory
index a986d76c8b4e..71d984c10678 100644
--- a/libcxx/include/memory
+++ b/libcxx/include/memory
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_MEMORY
-#define _LIBCPP_MEMORY
+#ifndef _LIBCUDACXX_MEMORY
+#define _LIBCUDACXX_MEMORY
 
 /*
     memory synopsis
@@ -873,7 +873,7 @@ template<size_t N, class T>
 #include <typeinfo>
 #include <version>
 
-#ifndef _LIBCPP_REMOVE_TRANSITIVE_INCLUDES
+#ifndef _LIBCUDACXX_REMOVE_TRANSITIVE_INCLUDES
 #  include <iterator>
 #  include <utility>
 #endif
@@ -881,11 +881,11 @@ template<size_t N, class T>
 // standard-mandated includes
 #include <compare>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 struct __destruct_n
 {
@@ -893,45 +893,45 @@ private:
     size_t __size_;
 
     template <class _Tp>
-    _LIBCPP_INLINE_VISIBILITY void __process(_Tp* __p, false_type) _NOEXCEPT
+    _LIBCUDACXX_INLINE_VISIBILITY void __process(_Tp* __p, false_type) _NOEXCEPT
         {for (size_t __i = 0; __i < __size_; ++__i, ++__p) __p->~_Tp();}
 
     template <class _Tp>
-    _LIBCPP_INLINE_VISIBILITY void __process(_Tp*, true_type) _NOEXCEPT
+    _LIBCUDACXX_INLINE_VISIBILITY void __process(_Tp*, true_type) _NOEXCEPT
         {}
 
-    _LIBCPP_INLINE_VISIBILITY void __incr(false_type) _NOEXCEPT
+    _LIBCUDACXX_INLINE_VISIBILITY void __incr(false_type) _NOEXCEPT
         {++__size_;}
-    _LIBCPP_INLINE_VISIBILITY void __incr(true_type) _NOEXCEPT
+    _LIBCUDACXX_INLINE_VISIBILITY void __incr(true_type) _NOEXCEPT
         {}
 
-    _LIBCPP_INLINE_VISIBILITY void __set(size_t __s, false_type) _NOEXCEPT
+    _LIBCUDACXX_INLINE_VISIBILITY void __set(size_t __s, false_type) _NOEXCEPT
         {__size_ = __s;}
-    _LIBCPP_INLINE_VISIBILITY void __set(size_t, true_type) _NOEXCEPT
+    _LIBCUDACXX_INLINE_VISIBILITY void __set(size_t, true_type) _NOEXCEPT
         {}
 public:
-    _LIBCPP_INLINE_VISIBILITY explicit __destruct_n(size_t __s) _NOEXCEPT
+    _LIBCUDACXX_INLINE_VISIBILITY explicit __destruct_n(size_t __s) _NOEXCEPT
         : __size_(__s) {}
 
     template <class _Tp>
-    _LIBCPP_INLINE_VISIBILITY void __incr() _NOEXCEPT
+    _LIBCUDACXX_INLINE_VISIBILITY void __incr() _NOEXCEPT
         {__incr(integral_constant<bool, is_trivially_destructible<_Tp>::value>());}
 
     template <class _Tp>
-    _LIBCPP_INLINE_VISIBILITY void __set(size_t __s, _Tp*) _NOEXCEPT
+    _LIBCUDACXX_INLINE_VISIBILITY void __set(size_t __s, _Tp*) _NOEXCEPT
         {__set(__s, integral_constant<bool, is_trivially_destructible<_Tp>::value>());}
 
     template <class _Tp>
-    _LIBCPP_INLINE_VISIBILITY void operator()(_Tp* __p) _NOEXCEPT
+    _LIBCUDACXX_INLINE_VISIBILITY void operator()(_Tp* __p) _NOEXCEPT
         {__process(__p, integral_constant<bool, is_trivially_destructible<_Tp>::value>());}
 };
 
-_LIBCPP_FUNC_VIS void* align(size_t __align, size_t __sz, void*& __ptr, size_t& __space);
+_LIBCUDACXX_FUNC_VIS void* align(size_t __align, size_t __sz, void*& __ptr, size_t& __space);
 
 template <typename _Alloc, typename _Traits=allocator_traits<_Alloc> >
 struct __noexcept_move_assign_container : public integral_constant<bool,
     _Traits::propagate_on_container_move_assignment::value
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
         || _Traits::is_always_equal::value
 #else
         && is_nothrow_move_assignable<_Alloc>::value
@@ -943,30 +943,30 @@ template <class _Tp, class _Alloc>
 struct __temp_value {
     typedef allocator_traits<_Alloc> _Traits;
 
-#ifdef _LIBCPP_CXX03_LANG
-    typename aligned_storage<sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp)>::type __v;
+#ifdef _LIBCUDACXX_CXX03_LANG
+    typename aligned_storage<sizeof(_Tp), _LIBCUDACXX_ALIGNOF(_Tp)>::type __v;
 #else
     union { _Tp __v; };
 #endif
     _Alloc &__a;
 
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 _Tp *__addr() {
-#ifdef _LIBCPP_CXX03_LANG
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _Tp *__addr() {
+#ifdef _LIBCUDACXX_CXX03_LANG
         return reinterpret_cast<_Tp*>(std::addressof(__v));
 #else
         return std::addressof(__v);
 #endif
     }
 
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 _Tp &   get() { return *__addr(); }
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _Tp &   get() { return *__addr(); }
 
     template<class... _Args>
-    _LIBCPP_NO_CFI
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 __temp_value(_Alloc &__alloc, _Args&& ... __args) : __a(__alloc) {
+    _LIBCUDACXX_NO_CFI
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 __temp_value(_Alloc &__alloc, _Args&& ... __args) : __a(__alloc) {
       _Traits::construct(__a, __addr(), std::forward<_Args>(__args)...);
     }
 
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 ~__temp_value() { _Traits::destroy(__a, __addr()); }
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 ~__temp_value() { _Traits::destroy(__a, __addr()); }
 };
 
 template<typename _Alloc, typename = void, typename = void>
@@ -987,11 +987,11 @@ struct __builtin_new_allocator {
   struct __builtin_new_deleter {
     typedef void* pointer_type;
 
-    _LIBCPP_CONSTEXPR explicit __builtin_new_deleter(size_t __size, size_t __align)
+    _LIBCUDACXX_CONSTEXPR explicit __builtin_new_deleter(size_t __size, size_t __align)
         : __size_(__size), __align_(__align) {}
 
     void operator()(void* __p) const _NOEXCEPT {
-        _VSTD::__libcpp_deallocate(__p, __size_, __align_);
+        _CUDA_VSTD::__LIBCUDACXX_deallocate(__p, __size_, __align_);
     }
 
    private:
@@ -1002,32 +1002,32 @@ struct __builtin_new_allocator {
   typedef unique_ptr<void, __builtin_new_deleter> __holder_t;
 
   static __holder_t __allocate_bytes(size_t __s, size_t __align) {
-      return __holder_t(_VSTD::__libcpp_allocate(__s, __align),
+      return __holder_t(_CUDA_VSTD::__LIBCUDACXX_allocate(__s, __align),
                      __builtin_new_deleter(__s, __align));
   }
 
   static void __deallocate_bytes(void* __p, size_t __s,
                                  size_t __align) _NOEXCEPT {
-      _VSTD::__libcpp_deallocate(__p, __s, __align);
+      _CUDA_VSTD::__LIBCUDACXX_deallocate(__p, __s, __align);
   }
 
   template <class _Tp>
-  _LIBCPP_NODEBUG _LIBCPP_ALWAYS_INLINE
+  _LIBCUDACXX_NODEBUG _LIBCUDACXX_ALWAYS_INLINE
   static __holder_t __allocate_type(size_t __n) {
-      return __allocate_bytes(__n * sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp));
+      return __allocate_bytes(__n * sizeof(_Tp), _LIBCUDACXX_ALIGNOF(_Tp));
   }
 
   template <class _Tp>
-  _LIBCPP_NODEBUG _LIBCPP_ALWAYS_INLINE
+  _LIBCUDACXX_NODEBUG _LIBCUDACXX_ALWAYS_INLINE
   static void __deallocate_type(void* __p, size_t __n) _NOEXCEPT {
-      __deallocate_bytes(__p, __n * sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp));
+      __deallocate_bytes(__p, __n * sizeof(_Tp), _LIBCUDACXX_ALIGNOF(_Tp));
   }
 };
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#if defined(_LIBCPP_HAS_PARALLEL_ALGORITHMS) && _LIBCPP_STD_VER >= 17
+#if defined(_LIBCUDACXX_HAS_PARALLEL_ALGORITHMS) && _LIBCUDACXX_STD_VER >= 17
 #   include <__pstl_memory>
 #endif
 
-#endif // _LIBCPP_MEMORY
+#endif // _LIBCUDACXX_MEMORY

diff  --git a/libcxx/include/mutex b/libcxx/include/mutex
index 5dfaad2b3510..282e4dc77b56 100644
--- a/libcxx/include/mutex
+++ b/libcxx/include/mutex
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_MUTEX
-#define _LIBCPP_MUTEX
+#ifndef _LIBCUDACXX_MUTEX
+#define _LIBCUDACXX_MUTEX
 
 /*
     mutex synopsis
@@ -193,30 +193,30 @@ template<class Callable, class ...Args>
 #include <__utility/forward.h>
 #include <cstdint>
 #include <memory>
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 # include <tuple>
 #endif
 #include <version>
 
-#ifndef _LIBCPP_REMOVE_TRANSITIVE_INCLUDES
+#ifndef _LIBCUDACXX_REMOVE_TRANSITIVE_INCLUDES
 #  include <functional>
 #endif
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#ifndef _LIBCPP_HAS_NO_THREADS
+#ifndef _LIBCUDACXX_HAS_NO_THREADS
 
-class _LIBCPP_TYPE_VIS recursive_mutex
+class _LIBCUDACXX_TYPE_VIS recursive_mutex
 {
-    __libcpp_recursive_mutex_t __m_;
+    __LIBCUDACXX_recursive_mutex_t __m_;
 
 public:
     recursive_mutex();
@@ -229,13 +229,13 @@ public:
     bool try_lock() _NOEXCEPT;
     void unlock()  _NOEXCEPT;
 
-    typedef __libcpp_recursive_mutex_t* native_handle_type;
+    typedef __LIBCUDACXX_recursive_mutex_t* native_handle_type;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     native_handle_type native_handle() {return &__m_;}
 };
 
-class _LIBCPP_TYPE_VIS timed_mutex
+class _LIBCUDACXX_TYPE_VIS timed_mutex
 {
     mutex              __m_;
     condition_variable __cv_;
@@ -251,11 +251,11 @@ public:
     void lock();
     bool try_lock() _NOEXCEPT;
     template <class _Rep, class _Period>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         bool try_lock_for(const chrono::duration<_Rep, _Period>& __d)
             {return try_lock_until(chrono::steady_clock::now() + __d);}
     template <class _Clock, class _Duration>
-        _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
+        _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
         bool try_lock_until(const chrono::time_point<_Clock, _Duration>& __t);
     void unlock() _NOEXCEPT;
 };
@@ -277,7 +277,7 @@ timed_mutex::try_lock_until(const chrono::time_point<_Clock, _Duration>& __t)
     return false;
 }
 
-class _LIBCPP_TYPE_VIS recursive_timed_mutex
+class _LIBCUDACXX_TYPE_VIS recursive_timed_mutex
 {
     mutex              __m_;
     condition_variable __cv_;
@@ -293,11 +293,11 @@ public:
     void lock();
     bool try_lock() _NOEXCEPT;
     template <class _Rep, class _Period>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         bool try_lock_for(const chrono::duration<_Rep, _Period>& __d)
             {return try_lock_until(chrono::steady_clock::now() + __d);}
     template <class _Clock, class _Duration>
-        _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
+        _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
         bool try_lock_until(const chrono::time_point<_Clock, _Duration>& __t);
     void unlock() _NOEXCEPT;
 };
@@ -346,7 +346,7 @@ try_lock(_L0& __l0, _L1& __l1)
     return 0;
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
 template <class _L0, class _L1, class _L2, class... _L3>
 int
@@ -365,7 +365,7 @@ try_lock(_L0& __l0, _L1& __l1, _L2& __l2, _L3&... __l3)
     return __r;
 }
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
 template <class _L0, class _L1>
 void
@@ -381,7 +381,7 @@ lock(_L0& __l0, _L1& __l1)
                 break;
             }
         }
-        __libcpp_thread_yield();
+        __LIBCUDACXX_thread_yield();
         {
             unique_lock<_L1> __u1(__l1);
             if (__l0.try_lock())
@@ -390,11 +390,11 @@ lock(_L0& __l0, _L1& __l1)
                 break;
             }
         }
-        __libcpp_thread_yield();
+        __LIBCUDACXX_thread_yield();
     }
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
 template <class _L0, class _L1, class _L2, class ..._L3>
 void
@@ -415,7 +415,7 @@ __lock_first(int __i, _L0& __l0, _L1& __l1, _L2& __l2, _L3& ...__l3)
                 }
             }
             ++__i;
-            __libcpp_thread_yield();
+            __LIBCUDACXX_thread_yield();
             break;
         case 1:
             {
@@ -431,7 +431,7 @@ __lock_first(int __i, _L0& __l0, _L1& __l1, _L2& __l2, _L3& ...__l3)
                 __i = 0;
             else
                 __i += 2;
-            __libcpp_thread_yield();
+            __LIBCUDACXX_thread_yield();
             break;
         default:
             __lock_first(__i - 2, __l2, __l3..., __l0, __l1);
@@ -441,7 +441,7 @@ __lock_first(int __i, _L0& __l0, _L1& __l1, _L2& __l2, _L3& ...__l3)
 }
 
 template <class _L0, class _L1, class _L2, class ..._L3>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 lock(_L0& __l0, _L1& __l1, _L2& __l2, _L3& ...__l3)
 {
@@ -449,39 +449,39 @@ lock(_L0& __l0, _L1& __l1, _L2& __l2, _L3& ...__l3)
 }
 
 template <class _L0>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void __unlock(_L0& __l0) {
     __l0.unlock();
 }
 
 template <class _L0, class _L1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void __unlock(_L0& __l0, _L1& __l1) {
     __l0.unlock();
     __l1.unlock();
 }
 
 template <class _L0, class _L1, class _L2, class ..._L3>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void __unlock(_L0& __l0, _L1& __l1, _L2& __l2, _L3&... __l3) {
     __l0.unlock();
     __l1.unlock();
-    _VSTD::__unlock(__l2, __l3...);
+    _CUDA_VSTD::__unlock(__l2, __l3...);
 }
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class ..._Mutexes>
-class _LIBCPP_TEMPLATE_VIS scoped_lock;
+class _LIBCUDACXX_TEMPLATE_VIS scoped_lock;
 
 template <>
-class _LIBCPP_TEMPLATE_VIS scoped_lock<> {
+class _LIBCUDACXX_TEMPLATE_VIS scoped_lock<> {
 public:
     explicit scoped_lock() {}
     ~scoped_lock() = default;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit scoped_lock(adopt_lock_t) {}
 
     scoped_lock(scoped_lock const&) = delete;
@@ -489,19 +489,19 @@ public:
 };
 
 template <class _Mutex>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_THREAD_SAFETY_ANNOTATION(scoped_lockable) scoped_lock<_Mutex> {
+class _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_THREAD_SAFETY_ANNOTATION(scoped_lockable) scoped_lock<_Mutex> {
 public:
     typedef _Mutex  mutex_type;
 private:
     mutex_type& __m_;
 public:
-    explicit scoped_lock(mutex_type & __m) _LIBCPP_THREAD_SAFETY_ANNOTATION(acquire_capability(__m))
+    explicit scoped_lock(mutex_type & __m) _LIBCUDACXX_THREAD_SAFETY_ANNOTATION(acquire_capability(__m))
         : __m_(__m) {__m_.lock();}
 
-    ~scoped_lock() _LIBCPP_THREAD_SAFETY_ANNOTATION(release_capability()) {__m_.unlock();}
+    ~scoped_lock() _LIBCUDACXX_THREAD_SAFETY_ANNOTATION(release_capability()) {__m_.unlock();}
 
-    _LIBCPP_INLINE_VISIBILITY
-    explicit scoped_lock(adopt_lock_t, mutex_type& __m) _LIBCPP_THREAD_SAFETY_ANNOTATION(requires_capability(__m))
+    _LIBCUDACXX_INLINE_VISIBILITY
+    explicit scoped_lock(adopt_lock_t, mutex_type& __m) _LIBCUDACXX_THREAD_SAFETY_ANNOTATION(requires_capability(__m))
         : __m_(__m) {}
 
     scoped_lock(scoped_lock const&) = delete;
@@ -509,26 +509,26 @@ public:
 };
 
 template <class ..._MArgs>
-class _LIBCPP_TEMPLATE_VIS scoped_lock
+class _LIBCUDACXX_TEMPLATE_VIS scoped_lock
 {
     static_assert(sizeof...(_MArgs) > 1, "At least 2 lock types required");
     typedef tuple<_MArgs&...> _MutexTuple;
 
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit scoped_lock(_MArgs&... __margs)
       : __t_(__margs...)
     {
-        _VSTD::lock(__margs...);
+        _CUDA_VSTD::lock(__margs...);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     scoped_lock(adopt_lock_t, _MArgs&... __margs)
         : __t_(__margs...)
     {
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     ~scoped_lock() {
         typedef typename __make_tuple_indices<sizeof...(_MArgs)>::type _Indices;
         __unlock_unpack(_Indices{}, __t_);
@@ -539,46 +539,46 @@ public:
 
 private:
     template <size_t ..._Indx>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     static void __unlock_unpack(__tuple_indices<_Indx...>, _MutexTuple& __mt) {
-        _VSTD::__unlock(_VSTD::get<_Indx>(__mt)...);
+        _CUDA_VSTD::__unlock(_CUDA_VSTD::get<_Indx>(__mt)...);
     }
 
     _MutexTuple __t_;
 };
 
-#endif // _LIBCPP_STD_VER > 14
-#endif // !_LIBCPP_HAS_NO_THREADS
+#endif // _LIBCUDACXX_STD_VER > 14
+#endif // !_LIBCUDACXX_HAS_NO_THREADS
 
-struct _LIBCPP_TEMPLATE_VIS once_flag;
+struct _LIBCUDACXX_TEMPLATE_VIS once_flag;
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
 template<class _Callable, class... _Args>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 void call_once(once_flag&, _Callable&&, _Args&&...);
 
-#else  // _LIBCPP_CXX03_LANG
+#else  // _LIBCUDACXX_CXX03_LANG
 
 template<class _Callable>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 void call_once(once_flag&, _Callable&);
 
 template<class _Callable>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 void call_once(once_flag&, const _Callable&);
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
-struct _LIBCPP_TEMPLATE_VIS once_flag
+struct _LIBCUDACXX_TEMPLATE_VIS once_flag
 {
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR
         once_flag() _NOEXCEPT : __state_(0) {}
     once_flag(const once_flag&) = delete;
     once_flag& operator=(const once_flag&) = delete;
 
-#if defined(_LIBCPP_ABI_MICROSOFT)
+#if defined(_LIBCUDACXX_ABI_MICROSOFT)
    typedef uintptr_t _State_type;
 #else
    typedef unsigned long _State_type;
@@ -587,11 +587,11 @@ struct _LIBCPP_TEMPLATE_VIS once_flag
 private:
     _State_type __state_;
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
     template<class _Callable, class... _Args>
     friend
     void call_once(once_flag&, _Callable&&, _Args&&...);
-#else  // _LIBCPP_CXX03_LANG
+#else  // _LIBCUDACXX_CXX03_LANG
     template<class _Callable>
     friend
     void call_once(once_flag&, _Callable&);
@@ -599,20 +599,20 @@ private:
     template<class _Callable>
     friend
     void call_once(once_flag&, const _Callable&);
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 };
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
 template <class _Fp>
 class __call_once_param
 {
     _Fp& __f_;
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __call_once_param(_Fp& __f) : __f_(__f) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void operator()()
     {
         typedef typename __make_tuple_indices<tuple_size<_Fp>::value, 1>::type _Index;
@@ -621,10 +621,10 @@ public:
 
 private:
     template <size_t ..._Indices>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __execute(__tuple_indices<_Indices...>)
     {
-        _VSTD::__invoke(_VSTD::get<0>(_VSTD::move(__f_)), _VSTD::get<_Indices>(_VSTD::move(__f_))...);
+        _CUDA_VSTD::__invoke(_CUDA_VSTD::get<0>(_CUDA_VSTD::move(__f_)), _CUDA_VSTD::get<_Indices>(_CUDA_VSTD::move(__f_))...);
     }
 };
 
@@ -635,10 +635,10 @@ class __call_once_param
 {
     _Fp& __f_;
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __call_once_param(_Fp& __f) : __f_(__f) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void operator()()
     {
         __f_();
@@ -648,40 +648,40 @@ public:
 #endif
 
 template <class _Fp>
-void _LIBCPP_INLINE_VISIBILITY
+void _LIBCUDACXX_INLINE_VISIBILITY
 __call_once_proxy(void* __vp)
 {
     __call_once_param<_Fp>* __p = static_cast<__call_once_param<_Fp>*>(__vp);
     (*__p)();
 }
 
-_LIBCPP_FUNC_VIS void __call_once(volatile once_flag::_State_type&, void*,
+_LIBCUDACXX_FUNC_VIS void __call_once(volatile once_flag::_State_type&, void*,
                                   void (*)(void*));
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
 template<class _Callable, class... _Args>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 call_once(once_flag& __flag, _Callable&& __func, _Args&&... __args)
 {
-    if (__libcpp_acquire_load(&__flag.__state_) != ~once_flag::_State_type(0))
+    if (__LIBCUDACXX_acquire_load(&__flag.__state_) != ~once_flag::_State_type(0))
     {
         typedef tuple<_Callable&&, _Args&&...> _Gp;
-        _Gp __f(_VSTD::forward<_Callable>(__func), _VSTD::forward<_Args>(__args)...);
+        _Gp __f(_CUDA_VSTD::forward<_Callable>(__func), _CUDA_VSTD::forward<_Args>(__args)...);
         __call_once_param<_Gp> __p(__f);
         __call_once(__flag.__state_, &__p, &__call_once_proxy<_Gp>);
     }
 }
 
-#else  // _LIBCPP_CXX03_LANG
+#else  // _LIBCUDACXX_CXX03_LANG
 
 template<class _Callable>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 call_once(once_flag& __flag, _Callable& __func)
 {
-    if (__libcpp_acquire_load(&__flag.__state_) != ~once_flag::_State_type(0))
+    if (__LIBCUDACXX_acquire_load(&__flag.__state_) != ~once_flag::_State_type(0))
     {
         __call_once_param<_Callable> __p(__func);
         __call_once(__flag.__state_, &__p, &__call_once_proxy<_Callable>);
@@ -689,21 +689,21 @@ call_once(once_flag& __flag, _Callable& __func)
 }
 
 template<class _Callable>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 call_once(once_flag& __flag, const _Callable& __func)
 {
-    if (__libcpp_acquire_load(&__flag.__state_) != ~once_flag::_State_type(0))
+    if (__LIBCUDACXX_acquire_load(&__flag.__state_) != ~once_flag::_State_type(0))
     {
         __call_once_param<const _Callable> __p(__func);
         __call_once(__flag.__state_, &__p, &__call_once_proxy<const _Callable>);
     }
 }
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP_MUTEX
+#endif // _LIBCUDACXX_MUTEX

diff  --git a/libcxx/include/new b/libcxx/include/new
index ed95caed1c41..9c879b5f8808 100644
--- a/libcxx/include/new
+++ b/libcxx/include/new
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_NEW
-#define _LIBCPP_NEW
+#ifndef _LIBCUDACXX_NEW
+#define _LIBCUDACXX_NEW
 
 /*
     new synopsis
@@ -95,36 +95,36 @@ void  operator delete[](void* ptr, void*) noexcept;
 #include <type_traits>
 #include <version>
 
-#if defined(_LIBCPP_ABI_VCRUNTIME)
+#if defined(_LIBCUDACXX_ABI_VCRUNTIME)
 #include <new.h>
 #endif
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
 #if !defined(__cpp_sized_deallocation) || __cpp_sized_deallocation  < 201309L
-#define _LIBCPP_HAS_NO_LANGUAGE_SIZED_DEALLOCATION
+#define _LIBCUDACXX_HAS_NO_LANGUAGE_SIZED_DEALLOCATION
 #endif
 
-#if !defined(_LIBCPP_BUILDING_LIBRARY) && _LIBCPP_STD_VER < 14 && \
-    defined(_LIBCPP_HAS_NO_LANGUAGE_SIZED_DEALLOCATION)
-# define _LIBCPP_HAS_NO_LIBRARY_SIZED_DEALLOCATION
+#if !defined(_LIBCUDACXX_BUILDING_LIBRARY) && _LIBCUDACXX_STD_VER < 14 && \
+    defined(_LIBCUDACXX_HAS_NO_LANGUAGE_SIZED_DEALLOCATION)
+# define _LIBCUDACXX_HAS_NO_LIBRARY_SIZED_DEALLOCATION
 #endif
 
-#if defined(_LIBCPP_HAS_NO_LIBRARY_SIZED_DEALLOCATION) || \
-    defined(_LIBCPP_HAS_NO_LANGUAGE_SIZED_DEALLOCATION)
-# define _LIBCPP_HAS_NO_SIZED_DEALLOCATION
+#if defined(_LIBCUDACXX_HAS_NO_LIBRARY_SIZED_DEALLOCATION) || \
+    defined(_LIBCUDACXX_HAS_NO_LANGUAGE_SIZED_DEALLOCATION)
+# define _LIBCUDACXX_HAS_NO_SIZED_DEALLOCATION
 #endif
 
 namespace std  // purposefully not using versioning namespace
 {
 
-#if !defined(_LIBCPP_ABI_VCRUNTIME)
-struct _LIBCPP_TYPE_VIS nothrow_t { explicit nothrow_t() = default; };
-extern _LIBCPP_FUNC_VIS const nothrow_t nothrow;
+#if !defined(_LIBCUDACXX_ABI_VCRUNTIME)
+struct _LIBCUDACXX_TYPE_VIS nothrow_t { explicit nothrow_t() = default; };
+extern _LIBCUDACXX_FUNC_VIS const nothrow_t nothrow;
 
-class _LIBCPP_EXCEPTION_ABI bad_alloc
+class _LIBCUDACXX_EXCEPTION_ABI bad_alloc
     : public exception
 {
 public:
@@ -133,7 +133,7 @@ public:
     virtual const char* what() const _NOEXCEPT;
 };
 
-class _LIBCPP_EXCEPTION_ABI bad_array_new_length
+class _LIBCUDACXX_EXCEPTION_ABI bad_array_new_length
     : public bad_alloc
 {
 public:
@@ -143,95 +143,95 @@ public:
 };
 
 typedef void (*new_handler)();
-_LIBCPP_FUNC_VIS new_handler set_new_handler(new_handler) _NOEXCEPT;
-_LIBCPP_FUNC_VIS new_handler get_new_handler() _NOEXCEPT;
+_LIBCUDACXX_FUNC_VIS new_handler set_new_handler(new_handler) _NOEXCEPT;
+_LIBCUDACXX_FUNC_VIS new_handler get_new_handler() _NOEXCEPT;
 
-#endif // !_LIBCPP_ABI_VCRUNTIME
+#endif // !_LIBCUDACXX_ABI_VCRUNTIME
 
-_LIBCPP_NORETURN _LIBCPP_FUNC_VIS void __throw_bad_alloc();  // not in C++ spec
+_LIBCUDACXX_NORETURN _LIBCUDACXX_FUNC_VIS void __throw_bad_alloc();  // not in C++ spec
 
-_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_NORETURN inline _LIBCUDACXX_INLINE_VISIBILITY
 void __throw_bad_array_new_length()
 {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     throw bad_array_new_length();
 #else
-    _VSTD::abort();
+    _CUDA_VSTD::abort();
 #endif
 }
 
-#if !defined(_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION) && \
-    !defined(_LIBCPP_ABI_VCRUNTIME)
-#ifndef _LIBCPP_CXX03_LANG
-enum class _LIBCPP_ENUM_VIS align_val_t : size_t { };
+#if !defined(_LIBCUDACXX_HAS_NO_LIBRARY_ALIGNED_ALLOCATION) && \
+    !defined(_LIBCUDACXX_ABI_VCRUNTIME)
+#ifndef _LIBCUDACXX_CXX03_LANG
+enum class _LIBCUDACXX_ENUM_VIS align_val_t : size_t { };
 #else
 enum align_val_t { __zero = 0, __max = (size_t)-1 };
 #endif
 #endif
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 // Enable the declaration even if the compiler doesn't support the language
 // feature.
 struct destroying_delete_t {
   explicit destroying_delete_t() = default;
 };
 inline constexpr destroying_delete_t destroying_delete{};
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
 } // namespace std
 
-#if defined(_LIBCPP_CXX03_LANG)
+#if defined(_LIBCUDACXX_CXX03_LANG)
 #define _THROW_BAD_ALLOC throw(std::bad_alloc)
 #else
 #define _THROW_BAD_ALLOC
 #endif
 
-#if !defined(_LIBCPP_ABI_VCRUNTIME)
+#if !defined(_LIBCUDACXX_ABI_VCRUNTIME)
 
-_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz) _THROW_BAD_ALLOC;
-_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _LIBCPP_NOALIAS;
-_LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete(void* __p) _NOEXCEPT;
-_LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete(void* __p, const std::nothrow_t&) _NOEXCEPT;
-#ifndef _LIBCPP_HAS_NO_LIBRARY_SIZED_DEALLOCATION
-_LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE void  operator delete(void* __p, std::size_t __sz) _NOEXCEPT;
+_LIBCUDACXX_NODISCARD_AFTER_CXX17 _LIBCUDACXX_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz) _THROW_BAD_ALLOC;
+_LIBCUDACXX_NODISCARD_AFTER_CXX17 _LIBCUDACXX_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _LIBCUDACXX_NOALIAS;
+_LIBCUDACXX_OVERRIDABLE_FUNC_VIS void  operator delete(void* __p) _NOEXCEPT;
+_LIBCUDACXX_OVERRIDABLE_FUNC_VIS void  operator delete(void* __p, const std::nothrow_t&) _NOEXCEPT;
+#ifndef _LIBCUDACXX_HAS_NO_LIBRARY_SIZED_DEALLOCATION
+_LIBCUDACXX_OVERRIDABLE_FUNC_VIS _LIBCUDACXX_AVAILABILITY_SIZED_NEW_DELETE void  operator delete(void* __p, std::size_t __sz) _NOEXCEPT;
 #endif
 
-_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz) _THROW_BAD_ALLOC;
-_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _LIBCPP_NOALIAS;
-_LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete[](void* __p) _NOEXCEPT;
-_LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete[](void* __p, const std::nothrow_t&) _NOEXCEPT;
-#ifndef _LIBCPP_HAS_NO_LIBRARY_SIZED_DEALLOCATION
-_LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE void  operator delete[](void* __p, std::size_t __sz) _NOEXCEPT;
+_LIBCUDACXX_NODISCARD_AFTER_CXX17 _LIBCUDACXX_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz) _THROW_BAD_ALLOC;
+_LIBCUDACXX_NODISCARD_AFTER_CXX17 _LIBCUDACXX_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _LIBCUDACXX_NOALIAS;
+_LIBCUDACXX_OVERRIDABLE_FUNC_VIS void  operator delete[](void* __p) _NOEXCEPT;
+_LIBCUDACXX_OVERRIDABLE_FUNC_VIS void  operator delete[](void* __p, const std::nothrow_t&) _NOEXCEPT;
+#ifndef _LIBCUDACXX_HAS_NO_LIBRARY_SIZED_DEALLOCATION
+_LIBCUDACXX_OVERRIDABLE_FUNC_VIS _LIBCUDACXX_AVAILABILITY_SIZED_NEW_DELETE void  operator delete[](void* __p, std::size_t __sz) _NOEXCEPT;
 #endif
 
-#ifndef _LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION
-_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, std::align_val_t) _THROW_BAD_ALLOC;
-_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, std::align_val_t, const std::nothrow_t&) _NOEXCEPT _LIBCPP_NOALIAS;
-_LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete(void* __p, std::align_val_t) _NOEXCEPT;
-_LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete(void* __p, std::align_val_t, const std::nothrow_t&) _NOEXCEPT;
-#ifndef _LIBCPP_HAS_NO_LIBRARY_SIZED_DEALLOCATION
-_LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE void  operator delete(void* __p, std::size_t __sz, std::align_val_t) _NOEXCEPT;
+#ifndef _LIBCUDACXX_HAS_NO_LIBRARY_ALIGNED_ALLOCATION
+_LIBCUDACXX_NODISCARD_AFTER_CXX17 _LIBCUDACXX_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, std::align_val_t) _THROW_BAD_ALLOC;
+_LIBCUDACXX_NODISCARD_AFTER_CXX17 _LIBCUDACXX_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, std::align_val_t, const std::nothrow_t&) _NOEXCEPT _LIBCUDACXX_NOALIAS;
+_LIBCUDACXX_OVERRIDABLE_FUNC_VIS void  operator delete(void* __p, std::align_val_t) _NOEXCEPT;
+_LIBCUDACXX_OVERRIDABLE_FUNC_VIS void  operator delete(void* __p, std::align_val_t, const std::nothrow_t&) _NOEXCEPT;
+#ifndef _LIBCUDACXX_HAS_NO_LIBRARY_SIZED_DEALLOCATION
+_LIBCUDACXX_OVERRIDABLE_FUNC_VIS _LIBCUDACXX_AVAILABILITY_SIZED_NEW_DELETE void  operator delete(void* __p, std::size_t __sz, std::align_val_t) _NOEXCEPT;
 #endif
 
-_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz, std::align_val_t) _THROW_BAD_ALLOC;
-_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz, std::align_val_t, const std::nothrow_t&) _NOEXCEPT _LIBCPP_NOALIAS;
-_LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete[](void* __p, std::align_val_t) _NOEXCEPT;
-_LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete[](void* __p, std::align_val_t, const std::nothrow_t&) _NOEXCEPT;
-#ifndef _LIBCPP_HAS_NO_LIBRARY_SIZED_DEALLOCATION
-_LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE void  operator delete[](void* __p, std::size_t __sz, std::align_val_t) _NOEXCEPT;
+_LIBCUDACXX_NODISCARD_AFTER_CXX17 _LIBCUDACXX_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz, std::align_val_t) _THROW_BAD_ALLOC;
+_LIBCUDACXX_NODISCARD_AFTER_CXX17 _LIBCUDACXX_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz, std::align_val_t, const std::nothrow_t&) _NOEXCEPT _LIBCUDACXX_NOALIAS;
+_LIBCUDACXX_OVERRIDABLE_FUNC_VIS void  operator delete[](void* __p, std::align_val_t) _NOEXCEPT;
+_LIBCUDACXX_OVERRIDABLE_FUNC_VIS void  operator delete[](void* __p, std::align_val_t, const std::nothrow_t&) _NOEXCEPT;
+#ifndef _LIBCUDACXX_HAS_NO_LIBRARY_SIZED_DEALLOCATION
+_LIBCUDACXX_OVERRIDABLE_FUNC_VIS _LIBCUDACXX_AVAILABILITY_SIZED_NEW_DELETE void  operator delete[](void* __p, std::size_t __sz, std::align_val_t) _NOEXCEPT;
 #endif
 #endif
 
-_LIBCPP_NODISCARD_AFTER_CXX17 inline _LIBCPP_INLINE_VISIBILITY void* operator new  (std::size_t, void* __p) _NOEXCEPT {return __p;}
-_LIBCPP_NODISCARD_AFTER_CXX17 inline _LIBCPP_INLINE_VISIBILITY void* operator new[](std::size_t, void* __p) _NOEXCEPT {return __p;}
-inline _LIBCPP_INLINE_VISIBILITY void  operator delete  (void*, void*) _NOEXCEPT {}
-inline _LIBCPP_INLINE_VISIBILITY void  operator delete[](void*, void*) _NOEXCEPT {}
+_LIBCUDACXX_NODISCARD_AFTER_CXX17 inline _LIBCUDACXX_INLINE_VISIBILITY void* operator new  (std::size_t, void* __p) _NOEXCEPT {return __p;}
+_LIBCUDACXX_NODISCARD_AFTER_CXX17 inline _LIBCUDACXX_INLINE_VISIBILITY void* operator new[](std::size_t, void* __p) _NOEXCEPT {return __p;}
+inline _LIBCUDACXX_INLINE_VISIBILITY void  operator delete  (void*, void*) _NOEXCEPT {}
+inline _LIBCUDACXX_INLINE_VISIBILITY void  operator delete[](void*, void*) _NOEXCEPT {}
 
-#endif // !_LIBCPP_ABI_VCRUNTIME
+#endif // !_LIBCUDACXX_ABI_VCRUNTIME
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-_LIBCPP_CONSTEXPR inline _LIBCPP_INLINE_VISIBILITY bool __is_overaligned_for_new(size_t __align) _NOEXCEPT {
+_LIBCUDACXX_CONSTEXPR inline _LIBCUDACXX_INLINE_VISIBILITY bool __is_overaligned_for_new(size_t __align) _NOEXCEPT {
 #ifdef __STDCPP_DEFAULT_NEW_ALIGNMENT__
   return __align > __STDCPP_DEFAULT_NEW_ALIGNMENT__;
 #else
@@ -240,8 +240,8 @@ _LIBCPP_CONSTEXPR inline _LIBCPP_INLINE_VISIBILITY bool __is_overaligned_for_new
 }
 
 template <class ..._Args>
-_LIBCPP_INLINE_VISIBILITY
-void* __libcpp_operator_new(_Args ...__args) {
+_LIBCUDACXX_INLINE_VISIBILITY
+void* __LIBCUDACXX_operator_new(_Args ...__args) {
 #if __has_builtin(__builtin_operator_new) && __has_builtin(__builtin_operator_delete)
   return __builtin_operator_new(__args...);
 #else
@@ -250,8 +250,8 @@ void* __libcpp_operator_new(_Args ...__args) {
 }
 
 template <class ..._Args>
-_LIBCPP_INLINE_VISIBILITY
-void __libcpp_operator_delete(_Args ...__args) {
+_LIBCUDACXX_INLINE_VISIBILITY
+void __LIBCUDACXX_operator_delete(_Args ...__args) {
 #if __has_builtin(__builtin_operator_new) && __has_builtin(__builtin_operator_delete)
   __builtin_operator_delete(__args...);
 #else
@@ -259,33 +259,33 @@ void __libcpp_operator_delete(_Args ...__args) {
 #endif
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
-void *__libcpp_allocate(size_t __size, size_t __align) {
-#ifndef _LIBCPP_HAS_NO_ALIGNED_ALLOCATION
+inline _LIBCUDACXX_INLINE_VISIBILITY
+void *__LIBCUDACXX_allocate(size_t __size, size_t __align) {
+#ifndef _LIBCUDACXX_HAS_NO_ALIGNED_ALLOCATION
   if (__is_overaligned_for_new(__align)) {
     const align_val_t __align_val = static_cast<align_val_t>(__align);
-    return __libcpp_operator_new(__size, __align_val);
+    return __LIBCUDACXX_operator_new(__size, __align_val);
   }
 #endif
 
   (void)__align;
-  return __libcpp_operator_new(__size);
+  return __LIBCUDACXX_operator_new(__size);
 }
 
 template <class ..._Args>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 void __do_deallocate_handle_size(void *__ptr, size_t __size, _Args ...__args) {
-#ifdef _LIBCPP_HAS_NO_SIZED_DEALLOCATION
+#ifdef _LIBCUDACXX_HAS_NO_SIZED_DEALLOCATION
   (void)__size;
-  return __libcpp_operator_delete(__ptr, __args...);
+  return __LIBCUDACXX_operator_delete(__ptr, __args...);
 #else
-  return __libcpp_operator_delete(__ptr, __size, __args...);
+  return __LIBCUDACXX_operator_delete(__ptr, __size, __args...);
 #endif
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
-void __libcpp_deallocate(void* __ptr, size_t __size, size_t __align) {
-#if defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION)
+inline _LIBCUDACXX_INLINE_VISIBILITY
+void __LIBCUDACXX_deallocate(void* __ptr, size_t __size, size_t __align) {
+#if defined(_LIBCUDACXX_HAS_NO_ALIGNED_ALLOCATION)
     (void)__align;
     return __do_deallocate_handle_size(__ptr, __size);
 #else
@@ -298,30 +298,30 @@ void __libcpp_deallocate(void* __ptr, size_t __size, size_t __align) {
 #endif
 }
 
-inline _LIBCPP_INLINE_VISIBILITY void __libcpp_deallocate_unsized(void* __ptr, size_t __align) {
-#if defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION)
+inline _LIBCUDACXX_INLINE_VISIBILITY void __LIBCUDACXX_deallocate_unsized(void* __ptr, size_t __align) {
+#if defined(_LIBCUDACXX_HAS_NO_ALIGNED_ALLOCATION)
     (void)__align;
-    return __libcpp_operator_delete(__ptr);
+    return __LIBCUDACXX_operator_delete(__ptr);
 #else
     if (__is_overaligned_for_new(__align)) {
       const align_val_t __align_val = static_cast<align_val_t>(__align);
-      return __libcpp_operator_delete(__ptr, __align_val);
+      return __LIBCUDACXX_operator_delete(__ptr, __align_val);
     } else {
-      return __libcpp_operator_delete(__ptr);
+      return __LIBCUDACXX_operator_delete(__ptr);
     }
 #endif
 }
 
-#if !defined(_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION)
+#if !defined(_LIBCUDACXX_HAS_NO_LIBRARY_ALIGNED_ALLOCATION)
 // Low-level helpers to call the aligned allocation and deallocation functions
 // on the target platform. This is used to implement libc++'s own memory
 // allocation routines -- if you need to allocate memory inside the library,
-// chances are that you want to use `__libcpp_allocate` instead.
+// chances are that you want to use `__LIBCUDACXX_allocate` instead.
 //
 // Returns the allocated memory, or `nullptr` on failure.
-inline _LIBCPP_INLINE_VISIBILITY
-void* __libcpp_aligned_alloc(std::size_t __alignment, std::size_t __size) {
-#if defined(_LIBCPP_MSVCRT_LIKE)
+inline _LIBCUDACXX_INLINE_VISIBILITY
+void* __LIBCUDACXX_aligned_alloc(std::size_t __alignment, std::size_t __size) {
+#if defined(_LIBCUDACXX_MSVCRT_LIKE)
   return ::_aligned_malloc(__size, __alignment);
 #else
   void* __result = nullptr;
@@ -331,36 +331,36 @@ void* __libcpp_aligned_alloc(std::size_t __alignment, std::size_t __size) {
 #endif
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
-void __libcpp_aligned_free(void* __ptr) {
-#if defined(_LIBCPP_MSVCRT_LIKE)
+inline _LIBCUDACXX_INLINE_VISIBILITY
+void __LIBCUDACXX_aligned_free(void* __ptr) {
+#if defined(_LIBCUDACXX_MSVCRT_LIKE)
   ::_aligned_free(__ptr);
 #else
   ::free(__ptr);
 #endif
 }
-#endif // !_LIBCPP_HAS_NO_ALIGNED_ALLOCATION
+#endif // !_LIBCUDACXX_HAS_NO_ALIGNED_ALLOCATION
 
 
 template <class _Tp>
-_LIBCPP_NODISCARD_AFTER_CXX17 inline _LIBCPP_HIDE_FROM_ABI
-_LIBCPP_CONSTEXPR _Tp* __launder(_Tp* __p) _NOEXCEPT
+_LIBCUDACXX_NODISCARD_AFTER_CXX17 inline _LIBCUDACXX_HIDE_FROM_ABI
+_LIBCUDACXX_CONSTEXPR _Tp* __launder(_Tp* __p) _NOEXCEPT
 {
     static_assert (!(is_function<_Tp>::value), "can't launder functions" );
     static_assert (!(is_same<void, typename remove_cv<_Tp>::type>::value), "can't launder cv-void" );
     return __builtin_launder(__p);
 }
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _Tp>
-_LIBCPP_NODISCARD_AFTER_CXX17 inline _LIBCPP_HIDE_FROM_ABI
+_LIBCUDACXX_NODISCARD_AFTER_CXX17 inline _LIBCUDACXX_HIDE_FROM_ABI
 constexpr _Tp* launder(_Tp* __p) noexcept
 {
-    return _VSTD::__launder(__p);
+    return _CUDA_VSTD::__launder(__p);
 }
 #endif
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 
 #if defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE)
 
@@ -369,8 +369,8 @@ inline constexpr size_t hardware_constructive_interference_size = __GCC_CONSTRUC
 
 #endif // defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE)
 
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCUDACXX_STD_VER > 14
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_NEW
+#endif // _LIBCUDACXX_NEW

diff  --git a/libcxx/include/numbers b/libcxx/include/numbers
index 3c8527dfc2de..343275c23670 100644
--- a/libcxx/include/numbers
+++ b/libcxx/include/numbers
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_NUMBERS
-#define _LIBCPP_NUMBERS
+#ifndef _LIBCUDACXX_NUMBERS
+#define _LIBCUDACXX_NUMBERS
 
 /*
     numbers synopsis
@@ -64,13 +64,13 @@ namespace std::numbers {
 #include <type_traits>
 #include <version>
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace numbers {
 
@@ -127,8 +127,8 @@ inline constexpr double phi        = phi_v<double>;
 
 } // namespace numbers
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-#endif // _LIBCPP_NUMBERS
+#endif // _LIBCUDACXX_NUMBERS

diff  --git a/libcxx/include/numeric b/libcxx/include/numeric
index 057faf508e6b..6b11b7f668a0 100644
--- a/libcxx/include/numeric
+++ b/libcxx/include/numeric
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_NUMERIC
-#define _LIBCPP_NUMERIC
+#ifndef _LIBCUDACXX_NUMERIC
+#define _LIBCUDACXX_NUMERIC
 
 /*
     numeric synopsis
@@ -163,17 +163,17 @@ template<class T>
 #include <__numeric/transform_inclusive_scan.h>
 #include <__numeric/transform_reduce.h>
 
-#ifndef _LIBCPP_REMOVE_TRANSITIVE_INCLUDES
+#ifndef _LIBCUDACXX_REMOVE_TRANSITIVE_INCLUDES
 #  include <functional>
 #  include <iterator>
 #endif
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if defined(_LIBCPP_HAS_PARALLEL_ALGORITHMS) && _LIBCPP_STD_VER >= 17
+#if defined(_LIBCUDACXX_HAS_PARALLEL_ALGORITHMS) && _LIBCUDACXX_STD_VER >= 17
 #   include <__pstl_numeric>
 #endif
 
-#endif // _LIBCPP_NUMERIC
+#endif // _LIBCUDACXX_NUMERIC

diff  --git a/libcxx/include/optional b/libcxx/include/optional
index 349ceb5bc7f6..4bfd9071c87a 100644
--- a/libcxx/include/optional
+++ b/libcxx/include/optional
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_OPTIONAL
-#define _LIBCPP_OPTIONAL
+#ifndef _LIBCUDACXX_OPTIONAL
+#define _LIBCUDACXX_OPTIONAL
 
 /*
     optional synopsis
@@ -177,7 +177,7 @@ template<class T>
 #include <type_traits>
 #include <version>
 
-#ifndef _LIBCPP_REMOVE_TRANSITIVE_INCLUDES
+#ifndef _LIBCUDACXX_REMOVE_TRANSITIVE_INCLUDES
 #  include <atomic>
 #  include <chrono>
 #  include <climits>
@@ -195,14 +195,14 @@ template<class T>
 // standard-mandated includes
 #include <compare>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
 namespace std  // purposefully not using versioning namespace
 {
 
-class _LIBCPP_EXCEPTION_ABI _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS bad_optional_access
+class _LIBCUDACXX_EXCEPTION_ABI _LIBCUDACXX_AVAILABILITY_BAD_OPTIONAL_ACCESS bad_optional_access
     : public exception
 {
 public:
@@ -213,25 +213,25 @@ public:
 
 } // namespace std
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-_LIBCPP_NORETURN
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
+_LIBCUDACXX_NORETURN
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
 void __throw_bad_optional_access() {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         throw bad_optional_access();
 #else
-        _VSTD::abort();
+        _CUDA_VSTD::abort();
 #endif
 }
 
 struct nullopt_t
 {
-    struct __secret_tag { _LIBCPP_INLINE_VISIBILITY explicit __secret_tag() = default; };
-    _LIBCPP_INLINE_VISIBILITY constexpr explicit nullopt_t(__secret_tag, __secret_tag) noexcept {}
+    struct __secret_tag { _LIBCUDACXX_INLINE_VISIBILITY explicit __secret_tag() = default; };
+    _LIBCUDACXX_INLINE_VISIBILITY constexpr explicit nullopt_t(__secret_tag, __secret_tag) noexcept {}
 };
 
 inline constexpr nullopt_t nullopt{nullopt_t::__secret_tag{}, nullopt_t::__secret_tag{}};
@@ -254,33 +254,33 @@ struct __optional_destruct_base<_Tp, false>
     };
     bool __engaged_;
 
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 ~__optional_destruct_base()
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 ~__optional_destruct_base()
     {
         if (__engaged_)
             __val_.~value_type();
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr __optional_destruct_base() noexcept
         :  __null_state_(),
            __engaged_(false) {}
 
     template <class... _Args>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr explicit __optional_destruct_base(in_place_t, _Args&&... __args)
-        :  __val_(_VSTD::forward<_Args>(__args)...),
+        :  __val_(_CUDA_VSTD::forward<_Args>(__args)...),
            __engaged_(true) {}
 
-#if _LIBCPP_STD_VER > 20
+#if _LIBCUDACXX_STD_VER > 20
   template <class _Fp, class... _Args>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr __optional_destruct_base(__optional_construct_from_invoke_tag, _Fp&& __f, _Args&&... __args)
-      : __val_(_VSTD::invoke(_VSTD::forward<_Fp>(__f), _VSTD::forward<_Args>(__args)...)), __engaged_(true) {}
+      : __val_(_CUDA_VSTD::invoke(_CUDA_VSTD::forward<_Fp>(__f), _CUDA_VSTD::forward<_Args>(__args)...)), __engaged_(true) {}
 #endif
 
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 void reset() noexcept
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 void reset() noexcept
     {
         if (__engaged_)
         {
@@ -303,26 +303,26 @@ struct __optional_destruct_base<_Tp, true>
     };
     bool __engaged_;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr __optional_destruct_base() noexcept
         :  __null_state_(),
            __engaged_(false) {}
 
     template <class... _Args>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr explicit __optional_destruct_base(in_place_t, _Args&&... __args)
-        :  __val_(_VSTD::forward<_Args>(__args)...),
+        :  __val_(_CUDA_VSTD::forward<_Args>(__args)...),
            __engaged_(true) {}
 
-#if _LIBCPP_STD_VER > 20
+#if _LIBCUDACXX_STD_VER > 20
   template <class _Fp, class... _Args>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr __optional_destruct_base(__optional_construct_from_invoke_tag, _Fp&& __f, _Args&&... __args)
-      : __val_(_VSTD::invoke(_VSTD::forward<_Fp>(__f), _VSTD::forward<_Args>(__args)...)), __engaged_(true) {}
+      : __val_(_CUDA_VSTD::invoke(_CUDA_VSTD::forward<_Fp>(__f), _CUDA_VSTD::forward<_Args>(__args)...)), __engaged_(true) {}
 #endif
 
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 void reset() noexcept
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 void reset() noexcept
     {
         if (__engaged_)
         {
@@ -338,69 +338,69 @@ struct __optional_storage_base : __optional_destruct_base<_Tp>
     using value_type = _Tp;
     using __base::__base;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr bool has_value() const noexcept
     {
         return this->__engaged_;
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr value_type& __get() & noexcept
     {
         return this->__val_;
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr const value_type& __get() const& noexcept
     {
         return this->__val_;
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr value_type&& __get() && noexcept
     {
-        return _VSTD::move(this->__val_);
+        return _CUDA_VSTD::move(this->__val_);
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr const value_type&& __get() const&& noexcept
     {
-        return _VSTD::move(this->__val_);
+        return _CUDA_VSTD::move(this->__val_);
     }
 
     template <class... _Args>
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 void __construct(_Args&&... __args)
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 void __construct(_Args&&... __args)
     {
-        _LIBCPP_ASSERT(!has_value(), "__construct called for engaged __optional_storage");
-#if _LIBCPP_STD_VER > 17
-        _VSTD::construct_at(_VSTD::addressof(this->__val_), _VSTD::forward<_Args>(__args)...);
+        _LIBCUDACXX_ASSERT(!has_value(), "__construct called for engaged __optional_storage");
+#if _LIBCUDACXX_STD_VER > 17
+        _CUDA_VSTD::construct_at(_CUDA_VSTD::addressof(this->__val_), _CUDA_VSTD::forward<_Args>(__args)...);
 #else
-        ::new ((void*)_VSTD::addressof(this->__val_)) value_type(_VSTD::forward<_Args>(__args)...);
+        ::new ((void*)_CUDA_VSTD::addressof(this->__val_)) value_type(_CUDA_VSTD::forward<_Args>(__args)...);
 #endif
         this->__engaged_ = true;
     }
 
     template <class _That>
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 void __construct_from(_That&& __opt)
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 void __construct_from(_That&& __opt)
     {
         if (__opt.has_value())
-            __construct(_VSTD::forward<_That>(__opt).__get());
+            __construct(_CUDA_VSTD::forward<_That>(__opt).__get());
     }
 
     template <class _That>
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 void __assign_from(_That&& __opt)
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 void __assign_from(_That&& __opt)
     {
         if (this->__engaged_ == __opt.has_value())
         {
             if (this->__engaged_)
-                this->__val_ = _VSTD::forward<_That>(__opt).__get();
+                this->__val_ = _CUDA_VSTD::forward<_That>(__opt).__get();
         }
         else
         {
             if (this->__engaged_)
                 this->reset();
             else
-                __construct(_VSTD::forward<_That>(__opt).__get());
+                __construct(_CUDA_VSTD::forward<_That>(__opt).__get());
         }
     }
 };
@@ -431,69 +431,69 @@ struct __optional_storage_base<_Tp, true>
                 is_convertible<_UpPtr, _TpPtr>::value);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr __optional_storage_base() noexcept
         :  __value_(nullptr) {}
 
     template <class _UArg>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr explicit __optional_storage_base(in_place_t, _UArg&& __uarg)
-        :  __value_(_VSTD::addressof(__uarg))
+        :  __value_(_CUDA_VSTD::addressof(__uarg))
     {
       static_assert(__can_bind_reference<_UArg>(),
         "Attempted to construct a reference element in tuple from a "
         "possible temporary");
     }
 
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 void reset() noexcept { __value_ = nullptr; }
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 void reset() noexcept { __value_ = nullptr; }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr bool has_value() const noexcept
       { return __value_ != nullptr; }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr value_type& __get() const& noexcept
       { return *__value_; }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr value_type&& __get() const&& noexcept
-      { return _VSTD::forward<value_type>(*__value_); }
+      { return _CUDA_VSTD::forward<value_type>(*__value_); }
 
     template <class _UArg>
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 void __construct(_UArg&& __val)
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 void __construct(_UArg&& __val)
     {
-        _LIBCPP_ASSERT(!has_value(), "__construct called for engaged __optional_storage");
+        _LIBCUDACXX_ASSERT(!has_value(), "__construct called for engaged __optional_storage");
         static_assert(__can_bind_reference<_UArg>(),
             "Attempted to construct a reference element in tuple from a "
             "possible temporary");
-        __value_ = _VSTD::addressof(__val);
+        __value_ = _CUDA_VSTD::addressof(__val);
     }
 
     template <class _That>
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 void __construct_from(_That&& __opt)
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 void __construct_from(_That&& __opt)
     {
         if (__opt.has_value())
-            __construct(_VSTD::forward<_That>(__opt).__get());
+            __construct(_CUDA_VSTD::forward<_That>(__opt).__get());
     }
 
     template <class _That>
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 void __assign_from(_That&& __opt)
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 void __assign_from(_That&& __opt)
     {
         if (has_value() == __opt.has_value())
         {
             if (has_value())
-                *__value_ = _VSTD::forward<_That>(__opt).__get();
+                *__value_ = _CUDA_VSTD::forward<_That>(__opt).__get();
         }
         else
         {
             if (has_value())
                 reset();
             else
-                __construct(_VSTD::forward<_That>(__opt).__get());
+                __construct(_CUDA_VSTD::forward<_That>(__opt).__get());
         }
     }
 };
@@ -509,20 +509,20 @@ struct __optional_copy_base<_Tp, false> : __optional_storage_base<_Tp>
 {
     using __optional_storage_base<_Tp>::__optional_storage_base;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __optional_copy_base() = default;
 
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 __optional_copy_base(const __optional_copy_base& __opt)
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 __optional_copy_base(const __optional_copy_base& __opt)
     {
         this->__construct_from(__opt);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __optional_copy_base(__optional_copy_base&&) = default;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __optional_copy_base& operator=(const __optional_copy_base&) = default;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __optional_copy_base& operator=(__optional_copy_base&&) = default;
 };
 
@@ -538,21 +538,21 @@ struct __optional_move_base<_Tp, false> : __optional_copy_base<_Tp>
     using value_type = _Tp;
     using __optional_copy_base<_Tp>::__optional_copy_base;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __optional_move_base() = default;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __optional_move_base(const __optional_move_base&) = default;
 
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 __optional_move_base(__optional_move_base&& __opt)
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 __optional_move_base(__optional_move_base&& __opt)
         noexcept(is_nothrow_move_constructible_v<value_type>)
     {
-        this->__construct_from(_VSTD::move(__opt));
+        this->__construct_from(_CUDA_VSTD::move(__opt));
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __optional_move_base& operator=(const __optional_move_base&) = default;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __optional_move_base& operator=(__optional_move_base&&) = default;
 };
 
@@ -570,21 +570,21 @@ struct __optional_copy_assign_base<_Tp, false> : __optional_move_base<_Tp>
 {
     using __optional_move_base<_Tp>::__optional_move_base;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __optional_copy_assign_base() = default;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __optional_copy_assign_base(const __optional_copy_assign_base&) = default;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __optional_copy_assign_base(__optional_copy_assign_base&&) = default;
 
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 __optional_copy_assign_base& operator=(const __optional_copy_assign_base& __opt)
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 __optional_copy_assign_base& operator=(const __optional_copy_assign_base& __opt)
     {
         this->__assign_from(__opt);
         return *this;
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __optional_copy_assign_base& operator=(__optional_copy_assign_base&&) = default;
 };
 
@@ -603,21 +603,21 @@ struct __optional_move_assign_base<_Tp, false> : __optional_copy_assign_base<_Tp
     using value_type = _Tp;
     using __optional_copy_assign_base<_Tp>::__optional_copy_assign_base;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __optional_move_assign_base() = default;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __optional_move_assign_base(const __optional_move_assign_base& __opt) = default;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __optional_move_assign_base(__optional_move_assign_base&&) = default;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __optional_move_assign_base& operator=(const __optional_move_assign_base&) = default;
 
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 __optional_move_assign_base& operator=(__optional_move_assign_base&& __opt)
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 __optional_move_assign_base& operator=(__optional_move_assign_base&& __opt)
         noexcept(is_nothrow_move_assignable_v<value_type> &&
                  is_nothrow_move_constructible_v<value_type>)
     {
-        this->__assign_from(_VSTD::move(__opt));
+        this->__assign_from(_CUDA_VSTD::move(__opt));
         return *this;
     }
 };
@@ -745,10 +745,10 @@ private:
 
 public:
 
-    _LIBCPP_INLINE_VISIBILITY constexpr optional() noexcept {}
-    _LIBCPP_INLINE_VISIBILITY constexpr optional(const optional&) = default;
-    _LIBCPP_INLINE_VISIBILITY constexpr optional(optional&&) = default;
-    _LIBCPP_INLINE_VISIBILITY constexpr optional(nullopt_t) noexcept {}
+    _LIBCUDACXX_INLINE_VISIBILITY constexpr optional() noexcept {}
+    _LIBCUDACXX_INLINE_VISIBILITY constexpr optional(const optional&) = default;
+    _LIBCUDACXX_INLINE_VISIBILITY constexpr optional(optional&&) = default;
+    _LIBCUDACXX_INLINE_VISIBILITY constexpr optional(nullopt_t) noexcept {}
 
     template <class _InPlaceT, class... _Args, class = enable_if_t<
           _And<
@@ -757,45 +757,45 @@ public:
             >::value
         >
     >
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr explicit optional(_InPlaceT, _Args&&... __args)
-        : __base(in_place, _VSTD::forward<_Args>(__args)...) {}
+        : __base(in_place, _CUDA_VSTD::forward<_Args>(__args)...) {}
 
     template <class _Up, class... _Args, class = enable_if_t<
         is_constructible_v<value_type, initializer_list<_Up>&, _Args...>>
     >
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr explicit optional(in_place_t, initializer_list<_Up> __il, _Args&&... __args)
-        : __base(in_place, __il, _VSTD::forward<_Args>(__args)...) {}
+        : __base(in_place, __il, _CUDA_VSTD::forward<_Args>(__args)...) {}
 
     template <class _Up = value_type, enable_if_t<
         _CheckOptionalArgsCtor<_Up>::template __enable_implicit<_Up>()
     , int> = 0>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr optional(_Up&& __v)
-        : __base(in_place, _VSTD::forward<_Up>(__v)) {}
+        : __base(in_place, _CUDA_VSTD::forward<_Up>(__v)) {}
 
     template <class _Up, enable_if_t<
         _CheckOptionalArgsCtor<_Up>::template __enable_explicit<_Up>()
     , int> = 0>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr explicit optional(_Up&& __v)
-        : __base(in_place, _VSTD::forward<_Up>(__v)) {}
+        : __base(in_place, _CUDA_VSTD::forward<_Up>(__v)) {}
 
     // LWG2756: conditionally explicit conversion from const optional<_Up>&
     template <class _Up, enable_if_t<
         _CheckOptionalLikeCtor<_Up, _Up const&>::template __enable_implicit<_Up>()
     , int> = 0>
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 optional(const optional<_Up>& __v)
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 optional(const optional<_Up>& __v)
     {
         this->__construct_from(__v);
     }
     template <class _Up, enable_if_t<
         _CheckOptionalLikeCtor<_Up, _Up const&>::template __enable_explicit<_Up>()
     , int> = 0>
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 explicit optional(const optional<_Up>& __v)
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 explicit optional(const optional<_Up>& __v)
     {
         this->__construct_from(__v);
     }
@@ -804,37 +804,37 @@ public:
     template <class _Up, enable_if_t<
         _CheckOptionalLikeCtor<_Up, _Up &&>::template __enable_implicit<_Up>()
     , int> = 0>
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 optional(optional<_Up>&& __v)
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 optional(optional<_Up>&& __v)
     {
-        this->__construct_from(_VSTD::move(__v));
+        this->__construct_from(_CUDA_VSTD::move(__v));
     }
     template <class _Up, enable_if_t<
         _CheckOptionalLikeCtor<_Up, _Up &&>::template __enable_explicit<_Up>()
     , int> = 0>
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 explicit optional(optional<_Up>&& __v)
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 explicit optional(optional<_Up>&& __v)
     {
-        this->__construct_from(_VSTD::move(__v));
+        this->__construct_from(_CUDA_VSTD::move(__v));
     }
 
-#if _LIBCPP_STD_VER > 20
+#if _LIBCUDACXX_STD_VER > 20
   template<class _Fp, class... _Args>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr explicit optional(__optional_construct_from_invoke_tag, _Fp&& __f, _Args&&... __args)
-      : __base(__optional_construct_from_invoke_tag{}, _VSTD::forward<_Fp>(__f), _VSTD::forward<_Args>(__args)...) {
+      : __base(__optional_construct_from_invoke_tag{}, _CUDA_VSTD::forward<_Fp>(__f), _CUDA_VSTD::forward<_Args>(__args)...) {
   }
 #endif
 
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 optional& operator=(nullopt_t) noexcept
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 optional& operator=(nullopt_t) noexcept
     {
         reset();
         return *this;
     }
 
-    _LIBCPP_INLINE_VISIBILITY optional& operator=(const optional&) = default;
-    _LIBCPP_INLINE_VISIBILITY optional& operator=(optional&&) = default;
+    _LIBCUDACXX_INLINE_VISIBILITY optional& operator=(const optional&) = default;
+    _LIBCUDACXX_INLINE_VISIBILITY optional& operator=(optional&&) = default;
 
     // LWG2756
     template <class _Up = value_type,
@@ -849,14 +849,14 @@ public:
                           is_assignable<value_type&, _Up>
                       >::value>
              >
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 optional&
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 optional&
     operator=(_Up&& __v)
     {
         if (this->has_value())
-            this->__get() = _VSTD::forward<_Up>(__v);
+            this->__get() = _CUDA_VSTD::forward<_Up>(__v);
         else
-            this->__construct(_VSTD::forward<_Up>(__v));
+            this->__construct(_CUDA_VSTD::forward<_Up>(__v));
         return *this;
     }
 
@@ -864,8 +864,8 @@ public:
     template <class _Up, enable_if_t<
         _CheckOptionalLikeAssign<_Up, _Up const&>::template __enable_assign<_Up>()
     , int> = 0>
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 optional&
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 optional&
     operator=(const optional<_Up>& __v)
     {
         this->__assign_from(__v);
@@ -876,11 +876,11 @@ public:
     template <class _Up, enable_if_t<
         _CheckOptionalLikeCtor<_Up, _Up &&>::template __enable_assign<_Up>()
     , int> = 0>
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 optional&
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 optional&
     operator=(optional<_Up>&& __v)
     {
-        this->__assign_from(_VSTD::move(__v));
+        this->__assign_from(_CUDA_VSTD::move(__v));
         return *this;
     }
 
@@ -890,12 +890,12 @@ public:
                           is_constructible_v<value_type, _Args...>
                       >
              >
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 _Tp &
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _Tp &
     emplace(_Args&&... __args)
     {
         reset();
-        this->__construct(_VSTD::forward<_Args>(__args)...);
+        this->__construct(_CUDA_VSTD::forward<_Args>(__args)...);
         return this->__get();
     }
 
@@ -905,23 +905,23 @@ public:
                           is_constructible_v<value_type, initializer_list<_Up>&, _Args...>
                       >
              >
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 _Tp &
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 _Tp &
     emplace(initializer_list<_Up> __il, _Args&&... __args)
     {
         reset();
-        this->__construct(__il, _VSTD::forward<_Args>(__args)...);
+        this->__construct(__il, _CUDA_VSTD::forward<_Args>(__args)...);
         return this->__get();
     }
 
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 void swap(optional& __opt)
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 void swap(optional& __opt)
         noexcept(is_nothrow_move_constructible_v<value_type> &&
                  is_nothrow_swappable_v<value_type>)
     {
         if (this->has_value() == __opt.has_value())
         {
-            using _VSTD::swap;
+            using _CUDA_VSTD::swap;
             if (this->has_value())
                 swap(this->__get(), __opt.__get());
         }
@@ -929,79 +929,79 @@ public:
         {
             if (this->has_value())
             {
-                __opt.__construct(_VSTD::move(this->__get()));
+                __opt.__construct(_CUDA_VSTD::move(this->__get()));
                 reset();
             }
             else
             {
-                this->__construct(_VSTD::move(__opt.__get()));
+                this->__construct(_CUDA_VSTD::move(__opt.__get()));
                 __opt.reset();
             }
         }
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr
     add_pointer_t<value_type const>
     operator->() const
     {
-        _LIBCPP_ASSERT(this->has_value(), "optional operator-> called on a disengaged value");
-        return _VSTD::addressof(this->__get());
+        _LIBCUDACXX_ASSERT(this->has_value(), "optional operator-> called on a disengaged value");
+        return _CUDA_VSTD::addressof(this->__get());
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr
     add_pointer_t<value_type>
     operator->()
     {
-        _LIBCPP_ASSERT(this->has_value(), "optional operator-> called on a disengaged value");
-        return _VSTD::addressof(this->__get());
+        _LIBCUDACXX_ASSERT(this->has_value(), "optional operator-> called on a disengaged value");
+        return _CUDA_VSTD::addressof(this->__get());
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr
     const value_type&
     operator*() const& noexcept
     {
-        _LIBCPP_ASSERT(this->has_value(), "optional operator* called on a disengaged value");
+        _LIBCUDACXX_ASSERT(this->has_value(), "optional operator* called on a disengaged value");
         return this->__get();
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr
     value_type&
     operator*() & noexcept
     {
-        _LIBCPP_ASSERT(this->has_value(), "optional operator* called on a disengaged value");
+        _LIBCUDACXX_ASSERT(this->has_value(), "optional operator* called on a disengaged value");
         return this->__get();
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr
     value_type&&
     operator*() && noexcept
     {
-        _LIBCPP_ASSERT(this->has_value(), "optional operator* called on a disengaged value");
-        return _VSTD::move(this->__get());
+        _LIBCUDACXX_ASSERT(this->has_value(), "optional operator* called on a disengaged value");
+        return _CUDA_VSTD::move(this->__get());
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr
     const value_type&&
     operator*() const&& noexcept
     {
-        _LIBCPP_ASSERT(this->has_value(), "optional operator* called on a disengaged value");
-        return _VSTD::move(this->__get());
+        _LIBCUDACXX_ASSERT(this->has_value(), "optional operator* called on a disengaged value");
+        return _CUDA_VSTD::move(this->__get());
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr explicit operator bool() const noexcept { return has_value(); }
 
     using __base::has_value;
     using __base::__get;
 
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
     constexpr value_type const& value() const&
     {
         if (!this->has_value())
@@ -1009,8 +1009,8 @@ public:
         return this->__get();
     }
 
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
     constexpr value_type& value() &
     {
         if (!this->has_value())
@@ -1018,26 +1018,26 @@ public:
         return this->__get();
     }
 
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
     constexpr value_type&& value() &&
     {
         if (!this->has_value())
             __throw_bad_optional_access();
-        return _VSTD::move(this->__get());
+        return _CUDA_VSTD::move(this->__get());
     }
 
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
     constexpr value_type const&& value() const&&
     {
         if (!this->has_value())
             __throw_bad_optional_access();
-        return _VSTD::move(this->__get());
+        return _CUDA_VSTD::move(this->__get());
     }
 
     template <class _Up>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr value_type value_or(_Up&& __v) const&
     {
         static_assert(is_copy_constructible_v<value_type>,
@@ -1045,68 +1045,68 @@ public:
         static_assert(is_convertible_v<_Up, value_type>,
                       "optional<T>::value_or: U must be convertible to T");
         return this->has_value() ? this->__get() :
-                                  static_cast<value_type>(_VSTD::forward<_Up>(__v));
+                                  static_cast<value_type>(_CUDA_VSTD::forward<_Up>(__v));
     }
 
     template <class _Up>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr value_type value_or(_Up&& __v) &&
     {
         static_assert(is_move_constructible_v<value_type>,
                       "optional<T>::value_or: T must be move constructible");
         static_assert(is_convertible_v<_Up, value_type>,
                       "optional<T>::value_or: U must be convertible to T");
-        return this->has_value() ? _VSTD::move(this->__get()) :
-                                  static_cast<value_type>(_VSTD::forward<_Up>(__v));
+        return this->has_value() ? _CUDA_VSTD::move(this->__get()) :
+                                  static_cast<value_type>(_CUDA_VSTD::forward<_Up>(__v));
     }
 
-#if _LIBCPP_STD_VER > 20
+#if _LIBCUDACXX_STD_VER > 20
   template<class _Func>
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
   constexpr auto and_then(_Func&& __f) & {
     using _Up = invoke_result_t<_Func, value_type&>;
     static_assert(__is_std_optional<remove_cvref_t<_Up>>::value,
                   "Result of f(value()) must be a specialization of std::optional");
     if (*this)
-      return _VSTD::invoke(_VSTD::forward<_Func>(__f), value());
+      return _CUDA_VSTD::invoke(_CUDA_VSTD::forward<_Func>(__f), value());
     return remove_cvref_t<_Up>();
   }
 
   template<class _Func>
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
   constexpr auto and_then(_Func&& __f) const& {
     using _Up = invoke_result_t<_Func, const value_type&>;
     static_assert(__is_std_optional<remove_cvref_t<_Up>>::value,
                   "Result of f(value()) must be a specialization of std::optional");
     if (*this)
-      return _VSTD::invoke(_VSTD::forward<_Func>(__f), value());
+      return _CUDA_VSTD::invoke(_CUDA_VSTD::forward<_Func>(__f), value());
     return remove_cvref_t<_Up>();
   }
 
   template<class _Func>
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
   constexpr auto and_then(_Func&& __f) && {
     using _Up = invoke_result_t<_Func, value_type&&>;
     static_assert(__is_std_optional<remove_cvref_t<_Up>>::value,
                   "Result of f(std::move(value())) must be a specialization of std::optional");
     if (*this)
-      return _VSTD::invoke(_VSTD::forward<_Func>(__f), _VSTD::move(value()));
+      return _CUDA_VSTD::invoke(_CUDA_VSTD::forward<_Func>(__f), _CUDA_VSTD::move(value()));
     return remove_cvref_t<_Up>();
   }
 
   template<class _Func>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr auto and_then(_Func&& __f) const&& {
     using _Up = invoke_result_t<_Func, const value_type&&>;
     static_assert(__is_std_optional<remove_cvref_t<_Up>>::value,
                   "Result of f(std::move(value())) must be a specialization of std::optional");
     if (*this)
-      return _VSTD::invoke(_VSTD::forward<_Func>(__f), _VSTD::move(value()));
+      return _CUDA_VSTD::invoke(_CUDA_VSTD::forward<_Func>(__f), _CUDA_VSTD::move(value()));
     return remove_cvref_t<_Up>();
   }
 
   template<class _Func>
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
   constexpr auto transform(_Func&& __f) & {
     using _Up = remove_cv_t<invoke_result_t<_Func, value_type&>>;
     static_assert(!is_array_v<_Up>, "Result of f(value()) should not be an Array");
@@ -1116,12 +1116,12 @@ public:
                   "Result of f(value()) should not be std::nullopt_t");
     static_assert(is_object_v<_Up>, "Result of f(value()) should be an object type");
     if (*this)
-      return optional<_Up>(__optional_construct_from_invoke_tag{}, _VSTD::forward<_Func>(__f), value());
+      return optional<_Up>(__optional_construct_from_invoke_tag{}, _CUDA_VSTD::forward<_Func>(__f), value());
     return optional<_Up>();
   }
 
   template<class _Func>
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
   constexpr auto transform(_Func&& __f) const& {
     using _Up = remove_cv_t<invoke_result_t<_Func, const value_type&>>;
     static_assert(!is_array_v<_Up>, "Result of f(value()) should not be an Array");
@@ -1131,12 +1131,12 @@ public:
                   "Result of f(value()) should not be std::nullopt_t");
     static_assert(is_object_v<_Up>, "Result of f(value()) should be an object type");
     if (*this)
-      return optional<_Up>(__optional_construct_from_invoke_tag{}, _VSTD::forward<_Func>(__f), value());
+      return optional<_Up>(__optional_construct_from_invoke_tag{}, _CUDA_VSTD::forward<_Func>(__f), value());
     return optional<_Up>();
   }
 
   template<class _Func>
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
   constexpr auto transform(_Func&& __f) && {
     using _Up = remove_cv_t<invoke_result_t<_Func, value_type&&>>;
     static_assert(!is_array_v<_Up>, "Result of f(std::move(value())) should not be an Array");
@@ -1146,12 +1146,12 @@ public:
                   "Result of f(std::move(value())) should not be std::nullopt_t");
     static_assert(is_object_v<_Up>, "Result of f(std::move(value())) should be an object type");
     if (*this)
-      return optional<_Up>(__optional_construct_from_invoke_tag{}, _VSTD::forward<_Func>(__f), _VSTD::move(value()));
+      return optional<_Up>(__optional_construct_from_invoke_tag{}, _CUDA_VSTD::forward<_Func>(__f), _CUDA_VSTD::move(value()));
     return optional<_Up>();
   }
 
   template<class _Func>
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
+  _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
   constexpr auto transform(_Func&& __f) const&& {
     using _Up = remove_cvref_t<invoke_result_t<_Func, const value_type&&>>;
     static_assert(!is_array_v<_Up>, "Result of f(std::move(value())) should not be an Array");
@@ -1161,42 +1161,42 @@ public:
                   "Result of f(std::move(value())) should not be std::nullopt_t");
     static_assert(is_object_v<_Up>, "Result of f(std::move(value())) should be an object type");
     if (*this)
-      return optional<_Up>(__optional_construct_from_invoke_tag{}, _VSTD::forward<_Func>(__f), _VSTD::move(value()));
+      return optional<_Up>(__optional_construct_from_invoke_tag{}, _CUDA_VSTD::forward<_Func>(__f), _CUDA_VSTD::move(value()));
     return optional<_Up>();
   }
 
   template<invocable _Func>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr optional or_else(_Func&& __f) const& requires is_copy_constructible_v<value_type> {
     static_assert(is_same_v<remove_cvref_t<invoke_result_t<_Func>>, optional>,
                   "Result of f() should be the same type as this optional");
     if (*this)
       return *this;
-    return _VSTD::forward<_Func>(__f)();
+    return _CUDA_VSTD::forward<_Func>(__f)();
   }
 
   template<invocable _Func>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCUDACXX_HIDE_FROM_ABI
   constexpr optional or_else(_Func&& __f) && requires is_move_constructible_v<value_type> {
     static_assert(is_same_v<remove_cvref_t<invoke_result_t<_Func>>, optional>,
                   "Result of f() should be the same type as this optional");
     if (*this)
-      return _VSTD::move(*this);
-    return _VSTD::forward<_Func>(__f)();
+      return _CUDA_VSTD::move(*this);
+    return _CUDA_VSTD::forward<_Func>(__f)();
   }
-#endif // _LIBCPP_STD_VER > 20
+#endif // _LIBCUDACXX_STD_VER > 20
 
     using __base::reset;
 };
 
-#if _LIBCPP_STD_VER >= 17
+#if _LIBCUDACXX_STD_VER >= 17
 template<class _Tp>
     optional(_Tp) -> optional<_Tp>;
 #endif
 
 // Comparisons between optionals
 template <class _Tp, class _Up>
-_LIBCPP_INLINE_VISIBILITY constexpr
+_LIBCUDACXX_INLINE_VISIBILITY constexpr
 enable_if_t<
     is_convertible_v<decltype(declval<const _Tp&>() ==
         declval<const _Up&>()), bool>,
@@ -1212,7 +1212,7 @@ operator==(const optional<_Tp>& __x, const optional<_Up>& __y)
 }
 
 template <class _Tp, class _Up>
-_LIBCPP_INLINE_VISIBILITY constexpr
+_LIBCUDACXX_INLINE_VISIBILITY constexpr
 enable_if_t<
     is_convertible_v<decltype(declval<const _Tp&>() !=
         declval<const _Up&>()), bool>,
@@ -1228,7 +1228,7 @@ operator!=(const optional<_Tp>& __x, const optional<_Up>& __y)
 }
 
 template <class _Tp, class _Up>
-_LIBCPP_INLINE_VISIBILITY constexpr
+_LIBCUDACXX_INLINE_VISIBILITY constexpr
 enable_if_t<
     is_convertible_v<decltype(declval<const _Tp&>() <
         declval<const _Up&>()), bool>,
@@ -1244,7 +1244,7 @@ operator<(const optional<_Tp>& __x, const optional<_Up>& __y)
 }
 
 template <class _Tp, class _Up>
-_LIBCPP_INLINE_VISIBILITY constexpr
+_LIBCUDACXX_INLINE_VISIBILITY constexpr
 enable_if_t<
     is_convertible_v<decltype(declval<const _Tp&>() >
         declval<const _Up&>()), bool>,
@@ -1260,7 +1260,7 @@ operator>(const optional<_Tp>& __x, const optional<_Up>& __y)
 }
 
 template <class _Tp, class _Up>
-_LIBCPP_INLINE_VISIBILITY constexpr
+_LIBCUDACXX_INLINE_VISIBILITY constexpr
 enable_if_t<
     is_convertible_v<decltype(declval<const _Tp&>() <=
         declval<const _Up&>()), bool>,
@@ -1276,7 +1276,7 @@ operator<=(const optional<_Tp>& __x, const optional<_Up>& __y)
 }
 
 template <class _Tp, class _Up>
-_LIBCPP_INLINE_VISIBILITY constexpr
+_LIBCUDACXX_INLINE_VISIBILITY constexpr
 enable_if_t<
     is_convertible_v<decltype(declval<const _Tp&>() >=
         declval<const _Up&>()), bool>,
@@ -1293,7 +1293,7 @@ operator>=(const optional<_Tp>& __x, const optional<_Up>& __y)
 
 // Comparisons with nullopt
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY constexpr
+_LIBCUDACXX_INLINE_VISIBILITY constexpr
 bool
 operator==(const optional<_Tp>& __x, nullopt_t) noexcept
 {
@@ -1301,7 +1301,7 @@ operator==(const optional<_Tp>& __x, nullopt_t) noexcept
 }
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY constexpr
+_LIBCUDACXX_INLINE_VISIBILITY constexpr
 bool
 operator==(nullopt_t, const optional<_Tp>& __x) noexcept
 {
@@ -1309,7 +1309,7 @@ operator==(nullopt_t, const optional<_Tp>& __x) noexcept
 }
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY constexpr
+_LIBCUDACXX_INLINE_VISIBILITY constexpr
 bool
 operator!=(const optional<_Tp>& __x, nullopt_t) noexcept
 {
@@ -1317,7 +1317,7 @@ operator!=(const optional<_Tp>& __x, nullopt_t) noexcept
 }
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY constexpr
+_LIBCUDACXX_INLINE_VISIBILITY constexpr
 bool
 operator!=(nullopt_t, const optional<_Tp>& __x) noexcept
 {
@@ -1325,7 +1325,7 @@ operator!=(nullopt_t, const optional<_Tp>& __x) noexcept
 }
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY constexpr
+_LIBCUDACXX_INLINE_VISIBILITY constexpr
 bool
 operator<(const optional<_Tp>&, nullopt_t) noexcept
 {
@@ -1333,7 +1333,7 @@ operator<(const optional<_Tp>&, nullopt_t) noexcept
 }
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY constexpr
+_LIBCUDACXX_INLINE_VISIBILITY constexpr
 bool
 operator<(nullopt_t, const optional<_Tp>& __x) noexcept
 {
@@ -1341,7 +1341,7 @@ operator<(nullopt_t, const optional<_Tp>& __x) noexcept
 }
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY constexpr
+_LIBCUDACXX_INLINE_VISIBILITY constexpr
 bool
 operator<=(const optional<_Tp>& __x, nullopt_t) noexcept
 {
@@ -1349,7 +1349,7 @@ operator<=(const optional<_Tp>& __x, nullopt_t) noexcept
 }
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY constexpr
+_LIBCUDACXX_INLINE_VISIBILITY constexpr
 bool
 operator<=(nullopt_t, const optional<_Tp>&) noexcept
 {
@@ -1357,7 +1357,7 @@ operator<=(nullopt_t, const optional<_Tp>&) noexcept
 }
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY constexpr
+_LIBCUDACXX_INLINE_VISIBILITY constexpr
 bool
 operator>(const optional<_Tp>& __x, nullopt_t) noexcept
 {
@@ -1365,7 +1365,7 @@ operator>(const optional<_Tp>& __x, nullopt_t) noexcept
 }
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY constexpr
+_LIBCUDACXX_INLINE_VISIBILITY constexpr
 bool
 operator>(nullopt_t, const optional<_Tp>&) noexcept
 {
@@ -1373,7 +1373,7 @@ operator>(nullopt_t, const optional<_Tp>&) noexcept
 }
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY constexpr
+_LIBCUDACXX_INLINE_VISIBILITY constexpr
 bool
 operator>=(const optional<_Tp>&, nullopt_t) noexcept
 {
@@ -1381,7 +1381,7 @@ operator>=(const optional<_Tp>&, nullopt_t) noexcept
 }
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY constexpr
+_LIBCUDACXX_INLINE_VISIBILITY constexpr
 bool
 operator>=(nullopt_t, const optional<_Tp>& __x) noexcept
 {
@@ -1390,7 +1390,7 @@ operator>=(nullopt_t, const optional<_Tp>& __x) noexcept
 
 // Comparisons with T
 template <class _Tp, class _Up>
-_LIBCPP_INLINE_VISIBILITY constexpr
+_LIBCUDACXX_INLINE_VISIBILITY constexpr
 enable_if_t<
     is_convertible_v<decltype(declval<const _Tp&>() ==
         declval<const _Up&>()), bool>,
@@ -1402,7 +1402,7 @@ operator==(const optional<_Tp>& __x, const _Up& __v)
 }
 
 template <class _Tp, class _Up>
-_LIBCPP_INLINE_VISIBILITY constexpr
+_LIBCUDACXX_INLINE_VISIBILITY constexpr
 enable_if_t<
     is_convertible_v<decltype(declval<const _Tp&>() ==
         declval<const _Up&>()), bool>,
@@ -1414,7 +1414,7 @@ operator==(const _Tp& __v, const optional<_Up>& __x)
 }
 
 template <class _Tp, class _Up>
-_LIBCPP_INLINE_VISIBILITY constexpr
+_LIBCUDACXX_INLINE_VISIBILITY constexpr
 enable_if_t<
     is_convertible_v<decltype(declval<const _Tp&>() !=
         declval<const _Up&>()), bool>,
@@ -1426,7 +1426,7 @@ operator!=(const optional<_Tp>& __x, const _Up& __v)
 }
 
 template <class _Tp, class _Up>
-_LIBCPP_INLINE_VISIBILITY constexpr
+_LIBCUDACXX_INLINE_VISIBILITY constexpr
 enable_if_t<
     is_convertible_v<decltype(declval<const _Tp&>() !=
         declval<const _Up&>()), bool>,
@@ -1438,7 +1438,7 @@ operator!=(const _Tp& __v, const optional<_Up>& __x)
 }
 
 template <class _Tp, class _Up>
-_LIBCPP_INLINE_VISIBILITY constexpr
+_LIBCUDACXX_INLINE_VISIBILITY constexpr
 enable_if_t<
     is_convertible_v<decltype(declval<const _Tp&>() <
         declval<const _Up&>()), bool>,
@@ -1450,7 +1450,7 @@ operator<(const optional<_Tp>& __x, const _Up& __v)
 }
 
 template <class _Tp, class _Up>
-_LIBCPP_INLINE_VISIBILITY constexpr
+_LIBCUDACXX_INLINE_VISIBILITY constexpr
 enable_if_t<
     is_convertible_v<decltype(declval<const _Tp&>() <
         declval<const _Up&>()), bool>,
@@ -1462,7 +1462,7 @@ operator<(const _Tp& __v, const optional<_Up>& __x)
 }
 
 template <class _Tp, class _Up>
-_LIBCPP_INLINE_VISIBILITY constexpr
+_LIBCUDACXX_INLINE_VISIBILITY constexpr
 enable_if_t<
     is_convertible_v<decltype(declval<const _Tp&>() <=
         declval<const _Up&>()), bool>,
@@ -1474,7 +1474,7 @@ operator<=(const optional<_Tp>& __x, const _Up& __v)
 }
 
 template <class _Tp, class _Up>
-_LIBCPP_INLINE_VISIBILITY constexpr
+_LIBCUDACXX_INLINE_VISIBILITY constexpr
 enable_if_t<
     is_convertible_v<decltype(declval<const _Tp&>() <=
         declval<const _Up&>()), bool>,
@@ -1486,7 +1486,7 @@ operator<=(const _Tp& __v, const optional<_Up>& __x)
 }
 
 template <class _Tp, class _Up>
-_LIBCPP_INLINE_VISIBILITY constexpr
+_LIBCUDACXX_INLINE_VISIBILITY constexpr
 enable_if_t<
     is_convertible_v<decltype(declval<const _Tp&>() >
         declval<const _Up&>()), bool>,
@@ -1498,7 +1498,7 @@ operator>(const optional<_Tp>& __x, const _Up& __v)
 }
 
 template <class _Tp, class _Up>
-_LIBCPP_INLINE_VISIBILITY constexpr
+_LIBCUDACXX_INLINE_VISIBILITY constexpr
 enable_if_t<
     is_convertible_v<decltype(declval<const _Tp&>() >
         declval<const _Up&>()), bool>,
@@ -1510,7 +1510,7 @@ operator>(const _Tp& __v, const optional<_Up>& __x)
 }
 
 template <class _Tp, class _Up>
-_LIBCPP_INLINE_VISIBILITY constexpr
+_LIBCUDACXX_INLINE_VISIBILITY constexpr
 enable_if_t<
     is_convertible_v<decltype(declval<const _Tp&>() >=
         declval<const _Up&>()), bool>,
@@ -1522,7 +1522,7 @@ operator>=(const optional<_Tp>& __x, const _Up& __v)
 }
 
 template <class _Tp, class _Up>
-_LIBCPP_INLINE_VISIBILITY constexpr
+_LIBCUDACXX_INLINE_VISIBILITY constexpr
 enable_if_t<
     is_convertible_v<decltype(declval<const _Tp&>() >=
         declval<const _Up&>()), bool>,
@@ -1535,7 +1535,7 @@ operator>=(const _Tp& __v, const optional<_Up>& __x)
 
 
 template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 enable_if_t<
     is_move_constructible_v<_Tp> && is_swappable_v<_Tp>,
     void
@@ -1546,45 +1546,45 @@ swap(optional<_Tp>& __x, optional<_Tp>& __y) noexcept(noexcept(__x.swap(__y)))
 }
 
 template <class _Tp>
-_LIBCPP_INLINE_VISIBILITY constexpr
+_LIBCUDACXX_INLINE_VISIBILITY constexpr
 optional<decay_t<_Tp>> make_optional(_Tp&& __v)
 {
-    return optional<decay_t<_Tp>>(_VSTD::forward<_Tp>(__v));
+    return optional<decay_t<_Tp>>(_CUDA_VSTD::forward<_Tp>(__v));
 }
 
 template <class _Tp, class... _Args>
-_LIBCPP_INLINE_VISIBILITY constexpr
+_LIBCUDACXX_INLINE_VISIBILITY constexpr
 optional<_Tp> make_optional(_Args&&... __args)
 {
-    return optional<_Tp>(in_place, _VSTD::forward<_Args>(__args)...);
+    return optional<_Tp>(in_place, _CUDA_VSTD::forward<_Args>(__args)...);
 }
 
 template <class _Tp, class _Up, class... _Args>
-_LIBCPP_INLINE_VISIBILITY constexpr
+_LIBCUDACXX_INLINE_VISIBILITY constexpr
 optional<_Tp> make_optional(initializer_list<_Up> __il,  _Args&&... __args)
 {
-    return optional<_Tp>(in_place, __il, _VSTD::forward<_Args>(__args)...);
+    return optional<_Tp>(in_place, __il, _CUDA_VSTD::forward<_Args>(__args)...);
 }
 
 template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS hash<
+struct _LIBCUDACXX_TEMPLATE_VIS hash<
     __enable_hash_helper<optional<_Tp>, remove_const_t<_Tp>>
 >
 {
-#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
-    _LIBCPP_DEPRECATED_IN_CXX17 typedef optional<_Tp> argument_type;
-    _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t        result_type;
+#if _LIBCUDACXX_STD_VER <= 17 || defined(_LIBCUDACXX_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+    _LIBCUDACXX_DEPRECATED_IN_CXX17 typedef optional<_Tp> argument_type;
+    _LIBCUDACXX_DEPRECATED_IN_CXX17 typedef size_t        result_type;
 #endif
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_t operator()(const optional<_Tp>& __opt) const
     {
         return static_cast<bool>(__opt) ? hash<remove_const_t<_Tp>>()(*__opt) : 0;
     }
 };
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 14
+#endif // _LIBCUDACXX_STD_VER > 14
 
-#endif // _LIBCPP_OPTIONAL
+#endif // _LIBCUDACXX_OPTIONAL

diff  --git a/libcxx/include/ostream b/libcxx/include/ostream
index 14b49d78cb03..53fd04e1b6f8 100644
--- a/libcxx/include/ostream
+++ b/libcxx/include/ostream
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_OSTREAM
-#define _LIBCPP_OSTREAM
+#ifndef _LIBCUDACXX_OSTREAM
+#define _LIBCUDACXX_OSTREAM
 
 /*
     ostream synopsis
@@ -171,18 +171,18 @@ basic_ostream<wchar_t, traits>& operator<<(basic_ostream<wchar_t, traits>&, cons
 #include <streambuf>
 #include <version>
 
-#ifndef _LIBCPP_REMOVE_TRANSITIVE_INCLUDES
+#ifndef _LIBCUDACXX_REMOVE_TRANSITIVE_INCLUDES
 #  include <iterator>
 #endif
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _CharT, class _Traits>
-class _LIBCPP_TEMPLATE_VIS basic_ostream
+class _LIBCUDACXX_TEMPLATE_VIS basic_ostream
     : virtual public basic_ios<_CharT, _Traits>
 {
 public:
@@ -194,19 +194,19 @@ public:
     typedef typename traits_type::off_type off_type;
 
     // 27.7.2.2 Constructor/destructor:
-    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
+    inline _LIBCUDACXX_HIDE_FROM_ABI_AFTER_V1
     explicit basic_ostream(basic_streambuf<char_type, traits_type>* __sb)
     { this->init(__sb); }
     virtual ~basic_ostream();
 protected:
-    inline _LIBCPP_INLINE_VISIBILITY
+    inline _LIBCUDACXX_INLINE_VISIBILITY
     basic_ostream(basic_ostream&& __rhs);
 
     // 27.7.2.3 Assign/swap
-    inline _LIBCPP_INLINE_VISIBILITY
+    inline _LIBCUDACXX_INLINE_VISIBILITY
     basic_ostream& operator=(basic_ostream&& __rhs);
 
-    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
+    inline _LIBCUDACXX_HIDE_FROM_ABI_AFTER_V1
     void swap(basic_ostream& __rhs)
     { basic_ios<char_type, traits_type>::swap(__rhs); }
 
@@ -215,19 +215,19 @@ protected:
 
 public:
     // 27.7.2.4 Prefix/suffix:
-    class _LIBCPP_TEMPLATE_VIS sentry;
+    class _LIBCUDACXX_TEMPLATE_VIS sentry;
 
     // 27.7.2.6 Formatted output:
-    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
+    inline _LIBCUDACXX_HIDE_FROM_ABI_AFTER_V1
     basic_ostream& operator<<(basic_ostream& (*__pf)(basic_ostream&))
     { return __pf(*this); }
 
-    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
+    inline _LIBCUDACXX_HIDE_FROM_ABI_AFTER_V1
     basic_ostream& operator<<(basic_ios<char_type, traits_type>&
                               (*__pf)(basic_ios<char_type,traits_type>&))
     { __pf(*this); return *this; }
 
-    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
+    inline _LIBCUDACXX_HIDE_FROM_ABI_AFTER_V1
     basic_ostream& operator<<(ios_base& (*__pf)(ios_base&))
     { __pf(*this); return *this; }
 
@@ -245,8 +245,8 @@ public:
     basic_ostream& operator<<(long double __f);
     basic_ostream& operator<<(const void* __p);
 
-#if _LIBCPP_STD_VER > 20
-    _LIBCPP_HIDE_FROM_ABI
+#if _LIBCUDACXX_STD_VER > 20
+    _LIBCUDACXX_HIDE_FROM_ABI
     basic_ostream& operator<<(const volatile void* __p) {
         return operator<<(const_cast<const void*>(__p));
     }
@@ -254,10 +254,10 @@ public:
 
     basic_ostream& operator<<(basic_streambuf<char_type, traits_type>* __sb);
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 // LWG 2221 - nullptr. This is not backported to older standards modes.
 // See https://reviews.llvm.org/D127033 for more info on the rationale.
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_ostream& operator<<(nullptr_t)
     { return *this << "nullptr"; }
 #endif
@@ -268,20 +268,20 @@ public:
     basic_ostream& flush();
 
     // 27.7.2.5 seeks:
-    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
+    inline _LIBCUDACXX_HIDE_FROM_ABI_AFTER_V1
     pos_type tellp();
-    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
+    inline _LIBCUDACXX_HIDE_FROM_ABI_AFTER_V1
     basic_ostream& seekp(pos_type __pos);
-    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
+    inline _LIBCUDACXX_HIDE_FROM_ABI_AFTER_V1
     basic_ostream& seekp(off_type __off, ios_base::seekdir __dir);
 
 protected:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_ostream() {}  // extension, intentially does not initialize
 };
 
 template <class _CharT, class _Traits>
-class _LIBCPP_TEMPLATE_VIS basic_ostream<_CharT, _Traits>::sentry
+class _LIBCUDACXX_TEMPLATE_VIS basic_ostream<_CharT, _Traits>::sentry
 {
     bool __ok_;
     basic_ostream<_CharT, _Traits>& __os_;
@@ -292,7 +292,7 @@ public:
     sentry(const sentry&) = delete;
     sentry& operator=(const sentry&) = delete;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit operator bool() const {return __ok_;}
 };
 
@@ -315,18 +315,18 @@ basic_ostream<_CharT, _Traits>::sentry::~sentry()
     if (__os_.rdbuf() && __os_.good() && (__os_.flags() & ios_base::unitbuf)
                       && !uncaught_exception())
     {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         try
         {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
             if (__os_.rdbuf()->pubsync() == -1)
                 __os_.setstate(ios_base::badbit);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
         }
         catch (...)
         {
         }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
     }
 }
 
@@ -353,19 +353,19 @@ template <class _CharT, class _Traits>
 basic_ostream<_CharT, _Traits>&
 basic_ostream<_CharT, _Traits>::operator<<(basic_streambuf<char_type, traits_type>* __sb)
 {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     try
     {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
         sentry __s(*this);
         if (__s)
         {
             if (__sb)
             {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
                 try
                 {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
                     typedef istreambuf_iterator<_CharT, _Traits> _Ip;
                     typedef ostreambuf_iterator<_CharT, _Traits> _Op;
                     _Ip __i(__sb);
@@ -380,24 +380,24 @@ basic_ostream<_CharT, _Traits>::operator<<(basic_streambuf<char_type, traits_typ
                     }
                     if (__c == 0)
                         this->setstate(ios_base::failbit);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
                 }
                 catch (...)
                 {
                     this->__set_failbit_and_consider_rethrow();
                 }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
             }
             else
                 this->setstate(ios_base::badbit);
         }
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     }
     catch (...)
     {
         this->__set_badbit_and_consider_rethrow();
     }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
     return *this;
 }
 
@@ -405,10 +405,10 @@ template <class _CharT, class _Traits>
 basic_ostream<_CharT, _Traits>&
 basic_ostream<_CharT, _Traits>::operator<<(bool __n)
 {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     try
     {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
         sentry __s(*this);
         if (__s)
         {
@@ -417,13 +417,13 @@ basic_ostream<_CharT, _Traits>::operator<<(bool __n)
             if (__f.put(*this, *this, this->fill(), __n).failed())
                 this->setstate(ios_base::badbit | ios_base::failbit);
         }
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     }
     catch (...)
     {
         this->__set_badbit_and_consider_rethrow();
     }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
     return *this;
 }
 
@@ -431,10 +431,10 @@ template <class _CharT, class _Traits>
 basic_ostream<_CharT, _Traits>&
 basic_ostream<_CharT, _Traits>::operator<<(short __n)
 {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     try
     {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
         sentry __s(*this);
         if (__s)
         {
@@ -447,13 +447,13 @@ basic_ostream<_CharT, _Traits>::operator<<(short __n)
                         static_cast<long>(__n)).failed())
                 this->setstate(ios_base::badbit | ios_base::failbit);
         }
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     }
     catch (...)
     {
         this->__set_badbit_and_consider_rethrow();
     }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
     return *this;
 }
 
@@ -461,10 +461,10 @@ template <class _CharT, class _Traits>
 basic_ostream<_CharT, _Traits>&
 basic_ostream<_CharT, _Traits>::operator<<(unsigned short __n)
 {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     try
     {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
         sentry __s(*this);
         if (__s)
         {
@@ -473,13 +473,13 @@ basic_ostream<_CharT, _Traits>::operator<<(unsigned short __n)
             if (__f.put(*this, *this, this->fill(), static_cast<unsigned long>(__n)).failed())
                 this->setstate(ios_base::badbit | ios_base::failbit);
         }
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     }
     catch (...)
     {
         this->__set_badbit_and_consider_rethrow();
     }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
     return *this;
 }
 
@@ -487,10 +487,10 @@ template <class _CharT, class _Traits>
 basic_ostream<_CharT, _Traits>&
 basic_ostream<_CharT, _Traits>::operator<<(int __n)
 {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     try
     {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
         sentry __s(*this);
         if (__s)
         {
@@ -503,13 +503,13 @@ basic_ostream<_CharT, _Traits>::operator<<(int __n)
                         static_cast<long>(__n)).failed())
                 this->setstate(ios_base::badbit | ios_base::failbit);
         }
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     }
     catch (...)
     {
         this->__set_badbit_and_consider_rethrow();
     }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
     return *this;
 }
 
@@ -517,10 +517,10 @@ template <class _CharT, class _Traits>
 basic_ostream<_CharT, _Traits>&
 basic_ostream<_CharT, _Traits>::operator<<(unsigned int __n)
 {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     try
     {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
         sentry __s(*this);
         if (__s)
         {
@@ -529,13 +529,13 @@ basic_ostream<_CharT, _Traits>::operator<<(unsigned int __n)
             if (__f.put(*this, *this, this->fill(), static_cast<unsigned long>(__n)).failed())
                 this->setstate(ios_base::badbit | ios_base::failbit);
         }
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     }
     catch (...)
     {
         this->__set_badbit_and_consider_rethrow();
     }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
     return *this;
 }
 
@@ -543,10 +543,10 @@ template <class _CharT, class _Traits>
 basic_ostream<_CharT, _Traits>&
 basic_ostream<_CharT, _Traits>::operator<<(long __n)
 {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     try
     {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
         sentry __s(*this);
         if (__s)
         {
@@ -555,13 +555,13 @@ basic_ostream<_CharT, _Traits>::operator<<(long __n)
             if (__f.put(*this, *this, this->fill(), __n).failed())
                 this->setstate(ios_base::badbit | ios_base::failbit);
         }
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     }
     catch (...)
     {
         this->__set_badbit_and_consider_rethrow();
     }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
     return *this;
 }
 
@@ -569,10 +569,10 @@ template <class _CharT, class _Traits>
 basic_ostream<_CharT, _Traits>&
 basic_ostream<_CharT, _Traits>::operator<<(unsigned long __n)
 {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     try
     {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
         sentry __s(*this);
         if (__s)
         {
@@ -581,13 +581,13 @@ basic_ostream<_CharT, _Traits>::operator<<(unsigned long __n)
             if (__f.put(*this, *this, this->fill(), __n).failed())
                 this->setstate(ios_base::badbit | ios_base::failbit);
         }
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     }
     catch (...)
     {
         this->__set_badbit_and_consider_rethrow();
     }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
     return *this;
 }
 
@@ -595,10 +595,10 @@ template <class _CharT, class _Traits>
 basic_ostream<_CharT, _Traits>&
 basic_ostream<_CharT, _Traits>::operator<<(long long __n)
 {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     try
     {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
         sentry __s(*this);
         if (__s)
         {
@@ -607,13 +607,13 @@ basic_ostream<_CharT, _Traits>::operator<<(long long __n)
             if (__f.put(*this, *this, this->fill(), __n).failed())
                 this->setstate(ios_base::badbit | ios_base::failbit);
         }
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     }
     catch (...)
     {
         this->__set_badbit_and_consider_rethrow();
     }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
     return *this;
 }
 
@@ -621,10 +621,10 @@ template <class _CharT, class _Traits>
 basic_ostream<_CharT, _Traits>&
 basic_ostream<_CharT, _Traits>::operator<<(unsigned long long __n)
 {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     try
     {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
         sentry __s(*this);
         if (__s)
         {
@@ -633,13 +633,13 @@ basic_ostream<_CharT, _Traits>::operator<<(unsigned long long __n)
             if (__f.put(*this, *this, this->fill(), __n).failed())
                 this->setstate(ios_base::badbit | ios_base::failbit);
         }
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     }
     catch (...)
     {
         this->__set_badbit_and_consider_rethrow();
     }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
     return *this;
 }
 
@@ -647,10 +647,10 @@ template <class _CharT, class _Traits>
 basic_ostream<_CharT, _Traits>&
 basic_ostream<_CharT, _Traits>::operator<<(float __n)
 {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     try
     {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
         sentry __s(*this);
         if (__s)
         {
@@ -659,13 +659,13 @@ basic_ostream<_CharT, _Traits>::operator<<(float __n)
             if (__f.put(*this, *this, this->fill(), static_cast<double>(__n)).failed())
                 this->setstate(ios_base::badbit | ios_base::failbit);
         }
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     }
     catch (...)
     {
         this->__set_badbit_and_consider_rethrow();
     }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
     return *this;
 }
 
@@ -673,10 +673,10 @@ template <class _CharT, class _Traits>
 basic_ostream<_CharT, _Traits>&
 basic_ostream<_CharT, _Traits>::operator<<(double __n)
 {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     try
     {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
         sentry __s(*this);
         if (__s)
         {
@@ -685,13 +685,13 @@ basic_ostream<_CharT, _Traits>::operator<<(double __n)
             if (__f.put(*this, *this, this->fill(), __n).failed())
                 this->setstate(ios_base::badbit | ios_base::failbit);
         }
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     }
     catch (...)
     {
         this->__set_badbit_and_consider_rethrow();
     }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
     return *this;
 }
 
@@ -699,10 +699,10 @@ template <class _CharT, class _Traits>
 basic_ostream<_CharT, _Traits>&
 basic_ostream<_CharT, _Traits>::operator<<(long double __n)
 {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     try
     {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
         sentry __s(*this);
         if (__s)
         {
@@ -711,13 +711,13 @@ basic_ostream<_CharT, _Traits>::operator<<(long double __n)
             if (__f.put(*this, *this, this->fill(), __n).failed())
                 this->setstate(ios_base::badbit | ios_base::failbit);
         }
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     }
     catch (...)
     {
         this->__set_badbit_and_consider_rethrow();
     }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
     return *this;
 }
 
@@ -725,10 +725,10 @@ template <class _CharT, class _Traits>
 basic_ostream<_CharT, _Traits>&
 basic_ostream<_CharT, _Traits>::operator<<(const void* __n)
 {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     try
     {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
         sentry __s(*this);
         if (__s)
         {
@@ -737,13 +737,13 @@ basic_ostream<_CharT, _Traits>::operator<<(const void* __n)
             if (__f.put(*this, *this, this->fill(), __n).failed())
                 this->setstate(ios_base::badbit | ios_base::failbit);
         }
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     }
     catch (...)
     {
         this->__set_badbit_and_consider_rethrow();
     }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
     return *this;
 }
 
@@ -752,10 +752,10 @@ basic_ostream<_CharT, _Traits>&
 __put_character_sequence(basic_ostream<_CharT, _Traits>& __os,
                           const _CharT* __str, size_t __len)
 {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     try
     {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
         typename basic_ostream<_CharT, _Traits>::sentry __s(__os);
         if (__s)
         {
@@ -770,13 +770,13 @@ __put_character_sequence(basic_ostream<_CharT, _Traits>& __os,
                                  __os.fill()).failed())
                 __os.setstate(ios_base::badbit | ios_base::failbit);
         }
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     }
     catch (...)
     {
         __os.__set_badbit_and_consider_rethrow();
     }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
     return __os;
 }
 
@@ -785,17 +785,17 @@ template<class _CharT, class _Traits>
 basic_ostream<_CharT, _Traits>&
 operator<<(basic_ostream<_CharT, _Traits>& __os, _CharT __c)
 {
-    return _VSTD::__put_character_sequence(__os, &__c, 1);
+    return _CUDA_VSTD::__put_character_sequence(__os, &__c, 1);
 }
 
 template<class _CharT, class _Traits>
 basic_ostream<_CharT, _Traits>&
 operator<<(basic_ostream<_CharT, _Traits>& __os, char __cn)
 {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     try
     {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
         typename basic_ostream<_CharT, _Traits>::sentry __s(__os);
         if (__s)
         {
@@ -811,13 +811,13 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, char __cn)
                                  __os.fill()).failed())
                 __os.setstate(ios_base::badbit | ios_base::failbit);
         }
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     }
     catch (...)
     {
         __os.__set_badbit_and_consider_rethrow();
     }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
     return __os;
 }
 
@@ -825,38 +825,38 @@ template<class _Traits>
 basic_ostream<char, _Traits>&
 operator<<(basic_ostream<char, _Traits>& __os, char __c)
 {
-    return _VSTD::__put_character_sequence(__os, &__c, 1);
+    return _CUDA_VSTD::__put_character_sequence(__os, &__c, 1);
 }
 
 template<class _Traits>
 basic_ostream<char, _Traits>&
 operator<<(basic_ostream<char, _Traits>& __os, signed char __c)
 {
-    return _VSTD::__put_character_sequence(__os, (char *) &__c, 1);
+    return _CUDA_VSTD::__put_character_sequence(__os, (char *) &__c, 1);
 }
 
 template<class _Traits>
 basic_ostream<char, _Traits>&
 operator<<(basic_ostream<char, _Traits>& __os, unsigned char __c)
 {
-    return _VSTD::__put_character_sequence(__os, (char *) &__c, 1);
+    return _CUDA_VSTD::__put_character_sequence(__os, (char *) &__c, 1);
 }
 
 template<class _CharT, class _Traits>
 basic_ostream<_CharT, _Traits>&
 operator<<(basic_ostream<_CharT, _Traits>& __os, const _CharT* __str)
 {
-    return _VSTD::__put_character_sequence(__os, __str, _Traits::length(__str));
+    return _CUDA_VSTD::__put_character_sequence(__os, __str, _Traits::length(__str));
 }
 
 template<class _CharT, class _Traits>
 basic_ostream<_CharT, _Traits>&
 operator<<(basic_ostream<_CharT, _Traits>& __os, const char* __strn)
 {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     try
     {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
         typename basic_ostream<_CharT, _Traits>::sentry __s(__os);
         if (__s)
         {
@@ -885,13 +885,13 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const char* __strn)
                                  __os.fill()).failed())
                 __os.setstate(ios_base::badbit | ios_base::failbit);
         }
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     }
     catch (...)
     {
         __os.__set_badbit_and_consider_rethrow();
     }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
     return __os;
 }
 
@@ -899,7 +899,7 @@ template<class _Traits>
 basic_ostream<char, _Traits>&
 operator<<(basic_ostream<char, _Traits>& __os, const char* __str)
 {
-    return _VSTD::__put_character_sequence(__os, __str, _Traits::length(__str));
+    return _CUDA_VSTD::__put_character_sequence(__os, __str, _Traits::length(__str));
 }
 
 template<class _Traits>
@@ -907,7 +907,7 @@ basic_ostream<char, _Traits>&
 operator<<(basic_ostream<char, _Traits>& __os, const signed char* __str)
 {
     const char *__s = (const char *) __str;
-    return _VSTD::__put_character_sequence(__os, __s, _Traits::length(__s));
+    return _CUDA_VSTD::__put_character_sequence(__os, __s, _Traits::length(__s));
 }
 
 template<class _Traits>
@@ -915,17 +915,17 @@ basic_ostream<char, _Traits>&
 operator<<(basic_ostream<char, _Traits>& __os, const unsigned char* __str)
 {
     const char *__s = (const char *) __str;
-    return _VSTD::__put_character_sequence(__os, __s, _Traits::length(__s));
+    return _CUDA_VSTD::__put_character_sequence(__os, __s, _Traits::length(__s));
 }
 
 template <class _CharT, class _Traits>
 basic_ostream<_CharT, _Traits>&
 basic_ostream<_CharT, _Traits>::put(char_type __c)
 {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     try
     {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
         sentry __s(*this);
         if (__s)
         {
@@ -935,13 +935,13 @@ basic_ostream<_CharT, _Traits>::put(char_type __c)
             if (__o.failed())
                 this->setstate(ios_base::badbit);
         }
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     }
     catch (...)
     {
         this->__set_badbit_and_consider_rethrow();
     }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
     return *this;
 }
 
@@ -949,23 +949,23 @@ template <class _CharT, class _Traits>
 basic_ostream<_CharT, _Traits>&
 basic_ostream<_CharT, _Traits>::write(const char_type* __s, streamsize __n)
 {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     try
     {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
         sentry __sen(*this);
         if (__sen && __n)
         {
             if (this->rdbuf()->sputn(__s, __n) != __n)
                 this->setstate(ios_base::badbit);
         }
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     }
     catch (...)
     {
         this->__set_badbit_and_consider_rethrow();
     }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
     return *this;
 }
 
@@ -973,10 +973,10 @@ template <class _CharT, class _Traits>
 basic_ostream<_CharT, _Traits>&
 basic_ostream<_CharT, _Traits>::flush()
 {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     try
     {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
         if (this->rdbuf())
         {
             sentry __s(*this);
@@ -986,13 +986,13 @@ basic_ostream<_CharT, _Traits>::flush()
                     this->setstate(ios_base::badbit);
             }
         }
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     }
     catch (...)
     {
         this->__set_badbit_and_consider_rethrow();
     }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
     return *this;
 }
 
@@ -1071,11 +1071,11 @@ template <class _Stream, class _Tp, class = typename enable_if<
     _And<is_base_of<ios_base, _Stream>,
          __is_ostreamable<_Stream&, const _Tp&> >::value
 >::type>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 _Stream&& operator<<(_Stream&& __os, const _Tp& __x)
 {
     __os << __x;
-    return _VSTD::move(__os);
+    return _CUDA_VSTD::move(__os);
 }
 
 template<class _CharT, class _Traits, class _Allocator>
@@ -1083,7 +1083,7 @@ basic_ostream<_CharT, _Traits>&
 operator<<(basic_ostream<_CharT, _Traits>& __os,
            const basic_string<_CharT, _Traits, _Allocator>& __str)
 {
-    return _VSTD::__put_character_sequence(__os, __str.data(), __str.size());
+    return _CUDA_VSTD::__put_character_sequence(__os, __str.data(), __str.size());
 }
 
 template<class _CharT, class _Traits>
@@ -1091,11 +1091,11 @@ basic_ostream<_CharT, _Traits>&
 operator<<(basic_ostream<_CharT, _Traits>& __os,
            basic_string_view<_CharT, _Traits> __sv)
 {
-    return _VSTD::__put_character_sequence(__os, __sv.data(), __sv.size());
+    return _CUDA_VSTD::__put_character_sequence(__os, __sv.data(), __sv.size());
 }
 
 template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 basic_ostream<_CharT, _Traits>&
 operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __ec)
 {
@@ -1103,7 +1103,7 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __ec)
 }
 
 template<class _CharT, class _Traits, class _Yp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 basic_ostream<_CharT, _Traits>&
 operator<<(basic_ostream<_CharT, _Traits>& __os, shared_ptr<_Yp> const& __p)
 {
@@ -1111,7 +1111,7 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, shared_ptr<_Yp> const& __p)
 }
 
 template<class _CharT, class _Traits, class _Yp, class _Dp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 typename enable_if
 <
     is_same<void, typename __void_t<decltype((declval<basic_ostream<_CharT, _Traits>&>() << declval<typename unique_ptr<_Yp, _Dp>::pointer>()))>::type>::value,
@@ -1131,9 +1131,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const bitset<_Size>& __x)
                          use_facet<ctype<_CharT> >(__os.getloc()).widen('1'));
 }
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 template <class _Traits>
 basic_ostream<char, _Traits>& operator<<(basic_ostream<char, _Traits>&, wchar_t) = delete;
 
@@ -1152,9 +1152,9 @@ basic_ostream<wchar_t, _Traits>& operator<<(basic_ostream<wchar_t, _Traits>&, co
 template <class _Traits>
 basic_ostream<wchar_t, _Traits>& operator<<(basic_ostream<wchar_t, _Traits>&, const char32_t*) = delete;
 
-#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#endif // _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 
-#ifndef _LIBCPP_HAS_NO_CHAR8_T
+#ifndef _LIBCUDACXX_HAS_NO_CHAR8_T
 template <class _Traits>
 basic_ostream<char, _Traits>& operator<<(basic_ostream<char, _Traits>&, char8_t) = delete;
 
@@ -1180,13 +1180,13 @@ basic_ostream<char, _Traits>& operator<<(basic_ostream<char, _Traits>&, const ch
 template <class _Traits>
 basic_ostream<char, _Traits>& operator<<(basic_ostream<char, _Traits>&, const char32_t*) = delete;
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream<char>;
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream<wchar_t>;
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS basic_ostream<char>;
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS basic_ostream<wchar_t>;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_OSTREAM
+#endif // _LIBCUDACXX_OSTREAM

diff  --git a/libcxx/include/queue b/libcxx/include/queue
index 9a5cfb39f24e..03ecfec55f5b 100644
--- a/libcxx/include/queue
+++ b/libcxx/include/queue
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_QUEUE
-#define _LIBCPP_QUEUE
+#ifndef _LIBCUDACXX_QUEUE
+#define _LIBCUDACXX_QUEUE
 
 /*
     queue synopsis
@@ -231,7 +231,7 @@ template <class T, class Container, class Compare>
 #include <vector>
 #include <version>
 
-#ifndef _LIBCPP_REMOVE_TRANSITIVE_INCLUDES
+#ifndef _LIBCUDACXX_REMOVE_TRANSITIVE_INCLUDES
 #  include <functional>
 #endif
 
@@ -239,26 +239,26 @@ template <class T, class Container, class Compare>
 #include <compare>
 #include <initializer_list>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-template <class _Tp, class _Container = deque<_Tp> > class _LIBCPP_TEMPLATE_VIS queue;
+template <class _Tp, class _Container = deque<_Tp> > class _LIBCUDACXX_TEMPLATE_VIS queue;
 
 template <class _Tp, class _Container>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator==(const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y);
 
 template <class _Tp, class _Container>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator< (const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y);
 
 template <class _Tp, class _Container /*= deque<_Tp>*/>
-class _LIBCPP_TEMPLATE_VIS queue
+class _LIBCUDACXX_TEMPLATE_VIS queue
 {
 public:
     typedef _Container                               container_type;
@@ -272,132 +272,132 @@ protected:
     container_type c;
 
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     queue()
         _NOEXCEPT_(is_nothrow_default_constructible<container_type>::value)
         : c() {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     queue(const queue& __q) : c(__q.c) {}
 
-#if _LIBCPP_STD_VER > 20
+#if _LIBCUDACXX_STD_VER > 20
     template <class _InputIterator,
               class = __enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>>
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     queue(_InputIterator __first, _InputIterator __last) : c(__first, __last) {}
 
     template <class _InputIterator,
               class _Alloc,
               class = __enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>,
               class = __enable_if_t<uses_allocator<container_type, _Alloc>::value>>
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     queue(_InputIterator __first, _InputIterator __second, const _Alloc& __alloc) : c(__first, __second, __alloc) {}
 #endif
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     queue& operator=(const queue& __q) {c = __q.c; return *this;}
 
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     queue(queue&& __q)
         _NOEXCEPT_(is_nothrow_move_constructible<container_type>::value)
-        : c(_VSTD::move(__q.c)) {}
+        : c(_CUDA_VSTD::move(__q.c)) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     queue& operator=(queue&& __q)
         _NOEXCEPT_(is_nothrow_move_assignable<container_type>::value)
-        {c = _VSTD::move(__q.c); return *this;}
-#endif // _LIBCPP_CXX03_LANG
+        {c = _CUDA_VSTD::move(__q.c); return *this;}
+#endif // _LIBCUDACXX_CXX03_LANG
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit queue(const container_type& __c)  : c(__c) {}
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
-    explicit queue(container_type&& __c) : c(_VSTD::move(__c)) {}
-#endif // _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
+    explicit queue(container_type&& __c) : c(_CUDA_VSTD::move(__c)) {}
+#endif // _LIBCUDACXX_CXX03_LANG
     template <class _Alloc>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         explicit queue(const _Alloc& __a,
                        __enable_if_t<uses_allocator<container_type, _Alloc>::value>* = 0)
             : c(__a) {}
     template <class _Alloc>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         queue(const queue& __q, const _Alloc& __a,
                        __enable_if_t<uses_allocator<container_type, _Alloc>::value>* = 0)
             : c(__q.c, __a) {}
     template <class _Alloc>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         queue(const container_type& __c, const _Alloc& __a,
                        __enable_if_t<uses_allocator<container_type, _Alloc>::value>* = 0)
             : c(__c, __a) {}
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
     template <class _Alloc>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         queue(container_type&& __c, const _Alloc& __a,
                        __enable_if_t<uses_allocator<container_type, _Alloc>::value>* = 0)
-            : c(_VSTD::move(__c), __a) {}
+            : c(_CUDA_VSTD::move(__c), __a) {}
     template <class _Alloc>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         queue(queue&& __q, const _Alloc& __a,
                        __enable_if_t<uses_allocator<container_type, _Alloc>::value>* = 0)
-            : c(_VSTD::move(__q.c), __a) {}
+            : c(_CUDA_VSTD::move(__q.c), __a) {}
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
-    _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_NODISCARD_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY
     bool      empty() const {return c.empty();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type size() const  {return c.size();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     reference       front()       {return c.front();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_reference front() const {return c.front();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     reference       back()        {return c.back();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_reference back() const  {return c.back();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void push(const value_type& __v) {c.push_back(__v);}
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
-    void push(value_type&& __v)      {c.push_back(_VSTD::move(__v));}
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
+    void push(value_type&& __v)      {c.push_back(_CUDA_VSTD::move(__v));}
     template <class... _Args>
-        _LIBCPP_INLINE_VISIBILITY
-#if _LIBCPP_STD_VER > 14
+        _LIBCUDACXX_INLINE_VISIBILITY
+#if _LIBCUDACXX_STD_VER > 14
         decltype(auto) emplace(_Args&&... __args)
-            { return c.emplace_back(_VSTD::forward<_Args>(__args)...);}
+            { return c.emplace_back(_CUDA_VSTD::forward<_Args>(__args)...);}
 #else
         void     emplace(_Args&&... __args)
-            {        c.emplace_back(_VSTD::forward<_Args>(__args)...);}
+            {        c.emplace_back(_CUDA_VSTD::forward<_Args>(__args)...);}
 #endif
-#endif // _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+#endif // _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     void pop() {c.pop_front();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void swap(queue& __q)
         _NOEXCEPT_(__is_nothrow_swappable<container_type>::value)
     {
-        using _VSTD::swap;
+        using _CUDA_VSTD::swap;
         swap(c, __q.c);
     }
 
     template <class _T1, class _C1>
     friend
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool
     operator==(const queue<_T1, _C1>& __x,const queue<_T1, _C1>& __y);
 
     template <class _T1, class _C1>
     friend
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool
     operator< (const queue<_T1, _C1>& __x,const queue<_T1, _C1>& __y);
 };
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template<class _Container,
          class = enable_if_t<!__is_allocator<_Container>::value>
 >
@@ -413,7 +413,7 @@ queue(_Container, _Alloc)
     -> queue<typename _Container::value_type, _Container>;
 #endif
 
-#if _LIBCPP_STD_VER > 20
+#if _LIBCUDACXX_STD_VER > 20
 template <class _InputIterator,
           class = __enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>>
 queue(_InputIterator, _InputIterator)
@@ -428,7 +428,7 @@ queue(_InputIterator, _InputIterator, _Alloc)
 #endif
 
 template <class _Tp, class _Container>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator==(const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y)
 {
@@ -436,7 +436,7 @@ operator==(const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y)
 }
 
 template <class _Tp, class _Container>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator< (const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y)
 {
@@ -444,7 +444,7 @@ operator< (const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y)
 }
 
 template <class _Tp, class _Container>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator!=(const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y)
 {
@@ -452,7 +452,7 @@ operator!=(const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y)
 }
 
 template <class _Tp, class _Container>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator> (const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y)
 {
@@ -460,7 +460,7 @@ operator> (const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y)
 }
 
 template <class _Tp, class _Container>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator>=(const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y)
 {
@@ -468,7 +468,7 @@ operator>=(const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y)
 }
 
 template <class _Tp, class _Container>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator<=(const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y)
 {
@@ -476,7 +476,7 @@ operator<=(const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y)
 }
 
 template <class _Tp, class _Container>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 __enable_if_t<__is_swappable<_Container>::value, void>
 swap(queue<_Tp, _Container>& __x, queue<_Tp, _Container>& __y)
     _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
@@ -485,14 +485,14 @@ swap(queue<_Tp, _Container>& __x, queue<_Tp, _Container>& __y)
 }
 
 template <class _Tp, class _Container, class _Alloc>
-struct _LIBCPP_TEMPLATE_VIS uses_allocator<queue<_Tp, _Container>, _Alloc>
+struct _LIBCUDACXX_TEMPLATE_VIS uses_allocator<queue<_Tp, _Container>, _Alloc>
     : public uses_allocator<_Container, _Alloc>
 {
 };
 
 template <class _Tp, class _Container = vector<_Tp>,
           class _Compare = less<typename _Container::value_type> >
-class _LIBCPP_TEMPLATE_VIS priority_queue
+class _LIBCUDACXX_TEMPLATE_VIS priority_queue
 {
 public:
     typedef _Container                               container_type;
@@ -508,136 +508,136 @@ protected:
     value_compare comp;
 
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     priority_queue()
         _NOEXCEPT_(is_nothrow_default_constructible<container_type>::value &&
                    is_nothrow_default_constructible<value_compare>::value)
         : c(), comp() {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     priority_queue(const priority_queue& __q) : c(__q.c), comp(__q.comp) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     priority_queue& operator=(const priority_queue& __q)
         {c = __q.c; comp = __q.comp; return *this;}
 
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     priority_queue(priority_queue&& __q)
         _NOEXCEPT_(is_nothrow_move_constructible<container_type>::value &&
                    is_nothrow_move_constructible<value_compare>::value)
-        : c(_VSTD::move(__q.c)), comp(_VSTD::move(__q.comp)) {}
+        : c(_CUDA_VSTD::move(__q.c)), comp(_CUDA_VSTD::move(__q.comp)) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     priority_queue& operator=(priority_queue&& __q)
         _NOEXCEPT_(is_nothrow_move_assignable<container_type>::value &&
                    is_nothrow_move_assignable<value_compare>::value)
-        {c = _VSTD::move(__q.c); comp = _VSTD::move(__q.comp); return *this;}
-#endif // _LIBCPP_CXX03_LANG
+        {c = _CUDA_VSTD::move(__q.c); comp = _CUDA_VSTD::move(__q.comp); return *this;}
+#endif // _LIBCUDACXX_CXX03_LANG
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit priority_queue(const value_compare& __comp)
         : c(), comp(__comp) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     priority_queue(const value_compare& __comp, const container_type& __c);
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     priority_queue(const value_compare& __comp, container_type&& __c);
 #endif
     template <class _InputIter, class = __enable_if_t<__is_cpp17_input_iterator<_InputIter>::value> >
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         priority_queue(_InputIter __f, _InputIter __l,
                        const value_compare& __comp = value_compare());
     template <class _InputIter, class = __enable_if_t<__is_cpp17_input_iterator<_InputIter>::value> >
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         priority_queue(_InputIter __f, _InputIter __l,
                        const value_compare& __comp, const container_type& __c);
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
     template <class _InputIter, class = __enable_if_t<__is_cpp17_input_iterator<_InputIter>::value> >
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         priority_queue(_InputIter __f, _InputIter __l,
                        const value_compare& __comp, container_type&& __c);
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
     template <class _Alloc>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         explicit priority_queue(const _Alloc& __a,
                        __enable_if_t<uses_allocator<container_type, _Alloc>::value>* = 0);
     template <class _Alloc>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         priority_queue(const value_compare& __comp, const _Alloc& __a,
                        __enable_if_t<uses_allocator<container_type, _Alloc>::value>* = 0);
     template <class _Alloc>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         priority_queue(const value_compare& __comp, const container_type& __c,
                        const _Alloc& __a,
                        __enable_if_t<uses_allocator<container_type, _Alloc>::value>* = 0);
     template <class _Alloc>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         priority_queue(const priority_queue& __q, const _Alloc& __a,
                        __enable_if_t<uses_allocator<container_type, _Alloc>::value>* = 0);
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
     template <class _Alloc>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         priority_queue(const value_compare& __comp, container_type&& __c,
                        const _Alloc& __a,
                        __enable_if_t<uses_allocator<container_type, _Alloc>::value>* = 0);
     template <class _Alloc>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         priority_queue(priority_queue&& __q, const _Alloc& __a,
                        __enable_if_t<uses_allocator<container_type, _Alloc>::value>* = 0);
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
     template <class _InputIter, class _Alloc, class = __enable_if_t<__is_cpp17_input_iterator<_InputIter>::value> >
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         priority_queue(_InputIter __f, _InputIter __l, const _Alloc& __a,
                        __enable_if_t<uses_allocator<container_type, _Alloc>::value>* = 0);
 
     template <class _InputIter, class _Alloc, class = __enable_if_t<__is_cpp17_input_iterator<_InputIter>::value> >
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         priority_queue(_InputIter __f, _InputIter __l,
                        const value_compare& __comp, const _Alloc& __a,
                        __enable_if_t<uses_allocator<container_type, _Alloc>::value>* = 0);
 
     template <class _InputIter, class _Alloc, class = __enable_if_t<__is_cpp17_input_iterator<_InputIter>::value> >
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         priority_queue(_InputIter __f, _InputIter __l,
                        const value_compare& __comp, const container_type& __c, const _Alloc& __a,
                        __enable_if_t<uses_allocator<container_type, _Alloc>::value>* = 0);
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
     template <class _InputIter, class _Alloc, class = __enable_if_t<__is_cpp17_input_iterator<_InputIter>::value> >
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         priority_queue(_InputIter __f, _InputIter __l,
                        const value_compare& __comp, container_type&& __c, const _Alloc& __a,
                        __enable_if_t<uses_allocator<container_type, _Alloc>::value>* = 0);
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCUDACXX_CXX03_LANG
 
-    _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_NODISCARD_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY
     bool            empty() const {return c.empty();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type       size() const  {return c.size();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_reference top() const   {return c.front();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void push(const value_type& __v);
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     void push(value_type&& __v);
     template <class... _Args>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void emplace(_Args&&... __args);
-#endif // _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+#endif // _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     void pop();
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void swap(priority_queue& __q)
         _NOEXCEPT_(__is_nothrow_swappable<container_type>::value &&
                    __is_nothrow_swappable<value_compare>::value);
 };
 
-#if _LIBCPP_STD_VER >= 17
+#if _LIBCUDACXX_STD_VER >= 17
 template <class _Compare,
           class _Container,
           class = enable_if_t<!__is_allocator<_Compare>::value>,
@@ -701,22 +701,22 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(const _Compare& __comp
     : c(__c),
       comp(__comp)
 {
-    _VSTD::make_heap(c.begin(), c.end(), comp);
+    _CUDA_VSTD::make_heap(c.begin(), c.end(), comp);
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
 template <class _Tp, class _Container, class _Compare>
 inline
 priority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& __comp,
                                                           container_type&& __c)
-    : c(_VSTD::move(__c)),
+    : c(_CUDA_VSTD::move(__c)),
       comp(__comp)
 {
-    _VSTD::make_heap(c.begin(), c.end(), comp);
+    _CUDA_VSTD::make_heap(c.begin(), c.end(), comp);
 }
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
 template <class _Tp, class _Container, class _Compare>
 template <class _InputIter, class>
@@ -726,7 +726,7 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(_InputIter __f, _Input
     : c(__f, __l),
       comp(__comp)
 {
-    _VSTD::make_heap(c.begin(), c.end(), comp);
+    _CUDA_VSTD::make_heap(c.begin(), c.end(), comp);
 }
 
 template <class _Tp, class _Container, class _Compare>
@@ -739,10 +739,10 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(_InputIter __f, _Input
       comp(__comp)
 {
     c.insert(c.end(), __f, __l);
-    _VSTD::make_heap(c.begin(), c.end(), comp);
+    _CUDA_VSTD::make_heap(c.begin(), c.end(), comp);
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
 template <class _Tp, class _Container, class _Compare>
 template <class _InputIter, class>
@@ -750,14 +750,14 @@ inline
 priority_queue<_Tp, _Container, _Compare>::priority_queue(_InputIter __f, _InputIter __l,
                                                           const value_compare& __comp,
                                                           container_type&& __c)
-    : c(_VSTD::move(__c)),
+    : c(_CUDA_VSTD::move(__c)),
       comp(__comp)
 {
     c.insert(c.end(), __f, __l);
-    _VSTD::make_heap(c.begin(), c.end(), comp);
+    _CUDA_VSTD::make_heap(c.begin(), c.end(), comp);
 }
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
 template <class _Tp, class _Container, class _Compare>
 template <class _Alloc>
@@ -789,7 +789,7 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& _
     : c(__c, __a),
       comp(__comp)
 {
-    _VSTD::make_heap(c.begin(), c.end(), comp);
+    _CUDA_VSTD::make_heap(c.begin(), c.end(), comp);
 }
 
 template <class _Tp, class _Container, class _Compare>
@@ -803,7 +803,7 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(const priority_queue&
 {
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
 template <class _Tp, class _Container, class _Compare>
 template <class _Alloc>
@@ -812,10 +812,10 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& _
                                                           container_type&& __c,
                                                           const _Alloc& __a,
                        __enable_if_t<uses_allocator<container_type, _Alloc>::value>*)
-    : c(_VSTD::move(__c), __a),
+    : c(_CUDA_VSTD::move(__c), __a),
       comp(__comp)
 {
-    _VSTD::make_heap(c.begin(), c.end(), comp);
+    _CUDA_VSTD::make_heap(c.begin(), c.end(), comp);
 }
 
 template <class _Tp, class _Container, class _Compare>
@@ -824,12 +824,12 @@ inline
 priority_queue<_Tp, _Container, _Compare>::priority_queue(priority_queue&& __q,
                                                           const _Alloc& __a,
                        __enable_if_t<uses_allocator<container_type, _Alloc>::value>*)
-    : c(_VSTD::move(__q.c), __a),
-      comp(_VSTD::move(__q.comp))
+    : c(_CUDA_VSTD::move(__q.c), __a),
+      comp(_CUDA_VSTD::move(__q.comp))
 {
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCUDACXX_CXX03_LANG
 
 template <class _Tp, class _Container, class _Compare>
 template <class _InputIter, class _Alloc, class>
@@ -840,7 +840,7 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(
     : c(__f, __l, __a),
       comp()
 {
-    _VSTD::make_heap(c.begin(), c.end(), comp);
+    _CUDA_VSTD::make_heap(c.begin(), c.end(), comp);
 }
 
 template <class _Tp, class _Container, class _Compare>
@@ -853,7 +853,7 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(
     : c(__f, __l, __a),
       comp(__comp)
 {
-    _VSTD::make_heap(c.begin(), c.end(), comp);
+    _CUDA_VSTD::make_heap(c.begin(), c.end(), comp);
 }
 
 template <class _Tp, class _Container, class _Compare>
@@ -867,10 +867,10 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(
       comp(__comp)
 {
     c.insert(c.end(), __f, __l);
-    _VSTD::make_heap(c.begin(), c.end(), comp);
+    _CUDA_VSTD::make_heap(c.begin(), c.end(), comp);
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 template <class _Tp, class _Container, class _Compare>
 template <class _InputIter, class _Alloc, class>
 inline
@@ -878,13 +878,13 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(
         _InputIter __f, _InputIter __l, const value_compare& __comp,
         container_type&& __c, const _Alloc& __a,
         __enable_if_t<uses_allocator<container_type, _Alloc>::value>*)
-    : c(_VSTD::move(__c), __a),
+    : c(_CUDA_VSTD::move(__c), __a),
       comp(__comp)
 {
     c.insert(c.end(), __f, __l);
-    _VSTD::make_heap(c.begin(), c.end(), comp);
+    _CUDA_VSTD::make_heap(c.begin(), c.end(), comp);
 }
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCUDACXX_CXX03_LANG
 
 template <class _Tp, class _Container, class _Compare>
 inline
@@ -892,18 +892,18 @@ void
 priority_queue<_Tp, _Container, _Compare>::push(const value_type& __v)
 {
     c.push_back(__v);
-    _VSTD::push_heap(c.begin(), c.end(), comp);
+    _CUDA_VSTD::push_heap(c.begin(), c.end(), comp);
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
 template <class _Tp, class _Container, class _Compare>
 inline
 void
 priority_queue<_Tp, _Container, _Compare>::push(value_type&& __v)
 {
-    c.push_back(_VSTD::move(__v));
-    _VSTD::push_heap(c.begin(), c.end(), comp);
+    c.push_back(_CUDA_VSTD::move(__v));
+    _CUDA_VSTD::push_heap(c.begin(), c.end(), comp);
 }
 
 template <class _Tp, class _Container, class _Compare>
@@ -912,18 +912,18 @@ inline
 void
 priority_queue<_Tp, _Container, _Compare>::emplace(_Args&&... __args)
 {
-    c.emplace_back(_VSTD::forward<_Args>(__args)...);
-    _VSTD::push_heap(c.begin(), c.end(), comp);
+    c.emplace_back(_CUDA_VSTD::forward<_Args>(__args)...);
+    _CUDA_VSTD::push_heap(c.begin(), c.end(), comp);
 }
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
 template <class _Tp, class _Container, class _Compare>
 inline
 void
 priority_queue<_Tp, _Container, _Compare>::pop()
 {
-    _VSTD::pop_heap(c.begin(), c.end(), comp);
+    _CUDA_VSTD::pop_heap(c.begin(), c.end(), comp);
     c.pop_back();
 }
 
@@ -934,13 +934,13 @@ priority_queue<_Tp, _Container, _Compare>::swap(priority_queue& __q)
         _NOEXCEPT_(__is_nothrow_swappable<container_type>::value &&
                    __is_nothrow_swappable<value_compare>::value)
 {
-    using _VSTD::swap;
+    using _CUDA_VSTD::swap;
     swap(c, __q.c);
     swap(comp, __q.comp);
 }
 
 template <class _Tp, class _Container, class _Compare>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 __enable_if_t<
     __is_swappable<_Container>::value && __is_swappable<_Compare>::value,
     void
@@ -953,11 +953,11 @@ swap(priority_queue<_Tp, _Container, _Compare>& __x,
 }
 
 template <class _Tp, class _Container, class _Compare, class _Alloc>
-struct _LIBCPP_TEMPLATE_VIS uses_allocator<priority_queue<_Tp, _Container, _Compare>, _Alloc>
+struct _LIBCUDACXX_TEMPLATE_VIS uses_allocator<priority_queue<_Tp, _Container, _Compare>, _Alloc>
     : public uses_allocator<_Container, _Alloc>
 {
 };
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_QUEUE
+#endif // _LIBCUDACXX_QUEUE

diff  --git a/libcxx/include/random b/libcxx/include/random
index 41ee4d85fda3..c05198adf2b1 100644
--- a/libcxx/include/random
+++ b/libcxx/include/random
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_RANDOM
-#define _LIBCPP_RANDOM
+#ifndef _LIBCUDACXX_RANDOM
+#define _LIBCUDACXX_RANDOM
 
 /*
     random synopsis
@@ -1718,7 +1718,7 @@ class piecewise_linear_distribution
 #include <__random/weibull_distribution.h>
 #include <version>
 
-#ifndef _LIBCPP_REMOVE_TRANSITIVE_INCLUDES
+#ifndef _LIBCUDACXX_REMOVE_TRANSITIVE_INCLUDES
 #  include <algorithm>
 #endif
 
@@ -1735,8 +1735,8 @@ class piecewise_linear_distribution
 #include <type_traits> // for backward compatibility; TODO remove it
 #include <vector>      // for backward compatibility; TODO remove it
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#endif // _LIBCPP_RANDOM
+#endif // _LIBCUDACXX_RANDOM

diff  --git a/libcxx/include/ranges b/libcxx/include/ranges
index 82378a6b0daa..527298773f03 100644
--- a/libcxx/include/ranges
+++ b/libcxx/include/ranges
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_RANGES
-#define _LIBCPP_RANGES
+#ifndef _LIBCUDACXX_RANGES
+#define _LIBCUDACXX_RANGES
 
 /*
 
@@ -309,8 +309,8 @@ namespace std {
 #include <type_traits>
 #include <version>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#endif // _LIBCPP_RANGES
+#endif // _LIBCUDACXX_RANGES

diff  --git a/libcxx/include/ratio b/libcxx/include/ratio
index 5d7af88a2ac8..d2434485d320 100644
--- a/libcxx/include/ratio
+++ b/libcxx/include/ratio
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_RATIO
-#define _LIBCPP_RATIO
+#ifndef _LIBCUDACXX_RATIO
+#define _LIBCUDACXX_RATIO
 
 /*
     ratio synopsis
@@ -84,15 +84,15 @@ typedef ratio<1000000000000000000000000, 1> yotta;  // not supported
 #include <type_traits>
 #include <version>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 // __static_gcd
 
@@ -247,27 +247,27 @@ public:
 };
 
 template <intmax_t _Num, intmax_t _Den = 1>
-class _LIBCPP_TEMPLATE_VIS ratio
+class _LIBCUDACXX_TEMPLATE_VIS ratio
 {
     static_assert(__static_abs<_Num>::value >= 0, "ratio numerator is out of range");
     static_assert(_Den != 0, "ratio divide by 0");
     static_assert(__static_abs<_Den>::value >  0, "ratio denominator is out of range");
-    static _LIBCPP_CONSTEXPR const intmax_t __na = __static_abs<_Num>::value;
-    static _LIBCPP_CONSTEXPR const intmax_t __da = __static_abs<_Den>::value;
-    static _LIBCPP_CONSTEXPR const intmax_t __s = __static_sign<_Num>::value * __static_sign<_Den>::value;
-    static _LIBCPP_CONSTEXPR const intmax_t __gcd = __static_gcd<__na, __da>::value;
+    static _LIBCUDACXX_CONSTEXPR const intmax_t __na = __static_abs<_Num>::value;
+    static _LIBCUDACXX_CONSTEXPR const intmax_t __da = __static_abs<_Den>::value;
+    static _LIBCUDACXX_CONSTEXPR const intmax_t __s = __static_sign<_Num>::value * __static_sign<_Den>::value;
+    static _LIBCUDACXX_CONSTEXPR const intmax_t __gcd = __static_gcd<__na, __da>::value;
 public:
-    static _LIBCPP_CONSTEXPR const intmax_t num = __s * __na / __gcd;
-    static _LIBCPP_CONSTEXPR const intmax_t den = __da / __gcd;
+    static _LIBCUDACXX_CONSTEXPR const intmax_t num = __s * __na / __gcd;
+    static _LIBCUDACXX_CONSTEXPR const intmax_t den = __da / __gcd;
 
     typedef ratio<num, den> type;
 };
 
 template <intmax_t _Num, intmax_t _Den>
-_LIBCPP_CONSTEXPR const intmax_t ratio<_Num, _Den>::num;
+_LIBCUDACXX_CONSTEXPR const intmax_t ratio<_Num, _Den>::num;
 
 template <intmax_t _Num, intmax_t _Den>
-_LIBCPP_CONSTEXPR const intmax_t ratio<_Num, _Den>::den;
+_LIBCUDACXX_CONSTEXPR const intmax_t ratio<_Num, _Den>::den;
 
 template <class _Tp>                    struct __is_ratio                     : false_type {};
 template <intmax_t _Num, intmax_t _Den> struct __is_ratio<ratio<_Num, _Den> > : true_type  {};
@@ -303,18 +303,18 @@ public:
         >::type type;
 };
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
 template <class _R1, class _R2> using ratio_multiply
                                     = typename __ratio_multiply<_R1, _R2>::type;
 
-#else  // _LIBCPP_CXX03_LANG
+#else  // _LIBCUDACXX_CXX03_LANG
 
 template <class _R1, class _R2>
-struct _LIBCPP_TEMPLATE_VIS ratio_multiply
+struct _LIBCUDACXX_TEMPLATE_VIS ratio_multiply
     : public __ratio_multiply<_R1, _R2>::type {};
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
 template <class _R1, class _R2>
 struct __ratio_divide
@@ -330,18 +330,18 @@ public:
         >::type type;
 };
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
 template <class _R1, class _R2> using ratio_divide
                                       = typename __ratio_divide<_R1, _R2>::type;
 
-#else  // _LIBCPP_CXX03_LANG
+#else  // _LIBCUDACXX_CXX03_LANG
 
 template <class _R1, class _R2>
-struct _LIBCPP_TEMPLATE_VIS ratio_divide
+struct _LIBCUDACXX_TEMPLATE_VIS ratio_divide
     : public __ratio_divide<_R1, _R2>::type {};
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
 template <class _R1, class _R2>
 struct __ratio_add
@@ -365,18 +365,18 @@ public:
         >::type type;
 };
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
 template <class _R1, class _R2> using ratio_add
                                          = typename __ratio_add<_R1, _R2>::type;
 
-#else  // _LIBCPP_CXX03_LANG
+#else  // _LIBCUDACXX_CXX03_LANG
 
 template <class _R1, class _R2>
-struct _LIBCPP_TEMPLATE_VIS ratio_add
+struct _LIBCUDACXX_TEMPLATE_VIS ratio_add
     : public __ratio_add<_R1, _R2>::type {};
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
 template <class _R1, class _R2>
 struct __ratio_subtract
@@ -400,27 +400,27 @@ public:
         >::type type;
 };
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
 template <class _R1, class _R2> using ratio_subtract
                                     = typename __ratio_subtract<_R1, _R2>::type;
 
-#else  // _LIBCPP_CXX03_LANG
+#else  // _LIBCUDACXX_CXX03_LANG
 
 template <class _R1, class _R2>
-struct _LIBCPP_TEMPLATE_VIS ratio_subtract
+struct _LIBCUDACXX_TEMPLATE_VIS ratio_subtract
     : public __ratio_subtract<_R1, _R2>::type {};
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
 // ratio_equal
 
 template <class _R1, class _R2>
-struct _LIBCPP_TEMPLATE_VIS ratio_equal
+struct _LIBCUDACXX_TEMPLATE_VIS ratio_equal
     : _BoolConstant<(_R1::num == _R2::num && _R1::den == _R2::den)> {};
 
 template <class _R1, class _R2>
-struct _LIBCPP_TEMPLATE_VIS ratio_not_equal
+struct _LIBCUDACXX_TEMPLATE_VIS ratio_not_equal
     : _BoolConstant<!ratio_equal<_R1, _R2>::value> {};
 
 // ratio_less
@@ -479,19 +479,19 @@ struct __ratio_less<_R1, _R2, -1LL, -1LL>
 };
 
 template <class _R1, class _R2>
-struct _LIBCPP_TEMPLATE_VIS ratio_less
+struct _LIBCUDACXX_TEMPLATE_VIS ratio_less
     : _BoolConstant<__ratio_less<_R1, _R2>::value> {};
 
 template <class _R1, class _R2>
-struct _LIBCPP_TEMPLATE_VIS ratio_less_equal
+struct _LIBCUDACXX_TEMPLATE_VIS ratio_less_equal
     : _BoolConstant<!ratio_less<_R2, _R1>::value> {};
 
 template <class _R1, class _R2>
-struct _LIBCPP_TEMPLATE_VIS ratio_greater
+struct _LIBCUDACXX_TEMPLATE_VIS ratio_greater
     : _BoolConstant<ratio_less<_R2, _R1>::value> {};
 
 template <class _R1, class _R2>
-struct _LIBCPP_TEMPLATE_VIS ratio_greater_equal
+struct _LIBCUDACXX_TEMPLATE_VIS ratio_greater_equal
     : _BoolConstant<!ratio_less<_R1, _R2>::value> {};
 
 template <class _R1, class _R2>
@@ -501,7 +501,7 @@ struct __ratio_gcd
                   __static_lcm<_R1::den, _R2::den>::value> type;
 };
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template <class _R1, class _R2>
 inline constexpr bool ratio_equal_v = ratio_equal<_R1, _R2>::value;
 
@@ -521,8 +521,8 @@ template <class _R1, class _R2>
 inline constexpr bool ratio_greater_equal_v = ratio_greater_equal<_R1, _R2>::value;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP_RATIO
+#endif // _LIBCUDACXX_RATIO

diff  --git a/libcxx/include/regex b/libcxx/include/regex
index 26887e84bf28..0bd99b06d26a 100644
--- a/libcxx/include/regex
+++ b/libcxx/include/regex
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_REGEX
-#define _LIBCPP_REGEX
+#ifndef _LIBCUDACXX_REGEX
+#define _LIBCUDACXX_REGEX
 
 /*
     regex synopsis
@@ -778,7 +778,7 @@ typedef regex_token_iterator<wstring::const_iterator> wsregex_token_iterator;
 #include <vector>
 #include <version>
 
-#ifndef _LIBCPP_REMOVE_TRANSITIVE_INCLUDES
+#ifndef _LIBCUDACXX_REMOVE_TRANSITIVE_INCLUDES
 #  include <iterator>
 #  include <utility>
 #endif
@@ -796,17 +796,17 @@ typedef regex_token_iterator<wstring::const_iterator> wsregex_token_iterator;
 #include <compare>
 #include <initializer_list>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
 
-#define _LIBCPP_REGEX_COMPLEXITY_FACTOR 4096
+#define _LIBCUDACXX_REGEX_COMPLEXITY_FACTOR 4096
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 namespace regex_constants
 {
@@ -819,7 +819,7 @@ enum syntax_option_type
     nosubs     = 1 << 1,
     optimize   = 1 << 2,
     collate    = 1 << 3,
-#ifdef _LIBCPP_ABI_REGEX_CONSTANTS_NONZERO
+#ifdef _LIBCUDACXX_ABI_REGEX_CONSTANTS_NONZERO
     ECMAScript = 1 << 9,
 #else
     ECMAScript = 0,
@@ -833,49 +833,49 @@ enum syntax_option_type
     multiline  = 1 << 10
 };
 
-inline _LIBCPP_CONSTEXPR
+inline _LIBCUDACXX_CONSTEXPR
 syntax_option_type __get_grammar(syntax_option_type __g)
 {
-#ifdef _LIBCPP_ABI_REGEX_CONSTANTS_NONZERO
+#ifdef _LIBCUDACXX_ABI_REGEX_CONSTANTS_NONZERO
     return static_cast<syntax_option_type>(__g & 0x3F0);
 #else
     return static_cast<syntax_option_type>(__g & 0x1F0);
 #endif
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR
 syntax_option_type
 operator~(syntax_option_type __x)
 {
     return syntax_option_type(~int(__x) & 0x1FF);
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR
 syntax_option_type
 operator&(syntax_option_type __x, syntax_option_type __y)
 {
     return syntax_option_type(int(__x) & int(__y));
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR
 syntax_option_type
 operator|(syntax_option_type __x, syntax_option_type __y)
 {
     return syntax_option_type(int(__x) | int(__y));
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR
 syntax_option_type
 operator^(syntax_option_type __x, syntax_option_type __y)
 {
     return syntax_option_type(int(__x) ^ int(__y));
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 syntax_option_type&
 operator&=(syntax_option_type& __x, syntax_option_type __y)
 {
@@ -883,7 +883,7 @@ operator&=(syntax_option_type& __x, syntax_option_type __y)
     return __x;
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 syntax_option_type&
 operator|=(syntax_option_type& __x, syntax_option_type __y)
 {
@@ -891,7 +891,7 @@ operator|=(syntax_option_type& __x, syntax_option_type __y)
     return __x;
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 syntax_option_type&
 operator^=(syntax_option_type& __x, syntax_option_type __y)
 {
@@ -920,39 +920,39 @@ enum match_flag_type
     __full_match      = 1 << 12
 };
 
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR
 match_flag_type
 operator~(match_flag_type __x)
 {
     return match_flag_type(~int(__x) & 0x0FFF);
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR
 match_flag_type
 operator&(match_flag_type __x, match_flag_type __y)
 {
     return match_flag_type(int(__x) & int(__y));
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR
 match_flag_type
 operator|(match_flag_type __x, match_flag_type __y)
 {
     return match_flag_type(int(__x) | int(__y));
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_CONSTEXPR
+inline _LIBCUDACXX_INLINE_VISIBILITY
+_LIBCUDACXX_CONSTEXPR
 match_flag_type
 operator^(match_flag_type __x, match_flag_type __y)
 {
     return match_flag_type(int(__x) ^ int(__y));
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 match_flag_type&
 operator&=(match_flag_type& __x, match_flag_type __y)
 {
@@ -960,7 +960,7 @@ operator&=(match_flag_type& __x, match_flag_type __y)
     return __x;
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 match_flag_type&
 operator|=(match_flag_type& __x, match_flag_type __y)
 {
@@ -968,7 +968,7 @@ operator|=(match_flag_type& __x, match_flag_type __y)
     return __x;
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 match_flag_type&
 operator^=(match_flag_type& __x, match_flag_type __y)
 {
@@ -999,7 +999,7 @@ enum error_type
 
 } // namespace regex_constants
 
-class _LIBCPP_EXCEPTION_ABI regex_error
+class _LIBCUDACXX_EXCEPTION_ABI regex_error
     : public runtime_error
 {
     regex_constants::error_type __code_;
@@ -1007,23 +1007,23 @@ public:
     explicit regex_error(regex_constants::error_type __ecode);
     regex_error(const regex_error&) _NOEXCEPT = default;
     virtual ~regex_error() _NOEXCEPT;
-     _LIBCPP_INLINE_VISIBILITY
+     _LIBCUDACXX_INLINE_VISIBILITY
     regex_constants::error_type code() const {return __code_;}
 };
 
 template <regex_constants::error_type _Ev>
-_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_NORETURN inline _LIBCUDACXX_INLINE_VISIBILITY
 void __throw_regex_error()
 {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     throw regex_error(_Ev);
 #else
-    _VSTD::abort();
+    _CUDA_VSTD::abort();
 #endif
 }
 
 template <class _CharT>
-struct _LIBCPP_TEMPLATE_VIS regex_traits
+struct _LIBCUDACXX_TEMPLATE_VIS regex_traits
 {
 public:
     typedef _CharT                  char_type;
@@ -1052,37 +1052,37 @@ private:
 public:
     regex_traits();
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     static size_t length(const char_type* __p)
         {return char_traits<char_type>::length(__p);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     char_type translate(char_type __c) const {return __c;}
     char_type translate_nocase(char_type __c) const;
     template <class _ForwardIterator>
         string_type
         transform(_ForwardIterator __f, _ForwardIterator __l) const;
     template <class _ForwardIterator>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         string_type
         transform_primary( _ForwardIterator __f, _ForwardIterator __l) const
             {return __transform_primary(__f, __l, char_type());}
     template <class _ForwardIterator>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         string_type
         lookup_collatename(_ForwardIterator __f, _ForwardIterator __l) const
             {return __lookup_collatename(__f, __l, char_type());}
     template <class _ForwardIterator>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         char_class_type
         lookup_classname(_ForwardIterator __f, _ForwardIterator __l,
                          bool __icase = false) const
             {return __lookup_classname(__f, __l, __icase, char_type());}
     bool isctype(char_type __c, char_class_type __m) const;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     int value(char_type __ch, int __radix) const
         {return __regex_traits_value(__ch, __radix);}
     locale_type imbue(locale_type __l);
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     locale_type getloc()const {return __loc_;}
 
 private:
@@ -1091,7 +1091,7 @@ private:
     template <class _ForwardIterator>
         string_type
         __transform_primary(_ForwardIterator __f, _ForwardIterator __l, char) const;
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
     template <class _ForwardIterator>
         string_type
         __transform_primary(_ForwardIterator __f, _ForwardIterator __l, wchar_t) const;
@@ -1099,7 +1099,7 @@ private:
     template <class _ForwardIterator>
         string_type
         __lookup_collatename(_ForwardIterator __f, _ForwardIterator __l, char) const;
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
     template <class _ForwardIterator>
         string_type
         __lookup_collatename(_ForwardIterator __f, _ForwardIterator __l, wchar_t) const;
@@ -1108,7 +1108,7 @@ private:
         char_class_type
         __lookup_classname(_ForwardIterator __f, _ForwardIterator __l,
                            bool __icase, char) const;
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
     template <class _ForwardIterator>
         char_class_type
         __lookup_classname(_ForwardIterator __f, _ForwardIterator __l,
@@ -1116,11 +1116,11 @@ private:
 #endif
 
     static int __regex_traits_value(unsigned char __ch, int __radix);
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     int __regex_traits_value(char __ch, int __radix) const
         {return __regex_traits_value(static_cast<unsigned char>(__ch), __radix);}
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-    _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
+    _LIBCUDACXX_INLINE_VISIBILITY
     int __regex_traits_value(wchar_t __ch, int __radix) const;
 #endif
 };
@@ -1193,7 +1193,7 @@ regex_traits<_CharT>::__transform_primary(_ForwardIterator __f,
     return __d;
 }
 
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 template <class _CharT>
 template <class _ForwardIterator>
 typename regex_traits<_CharT>::string_type
@@ -1219,7 +1219,7 @@ regex_traits<_CharT>::__transform_primary(_ForwardIterator __f,
 
 // lookup_collatename is very FreeBSD-specific
 
-_LIBCPP_FUNC_VIS string __get_collation_name(const char* __s);
+_LIBCUDACXX_FUNC_VIS string __get_collation_name(const char* __s);
 
 template <class _CharT>
 template <class _ForwardIterator>
@@ -1244,7 +1244,7 @@ regex_traits<_CharT>::__lookup_collatename(_ForwardIterator __f,
     return __r;
 }
 
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 template <class _CharT>
 template <class _ForwardIterator>
 typename regex_traits<_CharT>::string_type
@@ -1278,11 +1278,11 @@ regex_traits<_CharT>::__lookup_collatename(_ForwardIterator __f,
     }
     return __r;
 }
-#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#endif // _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 
 // lookup_classname
 
-regex_traits<char>::char_class_type _LIBCPP_FUNC_VIS
+regex_traits<char>::char_class_type _LIBCUDACXX_FUNC_VIS
 __get_classname(const char* __s, bool __icase);
 
 template <class _CharT>
@@ -1297,7 +1297,7 @@ regex_traits<_CharT>::__lookup_classname(_ForwardIterator __f,
     return __get_classname(__s.c_str(), __icase);
 }
 
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 template <class _CharT>
 template <class _ForwardIterator>
 typename regex_traits<_CharT>::char_class_type
@@ -1318,7 +1318,7 @@ regex_traits<_CharT>::__lookup_classname(_ForwardIterator __f,
     }
     return __get_classname(__n.c_str(), __icase);
 }
-#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#endif // _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 
 template <class _CharT>
 bool
@@ -1329,7 +1329,7 @@ regex_traits<_CharT>::isctype(char_type __c, char_class_type __m) const
     return (__c == '_' && (__m & __regex_word));
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool __is_07(unsigned char __c)
 {
     return (__c & 0xF8u) ==
@@ -1340,7 +1340,7 @@ bool __is_07(unsigned char __c)
 #endif
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool __is_89(unsigned char __c)
 {
     return (__c & 0xFEu) ==
@@ -1351,7 +1351,7 @@ bool __is_89(unsigned char __c)
 #endif
 }
 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 unsigned char __to_lower(unsigned char __c)
 {
 #if defined(__MVS__) && !defined(__NATIVE_ASCII_F)
@@ -1381,7 +1381,7 @@ regex_traits<_CharT>::__regex_traits_value(unsigned char __ch, int __radix)
     return -1;
 }
 
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 template <class _CharT>
 inline
 int
@@ -1393,11 +1393,11 @@ regex_traits<_CharT>::__regex_traits_value(wchar_t __ch, int __radix) const
 
 template <class _CharT> class __node;
 
-template <class _BidirectionalIterator> class _LIBCPP_TEMPLATE_VIS sub_match;
+template <class _BidirectionalIterator> class _LIBCUDACXX_TEMPLATE_VIS sub_match;
 
 template <class _BidirectionalIterator,
           class _Allocator = allocator<sub_match<_BidirectionalIterator> > >
-class _LIBCPP_TEMPLATE_VIS match_results;
+class _LIBCUDACXX_TEMPLATE_VIS match_results;
 
 template <class _CharT>
 struct __state
@@ -1426,7 +1426,7 @@ struct __state
     regex_constants::match_flag_type __flags_;
     bool __at_first_;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __state()
         : __do_(0), __first_(nullptr), __current_(nullptr), __last_(nullptr),
           __node_(nullptr), __flags_() {}
@@ -1440,16 +1440,16 @@ class __node
     __node(const __node&);
     __node& operator=(const __node&);
 public:
-    typedef _VSTD::__state<_CharT> __state;
+    typedef _CUDA_VSTD::__state<_CharT> __state;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __node() {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     virtual ~__node() {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     virtual void __exec(__state&) const {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     virtual void __exec_split(bool, __state&) const {}
 };
 
@@ -1460,9 +1460,9 @@ class __end_state
     : public __node<_CharT>
 {
 public:
-    typedef _VSTD::__state<_CharT> __state;
+    typedef _CUDA_VSTD::__state<_CharT> __state;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __end_state() {}
 
     virtual void __exec(__state&) const;
@@ -1484,13 +1484,13 @@ class __has_one_state
     __node<_CharT>* __first_;
 
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __has_one_state(__node<_CharT>* __s)
         : __first_(__s) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __node<_CharT>*  first() const {return __first_;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __node<_CharT>*& first()       {return __first_;}
 };
 
@@ -1503,7 +1503,7 @@ class __owns_one_state
     typedef __has_one_state<_CharT> base;
 
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __owns_one_state(__node<_CharT>* __s)
         : base(__s) {}
 
@@ -1525,9 +1525,9 @@ class __empty_state
     typedef __owns_one_state<_CharT> base;
 
 public:
-    typedef _VSTD::__state<_CharT> __state;
+    typedef _CUDA_VSTD::__state<_CharT> __state;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __empty_state(__node<_CharT>* __s)
         : base(__s) {}
 
@@ -1551,9 +1551,9 @@ class __empty_non_own_state
     typedef __has_one_state<_CharT> base;
 
 public:
-    typedef _VSTD::__state<_CharT> __state;
+    typedef _CUDA_VSTD::__state<_CharT> __state;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __empty_non_own_state(__node<_CharT>* __s)
         : base(__s) {}
 
@@ -1577,9 +1577,9 @@ class __repeat_one_loop
     typedef __has_one_state<_CharT> base;
 
 public:
-    typedef _VSTD::__state<_CharT> __state;
+    typedef _CUDA_VSTD::__state<_CharT> __state;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __repeat_one_loop(__node<_CharT>* __s)
         : base(__s) {}
 
@@ -1605,15 +1605,15 @@ class __owns_two_states
     base* __second_;
 
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __owns_two_states(__node<_CharT>* __s1, base* __s2)
         : base(__s1), __second_(__s2) {}
 
     virtual ~__owns_two_states();
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     base*  second() const {return __second_;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     base*& second()       {return __second_;}
 };
 
@@ -1639,9 +1639,9 @@ class __loop
     bool __greedy_;
 
 public:
-    typedef _VSTD::__state<_CharT> __state;
+    typedef _CUDA_VSTD::__state<_CharT> __state;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __loop(unsigned __loop_id,
                           __node<_CharT>* __s1, __owns_one_state<_CharT>* __s2,
                           unsigned __mexp_begin, unsigned __mexp_end,
@@ -1656,7 +1656,7 @@ public:
     virtual void __exec_split(bool __second, __state& __s) const;
 
 private:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __init_repeat(__state& __s) const
     {
         __s.__loop_data_[__loop_id_].second = __s.__current_;
@@ -1738,9 +1738,9 @@ class __alternate
     typedef __owns_two_states<_CharT> base;
 
 public:
-    typedef _VSTD::__state<_CharT> __state;
+    typedef _CUDA_VSTD::__state<_CharT> __state;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __alternate(__owns_one_state<_CharT>* __s1,
                          __owns_one_state<_CharT>* __s2)
         : base(__s1, __s2) {}
@@ -1777,9 +1777,9 @@ class __begin_marked_subexpression
 
     unsigned __mexp_;
 public:
-    typedef _VSTD::__state<_CharT> __state;
+    typedef _CUDA_VSTD::__state<_CharT> __state;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __begin_marked_subexpression(unsigned __mexp, __node<_CharT>* __s)
         : base(__s), __mexp_(__mexp) {}
 
@@ -1805,9 +1805,9 @@ class __end_marked_subexpression
 
     unsigned __mexp_;
 public:
-    typedef _VSTD::__state<_CharT> __state;
+    typedef _CUDA_VSTD::__state<_CharT> __state;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __end_marked_subexpression(unsigned __mexp, __node<_CharT>* __s)
         : base(__s), __mexp_(__mexp) {}
 
@@ -1834,9 +1834,9 @@ class __back_ref
 
     unsigned __mexp_;
 public:
-    typedef _VSTD::__state<_CharT> __state;
+    typedef _CUDA_VSTD::__state<_CharT> __state;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __back_ref(unsigned __mexp, __node<_CharT>* __s)
         : base(__s), __mexp_(__mexp) {}
 
@@ -1854,7 +1854,7 @@ __back_ref<_CharT>::__exec(__state& __s) const
     {
         ptr
diff _t __len = __sm.second - __sm.first;
         if (__s.__last_ - __s.__current_ >= __len &&
-            _VSTD::equal(__sm.first, __sm.second, __s.__current_))
+            _CUDA_VSTD::equal(__sm.first, __sm.second, __s.__current_))
         {
             __s.__do_ = __state::__accept_but_not_consume;
             __s.__current_ += __len;
@@ -1884,9 +1884,9 @@ class __back_ref_icase
     _Traits __traits_;
     unsigned __mexp_;
 public:
-    typedef _VSTD::__state<_CharT> __state;
+    typedef _CUDA_VSTD::__state<_CharT> __state;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __back_ref_icase(const _Traits& __traits, unsigned __mexp,
                               __node<_CharT>* __s)
         : base(__s), __traits_(__traits), __mexp_(__mexp) {}
@@ -1939,9 +1939,9 @@ class __back_ref_collate
     _Traits __traits_;
     unsigned __mexp_;
 public:
-    typedef _VSTD::__state<_CharT> __state;
+    typedef _CUDA_VSTD::__state<_CharT> __state;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __back_ref_collate(const _Traits& __traits, unsigned __mexp,
                               __node<_CharT>* __s)
         : base(__s), __traits_(__traits), __mexp_(__mexp) {}
@@ -1994,9 +1994,9 @@ class __word_boundary
     _Traits __traits_;
     bool __invert_;
 public:
-    typedef _VSTD::__state<_CharT> __state;
+    typedef _CUDA_VSTD::__state<_CharT> __state;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit __word_boundary(const _Traits& __traits, bool __invert,
                              __node<_CharT>* __s)
         : base(__s), __traits_(__traits), __invert_(__invert) {}
@@ -2056,7 +2056,7 @@ __word_boundary<_CharT, _Traits>::__exec(__state& __s) const
 // __l_anchor
 
 template <class _CharT>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR
 bool __is_eol(_CharT __c)
 {
     return __c == '\r' || __c == '\n';
@@ -2071,9 +2071,9 @@ class __l_anchor_multiline
     bool __multiline_;
 
 public:
-    typedef _VSTD::__state<_CharT> __state;
+    typedef _CUDA_VSTD::__state<_CharT> __state;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __l_anchor_multiline(bool __multiline, __node<_CharT>* __s)
         : base(__s), __multiline_(__multiline) {}
 
@@ -2092,7 +2092,7 @@ __l_anchor_multiline<_CharT>::__exec(__state& __s) const
     }
     else if (__multiline_ &&
              !__s.__at_first_ &&
-             __is_eol(*_VSTD::prev(__s.__current_)))
+             __is_eol(*_CUDA_VSTD::prev(__s.__current_)))
     {
         __s.__do_ = __state::__accept_but_not_consume;
         __s.__node_ = this->first();
@@ -2115,9 +2115,9 @@ class __r_anchor_multiline
     bool __multiline_;
 
 public:
-    typedef _VSTD::__state<_CharT> __state;
+    typedef _CUDA_VSTD::__state<_CharT> __state;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __r_anchor_multiline(bool __multiline, __node<_CharT>* __s)
         : base(__s), __multiline_(__multiline) {}
 
@@ -2155,9 +2155,9 @@ class __match_any
     typedef __owns_one_state<_CharT> base;
 
 public:
-    typedef _VSTD::__state<_CharT> __state;
+    typedef _CUDA_VSTD::__state<_CharT> __state;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __match_any(__node<_CharT>* __s)
         : base(__s) {}
 
@@ -2190,18 +2190,18 @@ class __match_any_but_newline
     typedef __owns_one_state<_CharT> base;
 
 public:
-    typedef _VSTD::__state<_CharT> __state;
+    typedef _CUDA_VSTD::__state<_CharT> __state;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __match_any_but_newline(__node<_CharT>* __s)
         : base(__s) {}
 
     virtual void __exec(__state&) const;
 };
 
-template <> _LIBCPP_FUNC_VIS void __match_any_but_newline<char>::__exec(__state&) const;
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-template <> _LIBCPP_FUNC_VIS void __match_any_but_newline<wchar_t>::__exec(__state&) const;
+template <> _LIBCUDACXX_FUNC_VIS void __match_any_but_newline<char>::__exec(__state&) const;
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
+template <> _LIBCUDACXX_FUNC_VIS void __match_any_but_newline<wchar_t>::__exec(__state&) const;
 #endif
 
 // __match_char
@@ -2217,9 +2217,9 @@ class __match_char
     __match_char(const __match_char&);
     __match_char& operator=(const __match_char&);
 public:
-    typedef _VSTD::__state<_CharT> __state;
+    typedef _CUDA_VSTD::__state<_CharT> __state;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __match_char(_CharT __c, __node<_CharT>* __s)
         : base(__s), __c_(__c) {}
 
@@ -2257,9 +2257,9 @@ class __match_char_icase
     __match_char_icase(const __match_char_icase&);
     __match_char_icase& operator=(const __match_char_icase&);
 public:
-    typedef _VSTD::__state<_CharT> __state;
+    typedef _CUDA_VSTD::__state<_CharT> __state;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __match_char_icase(const _Traits& __traits, _CharT __c, __node<_CharT>* __s)
         : base(__s), __traits_(__traits), __c_(__traits.translate_nocase(__c)) {}
 
@@ -2298,9 +2298,9 @@ class __match_char_collate
     __match_char_collate(const __match_char_collate&);
     __match_char_collate& operator=(const __match_char_collate&);
 public:
-    typedef _VSTD::__state<_CharT> __state;
+    typedef _CUDA_VSTD::__state<_CharT> __state;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __match_char_collate(const _Traits& __traits, _CharT __c, __node<_CharT>* __s)
         : base(__s), __traits_(__traits), __c_(__traits.translate(__c)) {}
 
@@ -2350,9 +2350,9 @@ class __bracket_expression
     __bracket_expression(const __bracket_expression&);
     __bracket_expression& operator=(const __bracket_expression&);
 public:
-    typedef _VSTD::__state<_CharT> __state;
+    typedef _CUDA_VSTD::__state<_CharT> __state;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __bracket_expression(const _Traits& __traits, __node<_CharT>* __s,
                                  bool __negate, bool __icase, bool __collate)
         : base(__s), __traits_(__traits), __mask_(), __neg_mask_(),
@@ -2361,10 +2361,10 @@ public:
 
     virtual void __exec(__state&) const;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool __negated() const {return __negate_;}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __add_char(_CharT __c)
         {
             if (__icase_)
@@ -2374,7 +2374,7 @@ public:
             else
                 __chars_.push_back(__c);
         }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __add_neg_char(_CharT __c)
         {
             if (__icase_)
@@ -2384,7 +2384,7 @@ public:
             else
                 __neg_chars_.push_back(__c);
         }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __add_range(string_type __b, string_type __e)
         {
             if (__collate_)
@@ -2416,10 +2416,10 @@ public:
                     __b[0] = __traits_.translate_nocase(__b[0]);
                     __e[0] = __traits_.translate_nocase(__e[0]);
                 }
-                __ranges_.push_back(make_pair(_VSTD::move(__b), _VSTD::move(__e)));
+                __ranges_.push_back(make_pair(_CUDA_VSTD::move(__b), _CUDA_VSTD::move(__e)));
             }
         }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __add_digraph(_CharT __c1, _CharT __c2)
         {
             if (__icase_)
@@ -2431,13 +2431,13 @@ public:
             else
                 __digraphs_.push_back(make_pair(__c1, __c2));
         }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __add_equivalence(const string_type& __s)
         {__equivalences_.push_back(__s);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __add_class(typename regex_traits<_CharT>::char_class_type __mask)
         {__mask_ |= __mask;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __add_neg_class(typename regex_traits<_CharT>::char_class_type __mask)
         {__neg_mask_ |= __mask;}
 };
@@ -2453,7 +2453,7 @@ __bracket_expression<_CharT, _Traits>::__exec(__state& __s) const
         ++__consumed;
         if (__might_have_digraph_)
         {
-            const _CharT* __next = _VSTD::next(__s.__current_);
+            const _CharT* __next = _CUDA_VSTD::next(__s.__current_);
             if (__next != __s.__last_)
             {
                 pair<_CharT, _CharT> __ch2(*__s.__current_, *__next);
@@ -2547,7 +2547,7 @@ __bracket_expression<_CharT, _Traits>::__exec(__state& __s) const
         {
             const bool __in_neg_mask = __traits_.isctype(__ch, __neg_mask_);
           const bool __in_neg_chars =
-              _VSTD::find(__neg_chars_.begin(), __neg_chars_.end(), __ch) !=
+              _CUDA_VSTD::find(__neg_chars_.begin(), __neg_chars_.end(), __ch) !=
               __neg_chars_.end();
           if (!(__in_neg_mask || __in_neg_chars))
           {
@@ -2606,18 +2606,18 @@ __exit:
 template <class _CharT, class _Traits> class __lookahead;
 
 template <class _CharT, class _Traits = regex_traits<_CharT> >
-    class _LIBCPP_TEMPLATE_VIS basic_regex;
+    class _LIBCUDACXX_TEMPLATE_VIS basic_regex;
 
 typedef basic_regex<char>    regex;
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 typedef basic_regex<wchar_t> wregex;
 #endif
 
 template <class _CharT, class _Traits>
 class
-    _LIBCPP_TEMPLATE_VIS
-    _LIBCPP_PREFERRED_NAME(regex)
-    _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wregex))
+    _LIBCUDACXX_TEMPLATE_VIS
+    _LIBCUDACXX_PREFERRED_NAME(regex)
+    _LIBCUDACXX_IF_WIDE_CHARACTERS(_LIBCUDACXX_PREFERRED_NAME(wregex))
     basic_regex
 {
 public:
@@ -2637,8 +2637,8 @@ private:
     shared_ptr<__empty_state<_CharT> > __start_;
     __owns_one_state<_CharT>* __end_;
 
-    typedef _VSTD::__state<_CharT> __state;
-    typedef _VSTD::__node<_CharT> __node;
+    typedef _CUDA_VSTD::__state<_CharT> __state;
+    typedef _CUDA_VSTD::__node<_CharT> __node;
 
 public:
     // constants:
@@ -2655,12 +2655,12 @@ public:
     static const regex_constants::syntax_option_type multiline = regex_constants::multiline;
 
     // construct/copy/destroy:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_regex()
         : __flags_(regex_constants::ECMAScript), __marked_count_(0), __loop_count_(0), __open_count_(0),
           __end_(nullptr)
         {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit basic_regex(const value_type* __p, flag_type __f = regex_constants::ECMAScript)
         : __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0),
           __end_(nullptr)
@@ -2668,7 +2668,7 @@ public:
         __init(__p, __p + __traits_.length(__p));
         }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_regex(const value_type* __p, size_t __len, flag_type __f = regex_constants::ECMAScript)
         : __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0),
           __end_(nullptr)
@@ -2679,7 +2679,7 @@ public:
 //     basic_regex(const basic_regex&) = default;
 //     basic_regex(basic_regex&&) = default;
     template <class _ST, class _SA>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         explicit basic_regex(const basic_string<value_type, _ST, _SA>& __p,
                              flag_type __f = regex_constants::ECMAScript)
         : __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0),
@@ -2689,7 +2689,7 @@ public:
         }
 
     template <class _ForwardIterator>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         basic_regex(_ForwardIterator __first, _ForwardIterator __last,
                     flag_type __f = regex_constants::ECMAScript)
         : __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0),
@@ -2697,8 +2697,8 @@ public:
         {
         __init(__first, __last);
         }
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_regex(initializer_list<value_type> __il,
                 flag_type __f = regex_constants::ECMAScript)
         : __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0),
@@ -2706,48 +2706,48 @@ public:
         {
         __init(__il.begin(), __il.end());
         }
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
 //    ~basic_regex() = default;
 
 //     basic_regex& operator=(const basic_regex&) = default;
 //     basic_regex& operator=(basic_regex&&) = default;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_regex& operator=(const value_type* __p)
         {return assign(__p);}
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_regex& operator=(initializer_list<value_type> __il)
         {return assign(__il);}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
     template <class _ST, class _SA>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         basic_regex& operator=(const basic_string<value_type, _ST, _SA>& __p)
         {return assign(__p);}
 
     // assign:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_regex& assign(const basic_regex& __that)
         {return *this = __that;}
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_regex& assign(basic_regex&& __that) _NOEXCEPT
-        {return *this = _VSTD::move(__that);}
+        {return *this = _CUDA_VSTD::move(__that);}
 #endif
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_regex& assign(const value_type* __p, flag_type __f = regex_constants::ECMAScript)
         {return assign(__p, __p + __traits_.length(__p), __f);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_regex& assign(const value_type* __p, size_t __len, flag_type __f = regex_constants::ECMAScript)
         {return assign(__p, __p + __len, __f);}
     template <class _ST, class _SA>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         basic_regex& assign(const basic_string<value_type, _ST, _SA>& __s,
                             flag_type __f = regex_constants::ECMAScript)
             {return assign(__s.begin(), __s.end(), __f);}
 
     template <class _InputIterator>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         typename enable_if<__is_exactly_cpp17_input_iterator<_InputIterator>::value, basic_regex&>::type
         assign(_InputIterator __first, _InputIterator __last,
                             flag_type __f = regex_constants::ECMAScript)
@@ -2757,7 +2757,7 @@ public:
         }
 
 private:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __member_init(flag_type __f)
     {
         __flags_ = __f;
@@ -2769,7 +2769,7 @@ private:
 public:
 
     template <class _ForwardIterator>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         typename enable_if
         <
             __is_cpp17_forward_iterator<_ForwardIterator>::value,
@@ -2781,40 +2781,40 @@ public:
             return assign(basic_regex(__first, __last, __f));
         }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_regex& assign(initializer_list<value_type> __il,
                         flag_type __f = regex_constants::ECMAScript)
         {return assign(__il.begin(), __il.end(), __f);}
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
     // const operations:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     unsigned mark_count() const {return __marked_count_;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     flag_type flags() const {return __flags_;}
 
     // locale:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     locale_type imbue(locale_type __loc)
     {
         __member_init(ECMAScript);
         __start_.reset();
         return __traits_.imbue(__loc);
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     locale_type getloc() const {return __traits_.getloc();}
 
     // swap:
     void swap(basic_regex& __r);
 
 private:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     unsigned __loop_count() const {return __loop_count_;}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool __use_multiline() const
     {
         return __get_grammar(__flags_) == ECMAScript && (__flags_ & multiline);
@@ -2965,17 +2965,17 @@ private:
 
     bool __test_back_ref(_CharT);
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __push_l_anchor();
     void __push_r_anchor();
     void __push_match_any();
     void __push_match_any_but_newline();
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __push_greedy_inf_repeat(size_t __min, __owns_one_state<_CharT>* __s,
                                   unsigned __mexp_begin = 0, unsigned __mexp_end = 0)
         {__push_loop(__min, numeric_limits<size_t>::max(), __s,
                      __mexp_begin, __mexp_end);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __push_nongreedy_inf_repeat(size_t __min, __owns_one_state<_CharT>* __s,
                                   unsigned __mexp_begin = 0, unsigned __mexp_end = 0)
         {__push_loop(__min, numeric_limits<size_t>::max(), __s,
@@ -3078,7 +3078,7 @@ private:
     template <class, class> friend class __lookahead;
 };
 
-#if _LIBCPP_STD_VER >= 17
+#if _LIBCUDACXX_STD_VER >= 17
 template <class _ForwardIterator,
           class = typename enable_if<__is_cpp17_forward_iterator<_ForwardIterator>::value, nullptr_t>::type
 >
@@ -3112,7 +3112,7 @@ template <class _CharT, class _Traits>
 void
 basic_regex<_CharT, _Traits>::swap(basic_regex& __r)
 {
-    using _VSTD::swap;
+    using _CUDA_VSTD::swap;
     swap(__traits_, __r.__traits_);
     swap(__flags_, __r.__flags_);
     swap(__marked_count_, __r.__marked_count_);
@@ -3123,7 +3123,7 @@ basic_regex<_CharT, _Traits>::swap(basic_regex& __r)
 }
 
 template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 swap(basic_regex<_CharT, _Traits>& __x, basic_regex<_CharT, _Traits>& __y)
 {
@@ -3145,9 +3145,9 @@ class __lookahead
     __lookahead(const __lookahead&);
     __lookahead& operator=(const __lookahead&);
 public:
-    typedef _VSTD::__state<_CharT> __state;
+    typedef _CUDA_VSTD::__state<_CharT> __state;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __lookahead(const basic_regex<_CharT, _Traits>& __exp, bool __invert, __node<_CharT>* __s, unsigned __mexp)
         : base(__s), __exp_(__exp), __mexp_(__mexp), __invert_(__invert) {}
 
@@ -3246,7 +3246,7 @@ basic_regex<_CharT, _Traits>::__parse_basic_reg_exp(_ForwardIterator __first,
             __first = __parse_RE_expression(__first, __last);
             if (__first != __last)
             {
-                _ForwardIterator __temp = _VSTD::next(__first);
+                _ForwardIterator __temp = _CUDA_VSTD::next(__first);
                 if (__temp == __last && *__first == '$')
                 {
                     __push_r_anchor();
@@ -3463,7 +3463,7 @@ basic_regex<_CharT, _Traits>::__parse_Back_open_paren(_ForwardIterator __first,
 {
     if (__first != __last)
     {
-        _ForwardIterator __temp = _VSTD::next(__first);
+        _ForwardIterator __temp = _CUDA_VSTD::next(__first);
         if (__temp != __last)
         {
             if (*__first == '\\' && *__temp == '(')
@@ -3481,7 +3481,7 @@ basic_regex<_CharT, _Traits>::__parse_Back_close_paren(_ForwardIterator __first,
 {
     if (__first != __last)
     {
-        _ForwardIterator __temp = _VSTD::next(__first);
+        _ForwardIterator __temp = _CUDA_VSTD::next(__first);
         if (__temp != __last)
         {
             if (*__first == '\\' && *__temp == ')')
@@ -3499,7 +3499,7 @@ basic_regex<_CharT, _Traits>::__parse_Back_open_brace(_ForwardIterator __first,
 {
     if (__first != __last)
     {
-        _ForwardIterator __temp = _VSTD::next(__first);
+        _ForwardIterator __temp = _CUDA_VSTD::next(__first);
         if (__temp != __last)
         {
             if (*__first == '\\' && *__temp == '{')
@@ -3517,7 +3517,7 @@ basic_regex<_CharT, _Traits>::__parse_Back_close_brace(_ForwardIterator __first,
 {
     if (__first != __last)
     {
-        _ForwardIterator __temp = _VSTD::next(__first);
+        _ForwardIterator __temp = _CUDA_VSTD::next(__first);
         if (__temp != __last)
         {
             if (*__first == '\\' && *__temp == '}')
@@ -3535,7 +3535,7 @@ basic_regex<_CharT, _Traits>::__parse_BACKREF(_ForwardIterator __first,
 {
     if (__first != __last)
     {
-        _ForwardIterator __temp = _VSTD::next(__first);
+        _ForwardIterator __temp = _CUDA_VSTD::next(__first);
         if (__temp != __last && *__first == '\\' && __test_back_ref(*__temp))
             __first = ++__temp;
     }
@@ -3550,7 +3550,7 @@ basic_regex<_CharT, _Traits>::__parse_ORD_CHAR(_ForwardIterator __first,
 {
     if (__first != __last)
     {
-        _ForwardIterator __temp = _VSTD::next(__first);
+        _ForwardIterator __temp = _CUDA_VSTD::next(__first);
         if (__temp == __last && *__first == '$')
             return __first;
         // Not called inside a bracket
@@ -3608,7 +3608,7 @@ basic_regex<_CharT, _Traits>::__parse_QUOTED_CHAR(_ForwardIterator __first,
 {
     if (__first != __last)
     {
-        _ForwardIterator __temp = _VSTD::next(__first);
+        _ForwardIterator __temp = _CUDA_VSTD::next(__first);
         if (__temp != __last)
         {
             if (*__first == '\\')
@@ -3639,7 +3639,7 @@ basic_regex<_CharT, _Traits>::__parse_QUOTED_CHAR_ERE(_ForwardIterator __first,
 {
     if (__first != __last)
     {
-        _ForwardIterator __temp = _VSTD::next(__first);
+        _ForwardIterator __temp = _CUDA_VSTD::next(__first);
         if (__temp != __last)
         {
             if (*__first == '\\')
@@ -3920,7 +3920,7 @@ basic_regex<_CharT, _Traits>::__parse_expression_term(_ForwardIterator __first,
 {
     if (__first != __last && *__first != ']')
     {
-        _ForwardIterator __temp = _VSTD::next(__first);
+        _ForwardIterator __temp = _CUDA_VSTD::next(__first);
         basic_string<_CharT> __start_range;
         if (__temp != __last && *__first == '[')
         {
@@ -3949,7 +3949,7 @@ basic_regex<_CharT, _Traits>::__parse_expression_term(_ForwardIterator __first,
         }
         if (__first != __last && *__first != ']')
         {
-            __temp = _VSTD::next(__first);
+            __temp = _CUDA_VSTD::next(__first);
             if (__temp != __last && *__first == '-' && *__temp != ']')
             {
                 // parse a range
@@ -3975,7 +3975,7 @@ basic_regex<_CharT, _Traits>::__parse_expression_term(_ForwardIterator __first,
                         ++__first;
                     }
                 }
-                __ml->__add_range(_VSTD::move(__start_range), _VSTD::move(__end_range));
+                __ml->__add_range(_CUDA_VSTD::move(__start_range), _CUDA_VSTD::move(__end_range));
             }
             else if (!__start_range.empty())
             {
@@ -4130,7 +4130,7 @@ basic_regex<_CharT, _Traits>::__parse_equivalence_class(_ForwardIterator __first
     // Found [=
     //   This means =] must exist
     value_type _Equal_close[2] = {'=', ']'};
-    _ForwardIterator __temp = _VSTD::search(__first, __last, _Equal_close,
+    _ForwardIterator __temp = _CUDA_VSTD::search(__first, __last, _Equal_close,
                                                             _Equal_close+2);
     if (__temp == __last)
         __throw_regex_error<regex_constants::error_brack>();
@@ -4158,7 +4158,7 @@ basic_regex<_CharT, _Traits>::__parse_equivalence_class(_ForwardIterator __first
             __throw_regex_error<regex_constants::error_collate>();
         }
     }
-    __first = _VSTD::next(__temp, 2);
+    __first = _CUDA_VSTD::next(__temp, 2);
     return __first;
 }
 
@@ -4172,7 +4172,7 @@ basic_regex<_CharT, _Traits>::__parse_character_class(_ForwardIterator __first,
     // Found [:
     //   This means :] must exist
     value_type _Colon_close[2] = {':', ']'};
-    _ForwardIterator __temp = _VSTD::search(__first, __last, _Colon_close,
+    _ForwardIterator __temp = _CUDA_VSTD::search(__first, __last, _Colon_close,
                                                             _Colon_close+2);
     if (__temp == __last)
         __throw_regex_error<regex_constants::error_brack>();
@@ -4183,7 +4183,7 @@ basic_regex<_CharT, _Traits>::__parse_character_class(_ForwardIterator __first,
     if (__class_type == 0)
         __throw_regex_error<regex_constants::error_ctype>();
     __ml->__add_class(__class_type);
-    __first = _VSTD::next(__temp, 2);
+    __first = _CUDA_VSTD::next(__temp, 2);
     return __first;
 }
 
@@ -4197,7 +4197,7 @@ basic_regex<_CharT, _Traits>::__parse_collating_symbol(_ForwardIterator __first,
     // Found [.
     //   This means .] must exist
     value_type _Dot_close[2] = {'.', ']'};
-    _ForwardIterator __temp = _VSTD::search(__first, __last, _Dot_close,
+    _ForwardIterator __temp = _CUDA_VSTD::search(__first, __last, _Dot_close,
                                                             _Dot_close+2);
     if (__temp == __last)
         __throw_regex_error<regex_constants::error_brack>();
@@ -4211,7 +4211,7 @@ basic_regex<_CharT, _Traits>::__parse_collating_symbol(_ForwardIterator __first,
     default:
         __throw_regex_error<regex_constants::error_collate>();
     }
-    __first = _VSTD::next(__temp, 2);
+    __first = _CUDA_VSTD::next(__temp, 2);
     return __first;
 }
 
@@ -4322,7 +4322,7 @@ basic_regex<_CharT, _Traits>::__parse_assertion(_ForwardIterator __first,
             break;
         case '\\':
             {
-                _ForwardIterator __temp = _VSTD::next(__first);
+                _ForwardIterator __temp = _CUDA_VSTD::next(__first);
                 if (__temp != __last)
                 {
                     if (*__temp == 'b')
@@ -4340,7 +4340,7 @@ basic_regex<_CharT, _Traits>::__parse_assertion(_ForwardIterator __first,
             break;
         case '(':
             {
-                _ForwardIterator __temp = _VSTD::next(__first);
+                _ForwardIterator __temp = _CUDA_VSTD::next(__first);
                 if (__temp != __last && *__temp == '?')
                 {
                     if (++__temp != __last)
@@ -4353,7 +4353,7 @@ basic_regex<_CharT, _Traits>::__parse_assertion(_ForwardIterator __first,
                                 __exp.__flags_ = __flags_;
                                 __temp = __exp.__parse(++__temp, __last);
                                 unsigned __mexp = __exp.__marked_count_;
-                                __push_lookahead(_VSTD::move(__exp), false, __marked_count_);
+                                __push_lookahead(_CUDA_VSTD::move(__exp), false, __marked_count_);
                                 __marked_count_ += __mexp;
                                 if (__temp == __last || *__temp != ')')
                                     __throw_regex_error<regex_constants::error_paren>();
@@ -4366,7 +4366,7 @@ basic_regex<_CharT, _Traits>::__parse_assertion(_ForwardIterator __first,
                                 __exp.__flags_ = __flags_;
                                 __temp = __exp.__parse(++__temp, __last);
                                 unsigned __mexp = __exp.__marked_count_;
-                                __push_lookahead(_VSTD::move(__exp), true, __marked_count_);
+                                __push_lookahead(_CUDA_VSTD::move(__exp), true, __marked_count_);
                                 __marked_count_ += __mexp;
                                 if (__temp == __last || *__temp != ')')
                                     __throw_regex_error<regex_constants::error_paren>();
@@ -4408,7 +4408,7 @@ basic_regex<_CharT, _Traits>::__parse_atom(_ForwardIterator __first,
                 ++__first;
                 if (__first == __last)
                     __throw_regex_error<regex_constants::error_paren>();
-                _ForwardIterator __temp = _VSTD::next(__first);
+                _ForwardIterator __temp = _CUDA_VSTD::next(__first);
                 if (__temp != __last && *__first == '?' && *__temp == ':')
                 {
                     ++__open_count_;
@@ -4454,7 +4454,7 @@ basic_regex<_CharT, _Traits>::__parse_atom_escape(_ForwardIterator __first,
 {
     if (__first != __last && *__first == '\\')
     {
-        _ForwardIterator __t1 = _VSTD::next(__first);
+        _ForwardIterator __t1 = _CUDA_VSTD::next(__first);
         if (__t1 == __last)
             __throw_regex_error<regex_constants::error_escape>();
 
@@ -4606,7 +4606,7 @@ basic_regex<_CharT, _Traits>::__parse_character_escape(_ForwardIterator __first,
             ++__first;
             break;
         case 'c':
-            if ((__t = _VSTD::next(__first)) != __last)
+            if ((__t = _CUDA_VSTD::next(__first)) != __last)
             {
                 if (('A' <= *__t && *__t <= 'Z') ||
                     ('a' <= *__t && *__t <= 'z'))
@@ -4725,7 +4725,7 @@ basic_regex<_CharT, _Traits>::__parse_grep(_ForwardIterator __first,
                                            _ForwardIterator __last)
 {
     __owns_one_state<_CharT>* __sa = __end_;
-    _ForwardIterator __t1 = _VSTD::find(__first, __last, _CharT('\n'));
+    _ForwardIterator __t1 = _CUDA_VSTD::find(__first, __last, _CharT('\n'));
     if (__t1 != __first)
         __parse_basic_reg_exp(__first, __t1);
     else
@@ -4735,7 +4735,7 @@ basic_regex<_CharT, _Traits>::__parse_grep(_ForwardIterator __first,
         ++__first;
     while (__first != __last)
     {
-        __t1 = _VSTD::find(__first, __last, _CharT('\n'));
+        __t1 = _CUDA_VSTD::find(__first, __last, _CharT('\n'));
         __owns_one_state<_CharT>* __sb = __end_;
         if (__t1 != __first)
             __parse_basic_reg_exp(__first, __t1);
@@ -4756,7 +4756,7 @@ basic_regex<_CharT, _Traits>::__parse_egrep(_ForwardIterator __first,
                                             _ForwardIterator __last)
 {
     __owns_one_state<_CharT>* __sa = __end_;
-    _ForwardIterator __t1 = _VSTD::find(__first, __last, _CharT('\n'));
+    _ForwardIterator __t1 = _CUDA_VSTD::find(__first, __last, _CharT('\n'));
     if (__t1 != __first)
         __parse_extended_reg_exp(__first, __t1);
     else
@@ -4766,7 +4766,7 @@ basic_regex<_CharT, _Traits>::__parse_egrep(_ForwardIterator __first,
         ++__first;
     while (__first != __last)
     {
-        __t1 = _VSTD::find(__first, __last, _CharT('\n'));
+        __t1 = _CUDA_VSTD::find(__first, __last, _CharT('\n'));
         __owns_one_state<_CharT>* __sb = __end_;
         if (__t1 != __first)
             __parse_extended_reg_exp(__first, __t1);
@@ -4962,18 +4962,18 @@ basic_regex<_CharT, _Traits>::__push_lookahead(const basic_regex& __exp,
 
 typedef sub_match<const char*>             csub_match;
 typedef sub_match<string::const_iterator>  ssub_match;
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 typedef sub_match<const wchar_t*>          wcsub_match;
 typedef sub_match<wstring::const_iterator> wssub_match;
 #endif
 
 template <class _BidirectionalIterator>
 class
-    _LIBCPP_TEMPLATE_VIS
-    _LIBCPP_PREFERRED_NAME(csub_match)
-    _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wcsub_match))
-    _LIBCPP_PREFERRED_NAME(ssub_match)
-    _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wssub_match))
+    _LIBCUDACXX_TEMPLATE_VIS
+    _LIBCUDACXX_PREFERRED_NAME(csub_match)
+    _LIBCUDACXX_IF_WIDE_CHARACTERS(_LIBCUDACXX_PREFERRED_NAME(wcsub_match))
+    _LIBCUDACXX_PREFERRED_NAME(ssub_match)
+    _LIBCUDACXX_IF_WIDE_CHARACTERS(_LIBCUDACXX_PREFERRED_NAME(wssub_match))
     sub_match
     : public pair<_BidirectionalIterator, _BidirectionalIterator>
 {
@@ -4985,32 +4985,32 @@ public:
 
     bool matched;
 
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR sub_match() : matched() {}
+    _LIBCUDACXX_INLINE_VISIBILITY
+    _LIBCUDACXX_CONSTEXPR sub_match() : matched() {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     
diff erence_type length() const
-        {return matched ? _VSTD::distance(this->first, this->second) : 0;}
-    _LIBCPP_INLINE_VISIBILITY
+        {return matched ? _CUDA_VSTD::distance(this->first, this->second) : 0;}
+    _LIBCUDACXX_INLINE_VISIBILITY
     string_type str() const
         {return matched ? string_type(this->first, this->second) : string_type();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     operator string_type() const
         {return str();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     int compare(const sub_match& __s) const
         {return str().compare(__s.str());}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     int compare(const string_type& __s) const
         {return str().compare(__s);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     int compare(const value_type* __s) const
         {return str().compare(__s);}
 };
 
 template <class _BiIter>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator==(const sub_match<_BiIter>& __x, const sub_match<_BiIter>& __y)
 {
@@ -5018,7 +5018,7 @@ operator==(const sub_match<_BiIter>& __x, const sub_match<_BiIter>& __y)
 }
 
 template <class _BiIter>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator!=(const sub_match<_BiIter>& __x, const sub_match<_BiIter>& __y)
 {
@@ -5026,7 +5026,7 @@ operator!=(const sub_match<_BiIter>& __x, const sub_match<_BiIter>& __y)
 }
 
 template <class _BiIter>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator<(const sub_match<_BiIter>& __x, const sub_match<_BiIter>& __y)
 {
@@ -5034,7 +5034,7 @@ operator<(const sub_match<_BiIter>& __x, const sub_match<_BiIter>& __y)
 }
 
 template <class _BiIter>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator<=(const sub_match<_BiIter>& __x, const sub_match<_BiIter>& __y)
 {
@@ -5042,7 +5042,7 @@ operator<=(const sub_match<_BiIter>& __x, const sub_match<_BiIter>& __y)
 }
 
 template <class _BiIter>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator>=(const sub_match<_BiIter>& __x, const sub_match<_BiIter>& __y)
 {
@@ -5050,7 +5050,7 @@ operator>=(const sub_match<_BiIter>& __x, const sub_match<_BiIter>& __y)
 }
 
 template <class _BiIter>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator>(const sub_match<_BiIter>& __x, const sub_match<_BiIter>& __y)
 {
@@ -5058,7 +5058,7 @@ operator>(const sub_match<_BiIter>& __x, const sub_match<_BiIter>& __y)
 }
 
 template <class _BiIter, class _ST, class _SA>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator==(const basic_string<typename iterator_traits<_BiIter>::value_type, _ST, _SA>& __x,
            const sub_match<_BiIter>& __y)
@@ -5067,7 +5067,7 @@ operator==(const basic_string<typename iterator_traits<_BiIter>::value_type, _ST
 }
 
 template <class _BiIter, class _ST, class _SA>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator!=(const basic_string<typename iterator_traits<_BiIter>::value_type, _ST, _SA>& __x,
            const sub_match<_BiIter>& __y)
@@ -5076,7 +5076,7 @@ operator!=(const basic_string<typename iterator_traits<_BiIter>::value_type, _ST
 }
 
 template <class _BiIter, class _ST, class _SA>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator<(const basic_string<typename iterator_traits<_BiIter>::value_type, _ST, _SA>& __x,
           const sub_match<_BiIter>& __y)
@@ -5085,7 +5085,7 @@ operator<(const basic_string<typename iterator_traits<_BiIter>::value_type, _ST,
 }
 
 template <class _BiIter, class _ST, class _SA>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator>(const basic_string<typename iterator_traits<_BiIter>::value_type, _ST, _SA>& __x,
           const sub_match<_BiIter>& __y)
@@ -5094,7 +5094,7 @@ operator>(const basic_string<typename iterator_traits<_BiIter>::value_type, _ST,
 }
 
 template <class _BiIter, class _ST, class _SA>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool operator>=(const basic_string<typename iterator_traits<_BiIter>::value_type, _ST, _SA>& __x,
                 const sub_match<_BiIter>& __y)
 {
@@ -5102,7 +5102,7 @@ bool operator>=(const basic_string<typename iterator_traits<_BiIter>::value_type
 }
 
 template <class _BiIter, class _ST, class _SA>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator<=(const basic_string<typename iterator_traits<_BiIter>::value_type, _ST, _SA>& __x,
            const sub_match<_BiIter>& __y)
@@ -5111,7 +5111,7 @@ operator<=(const basic_string<typename iterator_traits<_BiIter>::value_type, _ST
 }
 
 template <class _BiIter, class _ST, class _SA>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator==(const sub_match<_BiIter>& __x,
            const basic_string<typename iterator_traits<_BiIter>::value_type, _ST, _SA>& __y)
@@ -5120,7 +5120,7 @@ operator==(const sub_match<_BiIter>& __x,
 }
 
 template <class _BiIter, class _ST, class _SA>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator!=(const sub_match<_BiIter>& __x,
            const basic_string<typename iterator_traits<_BiIter>::value_type, _ST, _SA>& __y)
@@ -5129,7 +5129,7 @@ operator!=(const sub_match<_BiIter>& __x,
 }
 
 template <class _BiIter, class _ST, class _SA>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator<(const sub_match<_BiIter>& __x,
           const basic_string<typename iterator_traits<_BiIter>::value_type, _ST, _SA>& __y)
@@ -5138,7 +5138,7 @@ operator<(const sub_match<_BiIter>& __x,
 }
 
 template <class _BiIter, class _ST, class _SA>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool operator>(const sub_match<_BiIter>& __x,
                const basic_string<typename iterator_traits<_BiIter>::value_type, _ST, _SA>& __y)
 {
@@ -5146,7 +5146,7 @@ bool operator>(const sub_match<_BiIter>& __x,
 }
 
 template <class _BiIter, class _ST, class _SA>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator>=(const sub_match<_BiIter>& __x,
            const basic_string<typename iterator_traits<_BiIter>::value_type, _ST, _SA>& __y)
@@ -5155,7 +5155,7 @@ operator>=(const sub_match<_BiIter>& __x,
 }
 
 template <class _BiIter, class _ST, class _SA>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator<=(const sub_match<_BiIter>& __x,
            const basic_string<typename iterator_traits<_BiIter>::value_type, _ST, _SA>& __y)
@@ -5164,7 +5164,7 @@ operator<=(const sub_match<_BiIter>& __x,
 }
 
 template <class _BiIter>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator==(typename iterator_traits<_BiIter>::value_type const* __x,
            const sub_match<_BiIter>& __y)
@@ -5173,7 +5173,7 @@ operator==(typename iterator_traits<_BiIter>::value_type const* __x,
 }
 
 template <class _BiIter>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator!=(typename iterator_traits<_BiIter>::value_type const* __x,
            const sub_match<_BiIter>& __y)
@@ -5182,7 +5182,7 @@ operator!=(typename iterator_traits<_BiIter>::value_type const* __x,
 }
 
 template <class _BiIter>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator<(typename iterator_traits<_BiIter>::value_type const* __x,
           const sub_match<_BiIter>& __y)
@@ -5191,7 +5191,7 @@ operator<(typename iterator_traits<_BiIter>::value_type const* __x,
 }
 
 template <class _BiIter>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator>(typename iterator_traits<_BiIter>::value_type const* __x,
           const sub_match<_BiIter>& __y)
@@ -5200,7 +5200,7 @@ operator>(typename iterator_traits<_BiIter>::value_type const* __x,
 }
 
 template <class _BiIter>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator>=(typename iterator_traits<_BiIter>::value_type const* __x,
            const sub_match<_BiIter>& __y)
@@ -5209,7 +5209,7 @@ operator>=(typename iterator_traits<_BiIter>::value_type const* __x,
 }
 
 template <class _BiIter>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator<=(typename iterator_traits<_BiIter>::value_type const* __x,
            const sub_match<_BiIter>& __y)
@@ -5218,7 +5218,7 @@ operator<=(typename iterator_traits<_BiIter>::value_type const* __x,
 }
 
 template <class _BiIter>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator==(const sub_match<_BiIter>& __x,
            typename iterator_traits<_BiIter>::value_type const* __y)
@@ -5227,7 +5227,7 @@ operator==(const sub_match<_BiIter>& __x,
 }
 
 template <class _BiIter>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator!=(const sub_match<_BiIter>& __x,
            typename iterator_traits<_BiIter>::value_type const* __y)
@@ -5236,7 +5236,7 @@ operator!=(const sub_match<_BiIter>& __x,
 }
 
 template <class _BiIter>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator<(const sub_match<_BiIter>& __x,
           typename iterator_traits<_BiIter>::value_type const* __y)
@@ -5245,7 +5245,7 @@ operator<(const sub_match<_BiIter>& __x,
 }
 
 template <class _BiIter>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator>(const sub_match<_BiIter>& __x,
           typename iterator_traits<_BiIter>::value_type const* __y)
@@ -5254,7 +5254,7 @@ operator>(const sub_match<_BiIter>& __x,
 }
 
 template <class _BiIter>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator>=(const sub_match<_BiIter>& __x,
            typename iterator_traits<_BiIter>::value_type const* __y)
@@ -5263,7 +5263,7 @@ operator>=(const sub_match<_BiIter>& __x,
 }
 
 template <class _BiIter>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator<=(const sub_match<_BiIter>& __x,
            typename iterator_traits<_BiIter>::value_type const* __y)
@@ -5272,7 +5272,7 @@ operator<=(const sub_match<_BiIter>& __x,
 }
 
 template <class _BiIter>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator==(typename iterator_traits<_BiIter>::value_type const& __x,
            const sub_match<_BiIter>& __y)
@@ -5282,7 +5282,7 @@ operator==(typename iterator_traits<_BiIter>::value_type const& __x,
 }
 
 template <class _BiIter>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator!=(typename iterator_traits<_BiIter>::value_type const& __x,
            const sub_match<_BiIter>& __y)
@@ -5291,7 +5291,7 @@ operator!=(typename iterator_traits<_BiIter>::value_type const& __x,
 }
 
 template <class _BiIter>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator<(typename iterator_traits<_BiIter>::value_type const& __x,
           const sub_match<_BiIter>& __y)
@@ -5301,7 +5301,7 @@ operator<(typename iterator_traits<_BiIter>::value_type const& __x,
 }
 
 template <class _BiIter>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator>(typename iterator_traits<_BiIter>::value_type const& __x,
           const sub_match<_BiIter>& __y)
@@ -5310,7 +5310,7 @@ operator>(typename iterator_traits<_BiIter>::value_type const& __x,
 }
 
 template <class _BiIter>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator>=(typename iterator_traits<_BiIter>::value_type const& __x,
            const sub_match<_BiIter>& __y)
@@ -5319,7 +5319,7 @@ operator>=(typename iterator_traits<_BiIter>::value_type const& __x,
 }
 
 template <class _BiIter>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator<=(typename iterator_traits<_BiIter>::value_type const& __x,
            const sub_match<_BiIter>& __y)
@@ -5328,7 +5328,7 @@ operator<=(typename iterator_traits<_BiIter>::value_type const& __x,
 }
 
 template <class _BiIter>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator==(const sub_match<_BiIter>& __x,
            typename iterator_traits<_BiIter>::value_type const& __y)
@@ -5338,7 +5338,7 @@ operator==(const sub_match<_BiIter>& __x,
 }
 
 template <class _BiIter>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator!=(const sub_match<_BiIter>& __x,
            typename iterator_traits<_BiIter>::value_type const& __y)
@@ -5347,7 +5347,7 @@ operator!=(const sub_match<_BiIter>& __x,
 }
 
 template <class _BiIter>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator<(const sub_match<_BiIter>& __x,
           typename iterator_traits<_BiIter>::value_type const& __y)
@@ -5357,7 +5357,7 @@ operator<(const sub_match<_BiIter>& __x,
 }
 
 template <class _BiIter>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator>(const sub_match<_BiIter>& __x,
           typename iterator_traits<_BiIter>::value_type const& __y)
@@ -5366,7 +5366,7 @@ operator>(const sub_match<_BiIter>& __x,
 }
 
 template <class _BiIter>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator>=(const sub_match<_BiIter>& __x,
            typename iterator_traits<_BiIter>::value_type const& __y)
@@ -5375,7 +5375,7 @@ operator>=(const sub_match<_BiIter>& __x,
 }
 
 template <class _BiIter>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator<=(const sub_match<_BiIter>& __x,
            typename iterator_traits<_BiIter>::value_type const& __y)
@@ -5384,7 +5384,7 @@ operator<=(const sub_match<_BiIter>& __x,
 }
 
 template <class _CharT, class _ST, class _BiIter>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 basic_ostream<_CharT, _ST>&
 operator<<(basic_ostream<_CharT, _ST>& __os, const sub_match<_BiIter>& __m)
 {
@@ -5393,18 +5393,18 @@ operator<<(basic_ostream<_CharT, _ST>& __os, const sub_match<_BiIter>& __m)
 
 typedef match_results<const char*>             cmatch;
 typedef match_results<string::const_iterator>  smatch;
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 typedef match_results<const wchar_t*>          wcmatch;
 typedef match_results<wstring::const_iterator> wsmatch;
 #endif
 
 template <class _BidirectionalIterator, class _Allocator>
 class
-    _LIBCPP_TEMPLATE_VIS
-    _LIBCPP_PREFERRED_NAME(cmatch)
-    _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wcmatch))
-    _LIBCPP_PREFERRED_NAME(smatch)
-    _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wsmatch))
+    _LIBCUDACXX_TEMPLATE_VIS
+    _LIBCUDACXX_PREFERRED_NAME(cmatch)
+    _LIBCUDACXX_IF_WIDE_CHARACTERS(_LIBCUDACXX_PREFERRED_NAME(wcmatch))
+    _LIBCUDACXX_PREFERRED_NAME(smatch)
+    _LIBCUDACXX_IF_WIDE_CHARACTERS(_LIBCUDACXX_PREFERRED_NAME(wsmatch))
     match_results
 {
 public:
@@ -5430,7 +5430,7 @@ public:
     typedef basic_string<char_type>                           string_type;
 
     // construct/copy/destroy:
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
     match_results() : match_results(allocator_type()) {}
     explicit match_results(const allocator_type& __a);
 #else
@@ -5443,63 +5443,63 @@ public:
 //    match_results& operator=(match_results&& __m) = default;
 //    ~match_results() = default;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool ready() const {return __ready_;}
 
     // size:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type size() const _NOEXCEPT {return __matches_.size();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type max_size() const _NOEXCEPT {return __matches_.max_size();}
-    _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_NODISCARD_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY
     bool empty() const _NOEXCEPT {return size() == 0;}
 
     // element access:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     
diff erence_type length(size_type __sub = 0) const
         {
-        _LIBCPP_ASSERT(ready(), "match_results::length() called when not ready");
+        _LIBCUDACXX_ASSERT(ready(), "match_results::length() called when not ready");
         return (*this)[__sub].length();
         }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     
diff erence_type position(size_type __sub = 0) const
         {
-        _LIBCPP_ASSERT(ready(), "match_results::position() called when not ready");
-        return _VSTD::distance(__position_start_, (*this)[__sub].first);
+        _LIBCUDACXX_ASSERT(ready(), "match_results::position() called when not ready");
+        return _CUDA_VSTD::distance(__position_start_, (*this)[__sub].first);
         }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     string_type str(size_type __sub = 0) const
         {
-        _LIBCPP_ASSERT(ready(), "match_results::str() called when not ready");
+        _LIBCUDACXX_ASSERT(ready(), "match_results::str() called when not ready");
         return (*this)[__sub].str();
         }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_reference operator[](size_type __n) const
         {
-        _LIBCPP_ASSERT(ready(), "match_results::operator[]() called when not ready");
+        _LIBCUDACXX_ASSERT(ready(), "match_results::operator[]() called when not ready");
         return __n < __matches_.size() ? __matches_[__n] : __unmatched_;
         }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_reference prefix() const
         {
-        _LIBCPP_ASSERT(ready(), "match_results::prefix() called when not ready");
+        _LIBCUDACXX_ASSERT(ready(), "match_results::prefix() called when not ready");
         return __prefix_;
         }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_reference suffix() const
         {
-        _LIBCPP_ASSERT(ready(), "match_results::suffix() called when not ready");
+        _LIBCUDACXX_ASSERT(ready(), "match_results::suffix() called when not ready");
         return __suffix_;
         }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator begin() const {return empty() ? __matches_.end() : __matches_.begin();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator end() const {return __matches_.end();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator cbegin() const {return empty() ? __matches_.end() : __matches_.begin();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator cend() const {return __matches_.end();}
 
     // format:
@@ -5509,13 +5509,13 @@ public:
                const char_type* __fmt_last,
                regex_constants::match_flag_type __flags = regex_constants::format_default) const;
     template <class _OutputIter, class _ST, class _SA>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         _OutputIter
         format(_OutputIter __output_iter, const basic_string<char_type, _ST, _SA>& __fmt,
                regex_constants::match_flag_type __flags = regex_constants::format_default) const
             {return format(__output_iter, __fmt.data(), __fmt.data() + __fmt.size(), __flags);}
     template <class _ST, class _SA>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         basic_string<char_type, _ST, _SA>
         format(const basic_string<char_type, _ST, _SA>& __fmt,
                regex_constants::match_flag_type __flags = regex_constants::format_default) const
@@ -5525,7 +5525,7 @@ public:
                    __flags);
             return __r;
         }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     string_type
         format(const char_type* __fmt,
                regex_constants::match_flag_type __flags = regex_constants::format_default) const
@@ -5537,14 +5537,14 @@ public:
         }
 
     // allocator:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     allocator_type get_allocator() const {return __matches_.get_allocator();}
 
     // swap:
     void swap(match_results& __m);
 
     template <class _Bp, class _Ap>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         void __assign(_BidirectionalIterator __f, _BidirectionalIterator __l,
                       const match_results<_Bp, _Ap>& __m, bool __no_update_pos)
     {
@@ -5552,18 +5552,18 @@ public:
         __matches_.resize(__m.size());
         for (size_type __i = 0; __i < __matches_.size(); ++__i)
         {
-            __matches_[__i].first = _VSTD::next(__f, _VSTD::distance(__mf, __m[__i].first));
-            __matches_[__i].second = _VSTD::next(__f, _VSTD::distance(__mf, __m[__i].second));
+            __matches_[__i].first = _CUDA_VSTD::next(__f, _CUDA_VSTD::distance(__mf, __m[__i].first));
+            __matches_[__i].second = _CUDA_VSTD::next(__f, _CUDA_VSTD::distance(__mf, __m[__i].second));
             __matches_[__i].matched = __m[__i].matched;
         }
         __unmatched_.first   = __l;
         __unmatched_.second  = __l;
         __unmatched_.matched = false;
-        __prefix_.first = _VSTD::next(__f, _VSTD::distance(__mf, __m.prefix().first));
-        __prefix_.second = _VSTD::next(__f, _VSTD::distance(__mf, __m.prefix().second));
+        __prefix_.first = _CUDA_VSTD::next(__f, _CUDA_VSTD::distance(__mf, __m.prefix().first));
+        __prefix_.second = _CUDA_VSTD::next(__f, _CUDA_VSTD::distance(__mf, __m.prefix().second));
         __prefix_.matched = __m.prefix().matched;
-        __suffix_.first = _VSTD::next(__f, _VSTD::distance(__mf, __m.suffix().first));
-        __suffix_.second = _VSTD::next(__f, _VSTD::distance(__mf, __m.suffix().second));
+        __suffix_.first = _CUDA_VSTD::next(__f, _CUDA_VSTD::distance(__mf, __m.suffix().first));
+        __suffix_.second = _CUDA_VSTD::next(__f, _CUDA_VSTD::distance(__mf, __m.suffix().second));
         __suffix_.matched = __m.suffix().matched;
         if (!__no_update_pos)
             __position_start_ = __prefix_.first;
@@ -5629,13 +5629,13 @@ match_results<_BidirectionalIterator, _Allocator>::format(_OutputIter __output_i
         const char_type* __fmt_first, const char_type* __fmt_last,
         regex_constants::match_flag_type __flags) const
 {
-    _LIBCPP_ASSERT(ready(), "match_results::format() called when not ready");
+    _LIBCUDACXX_ASSERT(ready(), "match_results::format() called when not ready");
     if (__flags & regex_constants::format_sed)
     {
         for (; __fmt_first != __fmt_last; ++__fmt_first)
         {
             if (*__fmt_first == '&')
-                __output_iter = _VSTD::copy(__matches_[0].first, __matches_[0].second,
+                __output_iter = _CUDA_VSTD::copy(__matches_[0].first, __matches_[0].second,
                                    __output_iter);
             else if (*__fmt_first == '\\' && __fmt_first + 1 != __fmt_last)
             {
@@ -5643,7 +5643,7 @@ match_results<_BidirectionalIterator, _Allocator>::format(_OutputIter __output_i
                 if ('0' <= *__fmt_first && *__fmt_first <= '9')
                 {
                     size_t __i = *__fmt_first - '0';
-                    __output_iter = _VSTD::copy((*this)[__i].first,
+                    __output_iter = _CUDA_VSTD::copy((*this)[__i].first,
                                         (*this)[__i].second, __output_iter);
                 }
                 else
@@ -5673,16 +5673,16 @@ match_results<_BidirectionalIterator, _Allocator>::format(_OutputIter __output_i
                     break;
                 case '&':
                     ++__fmt_first;
-                    __output_iter = _VSTD::copy(__matches_[0].first, __matches_[0].second,
+                    __output_iter = _CUDA_VSTD::copy(__matches_[0].first, __matches_[0].second,
                                        __output_iter);
                     break;
                 case '`':
                     ++__fmt_first;
-                    __output_iter = _VSTD::copy(__prefix_.first, __prefix_.second, __output_iter);
+                    __output_iter = _CUDA_VSTD::copy(__prefix_.first, __prefix_.second, __output_iter);
                     break;
                 case '\'':
                     ++__fmt_first;
-                    __output_iter = _VSTD::copy(__suffix_.first, __suffix_.second, __output_iter);
+                    __output_iter = _CUDA_VSTD::copy(__suffix_.first, __suffix_.second, __output_iter);
                     break;
                 default:
                     if ('0' <= __fmt_first[1] && __fmt_first[1] <= '9')
@@ -5697,7 +5697,7 @@ match_results<_BidirectionalIterator, _Allocator>::format(_OutputIter __output_i
                                 __throw_regex_error<regex_constants::error_escape>();
                             __idx = 10 * __idx + *__fmt_first - '0';
                         }
-                        __output_iter = _VSTD::copy((*this)[__idx].first,
+                        __output_iter = _CUDA_VSTD::copy((*this)[__idx].first,
                                             (*this)[__idx].second, __output_iter);
                     }
                     else
@@ -5722,7 +5722,7 @@ template <class _BidirectionalIterator, class _Allocator>
 void
 match_results<_BidirectionalIterator, _Allocator>::swap(match_results& __m)
 {
-    using _VSTD::swap;
+    using _CUDA_VSTD::swap;
     swap(__matches_, __m.__matches_);
     swap(__unmatched_, __m.__unmatched_);
     swap(__prefix_, __m.__prefix_);
@@ -5746,7 +5746,7 @@ operator==(const match_results<_BidirectionalIterator, _Allocator>& __x,
 }
 
 template <class _BidirectionalIterator, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator!=(const match_results<_BidirectionalIterator, _Allocator>& __x,
            const match_results<_BidirectionalIterator, _Allocator>& __y)
@@ -5755,7 +5755,7 @@ operator!=(const match_results<_BidirectionalIterator, _Allocator>& __x,
 }
 
 template <class _BidirectionalIterator, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 swap(match_results<_BidirectionalIterator, _Allocator>& __x,
      match_results<_BidirectionalIterator, _Allocator>& __y)
@@ -5797,8 +5797,8 @@ basic_regex<_CharT, _Traits>::__match_at_start_ecma(
         do
         {
             ++__counter;
-            if (__counter % _LIBCPP_REGEX_COMPLEXITY_FACTOR == 0 &&
-                __counter / _LIBCPP_REGEX_COMPLEXITY_FACTOR >= __length)
+            if (__counter % _LIBCUDACXX_REGEX_COMPLEXITY_FACTOR == 0 &&
+                __counter / _LIBCUDACXX_REGEX_COMPLEXITY_FACTOR >= __length)
               __throw_regex_error<regex_constants::error_complexity>();
             __state& __s = __states.back();
             if (__s.__node_)
@@ -5819,7 +5819,7 @@ basic_regex<_CharT, _Traits>::__match_at_start_ecma(
                   break;
                 }
                 __m.__matches_[0].first = __first;
-                __m.__matches_[0].second = _VSTD::next(__first, __s.__current_ - __first);
+                __m.__matches_[0].second = _CUDA_VSTD::next(__first, __s.__current_ - __first);
                 __m.__matches_[0].matched = true;
                 for (unsigned __i = 0; __i < __s.__sub_matches_.size(); ++__i)
                     __m.__matches_[__i+1] = __s.__sub_matches_[__i];
@@ -5833,7 +5833,7 @@ basic_regex<_CharT, _Traits>::__match_at_start_ecma(
                 __state __snext = __s;
                 __s.__node_->__exec_split(true, __s);
                 __snext.__node_->__exec_split(false, __snext);
-                __states.push_back(_VSTD::move(__snext));
+                __states.push_back(_CUDA_VSTD::move(__snext));
                 }
                 break;
             case __state::__reject:
@@ -5859,7 +5859,7 @@ basic_regex<_CharT, _Traits>::__match_at_start_posix_nosubs(
 {
     deque<__state> __states;
     ptr
diff _t __highest_j = 0;
-    ptr
diff _t _Np = _VSTD::distance(__first, __last);
+    ptr
diff _t _Np = _CUDA_VSTD::distance(__first, __last);
     __node* __st = __start_.get();
     if (__st)
     {
@@ -5878,8 +5878,8 @@ basic_regex<_CharT, _Traits>::__match_at_start_posix_nosubs(
         do
         {
             ++__counter;
-            if (__counter % _LIBCPP_REGEX_COMPLEXITY_FACTOR == 0 &&
-                __counter / _LIBCPP_REGEX_COMPLEXITY_FACTOR >= __length)
+            if (__counter % _LIBCUDACXX_REGEX_COMPLEXITY_FACTOR == 0 &&
+                __counter / _LIBCUDACXX_REGEX_COMPLEXITY_FACTOR >= __length)
               __throw_regex_error<regex_constants::error_complexity>();
             __state& __s = __states.back();
             if (__s.__node_)
@@ -5910,7 +5910,7 @@ basic_regex<_CharT, _Traits>::__match_at_start_posix_nosubs(
             case __state::__consume_input:
                 break;
             case __state::__accept_and_consume:
-                __states.push_front(_VSTD::move(__s));
+                __states.push_front(_CUDA_VSTD::move(__s));
                 __states.pop_back();
                 break;
             case __state::__repeat:
@@ -5921,7 +5921,7 @@ basic_regex<_CharT, _Traits>::__match_at_start_posix_nosubs(
                 __state __snext = __s;
                 __s.__node_->__exec_split(true, __s);
                 __snext.__node_->__exec_split(false, __snext);
-                __states.push_back(_VSTD::move(__snext));
+                __states.push_back(_CUDA_VSTD::move(__snext));
                 }
                 break;
             case __state::__reject:
@@ -5935,7 +5935,7 @@ basic_regex<_CharT, _Traits>::__match_at_start_posix_nosubs(
         if (__matched)
         {
             __m.__matches_[0].first = __first;
-            __m.__matches_[0].second = _VSTD::next(__first, __highest_j);
+            __m.__matches_[0].second = _CUDA_VSTD::next(__first, __highest_j);
             __m.__matches_[0].matched = true;
             return true;
         }
@@ -5954,7 +5954,7 @@ basic_regex<_CharT, _Traits>::__match_at_start_posix_subs(
     vector<__state> __states;
     __state __best_state;
     ptr
diff _t __highest_j = 0;
-    ptr
diff _t _Np = _VSTD::distance(__first, __last);
+    ptr
diff _t _Np = _CUDA_VSTD::distance(__first, __last);
     __node* __st = __start_.get();
     if (__st)
     {
@@ -5979,8 +5979,8 @@ basic_regex<_CharT, _Traits>::__match_at_start_posix_subs(
         do
         {
             ++__counter;
-            if (__counter % _LIBCPP_REGEX_COMPLEXITY_FACTOR == 0 &&
-                __counter / _LIBCPP_REGEX_COMPLEXITY_FACTOR >= __length)
+            if (__counter % _LIBCUDACXX_REGEX_COMPLEXITY_FACTOR == 0 &&
+                __counter / _LIBCUDACXX_REGEX_COMPLEXITY_FACTOR >= __length)
               __throw_regex_error<regex_constants::error_complexity>();
             __state& __s = __states.back();
             if (__s.__node_)
@@ -6020,7 +6020,7 @@ basic_regex<_CharT, _Traits>::__match_at_start_posix_subs(
                 __state __snext = __s;
                 __s.__node_->__exec_split(true, __s);
                 __snext.__node_->__exec_split(false, __snext);
-                __states.push_back(_VSTD::move(__snext));
+                __states.push_back(_CUDA_VSTD::move(__snext));
                 }
                 break;
             case __state::__reject:
@@ -6034,7 +6034,7 @@ basic_regex<_CharT, _Traits>::__match_at_start_posix_subs(
         if (__matched)
         {
             __m.__matches_[0].first = __first;
-            __m.__matches_[0].second = _VSTD::next(__first, __highest_j);
+            __m.__matches_[0].second = _CUDA_VSTD::next(__first, __highest_j);
             __m.__matches_[0].matched = true;
             for (unsigned __i = 0; __i < __best_state.__sub_matches_.size(); ++__i)
                 __m.__matches_[__i+1] = __best_state.__sub_matches_[__i];
@@ -6103,7 +6103,7 @@ basic_regex<_CharT, _Traits>::__search(
 }
 
 template <class _BidirectionalIterator, class _Allocator, class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 regex_search(_BidirectionalIterator __first, _BidirectionalIterator __last,
              match_results<_BidirectionalIterator, _Allocator>& __m,
@@ -6111,7 +6111,7 @@ regex_search(_BidirectionalIterator __first, _BidirectionalIterator __last,
              regex_constants::match_flag_type __flags = regex_constants::match_default)
 {
     int __offset = (__flags & regex_constants::match_prev_avail) ? 1 : 0;
-    basic_string<_CharT> __s(_VSTD::prev(__first, __offset), __last);
+    basic_string<_CharT> __s(_CUDA_VSTD::prev(__first, __offset), __last);
     match_results<const _CharT*> __mc;
     bool __r = __e.__search(__s.data() + __offset, __s.data() + __s.size(), __mc, __flags);
     __m.__assign(__first, __last, __mc, __flags & regex_constants::__no_update_pos);
@@ -6119,7 +6119,7 @@ regex_search(_BidirectionalIterator __first, _BidirectionalIterator __last,
 }
 
 template <class _Iter, class _Allocator, class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 regex_search(__wrap_iter<_Iter> __first,
              __wrap_iter<_Iter> __last,
@@ -6134,7 +6134,7 @@ regex_search(__wrap_iter<_Iter> __first,
 }
 
 template <class _Allocator, class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 regex_search(const _CharT* __first, const _CharT* __last,
              match_results<const _CharT*, _Allocator>& __m,
@@ -6145,7 +6145,7 @@ regex_search(const _CharT* __first, const _CharT* __last,
 }
 
 template <class _BidirectionalIterator, class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 regex_search(_BidirectionalIterator __first, _BidirectionalIterator __last,
              const basic_regex<_CharT, _Traits>& __e,
@@ -6157,7 +6157,7 @@ regex_search(_BidirectionalIterator __first, _BidirectionalIterator __last,
 }
 
 template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 regex_search(const _CharT* __first, const _CharT* __last,
              const basic_regex<_CharT, _Traits>& __e,
@@ -6168,7 +6168,7 @@ regex_search(const _CharT* __first, const _CharT* __last,
 }
 
 template <class _CharT, class _Allocator, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 regex_search(const _CharT* __str, match_results<const _CharT*, _Allocator>& __m,
              const basic_regex<_CharT, _Traits>& __e,
@@ -6178,17 +6178,17 @@ regex_search(const _CharT* __str, match_results<const _CharT*, _Allocator>& __m,
 }
 
 template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 regex_search(const _CharT* __str, const basic_regex<_CharT, _Traits>& __e,
              regex_constants::match_flag_type __flags = regex_constants::match_default)
 {
     match_results<const _CharT*> __m;
-    return _VSTD::regex_search(__str, __m, __e, __flags);
+    return _CUDA_VSTD::regex_search(__str, __m, __e, __flags);
 }
 
 template <class _ST, class _SA, class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 regex_search(const basic_string<_CharT, _ST, _SA>& __s,
              const basic_regex<_CharT, _Traits>& __e,
@@ -6199,7 +6199,7 @@ regex_search(const basic_string<_CharT, _ST, _SA>& __s,
 }
 
 template <class _ST, class _SA, class _Allocator, class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 regex_search(const basic_string<_CharT, _ST, _SA>& __s,
              match_results<typename basic_string<_CharT, _ST, _SA>::const_iterator, _Allocator>& __m,
@@ -6212,7 +6212,7 @@ regex_search(const basic_string<_CharT, _ST, _SA>& __s,
     return __r;
 }
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <class _ST, class _SA, class _Ap, class _Cp, class _Tp>
 bool
 regex_search(const basic_string<_Cp, _ST, _SA>&& __s,
@@ -6230,7 +6230,7 @@ regex_match(_BidirectionalIterator __first, _BidirectionalIterator __last,
             const basic_regex<_CharT, _Traits>& __e,
             regex_constants::match_flag_type __flags = regex_constants::match_default)
 {
-    bool __r = _VSTD::regex_search(
+    bool __r = _CUDA_VSTD::regex_search(
         __first, __last, __m, __e,
         __flags | regex_constants::match_continuous |
         regex_constants::__full_match);
@@ -6244,40 +6244,40 @@ regex_match(_BidirectionalIterator __first, _BidirectionalIterator __last,
 }
 
 template <class _BidirectionalIterator, class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 regex_match(_BidirectionalIterator __first, _BidirectionalIterator __last,
             const basic_regex<_CharT, _Traits>& __e,
             regex_constants::match_flag_type __flags = regex_constants::match_default)
 {
     match_results<_BidirectionalIterator> __m;
-    return _VSTD::regex_match(__first, __last, __m, __e, __flags);
+    return _CUDA_VSTD::regex_match(__first, __last, __m, __e, __flags);
 }
 
 template <class _CharT, class _Allocator, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 regex_match(const _CharT* __str, match_results<const _CharT*, _Allocator>& __m,
             const basic_regex<_CharT, _Traits>& __e,
             regex_constants::match_flag_type __flags = regex_constants::match_default)
 {
-    return _VSTD::regex_match(__str, __str + _Traits::length(__str), __m, __e, __flags);
+    return _CUDA_VSTD::regex_match(__str, __str + _Traits::length(__str), __m, __e, __flags);
 }
 
 template <class _ST, class _SA, class _Allocator, class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 regex_match(const basic_string<_CharT, _ST, _SA>& __s,
             match_results<typename basic_string<_CharT, _ST, _SA>::const_iterator, _Allocator>& __m,
             const basic_regex<_CharT, _Traits>& __e,
             regex_constants::match_flag_type __flags = regex_constants::match_default)
 {
-    return _VSTD::regex_match(__s.begin(), __s.end(), __m, __e, __flags);
+    return _CUDA_VSTD::regex_match(__s.begin(), __s.end(), __m, __e, __flags);
 }
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
 template <class _ST, class _SA, class _Allocator, class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 regex_match(const basic_string<_CharT, _ST, _SA>&& __s,
             match_results<typename basic_string<_CharT, _ST, _SA>::const_iterator, _Allocator>& __m,
@@ -6286,22 +6286,22 @@ regex_match(const basic_string<_CharT, _ST, _SA>&& __s,
 #endif
 
 template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 regex_match(const _CharT* __str, const basic_regex<_CharT, _Traits>& __e,
             regex_constants::match_flag_type __flags = regex_constants::match_default)
 {
-    return _VSTD::regex_match(__str, __str + _Traits::length(__str), __e, __flags);
+    return _CUDA_VSTD::regex_match(__str, __str + _Traits::length(__str), __e, __flags);
 }
 
 template <class _ST, class _SA, class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 regex_match(const basic_string<_CharT, _ST, _SA>& __s,
             const basic_regex<_CharT, _Traits>& __e,
             regex_constants::match_flag_type __flags = regex_constants::match_default)
 {
-    return _VSTD::regex_match(__s.begin(), __s.end(), __e, __flags);
+    return _CUDA_VSTD::regex_match(__s.begin(), __s.end(), __e, __flags);
 }
 
 // regex_iterator
@@ -6309,22 +6309,22 @@ regex_match(const basic_string<_CharT, _ST, _SA>& __s,
 template <class _BidirectionalIterator,
           class _CharT = typename iterator_traits<_BidirectionalIterator>::value_type,
           class _Traits = regex_traits<_CharT> >
-    class _LIBCPP_TEMPLATE_VIS regex_iterator;
+    class _LIBCUDACXX_TEMPLATE_VIS regex_iterator;
 
 typedef regex_iterator<const char*>             cregex_iterator;
 typedef regex_iterator<string::const_iterator>  sregex_iterator;
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 typedef regex_iterator<const wchar_t*>          wcregex_iterator;
 typedef regex_iterator<wstring::const_iterator> wsregex_iterator;
 #endif
 
 template <class _BidirectionalIterator, class _CharT, class _Traits>
 class
-    _LIBCPP_TEMPLATE_VIS
-    _LIBCPP_PREFERRED_NAME(cregex_iterator)
-    _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wcregex_iterator))
-    _LIBCPP_PREFERRED_NAME(sregex_iterator)
-    _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wsregex_iterator))
+    _LIBCUDACXX_TEMPLATE_VIS
+    _LIBCUDACXX_PREFERRED_NAME(cregex_iterator)
+    _LIBCUDACXX_IF_WIDE_CHARACTERS(_LIBCUDACXX_PREFERRED_NAME(wcregex_iterator))
+    _LIBCUDACXX_PREFERRED_NAME(sregex_iterator)
+    _LIBCUDACXX_IF_WIDE_CHARACTERS(_LIBCUDACXX_PREFERRED_NAME(wsregex_iterator))
     regex_iterator
 {
 public:
@@ -6348,7 +6348,7 @@ public:
                    const regex_type& __re,
                    regex_constants::match_flag_type __m
                                               = regex_constants::match_default);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
     regex_iterator(_BidirectionalIterator __a, _BidirectionalIterator __b,
                    const regex_type&& __re,
                    regex_constants::match_flag_type __m
@@ -6356,16 +6356,16 @@ public:
 #endif
 
     bool operator==(const regex_iterator& __x) const;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool operator!=(const regex_iterator& __x) const {return !(*this == __x);}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     reference operator*() const {return  __match_;}
-    _LIBCPP_INLINE_VISIBILITY
-    pointer operator->() const  {return _VSTD::addressof(__match_);}
+    _LIBCUDACXX_INLINE_VISIBILITY
+    pointer operator->() const  {return _CUDA_VSTD::addressof(__match_);}
 
     regex_iterator& operator++();
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     regex_iterator operator++(int)
     {
         regex_iterator __t(*this);
@@ -6386,10 +6386,10 @@ regex_iterator<_BidirectionalIterator, _CharT, _Traits>::
                    const regex_type& __re, regex_constants::match_flag_type __m)
     : __begin_(__a),
       __end_(__b),
-      __pregex_(_VSTD::addressof(__re)),
+      __pregex_(_CUDA_VSTD::addressof(__re)),
       __flags_(__m)
 {
-    _VSTD::regex_search(__begin_, __end_, __match_, *__pregex_, __flags_);
+    _CUDA_VSTD::regex_search(__begin_, __end_, __match_, *__pregex_, __flags_);
 }
 
 template <class _BidirectionalIterator, class _CharT, class _Traits>
@@ -6421,7 +6421,7 @@ regex_iterator<_BidirectionalIterator, _CharT, _Traits>::operator++()
             __match_ = value_type();
             return *this;
         }
-        else if (_VSTD::regex_search(__start, __end_, __match_, *__pregex_,
+        else if (_CUDA_VSTD::regex_search(__start, __end_, __match_, *__pregex_,
                                     __flags_ | regex_constants::match_not_null |
                                     regex_constants::match_continuous))
             return *this;
@@ -6429,7 +6429,7 @@ regex_iterator<_BidirectionalIterator, _CharT, _Traits>::operator++()
             ++__start;
     }
     __flags_ |= regex_constants::match_prev_avail;
-    if (!_VSTD::regex_search(__start, __end_, __match_, *__pregex_, __flags_))
+    if (!_CUDA_VSTD::regex_search(__start, __end_, __match_, *__pregex_, __flags_))
         __match_ = value_type();
     return *this;
 }
@@ -6439,22 +6439,22 @@ regex_iterator<_BidirectionalIterator, _CharT, _Traits>::operator++()
 template <class _BidirectionalIterator,
           class _CharT = typename iterator_traits<_BidirectionalIterator>::value_type,
           class _Traits = regex_traits<_CharT> >
-    class _LIBCPP_TEMPLATE_VIS regex_token_iterator;
+    class _LIBCUDACXX_TEMPLATE_VIS regex_token_iterator;
 
 typedef regex_token_iterator<const char*>             cregex_token_iterator;
 typedef regex_token_iterator<string::const_iterator>  sregex_token_iterator;
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 typedef regex_token_iterator<const wchar_t*>          wcregex_token_iterator;
 typedef regex_token_iterator<wstring::const_iterator> wsregex_token_iterator;
 #endif
 
 template <class _BidirectionalIterator, class _CharT, class _Traits>
 class
-    _LIBCPP_TEMPLATE_VIS
-    _LIBCPP_PREFERRED_NAME(cregex_token_iterator)
-    _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wcregex_token_iterator))
-    _LIBCPP_PREFERRED_NAME(sregex_token_iterator)
-    _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wsregex_token_iterator))
+    _LIBCUDACXX_TEMPLATE_VIS
+    _LIBCUDACXX_PREFERRED_NAME(cregex_token_iterator)
+    _LIBCUDACXX_IF_WIDE_CHARACTERS(_LIBCUDACXX_PREFERRED_NAME(wcregex_token_iterator))
+    _LIBCUDACXX_PREFERRED_NAME(sregex_token_iterator)
+    _LIBCUDACXX_IF_WIDE_CHARACTERS(_LIBCUDACXX_PREFERRED_NAME(wsregex_token_iterator))
     regex_token_iterator
 {
 public:
@@ -6480,7 +6480,7 @@ public:
                          const regex_type& __re, int __submatch = 0,
                          regex_constants::match_flag_type __m =
                                                 regex_constants::match_default);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
     regex_token_iterator(_BidirectionalIterator __a, _BidirectionalIterator __b,
                          const regex_type&& __re, int __submatch = 0,
                          regex_constants::match_flag_type __m =
@@ -6491,28 +6491,28 @@ public:
                          const regex_type& __re, const vector<int>& __submatches,
                          regex_constants::match_flag_type __m =
                                                 regex_constants::match_default);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
     regex_token_iterator(_BidirectionalIterator __a, _BidirectionalIterator __b,
                          const regex_type&& __re, const vector<int>& __submatches,
                          regex_constants::match_flag_type __m =
                                      regex_constants::match_default) = delete;
 #endif
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
     regex_token_iterator(_BidirectionalIterator __a, _BidirectionalIterator __b,
                          const regex_type& __re,
                          initializer_list<int> __submatches,
                          regex_constants::match_flag_type __m =
                                                 regex_constants::match_default);
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
     regex_token_iterator(_BidirectionalIterator __a, _BidirectionalIterator __b,
                          const regex_type&& __re,
                          initializer_list<int> __submatches,
                          regex_constants::match_flag_type __m =
                                        regex_constants::match_default) = delete;
 #endif
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
     template <size_t _Np>
         regex_token_iterator(_BidirectionalIterator __a,
                              _BidirectionalIterator __b,
@@ -6520,7 +6520,7 @@ public:
                              const int (&__submatches)[_Np],
                              regex_constants::match_flag_type __m =
                                                 regex_constants::match_default);
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
     template <size_t _Np>
         regex_token_iterator(_BidirectionalIterator __a,
                              _BidirectionalIterator __b,
@@ -6534,16 +6534,16 @@ public:
     regex_token_iterator& operator=(const regex_token_iterator&);
 
     bool operator==(const regex_token_iterator& __x) const;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool operator!=(const regex_token_iterator& __x) const {return !(*this == __x);}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const value_type& operator*() const {return *__result_;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const value_type* operator->() const {return __result_;}
 
     regex_token_iterator& operator++();
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     regex_token_iterator operator++(int)
     {
         regex_token_iterator __t(*this);
@@ -6612,7 +6612,7 @@ regex_token_iterator<_BidirectionalIterator, _CharT, _Traits>::
     __init(__a, __b);
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
 template <class _BidirectionalIterator, class _CharT, class _Traits>
 regex_token_iterator<_BidirectionalIterator, _CharT, _Traits>::
@@ -6627,7 +6627,7 @@ regex_token_iterator<_BidirectionalIterator, _CharT, _Traits>::
     __init(__a, __b);
 }
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
 template <class _BidirectionalIterator, class _CharT, class _Traits>
 template <size_t _Np>
@@ -6718,7 +6718,7 @@ regex_token_iterator<_BidirectionalIterator, _CharT, _Traits>::operator++()
             __establish_result();
         else
         {
-            if (_VSTD::find(__subs_.begin(), __subs_.end(), -1) != __subs_.end()
+            if (_CUDA_VSTD::find(__subs_.begin(), __subs_.end(), -1) != __subs_.end()
                 && __prev->suffix().length() != 0)
             {
                 __suffix_.matched = true;
@@ -6749,7 +6749,7 @@ regex_replace(_OutputIterator __output_iter,
     if (__i == __eof)
     {
         if (!(__flags & regex_constants::format_no_copy))
-            __output_iter = _VSTD::copy(__first, __last, __output_iter);
+            __output_iter = _CUDA_VSTD::copy(__first, __last, __output_iter);
     }
     else
     {
@@ -6757,21 +6757,21 @@ regex_replace(_OutputIterator __output_iter,
         for (size_t __len = char_traits<_CharT>::length(__fmt); __i != __eof; ++__i)
         {
             if (!(__flags & regex_constants::format_no_copy))
-                __output_iter = _VSTD::copy(__i->prefix().first, __i->prefix().second, __output_iter);
+                __output_iter = _CUDA_VSTD::copy(__i->prefix().first, __i->prefix().second, __output_iter);
             __output_iter = __i->format(__output_iter, __fmt, __fmt + __len, __flags);
             __lm = __i->suffix();
             if (__flags & regex_constants::format_first_only)
                 break;
         }
         if (!(__flags & regex_constants::format_no_copy))
-            __output_iter = _VSTD::copy(__lm.first, __lm.second, __output_iter);
+            __output_iter = _CUDA_VSTD::copy(__lm.first, __lm.second, __output_iter);
     }
     return __output_iter;
 }
 
 template <class _OutputIterator, class _BidirectionalIterator,
           class _Traits, class _CharT, class _ST, class _SA>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 _OutputIterator
 regex_replace(_OutputIterator __output_iter,
               _BidirectionalIterator __first, _BidirectionalIterator __last,
@@ -6779,12 +6779,12 @@ regex_replace(_OutputIterator __output_iter,
               const basic_string<_CharT, _ST, _SA>& __fmt,
               regex_constants::match_flag_type __flags = regex_constants::match_default)
 {
-    return _VSTD::regex_replace(__output_iter, __first, __last, __e, __fmt.c_str(), __flags);
+    return _CUDA_VSTD::regex_replace(__output_iter, __first, __last, __e, __fmt.c_str(), __flags);
 }
 
 template <class _Traits, class _CharT, class _ST, class _SA, class _FST,
           class _FSA>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 basic_string<_CharT, _ST, _SA>
 regex_replace(const basic_string<_CharT, _ST, _SA>& __s,
               const basic_regex<_CharT, _Traits>& __e,
@@ -6792,26 +6792,26 @@ regex_replace(const basic_string<_CharT, _ST, _SA>& __s,
               regex_constants::match_flag_type __flags = regex_constants::match_default)
 {
     basic_string<_CharT, _ST, _SA> __r;
-    _VSTD::regex_replace(back_inserter(__r), __s.begin(), __s.end(), __e,
+    _CUDA_VSTD::regex_replace(back_inserter(__r), __s.begin(), __s.end(), __e,
                         __fmt.c_str(), __flags);
     return __r;
 }
 
 template <class _Traits, class _CharT, class _ST, class _SA>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 basic_string<_CharT, _ST, _SA>
 regex_replace(const basic_string<_CharT, _ST, _SA>& __s,
               const basic_regex<_CharT, _Traits>& __e, const _CharT* __fmt,
               regex_constants::match_flag_type __flags = regex_constants::match_default)
 {
     basic_string<_CharT, _ST, _SA> __r;
-    _VSTD::regex_replace(back_inserter(__r), __s.begin(), __s.end(), __e,
+    _CUDA_VSTD::regex_replace(back_inserter(__r), __s.begin(), __s.end(), __e,
                         __fmt, __flags);
     return __r;
 }
 
 template <class _Traits, class _CharT, class _ST, class _SA>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 basic_string<_CharT>
 regex_replace(const _CharT* __s,
               const basic_regex<_CharT, _Traits>& __e,
@@ -6819,14 +6819,14 @@ regex_replace(const _CharT* __s,
               regex_constants::match_flag_type __flags = regex_constants::match_default)
 {
     basic_string<_CharT> __r;
-    _VSTD::regex_replace(back_inserter(__r), __s,
+    _CUDA_VSTD::regex_replace(back_inserter(__r), __s,
                         __s + char_traits<_CharT>::length(__s), __e,
                         __fmt.c_str(), __flags);
     return __r;
 }
 
 template <class _Traits, class _CharT>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 basic_string<_CharT>
 regex_replace(const _CharT* __s,
               const basic_regex<_CharT, _Traits>& __e,
@@ -6834,14 +6834,14 @@ regex_replace(const _CharT* __s,
               regex_constants::match_flag_type __flags = regex_constants::match_default)
 {
     basic_string<_CharT> __r;
-    _VSTD::regex_replace(back_inserter(__r), __s,
+    _CUDA_VSTD::regex_replace(back_inserter(__r), __s,
                         __s + char_traits<_CharT>::length(__s), __e,
                         __fmt, __flags);
     return __r;
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP_REGEX
+#endif // _LIBCUDACXX_REGEX

diff  --git a/libcxx/include/scoped_allocator b/libcxx/include/scoped_allocator
index cf82affba78f..2ecb3114fa04 100644
--- a/libcxx/include/scoped_allocator
+++ b/libcxx/include/scoped_allocator
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_SCOPED_ALLOCATOR
-#define _LIBCPP_SCOPED_ALLOCATOR
+#ifndef _LIBCUDACXX_SCOPED_ALLOCATOR
+#define _LIBCUDACXX_SCOPED_ALLOCATOR
 
 /*
     scoped_allocator synopsis
@@ -115,13 +115,13 @@ template <class OuterA1, class OuterA2, class... InnerAllocs>
 #include <memory>
 #include <version>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if !defined(_LIBCPP_CXX03_LANG)
+#if !defined(_LIBCUDACXX_CXX03_LANG)
 
 // scoped_allocator_adaptor
 
@@ -211,24 +211,24 @@ private:
 
 protected:
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __scoped_allocator_storage() _NOEXCEPT {}
 
     template <class _OuterA2,
               class = typename enable_if<
                         is_constructible<outer_allocator_type, _OuterA2>::value
                       >::type>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         __scoped_allocator_storage(_OuterA2&& __outer_alloc,
                                    const _InnerAllocs& ...__inner_allocs) _NOEXCEPT
-            : outer_allocator_type(_VSTD::forward<_OuterA2>(__outer_alloc)),
+            : outer_allocator_type(_CUDA_VSTD::forward<_OuterA2>(__outer_alloc)),
               __inner_(__inner_allocs...) {}
 
     template <class _OuterA2,
               class = typename enable_if<
                         is_constructible<outer_allocator_type, const _OuterA2&>::value
                       >::type>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         __scoped_allocator_storage(
             const __scoped_allocator_storage<_OuterA2, _InnerAllocs...>& __other) _NOEXCEPT
             : outer_allocator_type(__other.outer_allocator()),
@@ -238,38 +238,38 @@ protected:
               class = typename enable_if<
                         is_constructible<outer_allocator_type, _OuterA2>::value
                       >::type>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         __scoped_allocator_storage(
             __scoped_allocator_storage<_OuterA2, _InnerAllocs...>&& __other) _NOEXCEPT
-            : outer_allocator_type(_VSTD::move(__other.outer_allocator())),
-              __inner_(_VSTD::move(__other.inner_allocator())) {}
+            : outer_allocator_type(_CUDA_VSTD::move(__other.outer_allocator())),
+              __inner_(_CUDA_VSTD::move(__other.inner_allocator())) {}
 
     template <class _OuterA2,
               class = typename enable_if<
                         is_constructible<outer_allocator_type, _OuterA2>::value
                       >::type>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         __scoped_allocator_storage(_OuterA2&& __o,
                                    const inner_allocator_type& __i) _NOEXCEPT
-            : outer_allocator_type(_VSTD::forward<_OuterA2>(__o)),
+            : outer_allocator_type(_CUDA_VSTD::forward<_OuterA2>(__o)),
               __inner_(__i)
         {
         }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     inner_allocator_type& inner_allocator() _NOEXCEPT             {return __inner_;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const inner_allocator_type& inner_allocator() const _NOEXCEPT {return __inner_;}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     outer_allocator_type& outer_allocator() _NOEXCEPT
         {return static_cast<outer_allocator_type&>(*this);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const outer_allocator_type& outer_allocator() const _NOEXCEPT
         {return static_cast<const outer_allocator_type&>(*this);}
 
     scoped_allocator_adaptor<outer_allocator_type, _InnerAllocs...>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     select_on_container_copy_construction() const _NOEXCEPT
         {
             return scoped_allocator_adaptor<outer_allocator_type, _InnerAllocs...>
@@ -292,22 +292,22 @@ class __scoped_allocator_storage<_OuterAlloc>
 protected:
     typedef scoped_allocator_adaptor<_OuterAlloc> inner_allocator_type;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     __scoped_allocator_storage() _NOEXCEPT {}
 
     template <class _OuterA2,
               class = typename enable_if<
                         is_constructible<outer_allocator_type, _OuterA2>::value
                       >::type>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         __scoped_allocator_storage(_OuterA2&& __outer_alloc) _NOEXCEPT
-            : outer_allocator_type(_VSTD::forward<_OuterA2>(__outer_alloc)) {}
+            : outer_allocator_type(_CUDA_VSTD::forward<_OuterA2>(__outer_alloc)) {}
 
     template <class _OuterA2,
               class = typename enable_if<
                         is_constructible<outer_allocator_type, const _OuterA2&>::value
                       >::type>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         __scoped_allocator_storage(
             const __scoped_allocator_storage<_OuterA2>& __other) _NOEXCEPT
             : outer_allocator_type(__other.outer_allocator()) {}
@@ -316,26 +316,26 @@ protected:
               class = typename enable_if<
                         is_constructible<outer_allocator_type, _OuterA2>::value
                       >::type>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         __scoped_allocator_storage(
             __scoped_allocator_storage<_OuterA2>&& __other) _NOEXCEPT
-            : outer_allocator_type(_VSTD::move(__other.outer_allocator())) {}
+            : outer_allocator_type(_CUDA_VSTD::move(__other.outer_allocator())) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     inner_allocator_type& inner_allocator() _NOEXCEPT
         {return static_cast<inner_allocator_type&>(*this);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const inner_allocator_type& inner_allocator() const _NOEXCEPT
         {return static_cast<const inner_allocator_type&>(*this);}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     outer_allocator_type& outer_allocator() _NOEXCEPT
         {return static_cast<outer_allocator_type&>(*this);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const outer_allocator_type& outer_allocator() const _NOEXCEPT
         {return static_cast<const outer_allocator_type&>(*this);}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     scoped_allocator_adaptor<outer_allocator_type>
     select_on_container_copy_construction() const _NOEXCEPT
         {return scoped_allocator_adaptor<outer_allocator_type>(
@@ -372,7 +372,7 @@ template <class _Alloc, bool = __has_outer_allocator<_Alloc>::value>
 struct __outermost
 {
     typedef _Alloc type;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     type& operator()(type& __a) const _NOEXCEPT {return __a;}
 };
 
@@ -384,13 +384,13 @@ struct __outermost<_Alloc, true>
                         decltype(declval<_Alloc>().outer_allocator())
                      >::type                                    _OuterAlloc;
     typedef typename __outermost<_OuterAlloc>::type             type;
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     type& operator()(_Alloc& __a) const _NOEXCEPT
         {return __outermost<_OuterAlloc>()(__a.outer_allocator());}
 };
 
 template <class _OuterAlloc, class... _InnerAllocs>
-class _LIBCPP_TEMPLATE_VIS scoped_allocator_adaptor<_OuterAlloc, _InnerAllocs...>
+class _LIBCUDACXX_TEMPLATE_VIS scoped_allocator_adaptor<_OuterAlloc, _InnerAllocs...>
     : public __scoped_allocator_storage<_OuterAlloc, _InnerAllocs...>
 {
     typedef __scoped_allocator_storage<_OuterAlloc, _InnerAllocs...> base;
@@ -437,22 +437,22 @@ public:
         > other;
     };
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     scoped_allocator_adaptor() _NOEXCEPT {}
     template <class _OuterA2,
               class = typename enable_if<
                         is_constructible<outer_allocator_type, _OuterA2>::value
                       >::type>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         scoped_allocator_adaptor(_OuterA2&& __outer_alloc,
                                  const _InnerAllocs& ...__inner_allocs) _NOEXCEPT
-            : base(_VSTD::forward<_OuterA2>(__outer_alloc), __inner_allocs...) {}
+            : base(_CUDA_VSTD::forward<_OuterA2>(__outer_alloc), __inner_allocs...) {}
     // scoped_allocator_adaptor(const scoped_allocator_adaptor& __other) = default;
     template <class _OuterA2,
               class = typename enable_if<
                         is_constructible<outer_allocator_type, const _OuterA2&>::value
                       >::type>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         scoped_allocator_adaptor(
             const scoped_allocator_adaptor<_OuterA2, _InnerAllocs...>& __other) _NOEXCEPT
                 : base(__other) {}
@@ -460,52 +460,52 @@ public:
               class = typename enable_if<
                         is_constructible<outer_allocator_type, _OuterA2>::value
                       >::type>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         scoped_allocator_adaptor(
             scoped_allocator_adaptor<_OuterA2, _InnerAllocs...>&& __other) _NOEXCEPT
-                : base(_VSTD::move(__other)) {}
+                : base(_CUDA_VSTD::move(__other)) {}
 
     // scoped_allocator_adaptor& operator=(const scoped_allocator_adaptor&) = default;
     // scoped_allocator_adaptor& operator=(scoped_allocator_adaptor&&) = default;
     // ~scoped_allocator_adaptor() = default;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     inner_allocator_type& inner_allocator() _NOEXCEPT
         {return base::inner_allocator();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const inner_allocator_type& inner_allocator() const _NOEXCEPT
         {return base::inner_allocator();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     outer_allocator_type& outer_allocator() _NOEXCEPT
         {return base::outer_allocator();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const outer_allocator_type& outer_allocator() const _NOEXCEPT
         {return base::outer_allocator();}
 
-    _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_NODISCARD_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY
     pointer allocate(size_type __n)
         {return allocator_traits<outer_allocator_type>::
             allocate(outer_allocator(), __n);}
-    _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_NODISCARD_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY
     pointer allocate(size_type __n, const_void_pointer __hint)
         {return allocator_traits<outer_allocator_type>::
             allocate(outer_allocator(), __n, __hint);}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void deallocate(pointer __p, size_type __n) _NOEXCEPT
         {allocator_traits<outer_allocator_type>::
             deallocate(outer_allocator(), __p, __n);}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type max_size() const
         {return allocator_traits<outer_allocator_type>::max_size(outer_allocator());}
 
     template <class _Tp, class... _Args>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         void construct(_Tp* __p, _Args&& ...__args)
             {__construct(__uses_alloc_ctor<_Tp, inner_allocator_type&, _Args...>(),
-                         __p, _VSTD::forward<_Args>(__args)...);}
+                         __p, _CUDA_VSTD::forward<_Args>(__args)...);}
 
     template <class _T1, class _T2, class... _Args1, class... _Args2>
     void construct(pair<_T1, _T2>* __p, piecewise_construct_t,
@@ -518,14 +518,14 @@ public:
               typename __uses_alloc_ctor<
                   _T1, inner_allocator_type&, _Args1...
               >::type()
-            , _VSTD::move(__x)
+            , _CUDA_VSTD::move(__x)
             , typename __make_tuple_indices<sizeof...(_Args1)>::type{}
           )
           , __transform_tuple(
               typename __uses_alloc_ctor<
                   _T2, inner_allocator_type&, _Args2...
               >::type()
-            , _VSTD::move(__y)
+            , _CUDA_VSTD::move(__y)
             , typename __make_tuple_indices<sizeof...(_Args2)>::type{}
           )
         );
@@ -538,26 +538,26 @@ public:
     template <class _T1, class _T2, class _Up, class _Vp>
     void construct(pair<_T1, _T2>* __p, _Up&& __x, _Vp&& __y) {
         construct(__p, piecewise_construct,
-                  _VSTD::forward_as_tuple(_VSTD::forward<_Up>(__x)),
-                  _VSTD::forward_as_tuple(_VSTD::forward<_Vp>(__y)));
+                  _CUDA_VSTD::forward_as_tuple(_CUDA_VSTD::forward<_Up>(__x)),
+                  _CUDA_VSTD::forward_as_tuple(_CUDA_VSTD::forward<_Vp>(__y)));
     }
 
     template <class _T1, class _T2, class _Up, class _Vp>
     void construct(pair<_T1, _T2>* __p, const pair<_Up, _Vp>& __x) {
         construct(__p, piecewise_construct,
-                  _VSTD::forward_as_tuple(__x.first),
-                  _VSTD::forward_as_tuple(__x.second));
+                  _CUDA_VSTD::forward_as_tuple(__x.first),
+                  _CUDA_VSTD::forward_as_tuple(__x.second));
     }
 
     template <class _T1, class _T2, class _Up, class _Vp>
     void construct(pair<_T1, _T2>* __p, pair<_Up, _Vp>&& __x) {
         construct(__p, piecewise_construct,
-                  _VSTD::forward_as_tuple(_VSTD::forward<_Up>(__x.first)),
-                  _VSTD::forward_as_tuple(_VSTD::forward<_Vp>(__x.second)));
+                  _CUDA_VSTD::forward_as_tuple(_CUDA_VSTD::forward<_Up>(__x.first)),
+                  _CUDA_VSTD::forward_as_tuple(_CUDA_VSTD::forward<_Vp>(__x.second)));
     }
 
     template <class _Tp>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         void destroy(_Tp* __p)
             {
                 typedef __outermost<outer_allocator_type> _OM;
@@ -565,7 +565,7 @@ public:
                                          destroy(_OM()(outer_allocator()), __p);
             }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     scoped_allocator_adaptor select_on_container_copy_construction() const _NOEXCEPT
         {return base::select_on_container_copy_construction();}
 
@@ -576,13 +576,13 @@ private:
               class = typename enable_if<
                         is_constructible<outer_allocator_type, _OuterA2>::value
                       >::type>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     scoped_allocator_adaptor(_OuterA2&& __o,
                              const inner_allocator_type& __i) _NOEXCEPT
-        : base(_VSTD::forward<_OuterA2>(__o), __i) {}
+        : base(_CUDA_VSTD::forward<_OuterA2>(__o), __i) {}
 
     template <class _Tp, class... _Args>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         void __construct(integral_constant<int, 0>, _Tp* __p, _Args&& ...__args)
             {
                 typedef __outermost<outer_allocator_type> _OM;
@@ -590,12 +590,12 @@ private:
                 (
                     _OM()(outer_allocator()),
                     __p,
-                    _VSTD::forward<_Args>(__args)...
+                    _CUDA_VSTD::forward<_Args>(__args)...
                 );
             }
 
     template <class _Tp, class... _Args>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         void __construct(integral_constant<int, 1>, _Tp* __p, _Args&& ...__args)
             {
                 typedef __outermost<outer_allocator_type> _OM;
@@ -603,12 +603,12 @@ private:
                 (
                     _OM()(outer_allocator()),
                     __p, allocator_arg, inner_allocator(),
-                    _VSTD::forward<_Args>(__args)...
+                    _CUDA_VSTD::forward<_Args>(__args)...
                 );
             }
 
     template <class _Tp, class... _Args>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         void __construct(integral_constant<int, 2>, _Tp* __p, _Args&& ...__args)
             {
                 typedef __outermost<outer_allocator_type> _OM;
@@ -616,52 +616,52 @@ private:
                 (
                     _OM()(outer_allocator()),
                     __p,
-                    _VSTD::forward<_Args>(__args)...,
+                    _CUDA_VSTD::forward<_Args>(__args)...,
                     inner_allocator()
                 );
             }
 
     template <class ..._Args, size_t ..._Idx>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     tuple<_Args&&...>
     __transform_tuple(integral_constant<int, 0>, tuple<_Args...>&& __t,
                       __tuple_indices<_Idx...>)
     {
-        return _VSTD::forward_as_tuple(_VSTD::get<_Idx>(_VSTD::move(__t))...);
+        return _CUDA_VSTD::forward_as_tuple(_CUDA_VSTD::get<_Idx>(_CUDA_VSTD::move(__t))...);
     }
 
     template <class ..._Args, size_t ..._Idx>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     tuple<allocator_arg_t, inner_allocator_type&, _Args&&...>
     __transform_tuple(integral_constant<int, 1>, tuple<_Args...> && __t,
                       __tuple_indices<_Idx...>)
     {
         using _Tup = tuple<allocator_arg_t, inner_allocator_type&, _Args&&...>;
         return _Tup(allocator_arg, inner_allocator(),
-                    _VSTD::get<_Idx>(_VSTD::move(__t))...);
+                    _CUDA_VSTD::get<_Idx>(_CUDA_VSTD::move(__t))...);
     }
 
     template <class ..._Args, size_t ..._Idx>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     tuple<_Args&&..., inner_allocator_type&>
     __transform_tuple(integral_constant<int, 2>, tuple<_Args...> && __t,
                       __tuple_indices<_Idx...>)
     {
         using _Tup = tuple<_Args&&..., inner_allocator_type&>;
-        return _Tup(_VSTD::get<_Idx>(_VSTD::move(__t))..., inner_allocator());
+        return _Tup(_CUDA_VSTD::get<_Idx>(_CUDA_VSTD::move(__t))..., inner_allocator());
     }
 
     template <class...> friend class __scoped_allocator_storage;
 };
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template<class _OuterAlloc, class... _InnerAllocs>
     scoped_allocator_adaptor(_OuterAlloc, _InnerAllocs...)
         -> scoped_allocator_adaptor<_OuterAlloc, _InnerAllocs...>;
 #endif
 
 template <class _OuterA1, class _OuterA2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator==(const scoped_allocator_adaptor<_OuterA1>& __a,
            const scoped_allocator_adaptor<_OuterA2>& __b) _NOEXCEPT
@@ -670,7 +670,7 @@ operator==(const scoped_allocator_adaptor<_OuterA1>& __a,
 }
 
 template <class _OuterA1, class _OuterA2, class _InnerA0, class... _InnerAllocs>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator==(const scoped_allocator_adaptor<_OuterA1, _InnerA0, _InnerAllocs...>& __a,
            const scoped_allocator_adaptor<_OuterA2, _InnerA0, _InnerAllocs...>& __b) _NOEXCEPT
@@ -680,7 +680,7 @@ operator==(const scoped_allocator_adaptor<_OuterA1, _InnerA0, _InnerAllocs...>&
 }
 
 template <class _OuterA1, class _OuterA2, class... _InnerAllocs>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator!=(const scoped_allocator_adaptor<_OuterA1, _InnerAllocs...>& __a,
            const scoped_allocator_adaptor<_OuterA2, _InnerAllocs...>& __b) _NOEXCEPT
@@ -688,8 +688,8 @@ operator!=(const scoped_allocator_adaptor<_OuterA1, _InnerAllocs...>& __a,
     return !(__a == __b);
 }
 
-#endif // !defined(_LIBCPP_CXX03_LANG)
+#endif // !defined(_LIBCUDACXX_CXX03_LANG)
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_SCOPED_ALLOCATOR
+#endif // _LIBCUDACXX_SCOPED_ALLOCATOR

diff  --git a/libcxx/include/semaphore b/libcxx/include/semaphore
index 228cf773f0fd..c3cdaab4d123 100644
--- a/libcxx/include/semaphore
+++ b/libcxx/include/semaphore
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_SEMAPHORE
-#define _LIBCPP_SEMAPHORE
+#ifndef _LIBCUDACXX_SEMAPHORE
+#define _LIBCUDACXX_SEMAPHORE
 
 /*
     semaphore synopsis
@@ -55,20 +55,20 @@ using binary_semaphore = counting_semaphore<1>;
 #include <limits>
 #include <version>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#ifdef _LIBCPP_HAS_NO_THREADS
+#ifdef _LIBCUDACXX_HAS_NO_THREADS
 # error "<semaphore> is not supported since libc++ has been configured without support for threads."
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-#if _LIBCPP_STD_VER >= 14
+#if _LIBCUDACXX_STD_VER >= 14
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 /*
 
@@ -83,11 +83,11 @@ class __atomic_semaphore_base
     __atomic_base<ptr
diff _t> __a;
 
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr explicit __atomic_semaphore_base(ptr
diff _t __count) : __a(__count)
     {
     }
-    _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_INLINE_VISIBILITY
     void release(ptr
diff _t __update = 1)
     {
         if(0 < __a.fetch_add(__update, memory_order_release))
@@ -97,7 +97,7 @@ public:
         else
             __a.notify_one();
     }
-    _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_INLINE_VISIBILITY
     void acquire()
     {
         auto const __test_fn = [this]() -> bool {
@@ -107,15 +107,15 @@ public:
         __cxx_atomic_wait(&__a.__a_, __test_fn);
     }
     template <class Rep, class Period>
-    _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_INLINE_VISIBILITY
     bool try_acquire_for(chrono::duration<Rep, Period> const& __rel_time)
     {
         if (__rel_time == chrono::duration<Rep, Period>::zero())
             return try_acquire();
         auto const __test_fn = [this]() { return try_acquire(); };
-        return __libcpp_thread_poll_with_backoff(__test_fn, __libcpp_timed_backoff_policy(), __rel_time);
+        return __LIBCUDACXX_thread_poll_with_backoff(__test_fn, __LIBCUDACXX_timed_backoff_policy(), __rel_time);
     }
-    _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_INLINE_VISIBILITY
     bool try_acquire()
     {
         auto __old = __a.load(memory_order_acquire);
@@ -128,9 +128,9 @@ public:
     }
 };
 
-#define _LIBCPP_SEMAPHORE_MAX (numeric_limits<ptr
diff _t>::max())
+#define _LIBCUDACXX_SEMAPHORE_MAX (numeric_limits<ptr
diff _t>::max())
 
-template<ptr
diff _t __least_max_value = _LIBCPP_SEMAPHORE_MAX>
+template<ptr
diff _t __least_max_value = _LIBCUDACXX_SEMAPHORE_MAX>
 class counting_semaphore
 {
     __atomic_semaphore_base __semaphore;
@@ -140,36 +140,36 @@ public:
         return __least_max_value;
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr explicit counting_semaphore(ptr
diff _t __count) : __semaphore(__count) { }
     ~counting_semaphore() = default;
 
     counting_semaphore(const counting_semaphore&) = delete;
     counting_semaphore& operator=(const counting_semaphore&) = delete;
 
-    _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_INLINE_VISIBILITY
     void release(ptr
diff _t __update = 1)
     {
         __semaphore.release(__update);
     }
-    _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_INLINE_VISIBILITY
     void acquire()
     {
         __semaphore.acquire();
     }
     template<class Rep, class Period>
-    _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_INLINE_VISIBILITY
     bool try_acquire_for(chrono::duration<Rep, Period> const& __rel_time)
     {
         return __semaphore.try_acquire_for(chrono::duration_cast<chrono::nanoseconds>(__rel_time));
     }
-    _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_INLINE_VISIBILITY
     bool try_acquire()
     {
         return __semaphore.try_acquire();
     }
     template <class Clock, class Duration>
-    _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_AVAILABILITY_SYNC _LIBCUDACXX_INLINE_VISIBILITY
     bool try_acquire_until(chrono::time_point<Clock, Duration> const& __abs_time)
     {
         auto const current = Clock::now();
@@ -182,10 +182,10 @@ public:
 
 using binary_semaphore = counting_semaphore<1>;
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER >= 14
+#endif // _LIBCUDACXX_STD_VER >= 14
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif //_LIBCPP_SEMAPHORE
+#endif //_LIBCUDACXX_SEMAPHORE

diff  --git a/libcxx/include/set b/libcxx/include/set
index da62f6f5ca5b..9409f02c812e 100644
--- a/libcxx/include/set
+++ b/libcxx/include/set
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_SET
-#define _LIBCPP_SET
+#ifndef _LIBCUDACXX_SET
+#define _LIBCUDACXX_SET
 
 /*
 
@@ -485,7 +485,7 @@ erase_if(multiset<Key, Compare, Allocator>& c, Predicate pred);  // C++20
 #include <__utility/forward.h>
 #include <version>
 
-#ifndef _LIBCPP_REMOVE_TRANSITIVE_INCLUDES
+#ifndef _LIBCUDACXX_REMOVE_TRANSITIVE_INCLUDES
 #  include <functional>
 #  include <iterator>
 #endif
@@ -503,18 +503,18 @@ erase_if(multiset<Key, Compare, Allocator>& c, Predicate pred);  // C++20
 #include <compare>
 #include <initializer_list>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _Key, class _Compare, class _Allocator>
 class multiset;
 
 template <class _Key, class _Compare = less<_Key>,
           class _Allocator = allocator<_Key> >
-class _LIBCPP_TEMPLATE_VIS set
+class _LIBCUDACXX_TEMPLATE_VIS set
 {
 public:
     // types:
@@ -542,20 +542,20 @@ public:
     typedef typename __base::
diff erence_type       
diff erence_type;
     typedef typename __base::const_iterator        iterator;
     typedef typename __base::const_iterator        const_iterator;
-    typedef _VSTD::reverse_iterator<iterator>       reverse_iterator;
-    typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
+    typedef _CUDA_VSTD::reverse_iterator<iterator>       reverse_iterator;
+    typedef _CUDA_VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
     typedef __set_node_handle<typename __base::__node, allocator_type> node_type;
     typedef __insert_return_type<iterator, node_type> insert_return_type;
 #endif
 
     template <class _Key2, class _Compare2, class _Alloc2>
-        friend class _LIBCPP_TEMPLATE_VIS set;
+        friend class _LIBCUDACXX_TEMPLATE_VIS set;
     template <class _Key2, class _Compare2, class _Alloc2>
-        friend class _LIBCPP_TEMPLATE_VIS multiset;
+        friend class _LIBCUDACXX_TEMPLATE_VIS multiset;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     set()
         _NOEXCEPT_(
             is_nothrow_default_constructible<allocator_type>::value &&
@@ -563,18 +563,18 @@ public:
             is_nothrow_copy_constructible<key_compare>::value)
         : __tree_(value_compare()) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit set(const value_compare& __comp)
         _NOEXCEPT_(
             is_nothrow_default_constructible<allocator_type>::value &&
             is_nothrow_copy_constructible<key_compare>::value)
         : __tree_(__comp) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit set(const value_compare& __comp, const allocator_type& __a)
         : __tree_(__comp, __a) {}
     template <class _InputIterator>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         set(_InputIterator __f, _InputIterator __l,
             const value_compare& __comp = value_compare())
         : __tree_(__comp)
@@ -583,7 +583,7 @@ public:
         }
 
     template <class _InputIterator>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         set(_InputIterator __f, _InputIterator __l, const value_compare& __comp,
             const allocator_type& __a)
         : __tree_(__comp, __a)
@@ -591,56 +591,56 @@ public:
             insert(__f, __l);
         }
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
         template <class _InputIterator>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         set(_InputIterator __f, _InputIterator __l, const allocator_type& __a)
             : set(__f, __l, key_compare(), __a) {}
 #endif
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     set(const set& __s)
         : __tree_(__s.__tree_)
         {
             insert(__s.begin(), __s.end());
         }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     set& operator=(const set& __s)
         {
             __tree_ = __s.__tree_;
             return *this;
         }
 
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     set(set&& __s)
         _NOEXCEPT_(is_nothrow_move_constructible<__base>::value)
-        : __tree_(_VSTD::move(__s.__tree_)) {}
-#endif // _LIBCPP_CXX03_LANG
+        : __tree_(_CUDA_VSTD::move(__s.__tree_)) {}
+#endif // _LIBCUDACXX_CXX03_LANG
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit set(const allocator_type& __a)
         : __tree_(__a) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     set(const set& __s, const allocator_type& __a)
         : __tree_(__s.__tree_.value_comp(), __a)
         {
             insert(__s.begin(), __s.end());
         }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
     set(set&& __s, const allocator_type& __a);
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     set(initializer_list<value_type> __il, const value_compare& __comp = value_compare())
         : __tree_(__comp)
         {
             insert(__il.begin(), __il.end());
         }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     set(initializer_list<value_type> __il, const value_compare& __comp,
         const allocator_type& __a)
         : __tree_(__comp, __a)
@@ -648,284 +648,284 @@ public:
             insert(__il.begin(), __il.end());
         }
 
-#if _LIBCPP_STD_VER > 11
-    _LIBCPP_INLINE_VISIBILITY
+#if _LIBCUDACXX_STD_VER > 11
+    _LIBCUDACXX_INLINE_VISIBILITY
     set(initializer_list<value_type> __il, const allocator_type& __a)
         : set(__il, key_compare(), __a) {}
 #endif
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     set& operator=(initializer_list<value_type> __il)
         {
             __tree_.__assign_unique(__il.begin(), __il.end());
             return *this;
         }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     set& operator=(set&& __s)
         _NOEXCEPT_(is_nothrow_move_assignable<__base>::value)
         {
-            __tree_ = _VSTD::move(__s.__tree_);
+            __tree_ = _CUDA_VSTD::move(__s.__tree_);
             return *this;
         }
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     ~set() {
         static_assert(sizeof(__diagnose_non_const_comparator<_Key, _Compare>()), "");
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
           iterator begin() _NOEXCEPT       {return __tree_.begin();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator begin() const _NOEXCEPT {return __tree_.begin();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
           iterator end() _NOEXCEPT         {return __tree_.end();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator end()   const _NOEXCEPT {return __tree_.end();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
           reverse_iterator rbegin() _NOEXCEPT
             {return reverse_iterator(end());}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_reverse_iterator rbegin() const _NOEXCEPT
         {return const_reverse_iterator(end());}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
           reverse_iterator rend() _NOEXCEPT
             {return reverse_iterator(begin());}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_reverse_iterator rend() const _NOEXCEPT
         {return const_reverse_iterator(begin());}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator cbegin()  const _NOEXCEPT {return begin();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator cend() const _NOEXCEPT {return end();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_reverse_iterator crbegin() const _NOEXCEPT {return rbegin();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_reverse_iterator crend() const _NOEXCEPT {return rend();}
 
-    _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_NODISCARD_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY
     bool empty() const _NOEXCEPT {return __tree_.size() == 0;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type size() const _NOEXCEPT {return __tree_.size();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type max_size() const _NOEXCEPT {return __tree_.max_size();}
 
     // modifiers:
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
     template <class... _Args>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         pair<iterator, bool> emplace(_Args&&... __args)
-            {return __tree_.__emplace_unique(_VSTD::forward<_Args>(__args)...);}
+            {return __tree_.__emplace_unique(_CUDA_VSTD::forward<_Args>(__args)...);}
     template <class... _Args>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         iterator emplace_hint(const_iterator __p, _Args&&... __args)
-            {return __tree_.__emplace_hint_unique(__p, _VSTD::forward<_Args>(__args)...);}
-#endif // _LIBCPP_CXX03_LANG
+            {return __tree_.__emplace_hint_unique(__p, _CUDA_VSTD::forward<_Args>(__args)...);}
+#endif // _LIBCUDACXX_CXX03_LANG
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     pair<iterator,bool> insert(const value_type& __v)
         {return __tree_.__insert_unique(__v);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator insert(const_iterator __p, const value_type& __v)
         {return __tree_.__insert_unique(__p, __v);}
 
     template <class _InputIterator>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         void insert(_InputIterator __f, _InputIterator __l)
         {
             for (const_iterator __e = cend(); __f != __l; ++__f)
                 __tree_.__insert_unique(__e, *__f);
         }
 
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     pair<iterator,bool> insert(value_type&& __v)
-        {return __tree_.__insert_unique(_VSTD::move(__v));}
+        {return __tree_.__insert_unique(_CUDA_VSTD::move(__v));}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator insert(const_iterator __p, value_type&& __v)
-        {return __tree_.__insert_unique(__p, _VSTD::move(__v));}
+        {return __tree_.__insert_unique(__p, _CUDA_VSTD::move(__v));}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void insert(initializer_list<value_type> __il)
         {insert(__il.begin(), __il.end());}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator  erase(const_iterator __p) {return __tree_.erase(__p);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type erase(const key_type& __k)
         {return __tree_.__erase_unique(__k);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator  erase(const_iterator __f, const_iterator __l)
         {return __tree_.erase(__f, __l);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void clear() _NOEXCEPT {__tree_.clear();}
 
-#if _LIBCPP_STD_VER > 14
-    _LIBCPP_INLINE_VISIBILITY
+#if _LIBCUDACXX_STD_VER > 14
+    _LIBCUDACXX_INLINE_VISIBILITY
     insert_return_type insert(node_type&& __nh)
     {
-        _LIBCPP_ASSERT(__nh.empty() || __nh.get_allocator() == get_allocator(),
+        _LIBCUDACXX_ASSERT(__nh.empty() || __nh.get_allocator() == get_allocator(),
             "node_type with incompatible allocator passed to set::insert()");
         return __tree_.template __node_handle_insert_unique<
-            node_type, insert_return_type>(_VSTD::move(__nh));
+            node_type, insert_return_type>(_CUDA_VSTD::move(__nh));
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator insert(const_iterator __hint, node_type&& __nh)
     {
-        _LIBCPP_ASSERT(__nh.empty() || __nh.get_allocator() == get_allocator(),
+        _LIBCUDACXX_ASSERT(__nh.empty() || __nh.get_allocator() == get_allocator(),
             "node_type with incompatible allocator passed to set::insert()");
         return __tree_.template __node_handle_insert_unique<node_type>(
-            __hint, _VSTD::move(__nh));
+            __hint, _CUDA_VSTD::move(__nh));
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     node_type extract(key_type const& __key)
     {
         return __tree_.template __node_handle_extract<node_type>(__key);
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     node_type extract(const_iterator __it)
     {
         return __tree_.template __node_handle_extract<node_type>(__it);
     }
     template <class _Compare2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void merge(set<key_type, _Compare2, allocator_type>& __source)
     {
-        _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
+        _LIBCUDACXX_ASSERT(__source.get_allocator() == get_allocator(),
                        "merging container with incompatible allocator");
         __tree_.__node_handle_merge_unique(__source.__tree_);
     }
     template <class _Compare2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void merge(set<key_type, _Compare2, allocator_type>&& __source)
     {
-        _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
+        _LIBCUDACXX_ASSERT(__source.get_allocator() == get_allocator(),
                        "merging container with incompatible allocator");
         __tree_.__node_handle_merge_unique(__source.__tree_);
     }
     template <class _Compare2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void merge(multiset<key_type, _Compare2, allocator_type>& __source)
     {
-        _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
+        _LIBCUDACXX_ASSERT(__source.get_allocator() == get_allocator(),
                        "merging container with incompatible allocator");
         __tree_.__node_handle_merge_unique(__source.__tree_);
     }
     template <class _Compare2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void merge(multiset<key_type, _Compare2, allocator_type>&& __source)
     {
-        _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
+        _LIBCUDACXX_ASSERT(__source.get_allocator() == get_allocator(),
                        "merging container with incompatible allocator");
         __tree_.__node_handle_merge_unique(__source.__tree_);
     }
 #endif
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void swap(set& __s) _NOEXCEPT_(__is_nothrow_swappable<__base>::value)
         {__tree_.swap(__s.__tree_);}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     allocator_type get_allocator() const _NOEXCEPT {return __tree_.__alloc();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     key_compare    key_comp()      const {return __tree_.value_comp();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     value_compare  value_comp()    const {return __tree_.value_comp();}
 
     // set operations:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator find(const key_type& __k)             {return __tree_.find(__k);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator find(const key_type& __k) const {return __tree_.find(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
     template <typename _K2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     typename enable_if<__is_transparent<_Compare, _K2>::value,iterator>::type
     find(const _K2& __k)                           {return __tree_.find(__k);}
     template <typename _K2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     typename enable_if<__is_transparent<_Compare, _K2>::value,const_iterator>::type
     find(const _K2& __k) const                     {return __tree_.find(__k);}
 #endif
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type      count(const key_type& __k) const
         {return __tree_.__count_unique(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
     template <typename _K2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     typename enable_if<__is_transparent<_Compare, _K2>::value,size_type>::type
     count(const _K2& __k) const                    {return __tree_.__count_multi(__k);}
 #endif
 
-#if _LIBCPP_STD_VER > 17
-    _LIBCPP_INLINE_VISIBILITY
+#if _LIBCUDACXX_STD_VER > 17
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool contains(const key_type& __k) const {return find(__k) != end();}
     template <typename _K2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     typename enable_if<__is_transparent<_Compare, _K2>::value, bool>::type
     contains(const _K2& __k) const { return find(__k) != end(); }
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator lower_bound(const key_type& __k)
         {return __tree_.lower_bound(__k);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator lower_bound(const key_type& __k) const
         {return __tree_.lower_bound(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
     template <typename _K2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     typename enable_if<__is_transparent<_Compare, _K2>::value,iterator>::type
     lower_bound(const _K2& __k)       {return __tree_.lower_bound(__k);}
 
     template <typename _K2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     typename enable_if<__is_transparent<_Compare, _K2>::value,const_iterator>::type
     lower_bound(const _K2& __k) const {return __tree_.lower_bound(__k);}
 #endif
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator upper_bound(const key_type& __k)
         {return __tree_.upper_bound(__k);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator upper_bound(const key_type& __k) const
         {return __tree_.upper_bound(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
     template <typename _K2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     typename enable_if<__is_transparent<_Compare, _K2>::value,iterator>::type
     upper_bound(const _K2& __k)       {return __tree_.upper_bound(__k);}
     template <typename _K2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     typename enable_if<__is_transparent<_Compare, _K2>::value,const_iterator>::type
     upper_bound(const _K2& __k) const {return __tree_.upper_bound(__k);}
 #endif
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     pair<iterator,iterator> equal_range(const key_type& __k)
         {return __tree_.__equal_range_unique(__k);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     pair<const_iterator,const_iterator> equal_range(const key_type& __k) const
         {return __tree_.__equal_range_unique(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
     template <typename _K2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     typename enable_if<__is_transparent<_Compare, _K2>::value,pair<iterator,iterator>>::type
     equal_range(const _K2& __k)       {return __tree_.__equal_range_multi(__k);}
     template <typename _K2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     typename enable_if<__is_transparent<_Compare, _K2>::value,pair<const_iterator,const_iterator>>::type
     equal_range(const _K2& __k) const {return __tree_.__equal_range_multi(__k);}
 #endif
 };
 
-#if _LIBCPP_STD_VER >= 17
+#if _LIBCUDACXX_STD_VER >= 17
 template<class _InputIterator,
          class _Compare = less<__iter_value_type<_InputIterator>>,
          class _Allocator = allocator<__iter_value_type<_InputIterator>>,
@@ -955,42 +955,42 @@ set(initializer_list<_Key>, _Allocator)
   -> set<_Key, less<_Key>, _Allocator>;
 #endif
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
 template <class _Key, class _Compare, class _Allocator>
 set<_Key, _Compare, _Allocator>::set(set&& __s, const allocator_type& __a)
-    : __tree_(_VSTD::move(__s.__tree_), __a)
+    : __tree_(_CUDA_VSTD::move(__s.__tree_), __a)
 {
     if (__a != __s.get_allocator())
     {
         const_iterator __e = cend();
         while (!__s.empty())
-            insert(__e, _VSTD::move(__s.__tree_.remove(__s.begin())->__value_));
+            insert(__e, _CUDA_VSTD::move(__s.__tree_.remove(__s.begin())->__value_));
     }
 }
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
 template <class _Key, class _Compare, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator==(const set<_Key, _Compare, _Allocator>& __x,
            const set<_Key, _Compare, _Allocator>& __y)
 {
-    return __x.size() == __y.size() && _VSTD::equal(__x.begin(), __x.end(), __y.begin());
+    return __x.size() == __y.size() && _CUDA_VSTD::equal(__x.begin(), __x.end(), __y.begin());
 }
 
 template <class _Key, class _Compare, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator< (const set<_Key, _Compare, _Allocator>& __x,
            const set<_Key, _Compare, _Allocator>& __y)
 {
-    return _VSTD::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());
+    return _CUDA_VSTD::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());
 }
 
 template <class _Key, class _Compare, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator!=(const set<_Key, _Compare, _Allocator>& __x,
            const set<_Key, _Compare, _Allocator>& __y)
@@ -999,7 +999,7 @@ operator!=(const set<_Key, _Compare, _Allocator>& __x,
 }
 
 template <class _Key, class _Compare, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator> (const set<_Key, _Compare, _Allocator>& __x,
            const set<_Key, _Compare, _Allocator>& __y)
@@ -1008,7 +1008,7 @@ operator> (const set<_Key, _Compare, _Allocator>& __x,
 }
 
 template <class _Key, class _Compare, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator>=(const set<_Key, _Compare, _Allocator>& __x,
            const set<_Key, _Compare, _Allocator>& __y)
@@ -1017,7 +1017,7 @@ operator>=(const set<_Key, _Compare, _Allocator>& __x,
 }
 
 template <class _Key, class _Compare, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator<=(const set<_Key, _Compare, _Allocator>& __x,
            const set<_Key, _Compare, _Allocator>& __y)
@@ -1027,7 +1027,7 @@ operator<=(const set<_Key, _Compare, _Allocator>& __x,
 
 // specialized algorithms:
 template <class _Key, class _Compare, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 swap(set<_Key, _Compare, _Allocator>& __x,
      set<_Key, _Compare, _Allocator>& __y)
@@ -1036,18 +1036,18 @@ swap(set<_Key, _Compare, _Allocator>& __x,
     __x.swap(__y);
 }
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 template <class _Key, class _Compare, class _Allocator, class _Predicate>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
     typename set<_Key, _Compare, _Allocator>::size_type
     erase_if(set<_Key, _Compare, _Allocator>& __c, _Predicate __pred) {
-  return _VSTD::__libcpp_erase_if_container(__c, __pred);
+  return _CUDA_VSTD::__LIBCUDACXX_erase_if_container(__c, __pred);
 }
 #endif
 
 template <class _Key, class _Compare = less<_Key>,
           class _Allocator = allocator<_Key> >
-class _LIBCPP_TEMPLATE_VIS multiset
+class _LIBCUDACXX_TEMPLATE_VIS multiset
 {
 public:
     // types:
@@ -1075,20 +1075,20 @@ public:
     typedef typename __base::
diff erence_type       
diff erence_type;
     typedef typename __base::const_iterator        iterator;
     typedef typename __base::const_iterator        const_iterator;
-    typedef _VSTD::reverse_iterator<iterator>       reverse_iterator;
-    typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
+    typedef _CUDA_VSTD::reverse_iterator<iterator>       reverse_iterator;
+    typedef _CUDA_VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
     typedef __set_node_handle<typename __base::__node, allocator_type> node_type;
 #endif
 
     template <class _Key2, class _Compare2, class _Alloc2>
-        friend class _LIBCPP_TEMPLATE_VIS set;
+        friend class _LIBCUDACXX_TEMPLATE_VIS set;
     template <class _Key2, class _Compare2, class _Alloc2>
-        friend class _LIBCPP_TEMPLATE_VIS multiset;
+        friend class _LIBCUDACXX_TEMPLATE_VIS multiset;
 
     // construct/copy/destroy:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     multiset()
         _NOEXCEPT_(
             is_nothrow_default_constructible<allocator_type>::value &&
@@ -1096,18 +1096,18 @@ public:
             is_nothrow_copy_constructible<key_compare>::value)
         : __tree_(value_compare()) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit multiset(const value_compare& __comp)
         _NOEXCEPT_(
             is_nothrow_default_constructible<allocator_type>::value &&
             is_nothrow_copy_constructible<key_compare>::value)
         : __tree_(__comp) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit multiset(const value_compare& __comp, const allocator_type& __a)
         : __tree_(__comp, __a) {}
     template <class _InputIterator>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         multiset(_InputIterator __f, _InputIterator __l,
                  const value_compare& __comp = value_compare())
         : __tree_(__comp)
@@ -1115,15 +1115,15 @@ public:
             insert(__f, __l);
         }
 
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
         template <class _InputIterator>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         multiset(_InputIterator __f, _InputIterator __l, const allocator_type& __a)
             : multiset(__f, __l, key_compare(), __a) {}
 #endif
 
     template <class _InputIterator>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         multiset(_InputIterator __f, _InputIterator __l,
                  const value_compare& __comp, const allocator_type& __a)
         : __tree_(__comp, __a)
@@ -1131,7 +1131,7 @@ public:
             insert(__f, __l);
         }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     multiset(const multiset& __s)
         : __tree_(__s.__tree_.value_comp(),
           __alloc_traits::select_on_container_copy_construction(__s.__tree_.__alloc()))
@@ -1139,40 +1139,40 @@ public:
             insert(__s.begin(), __s.end());
         }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     multiset& operator=(const multiset& __s)
         {
             __tree_ = __s.__tree_;
             return *this;
         }
 
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     multiset(multiset&& __s)
         _NOEXCEPT_(is_nothrow_move_constructible<__base>::value)
-        : __tree_(_VSTD::move(__s.__tree_)) {}
+        : __tree_(_CUDA_VSTD::move(__s.__tree_)) {}
 
     multiset(multiset&& __s, const allocator_type& __a);
-#endif // _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+#endif // _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit multiset(const allocator_type& __a)
         : __tree_(__a) {}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     multiset(const multiset& __s, const allocator_type& __a)
         : __tree_(__s.__tree_.value_comp(), __a)
         {
             insert(__s.begin(), __s.end());
         }
 
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     multiset(initializer_list<value_type> __il, const value_compare& __comp = value_compare())
         : __tree_(__comp)
         {
             insert(__il.begin(), __il.end());
         }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     multiset(initializer_list<value_type> __il, const value_compare& __comp,
         const allocator_type& __a)
         : __tree_(__comp, __a)
@@ -1180,284 +1180,284 @@ public:
             insert(__il.begin(), __il.end());
         }
 
-#if _LIBCPP_STD_VER > 11
-    _LIBCPP_INLINE_VISIBILITY
+#if _LIBCUDACXX_STD_VER > 11
+    _LIBCUDACXX_INLINE_VISIBILITY
     multiset(initializer_list<value_type> __il, const allocator_type& __a)
         : multiset(__il, key_compare(), __a) {}
 #endif
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     multiset& operator=(initializer_list<value_type> __il)
         {
             __tree_.__assign_multi(__il.begin(), __il.end());
             return *this;
         }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     multiset& operator=(multiset&& __s)
         _NOEXCEPT_(is_nothrow_move_assignable<__base>::value)
         {
-            __tree_ = _VSTD::move(__s.__tree_);
+            __tree_ = _CUDA_VSTD::move(__s.__tree_);
             return *this;
         }
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     ~multiset() {
         static_assert(sizeof(__diagnose_non_const_comparator<_Key, _Compare>()), "");
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
           iterator begin() _NOEXCEPT       {return __tree_.begin();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator begin() const _NOEXCEPT {return __tree_.begin();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
           iterator end() _NOEXCEPT         {return __tree_.end();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator end()   const _NOEXCEPT {return __tree_.end();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
           reverse_iterator rbegin() _NOEXCEPT
             {return reverse_iterator(end());}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_reverse_iterator rbegin() const _NOEXCEPT
         {return const_reverse_iterator(end());}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
           reverse_iterator rend() _NOEXCEPT
             {return       reverse_iterator(begin());}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_reverse_iterator rend() const _NOEXCEPT
         {return const_reverse_iterator(begin());}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator cbegin()  const _NOEXCEPT {return begin();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator cend() const _NOEXCEPT {return end();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_reverse_iterator crbegin() const _NOEXCEPT {return rbegin();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_reverse_iterator crend() const _NOEXCEPT {return rend();}
 
-    _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_NODISCARD_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY
     bool empty() const _NOEXCEPT {return __tree_.size() == 0;}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type size() const _NOEXCEPT {return __tree_.size();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type max_size() const _NOEXCEPT {return __tree_.max_size();}
 
     // modifiers:
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
     template <class... _Args>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         iterator emplace(_Args&&... __args)
-            {return __tree_.__emplace_multi(_VSTD::forward<_Args>(__args)...);}
+            {return __tree_.__emplace_multi(_CUDA_VSTD::forward<_Args>(__args)...);}
     template <class... _Args>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         iterator emplace_hint(const_iterator __p, _Args&&... __args)
-            {return __tree_.__emplace_hint_multi(__p, _VSTD::forward<_Args>(__args)...);}
-#endif // _LIBCPP_CXX03_LANG
+            {return __tree_.__emplace_hint_multi(__p, _CUDA_VSTD::forward<_Args>(__args)...);}
+#endif // _LIBCUDACXX_CXX03_LANG
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator insert(const value_type& __v)
         {return __tree_.__insert_multi(__v);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator insert(const_iterator __p, const value_type& __v)
         {return __tree_.__insert_multi(__p, __v);}
 
     template <class _InputIterator>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         void insert(_InputIterator __f, _InputIterator __l)
         {
             for (const_iterator __e = cend(); __f != __l; ++__f)
                 __tree_.__insert_multi(__e, *__f);
         }
 
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator insert(value_type&& __v)
-        {return __tree_.__insert_multi(_VSTD::move(__v));}
+        {return __tree_.__insert_multi(_CUDA_VSTD::move(__v));}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator insert(const_iterator __p, value_type&& __v)
-        {return __tree_.__insert_multi(__p, _VSTD::move(__v));}
+        {return __tree_.__insert_multi(__p, _CUDA_VSTD::move(__v));}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void insert(initializer_list<value_type> __il)
         {insert(__il.begin(), __il.end());}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator  erase(const_iterator __p) {return __tree_.erase(__p);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type erase(const key_type& __k) {return __tree_.__erase_multi(__k);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator  erase(const_iterator __f, const_iterator __l)
         {return __tree_.erase(__f, __l);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void clear() _NOEXCEPT {__tree_.clear();}
 
-#if _LIBCPP_STD_VER > 14
-    _LIBCPP_INLINE_VISIBILITY
+#if _LIBCUDACXX_STD_VER > 14
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator insert(node_type&& __nh)
     {
-        _LIBCPP_ASSERT(__nh.empty() || __nh.get_allocator() == get_allocator(),
+        _LIBCUDACXX_ASSERT(__nh.empty() || __nh.get_allocator() == get_allocator(),
             "node_type with incompatible allocator passed to multiset::insert()");
         return __tree_.template __node_handle_insert_multi<node_type>(
-            _VSTD::move(__nh));
+            _CUDA_VSTD::move(__nh));
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator insert(const_iterator __hint, node_type&& __nh)
     {
-        _LIBCPP_ASSERT(__nh.empty() || __nh.get_allocator() == get_allocator(),
+        _LIBCUDACXX_ASSERT(__nh.empty() || __nh.get_allocator() == get_allocator(),
             "node_type with incompatible allocator passed to multiset::insert()");
         return __tree_.template __node_handle_insert_multi<node_type>(
-            __hint, _VSTD::move(__nh));
+            __hint, _CUDA_VSTD::move(__nh));
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     node_type extract(key_type const& __key)
     {
         return __tree_.template __node_handle_extract<node_type>(__key);
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     node_type extract(const_iterator __it)
     {
         return __tree_.template __node_handle_extract<node_type>(__it);
     }
     template <class _Compare2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void merge(multiset<key_type, _Compare2, allocator_type>& __source)
     {
-        _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
+        _LIBCUDACXX_ASSERT(__source.get_allocator() == get_allocator(),
                        "merging container with incompatible allocator");
         __tree_.__node_handle_merge_multi(__source.__tree_);
     }
     template <class _Compare2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void merge(multiset<key_type, _Compare2, allocator_type>&& __source)
     {
-        _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
+        _LIBCUDACXX_ASSERT(__source.get_allocator() == get_allocator(),
                        "merging container with incompatible allocator");
         __tree_.__node_handle_merge_multi(__source.__tree_);
     }
     template <class _Compare2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void merge(set<key_type, _Compare2, allocator_type>& __source)
     {
-        _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
+        _LIBCUDACXX_ASSERT(__source.get_allocator() == get_allocator(),
                        "merging container with incompatible allocator");
         __tree_.__node_handle_merge_multi(__source.__tree_);
     }
     template <class _Compare2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void merge(set<key_type, _Compare2, allocator_type>&& __source)
     {
-        _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
+        _LIBCUDACXX_ASSERT(__source.get_allocator() == get_allocator(),
                        "merging container with incompatible allocator");
         __tree_.__node_handle_merge_multi(__source.__tree_);
     }
 #endif
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void swap(multiset& __s)
         _NOEXCEPT_(__is_nothrow_swappable<__base>::value)
         {__tree_.swap(__s.__tree_);}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     allocator_type get_allocator() const _NOEXCEPT {return __tree_.__alloc();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     key_compare    key_comp()      const {return __tree_.value_comp();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     value_compare  value_comp()    const {return __tree_.value_comp();}
 
     // set operations:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator find(const key_type& __k)             {return __tree_.find(__k);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator find(const key_type& __k) const {return __tree_.find(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
     template <typename _K2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     typename enable_if<__is_transparent<_Compare, _K2>::value,iterator>::type
     find(const _K2& __k)                           {return __tree_.find(__k);}
     template <typename _K2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     typename enable_if<__is_transparent<_Compare, _K2>::value,const_iterator>::type
     find(const _K2& __k) const                     {return __tree_.find(__k);}
 #endif
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type      count(const key_type& __k) const
         {return __tree_.__count_multi(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
     template <typename _K2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     typename enable_if<__is_transparent<_Compare, _K2>::value,size_type>::type
     count(const _K2& __k) const            {return __tree_.__count_multi(__k);}
 #endif
 
-#if _LIBCPP_STD_VER > 17
-    _LIBCPP_INLINE_VISIBILITY
+#if _LIBCUDACXX_STD_VER > 17
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool contains(const key_type& __k) const {return find(__k) != end();}
     template <typename _K2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     typename enable_if<__is_transparent<_Compare, _K2>::value, bool>::type
     contains(const _K2& __k) const { return find(__k) != end(); }
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator lower_bound(const key_type& __k)
         {return __tree_.lower_bound(__k);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator lower_bound(const key_type& __k) const
             {return __tree_.lower_bound(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
     template <typename _K2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     typename enable_if<__is_transparent<_Compare, _K2>::value,iterator>::type
     lower_bound(const _K2& __k)       {return __tree_.lower_bound(__k);}
 
     template <typename _K2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     typename enable_if<__is_transparent<_Compare, _K2>::value,const_iterator>::type
     lower_bound(const _K2& __k) const {return __tree_.lower_bound(__k);}
 #endif
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     iterator upper_bound(const key_type& __k)
             {return __tree_.upper_bound(__k);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_iterator upper_bound(const key_type& __k) const
             {return __tree_.upper_bound(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
     template <typename _K2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     typename enable_if<__is_transparent<_Compare, _K2>::value,iterator>::type
     upper_bound(const _K2& __k)       {return __tree_.upper_bound(__k);}
     template <typename _K2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     typename enable_if<__is_transparent<_Compare, _K2>::value,const_iterator>::type
     upper_bound(const _K2& __k) const {return __tree_.upper_bound(__k);}
 #endif
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     pair<iterator,iterator>             equal_range(const key_type& __k)
             {return __tree_.__equal_range_multi(__k);}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     pair<const_iterator,const_iterator> equal_range(const key_type& __k) const
             {return __tree_.__equal_range_multi(__k);}
-#if _LIBCPP_STD_VER > 11
+#if _LIBCUDACXX_STD_VER > 11
     template <typename _K2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     typename enable_if<__is_transparent<_Compare, _K2>::value,pair<iterator,iterator>>::type
     equal_range(const _K2& __k)       {return __tree_.__equal_range_multi(__k);}
     template <typename _K2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     typename enable_if<__is_transparent<_Compare, _K2>::value,pair<const_iterator,const_iterator>>::type
     equal_range(const _K2& __k) const {return __tree_.__equal_range_multi(__k);}
 #endif
 };
 
-#if _LIBCPP_STD_VER >= 17
+#if _LIBCUDACXX_STD_VER >= 17
 template<class _InputIterator,
          class _Compare = less<__iter_value_type<_InputIterator>>,
          class _Allocator = allocator<__iter_value_type<_InputIterator>>,
@@ -1487,42 +1487,42 @@ multiset(initializer_list<_Key>, _Allocator)
   -> multiset<_Key, less<_Key>, _Allocator>;
 #endif
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
 template <class _Key, class _Compare, class _Allocator>
 multiset<_Key, _Compare, _Allocator>::multiset(multiset&& __s, const allocator_type& __a)
-    : __tree_(_VSTD::move(__s.__tree_), __a)
+    : __tree_(_CUDA_VSTD::move(__s.__tree_), __a)
 {
     if (__a != __s.get_allocator())
     {
         const_iterator __e = cend();
         while (!__s.empty())
-            insert(__e, _VSTD::move(__s.__tree_.remove(__s.begin())->__value_));
+            insert(__e, _CUDA_VSTD::move(__s.__tree_.remove(__s.begin())->__value_));
     }
 }
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
 template <class _Key, class _Compare, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator==(const multiset<_Key, _Compare, _Allocator>& __x,
            const multiset<_Key, _Compare, _Allocator>& __y)
 {
-    return __x.size() == __y.size() && _VSTD::equal(__x.begin(), __x.end(), __y.begin());
+    return __x.size() == __y.size() && _CUDA_VSTD::equal(__x.begin(), __x.end(), __y.begin());
 }
 
 template <class _Key, class _Compare, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator< (const multiset<_Key, _Compare, _Allocator>& __x,
            const multiset<_Key, _Compare, _Allocator>& __y)
 {
-    return _VSTD::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());
+    return _CUDA_VSTD::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());
 }
 
 template <class _Key, class _Compare, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator!=(const multiset<_Key, _Compare, _Allocator>& __x,
            const multiset<_Key, _Compare, _Allocator>& __y)
@@ -1531,7 +1531,7 @@ operator!=(const multiset<_Key, _Compare, _Allocator>& __x,
 }
 
 template <class _Key, class _Compare, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator> (const multiset<_Key, _Compare, _Allocator>& __x,
            const multiset<_Key, _Compare, _Allocator>& __y)
@@ -1540,7 +1540,7 @@ operator> (const multiset<_Key, _Compare, _Allocator>& __x,
 }
 
 template <class _Key, class _Compare, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator>=(const multiset<_Key, _Compare, _Allocator>& __x,
            const multiset<_Key, _Compare, _Allocator>& __y)
@@ -1549,7 +1549,7 @@ operator>=(const multiset<_Key, _Compare, _Allocator>& __x,
 }
 
 template <class _Key, class _Compare, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator<=(const multiset<_Key, _Compare, _Allocator>& __x,
            const multiset<_Key, _Compare, _Allocator>& __y)
@@ -1558,7 +1558,7 @@ operator<=(const multiset<_Key, _Compare, _Allocator>& __x,
 }
 
 template <class _Key, class _Compare, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 swap(multiset<_Key, _Compare, _Allocator>& __x,
      multiset<_Key, _Compare, _Allocator>& __y)
@@ -1567,15 +1567,15 @@ swap(multiset<_Key, _Compare, _Allocator>& __x,
     __x.swap(__y);
 }
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 template <class _Key, class _Compare, class _Allocator, class _Predicate>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
     typename multiset<_Key, _Compare, _Allocator>::size_type
     erase_if(multiset<_Key, _Compare, _Allocator>& __c, _Predicate __pred) {
-  return _VSTD::__libcpp_erase_if_container(__c, __pred);
+  return _CUDA_VSTD::__LIBCUDACXX_erase_if_container(__c, __pred);
 }
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_SET
+#endif // _LIBCUDACXX_SET

diff  --git a/libcxx/include/setjmp.h b/libcxx/include/setjmp.h
index de4f9edf4886..4d6962d4d9aa 100644
--- a/libcxx/include/setjmp.h
+++ b/libcxx/include/setjmp.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_SETJMP_H
-#define _LIBCPP_SETJMP_H
+#ifndef _LIBCUDACXX_SETJMP_H
+#define _LIBCUDACXX_SETJMP_H
 
 /*
     setjmp.h synopsis
@@ -27,7 +27,7 @@ void longjmp(jmp_buf env, int val);
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
@@ -41,4 +41,4 @@ void longjmp(jmp_buf env, int val);
 
 #endif // __cplusplus
 
-#endif // _LIBCPP_SETJMP_H
+#endif // _LIBCUDACXX_SETJMP_H

diff  --git a/libcxx/include/shared_mutex b/libcxx/include/shared_mutex
index f85cf6ec4c4f..87ca7c659d96 100644
--- a/libcxx/include/shared_mutex
+++ b/libcxx/include/shared_mutex
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_SHARED_MUTEX
-#define _LIBCPP_SHARED_MUTEX
+#ifndef _LIBCUDACXX_SHARED_MUTEX
+#define _LIBCUDACXX_SHARED_MUTEX
 
 /*
     shared_mutex synopsis
@@ -127,25 +127,25 @@ template <class Mutex>
 #include <__config>
 #include <version>
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
 
-#if _LIBCPP_STD_VER > 11 || defined(_LIBCPP_BUILDING_LIBRARY)
+#if _LIBCUDACXX_STD_VER > 11 || defined(_LIBCUDACXX_BUILDING_LIBRARY)
 
 #include <__mutex_base>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#ifdef _LIBCPP_HAS_NO_THREADS
+#ifdef _LIBCUDACXX_HAS_NO_THREADS
 # error "<shared_mutex> is not supported since libc++ has been configured without support for threads."
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-struct _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_SHARED_MUTEX _LIBCPP_THREAD_SAFETY_ANNOTATION(capability("shared_mutex"))
+struct _LIBCUDACXX_TYPE_VIS _LIBCUDACXX_AVAILABILITY_SHARED_MUTEX _LIBCUDACXX_THREAD_SAFETY_ANNOTATION(capability("shared_mutex"))
 __shared_mutex_base
 {
     mutex               __mut_;
@@ -157,59 +157,59 @@ __shared_mutex_base
     static const unsigned __n_readers_ = ~__write_entered_;
 
     __shared_mutex_base();
-    _LIBCPP_INLINE_VISIBILITY ~__shared_mutex_base() = default;
+    _LIBCUDACXX_INLINE_VISIBILITY ~__shared_mutex_base() = default;
 
     __shared_mutex_base(const __shared_mutex_base&) = delete;
     __shared_mutex_base& operator=(const __shared_mutex_base&) = delete;
 
     // Exclusive ownership
-    void lock() _LIBCPP_THREAD_SAFETY_ANNOTATION(acquire_capability()); // blocking
-    bool try_lock() _LIBCPP_THREAD_SAFETY_ANNOTATION(try_acquire_capability(true));
-    void unlock() _LIBCPP_THREAD_SAFETY_ANNOTATION(release_capability());
+    void lock() _LIBCUDACXX_THREAD_SAFETY_ANNOTATION(acquire_capability()); // blocking
+    bool try_lock() _LIBCUDACXX_THREAD_SAFETY_ANNOTATION(try_acquire_capability(true));
+    void unlock() _LIBCUDACXX_THREAD_SAFETY_ANNOTATION(release_capability());
 
     // Shared ownership
-    void lock_shared() _LIBCPP_THREAD_SAFETY_ANNOTATION(acquire_shared_capability()); // blocking
-    bool try_lock_shared() _LIBCPP_THREAD_SAFETY_ANNOTATION(try_acquire_shared_capability(true));
-    void unlock_shared() _LIBCPP_THREAD_SAFETY_ANNOTATION(release_shared_capability());
+    void lock_shared() _LIBCUDACXX_THREAD_SAFETY_ANNOTATION(acquire_shared_capability()); // blocking
+    bool try_lock_shared() _LIBCUDACXX_THREAD_SAFETY_ANNOTATION(try_acquire_shared_capability(true));
+    void unlock_shared() _LIBCUDACXX_THREAD_SAFETY_ANNOTATION(release_shared_capability());
 
 //     typedef implementation-defined native_handle_type; // See 30.2.3
 //     native_handle_type native_handle(); // See 30.2.3
 };
 
 
-#if _LIBCPP_STD_VER > 14
-class _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_SHARED_MUTEX shared_mutex
+#if _LIBCUDACXX_STD_VER > 14
+class _LIBCUDACXX_TYPE_VIS _LIBCUDACXX_AVAILABILITY_SHARED_MUTEX shared_mutex
 {
     __shared_mutex_base __base;
 public:
-    _LIBCPP_INLINE_VISIBILITY shared_mutex() : __base() {}
-    _LIBCPP_INLINE_VISIBILITY ~shared_mutex() = default;
+    _LIBCUDACXX_INLINE_VISIBILITY shared_mutex() : __base() {}
+    _LIBCUDACXX_INLINE_VISIBILITY ~shared_mutex() = default;
 
     shared_mutex(const shared_mutex&) = delete;
     shared_mutex& operator=(const shared_mutex&) = delete;
 
     // Exclusive ownership
-    _LIBCPP_INLINE_VISIBILITY void lock()     { return __base.lock(); }
-    _LIBCPP_INLINE_VISIBILITY bool try_lock() { return __base.try_lock(); }
-    _LIBCPP_INLINE_VISIBILITY void unlock()   { return __base.unlock(); }
+    _LIBCUDACXX_INLINE_VISIBILITY void lock()     { return __base.lock(); }
+    _LIBCUDACXX_INLINE_VISIBILITY bool try_lock() { return __base.try_lock(); }
+    _LIBCUDACXX_INLINE_VISIBILITY void unlock()   { return __base.unlock(); }
 
     // Shared ownership
-    _LIBCPP_INLINE_VISIBILITY void lock_shared()     { return __base.lock_shared(); }
-    _LIBCPP_INLINE_VISIBILITY bool try_lock_shared() { return __base.try_lock_shared(); }
-    _LIBCPP_INLINE_VISIBILITY void unlock_shared()   { return __base.unlock_shared(); }
+    _LIBCUDACXX_INLINE_VISIBILITY void lock_shared()     { return __base.lock_shared(); }
+    _LIBCUDACXX_INLINE_VISIBILITY bool try_lock_shared() { return __base.try_lock_shared(); }
+    _LIBCUDACXX_INLINE_VISIBILITY void unlock_shared()   { return __base.unlock_shared(); }
 
 //     typedef __shared_mutex_base::native_handle_type native_handle_type;
-//     _LIBCPP_INLINE_VISIBILITY native_handle_type native_handle() { return __base::unlock_shared(); }
+//     _LIBCUDACXX_INLINE_VISIBILITY native_handle_type native_handle() { return __base::unlock_shared(); }
 };
 #endif
 
 
-class _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_SHARED_MUTEX shared_timed_mutex
+class _LIBCUDACXX_TYPE_VIS _LIBCUDACXX_AVAILABILITY_SHARED_MUTEX shared_timed_mutex
 {
     __shared_mutex_base __base;
 public:
     shared_timed_mutex();
-    _LIBCPP_INLINE_VISIBILITY ~shared_timed_mutex() = default;
+    _LIBCUDACXX_INLINE_VISIBILITY ~shared_timed_mutex() = default;
 
     shared_timed_mutex(const shared_timed_mutex&) = delete;
     shared_timed_mutex& operator=(const shared_timed_mutex&) = delete;
@@ -218,14 +218,14 @@ public:
     void lock();
     bool try_lock();
     template <class _Rep, class _Period>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         bool
         try_lock_for(const chrono::duration<_Rep, _Period>& __rel_time)
         {
             return try_lock_until(chrono::steady_clock::now() + __rel_time);
         }
     template <class _Clock, class _Duration>
-        _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
+        _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
         bool
         try_lock_until(const chrono::time_point<_Clock, _Duration>& __abs_time);
     void unlock();
@@ -234,14 +234,14 @@ public:
     void lock_shared();
     bool try_lock_shared();
     template <class _Rep, class _Period>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         bool
         try_lock_shared_for(const chrono::duration<_Rep, _Period>& __rel_time)
         {
             return try_lock_shared_until(chrono::steady_clock::now() + __rel_time);
         }
     template <class _Clock, class _Duration>
-        _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
+        _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
         bool
         try_lock_shared_until(const chrono::time_point<_Clock, _Duration>& __abs_time);
     void unlock_shared();
@@ -318,53 +318,53 @@ private:
     bool __owns_;
 
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     shared_lock() _NOEXCEPT
         : __m_(nullptr),
           __owns_(false)
         {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit shared_lock(mutex_type& __m)
-        : __m_(_VSTD::addressof(__m)),
+        : __m_(_CUDA_VSTD::addressof(__m)),
           __owns_(true)
         {__m_->lock_shared();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     shared_lock(mutex_type& __m, defer_lock_t) _NOEXCEPT
-        : __m_(_VSTD::addressof(__m)),
+        : __m_(_CUDA_VSTD::addressof(__m)),
           __owns_(false)
         {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     shared_lock(mutex_type& __m, try_to_lock_t)
-        : __m_(_VSTD::addressof(__m)),
+        : __m_(_CUDA_VSTD::addressof(__m)),
           __owns_(__m.try_lock_shared())
         {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     shared_lock(mutex_type& __m, adopt_lock_t)
-        : __m_(_VSTD::addressof(__m)),
+        : __m_(_CUDA_VSTD::addressof(__m)),
           __owns_(true)
         {}
 
     template <class _Clock, class _Duration>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         shared_lock(mutex_type& __m,
                     const chrono::time_point<_Clock, _Duration>& __abs_time)
-            : __m_(_VSTD::addressof(__m)),
+            : __m_(_CUDA_VSTD::addressof(__m)),
               __owns_(__m.try_lock_shared_until(__abs_time))
             {}
 
     template <class _Rep, class _Period>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         shared_lock(mutex_type& __m,
                     const chrono::duration<_Rep, _Period>& __rel_time)
-            : __m_(_VSTD::addressof(__m)),
+            : __m_(_CUDA_VSTD::addressof(__m)),
               __owns_(__m.try_lock_shared_for(__rel_time))
             {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     ~shared_lock()
     {
         if (__owns_)
@@ -374,7 +374,7 @@ public:
     shared_lock(shared_lock const&) = delete;
     shared_lock& operator=(shared_lock const&) = delete;
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     shared_lock(shared_lock&& __u) _NOEXCEPT
         : __m_(__u.__m_),
           __owns_(__u.__owns_)
@@ -383,7 +383,7 @@ public:
             __u.__owns_ = false;
         }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     shared_lock& operator=(shared_lock&& __u) _NOEXCEPT
     {
         if (__owns_)
@@ -406,14 +406,14 @@ public:
     void unlock();
 
     // Setters
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void swap(shared_lock& __u) _NOEXCEPT
     {
-        _VSTD::swap(__m_, __u.__m_);
-        _VSTD::swap(__owns_, __u.__owns_);
+        _CUDA_VSTD::swap(__m_, __u.__m_);
+        _CUDA_VSTD::swap(__owns_, __u.__owns_);
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     mutex_type* release() _NOEXCEPT
     {
         mutex_type* __m = __m_;
@@ -423,13 +423,13 @@ public:
     }
 
     // Getters
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     bool owns_lock() const _NOEXCEPT {return __owns_;}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit operator bool () const _NOEXCEPT {return __owns_;}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     mutex_type* mutex() const _NOEXCEPT {return __m_;}
 };
 
@@ -494,15 +494,15 @@ shared_lock<_Mutex>::unlock()
 }
 
 template <class _Mutex>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 swap(shared_lock<_Mutex>& __x, shared_lock<_Mutex>& __y) _NOEXCEPT
     {__x.swap(__y);}
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 11
+#endif // _LIBCUDACXX_STD_VER > 11
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP_SHARED_MUTEX
+#endif // _LIBCUDACXX_SHARED_MUTEX

diff  --git a/libcxx/include/span b/libcxx/include/span
index 67d2ac241ff2..f705d3b71926 100644
--- a/libcxx/include/span
+++ b/libcxx/include/span
@@ -7,8 +7,8 @@
 //
 //===---------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_SPAN
-#define _LIBCPP_SPAN
+#ifndef _LIBCUDACXX_SPAN
+#define _LIBCUDACXX_SPAN
 
 /*
     span synopsis
@@ -148,7 +148,7 @@ template<class R>
 #include <type_traits>  // for remove_cv, etc
 #include <version>
 
-#ifndef _LIBCPP_REMOVE_TRANSITIVE_INCLUDES
+#ifndef _LIBCUDACXX_REMOVE_TRANSITIVE_INCLUDES
 #  include <functional>
 #  include <iterator>
 #endif
@@ -162,16 +162,16 @@ template<class R>
 #include <__iterator/reverse_access.h>
 #include <__iterator/size.h>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 
 template <class _Tp>
 struct __is_std_array : false_type {};
@@ -185,7 +185,7 @@ struct __is_std_span : false_type {};
 template <class _Tp, size_t _Sz>
 struct __is_std_span<span<_Tp, _Sz>> : true_type {};
 
-#if defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 // This is a temporary workaround until we ship <ranges> -- we've unfortunately been
 // shipping <span> before its API was finalized, and we used to provide a constructor
 // from container types that had the requirements below. To avoid breaking code that
@@ -211,7 +211,7 @@ concept __span_compatible_range =
   !__is_std_array<remove_cvref_t<_Range>>::value &&
   !is_array_v<remove_cvref_t<_Range>> &&
   is_convertible_v<remove_reference_t<ranges::range_reference_t<_Range>>(*)[], _ElementType(*)[]>;
-#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // !defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 
 template <class _From, class _To>
 concept __span_array_convertible = is_convertible_v<_From(*)[], _To(*)[]>;
@@ -223,7 +223,7 @@ template <class _Sentinel, class _It>
 concept __span_compatible_sentinel_for = sized_sentinel_for<_Sentinel, _It> && !is_convertible_v<_Sentinel, size_t>;
 
 template <typename _Tp, size_t _Extent>
-class _LIBCPP_TEMPLATE_VIS span {
+class _LIBCUDACXX_TEMPLATE_VIS span {
 public:
 //  constants and types
     using element_type           = _Tp;
@@ -234,86 +234,86 @@ public:
     using const_pointer          = const _Tp *;
     using reference              = _Tp &;
     using const_reference        = const _Tp &;
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
+#ifdef _LIBCUDACXX_ENABLE_DEBUG_MODE
     using iterator               = __bounded_iter<pointer>;
 #else
     using iterator               = __wrap_iter<pointer>;
 #endif
-    using reverse_iterator       = _VSTD::reverse_iterator<iterator>;
+    using reverse_iterator       = _CUDA_VSTD::reverse_iterator<iterator>;
 
     static constexpr size_type extent = _Extent;
 
 // [span.cons], span constructors, copy, assignment, and destructor
     template <size_t _Sz = _Extent> requires(_Sz == 0)
-    _LIBCPP_INLINE_VISIBILITY constexpr span() noexcept : __data{nullptr} {}
+    _LIBCUDACXX_INLINE_VISIBILITY constexpr span() noexcept : __data{nullptr} {}
 
     constexpr span           (const span&) noexcept = default;
     constexpr span& operator=(const span&) noexcept = default;
 
     template <__span_compatible_iterator<element_type> _It>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr explicit span(_It __first, size_type __count)
-        : __data{_VSTD::to_address(__first)} {
+        : __data{_CUDA_VSTD::to_address(__first)} {
       (void)__count;
-      _LIBCPP_ASSERT(_Extent == __count, "size mismatch in span's constructor (iterator, len)");
+      _LIBCUDACXX_ASSERT(_Extent == __count, "size mismatch in span's constructor (iterator, len)");
     }
 
     template <__span_compatible_iterator<element_type> _It, __span_compatible_sentinel_for<_It> _End>
-    _LIBCPP_INLINE_VISIBILITY
-    constexpr explicit span(_It __first, _End __last) : __data{_VSTD::to_address(__first)} {
+    _LIBCUDACXX_INLINE_VISIBILITY
+    constexpr explicit span(_It __first, _End __last) : __data{_CUDA_VSTD::to_address(__first)} {
       (void)__last;
-      _LIBCPP_ASSERT((__last - __first >= 0), "invalid range in span's constructor (iterator, sentinel)");
-      _LIBCPP_ASSERT(__last - __first == _Extent,
+      _LIBCUDACXX_ASSERT((__last - __first >= 0), "invalid range in span's constructor (iterator, sentinel)");
+      _LIBCUDACXX_ASSERT(__last - __first == _Extent,
                      "invalid range in span's constructor (iterator, sentinel): last - first != extent");
     }
 
-    _LIBCPP_INLINE_VISIBILITY constexpr span(type_identity_t<element_type> (&__arr)[_Extent]) noexcept : __data{__arr} {}
+    _LIBCUDACXX_INLINE_VISIBILITY constexpr span(type_identity_t<element_type> (&__arr)[_Extent]) noexcept : __data{__arr} {}
 
     template <__span_array_convertible<element_type> _OtherElementType>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr span(array<_OtherElementType, _Extent>& __arr) noexcept : __data{__arr.data()} {}
 
     template <class _OtherElementType>
         requires __span_array_convertible<const _OtherElementType, element_type>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr span(const array<_OtherElementType, _Extent>& __arr) noexcept : __data{__arr.data()} {}
 
-#if defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
     template <class _Container>
         requires __span_compatible_range<_Container, element_type>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr explicit span(_Container& __c) : __data{std::data(__c)} {
-      _LIBCPP_ASSERT(std::size(__c) == _Extent, "size mismatch in span's constructor (range)");
+      _LIBCUDACXX_ASSERT(std::size(__c) == _Extent, "size mismatch in span's constructor (range)");
     }
     template <class _Container>
         requires __span_compatible_range<const _Container, element_type>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr explicit span(const _Container& __c) : __data{std::data(__c)} {
-      _LIBCPP_ASSERT(std::size(__c) == _Extent, "size mismatch in span's constructor (range)");
+      _LIBCUDACXX_ASSERT(std::size(__c) == _Extent, "size mismatch in span's constructor (range)");
     }
 #else
     template <__span_compatible_range<element_type> _Range>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr explicit span(_Range&& __r) : __data{ranges::data(__r)} {
-      _LIBCPP_ASSERT(ranges::size(__r) == _Extent, "size mismatch in span's constructor (range)");
+      _LIBCUDACXX_ASSERT(ranges::size(__r) == _Extent, "size mismatch in span's constructor (range)");
     }
 #endif
 
     template <__span_array_convertible<element_type> _OtherElementType>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
         constexpr span(const span<_OtherElementType, _Extent>& __other)
         : __data{__other.data()} {}
 
     template <__span_array_convertible<element_type> _OtherElementType>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
         constexpr explicit span(const span<_OtherElementType, dynamic_extent>& __other) noexcept
-        : __data{__other.data()} { _LIBCPP_ASSERT(_Extent == __other.size(), "size mismatch in span's constructor (other span)"); }
+        : __data{__other.data()} { _LIBCUDACXX_ASSERT(_Extent == __other.size(), "size mismatch in span's constructor (other span)"); }
 
 
 //  ~span() noexcept = default;
 
     template <size_t _Count>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr span<element_type, _Count> first() const noexcept
     {
         static_assert(_Count <= _Extent, "span<T, N>::first<Count>(): Count out of range");
@@ -321,29 +321,29 @@ public:
     }
 
     template <size_t _Count>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr span<element_type, _Count> last() const noexcept
     {
         static_assert(_Count <= _Extent, "span<T, N>::last<Count>(): Count out of range");
         return span<element_type, _Count>{data() + size() - _Count, _Count};
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr span<element_type, dynamic_extent> first(size_type __count) const noexcept
     {
-        _LIBCPP_ASSERT(__count <= size(), "span<T, N>::first(count): count out of range");
+        _LIBCUDACXX_ASSERT(__count <= size(), "span<T, N>::first(count): count out of range");
         return {data(), __count};
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr span<element_type, dynamic_extent> last(size_type __count) const noexcept
     {
-        _LIBCPP_ASSERT(__count <= size(), "span<T, N>::last(count): count out of range");
+        _LIBCUDACXX_ASSERT(__count <= size(), "span<T, N>::last(count): count out of range");
         return {data() + size() - __count, __count};
     }
 
     template <size_t _Offset, size_t _Count = dynamic_extent>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr auto subspan() const noexcept
         -> span<element_type, _Count != dynamic_extent ? _Count : _Extent - _Offset>
     {
@@ -355,64 +355,64 @@ public:
     }
 
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr span<element_type, dynamic_extent>
        subspan(size_type __offset, size_type __count = dynamic_extent) const noexcept
     {
-        _LIBCPP_ASSERT(__offset <= size(), "span<T, N>::subspan(offset, count): offset out of range");
-        _LIBCPP_ASSERT(__count  <= size() || __count == dynamic_extent, "span<T, N>::subspan(offset, count): count out of range");
+        _LIBCUDACXX_ASSERT(__offset <= size(), "span<T, N>::subspan(offset, count): offset out of range");
+        _LIBCUDACXX_ASSERT(__count  <= size() || __count == dynamic_extent, "span<T, N>::subspan(offset, count): count out of range");
         if (__count == dynamic_extent)
             return {data() + __offset, size() - __offset};
-        _LIBCPP_ASSERT(__count <= size() - __offset, "span<T, N>::subspan(offset, count): offset + count out of range");
+        _LIBCUDACXX_ASSERT(__count <= size() - __offset, "span<T, N>::subspan(offset, count): offset + count out of range");
         return {data() + __offset, __count};
     }
 
-    _LIBCPP_INLINE_VISIBILITY constexpr size_type size()           const noexcept { return _Extent; }
-    _LIBCPP_INLINE_VISIBILITY constexpr size_type size_bytes()     const noexcept { return _Extent * sizeof(element_type); }
-    [[nodiscard]] _LIBCPP_INLINE_VISIBILITY constexpr bool empty() const noexcept { return _Extent == 0; }
+    _LIBCUDACXX_INLINE_VISIBILITY constexpr size_type size()           const noexcept { return _Extent; }
+    _LIBCUDACXX_INLINE_VISIBILITY constexpr size_type size_bytes()     const noexcept { return _Extent * sizeof(element_type); }
+    [[nodiscard]] _LIBCUDACXX_INLINE_VISIBILITY constexpr bool empty() const noexcept { return _Extent == 0; }
 
-    _LIBCPP_INLINE_VISIBILITY constexpr reference operator[](size_type __idx) const noexcept
+    _LIBCUDACXX_INLINE_VISIBILITY constexpr reference operator[](size_type __idx) const noexcept
     {
-        _LIBCPP_ASSERT(__idx < size(), "span<T, N>::operator[](index): index out of range");
+        _LIBCUDACXX_ASSERT(__idx < size(), "span<T, N>::operator[](index): index out of range");
         return __data[__idx];
     }
 
-    _LIBCPP_INLINE_VISIBILITY constexpr reference front() const noexcept
+    _LIBCUDACXX_INLINE_VISIBILITY constexpr reference front() const noexcept
     {
-        _LIBCPP_ASSERT(!empty(), "span<T, N>::front() on empty span");
+        _LIBCUDACXX_ASSERT(!empty(), "span<T, N>::front() on empty span");
         return __data[0];
     }
 
-    _LIBCPP_INLINE_VISIBILITY constexpr reference back() const noexcept
+    _LIBCUDACXX_INLINE_VISIBILITY constexpr reference back() const noexcept
     {
-        _LIBCPP_ASSERT(!empty(), "span<T, N>::back() on empty span");
+        _LIBCUDACXX_ASSERT(!empty(), "span<T, N>::back() on empty span");
         return __data[size()-1];
     }
 
-    _LIBCPP_INLINE_VISIBILITY constexpr pointer data()                         const noexcept { return __data; }
+    _LIBCUDACXX_INLINE_VISIBILITY constexpr pointer data()                         const noexcept { return __data; }
 
 // [span.iter], span iterator support
-    _LIBCPP_INLINE_VISIBILITY constexpr iterator begin() const noexcept {
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
+    _LIBCUDACXX_INLINE_VISIBILITY constexpr iterator begin() const noexcept {
+#ifdef _LIBCUDACXX_ENABLE_DEBUG_MODE
         return std::__make_bounded_iter(data(), data(), data() + size());
 #else
         return iterator(this, data());
 #endif
     }
-    _LIBCPP_INLINE_VISIBILITY constexpr iterator end() const noexcept {
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
+    _LIBCUDACXX_INLINE_VISIBILITY constexpr iterator end() const noexcept {
+#ifdef _LIBCUDACXX_ENABLE_DEBUG_MODE
         return std::__make_bounded_iter(data() + size(), data(), data() + size());
 #else
         return iterator(this, data() + size());
 #endif
     }
-    _LIBCPP_INLINE_VISIBILITY constexpr reverse_iterator        rbegin() const noexcept { return reverse_iterator(end()); }
-    _LIBCPP_INLINE_VISIBILITY constexpr reverse_iterator          rend() const noexcept { return reverse_iterator(begin()); }
+    _LIBCUDACXX_INLINE_VISIBILITY constexpr reverse_iterator        rbegin() const noexcept { return reverse_iterator(end()); }
+    _LIBCUDACXX_INLINE_VISIBILITY constexpr reverse_iterator          rend() const noexcept { return reverse_iterator(begin()); }
 
-    _LIBCPP_INLINE_VISIBILITY span<const byte, _Extent * sizeof(element_type)> __as_bytes() const noexcept
+    _LIBCUDACXX_INLINE_VISIBILITY span<const byte, _Extent * sizeof(element_type)> __as_bytes() const noexcept
     { return span<const byte, _Extent * sizeof(element_type)>{reinterpret_cast<const byte *>(data()), size_bytes()}; }
 
-    _LIBCPP_INLINE_VISIBILITY span<byte, _Extent * sizeof(element_type)> __as_writable_bytes() const noexcept
+    _LIBCUDACXX_INLINE_VISIBILITY span<byte, _Extent * sizeof(element_type)> __as_writable_bytes() const noexcept
     { return span<byte, _Extent * sizeof(element_type)>{reinterpret_cast<byte *>(data()), size_bytes()}; }
 
 private:
@@ -421,7 +421,7 @@ private:
 
 
 template <typename _Tp>
-class _LIBCPP_TEMPLATE_VIS span<_Tp, dynamic_extent> {
+class _LIBCUDACXX_TEMPLATE_VIS span<_Tp, dynamic_extent> {
 public:
 //  constants and types
     using element_type           = _Tp;
@@ -432,165 +432,165 @@ public:
     using const_pointer          = const _Tp *;
     using reference              = _Tp &;
     using const_reference        = const _Tp &;
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
+#ifdef _LIBCUDACXX_ENABLE_DEBUG_MODE
     using iterator               = __bounded_iter<pointer>;
 #else
     using iterator               = __wrap_iter<pointer>;
 #endif
-    using reverse_iterator       = _VSTD::reverse_iterator<iterator>;
+    using reverse_iterator       = _CUDA_VSTD::reverse_iterator<iterator>;
 
     static constexpr size_type extent = dynamic_extent;
 
 // [span.cons], span constructors, copy, assignment, and destructor
-    _LIBCPP_INLINE_VISIBILITY constexpr span() noexcept : __data{nullptr}, __size{0} {}
+    _LIBCUDACXX_INLINE_VISIBILITY constexpr span() noexcept : __data{nullptr}, __size{0} {}
 
     constexpr span           (const span&) noexcept = default;
     constexpr span& operator=(const span&) noexcept = default;
 
     template <__span_compatible_iterator<element_type> _It>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr span(_It __first, size_type __count)
-        : __data{_VSTD::to_address(__first)}, __size{__count} {}
+        : __data{_CUDA_VSTD::to_address(__first)}, __size{__count} {}
 
     template <__span_compatible_iterator<element_type> _It, __span_compatible_sentinel_for<_It> _End>
-    _LIBCPP_INLINE_VISIBILITY constexpr span(_It __first, _End __last)
-        : __data(_VSTD::to_address(__first)), __size(__last - __first) {
-      _LIBCPP_ASSERT(__last - __first >= 0, "invalid range in span's constructor (iterator, sentinel)");
+    _LIBCUDACXX_INLINE_VISIBILITY constexpr span(_It __first, _End __last)
+        : __data(_CUDA_VSTD::to_address(__first)), __size(__last - __first) {
+      _LIBCUDACXX_ASSERT(__last - __first >= 0, "invalid range in span's constructor (iterator, sentinel)");
     }
 
     template <size_t _Sz>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr span(type_identity_t<element_type> (&__arr)[_Sz]) noexcept : __data{__arr}, __size{_Sz} {}
 
     template <__span_array_convertible<element_type> _OtherElementType, size_t _Sz>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr span(array<_OtherElementType, _Sz>& __arr) noexcept : __data{__arr.data()}, __size{_Sz} {}
 
     template <class _OtherElementType, size_t _Sz>
         requires __span_array_convertible<const _OtherElementType, element_type>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr span(const array<_OtherElementType, _Sz>& __arr) noexcept : __data{__arr.data()}, __size{_Sz} {}
 
-#if defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
     template <class _Container>
         requires __span_compatible_range<_Container, element_type>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr span(_Container& __c) : __data(std::data(__c)), __size{std::size(__c)} {}
     template <class _Container>
         requires __span_compatible_range<const _Container, element_type>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr span(const _Container& __c) : __data(std::data(__c)), __size{std::size(__c)} {}
 #else
     template <__span_compatible_range<element_type> _Range>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr span(_Range&& __r) : __data(ranges::data(__r)), __size{ranges::size(__r)} {}
 #endif
 
     template <__span_array_convertible<element_type> _OtherElementType, size_t _OtherExtent>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
         constexpr span(const span<_OtherElementType, _OtherExtent>& __other)  noexcept
         : __data{__other.data()}, __size{__other.size()} {}
 
 //    ~span() noexcept = default;
 
     template <size_t _Count>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr span<element_type, _Count> first() const noexcept
     {
-        _LIBCPP_ASSERT(_Count <= size(), "span<T>::first<Count>(): Count out of range");
+        _LIBCUDACXX_ASSERT(_Count <= size(), "span<T>::first<Count>(): Count out of range");
         return span<element_type, _Count>{data(), _Count};
     }
 
     template <size_t _Count>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr span<element_type, _Count> last() const noexcept
     {
-        _LIBCPP_ASSERT(_Count <= size(), "span<T>::last<Count>(): Count out of range");
+        _LIBCUDACXX_ASSERT(_Count <= size(), "span<T>::last<Count>(): Count out of range");
         return span<element_type, _Count>{data() + size() - _Count, _Count};
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr span<element_type, dynamic_extent> first(size_type __count) const noexcept
     {
-        _LIBCPP_ASSERT(__count <= size(), "span<T>::first(count): count out of range");
+        _LIBCUDACXX_ASSERT(__count <= size(), "span<T>::first(count): count out of range");
         return {data(), __count};
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr span<element_type, dynamic_extent> last (size_type __count) const noexcept
     {
-        _LIBCPP_ASSERT(__count <= size(), "span<T>::last(count): count out of range");
+        _LIBCUDACXX_ASSERT(__count <= size(), "span<T>::last(count): count out of range");
         return {data() + size() - __count, __count};
     }
 
     template <size_t _Offset, size_t _Count = dynamic_extent>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     constexpr span<element_type, _Count> subspan() const noexcept
     {
-        _LIBCPP_ASSERT(_Offset <= size(), "span<T>::subspan<Offset, Count>(): Offset out of range");
-        _LIBCPP_ASSERT(_Count == dynamic_extent || _Count <= size() - _Offset, "span<T>::subspan<Offset, Count>(): Offset + Count out of range");
+        _LIBCUDACXX_ASSERT(_Offset <= size(), "span<T>::subspan<Offset, Count>(): Offset out of range");
+        _LIBCUDACXX_ASSERT(_Count == dynamic_extent || _Count <= size() - _Offset, "span<T>::subspan<Offset, Count>(): Offset + Count out of range");
         return span<element_type, _Count>{data() + _Offset, _Count == dynamic_extent ? size() - _Offset : _Count};
     }
 
     constexpr span<element_type, dynamic_extent>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     subspan(size_type __offset, size_type __count = dynamic_extent) const noexcept
     {
-        _LIBCPP_ASSERT(__offset <= size(), "span<T>::subspan(offset, count): offset out of range");
-        _LIBCPP_ASSERT(__count <= size() || __count == dynamic_extent, "span<T>::subspan(offset, count): count out of range");
+        _LIBCUDACXX_ASSERT(__offset <= size(), "span<T>::subspan(offset, count): offset out of range");
+        _LIBCUDACXX_ASSERT(__count <= size() || __count == dynamic_extent, "span<T>::subspan(offset, count): count out of range");
         if (__count == dynamic_extent)
             return {data() + __offset, size() - __offset};
-        _LIBCPP_ASSERT(__count <= size() - __offset, "span<T>::subspan(offset, count): offset + count out of range");
+        _LIBCUDACXX_ASSERT(__count <= size() - __offset, "span<T>::subspan(offset, count): offset + count out of range");
         return {data() + __offset, __count};
     }
 
-    _LIBCPP_INLINE_VISIBILITY constexpr size_type size()           const noexcept { return __size; }
-    _LIBCPP_INLINE_VISIBILITY constexpr size_type size_bytes()     const noexcept { return __size * sizeof(element_type); }
-    [[nodiscard]] _LIBCPP_INLINE_VISIBILITY constexpr bool empty() const noexcept { return __size == 0; }
+    _LIBCUDACXX_INLINE_VISIBILITY constexpr size_type size()           const noexcept { return __size; }
+    _LIBCUDACXX_INLINE_VISIBILITY constexpr size_type size_bytes()     const noexcept { return __size * sizeof(element_type); }
+    [[nodiscard]] _LIBCUDACXX_INLINE_VISIBILITY constexpr bool empty() const noexcept { return __size == 0; }
 
-    _LIBCPP_INLINE_VISIBILITY constexpr reference operator[](size_type __idx) const noexcept
+    _LIBCUDACXX_INLINE_VISIBILITY constexpr reference operator[](size_type __idx) const noexcept
     {
-        _LIBCPP_ASSERT(__idx < size(), "span<T>::operator[](index): index out of range");
+        _LIBCUDACXX_ASSERT(__idx < size(), "span<T>::operator[](index): index out of range");
         return __data[__idx];
     }
 
-    _LIBCPP_INLINE_VISIBILITY constexpr reference front() const noexcept
+    _LIBCUDACXX_INLINE_VISIBILITY constexpr reference front() const noexcept
     {
-        _LIBCPP_ASSERT(!empty(), "span<T>::front() on empty span");
+        _LIBCUDACXX_ASSERT(!empty(), "span<T>::front() on empty span");
         return __data[0];
     }
 
-    _LIBCPP_INLINE_VISIBILITY constexpr reference back() const noexcept
+    _LIBCUDACXX_INLINE_VISIBILITY constexpr reference back() const noexcept
     {
-        _LIBCPP_ASSERT(!empty(), "span<T>::back() on empty span");
+        _LIBCUDACXX_ASSERT(!empty(), "span<T>::back() on empty span");
         return __data[size()-1];
     }
 
 
-    _LIBCPP_INLINE_VISIBILITY constexpr pointer data()                         const noexcept { return __data; }
+    _LIBCUDACXX_INLINE_VISIBILITY constexpr pointer data()                         const noexcept { return __data; }
 
 // [span.iter], span iterator support
-    _LIBCPP_INLINE_VISIBILITY constexpr iterator begin() const noexcept {
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
+    _LIBCUDACXX_INLINE_VISIBILITY constexpr iterator begin() const noexcept {
+#ifdef _LIBCUDACXX_ENABLE_DEBUG_MODE
         return std::__make_bounded_iter(data(), data(), data() + size());
 #else
         return iterator(this, data());
 #endif
     }
-    _LIBCPP_INLINE_VISIBILITY constexpr iterator end() const noexcept {
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
+    _LIBCUDACXX_INLINE_VISIBILITY constexpr iterator end() const noexcept {
+#ifdef _LIBCUDACXX_ENABLE_DEBUG_MODE
         return std::__make_bounded_iter(data() + size(), data(), data() + size());
 #else
         return iterator(this, data() + size());
 #endif
     }
-    _LIBCPP_INLINE_VISIBILITY constexpr reverse_iterator        rbegin() const noexcept { return reverse_iterator(end()); }
-    _LIBCPP_INLINE_VISIBILITY constexpr reverse_iterator          rend() const noexcept { return reverse_iterator(begin()); }
+    _LIBCUDACXX_INLINE_VISIBILITY constexpr reverse_iterator        rbegin() const noexcept { return reverse_iterator(end()); }
+    _LIBCUDACXX_INLINE_VISIBILITY constexpr reverse_iterator          rend() const noexcept { return reverse_iterator(begin()); }
 
-    _LIBCPP_INLINE_VISIBILITY span<const byte, dynamic_extent> __as_bytes() const noexcept
+    _LIBCUDACXX_INLINE_VISIBILITY span<const byte, dynamic_extent> __as_bytes() const noexcept
     { return {reinterpret_cast<const byte *>(data()), size_bytes()}; }
 
-    _LIBCPP_INLINE_VISIBILITY span<byte, dynamic_extent> __as_writable_bytes() const noexcept
+    _LIBCUDACXX_INLINE_VISIBILITY span<byte, dynamic_extent> __as_writable_bytes() const noexcept
     { return {reinterpret_cast<byte *>(data()), size_bytes()}; }
 
 private:
@@ -606,19 +606,19 @@ inline constexpr bool ranges::enable_view<span<_ElementType, _Extent>> = true;
 
 //  as_bytes & as_writable_bytes
 template <class _Tp, size_t _Extent>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 auto as_bytes(span<_Tp, _Extent> __s) noexcept
 { return __s.__as_bytes(); }
 
 template <class _Tp, size_t _Extent> requires(!is_const_v<_Tp>)
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 auto as_writable_bytes(span<_Tp, _Extent> __s) noexcept
 { return __s.__as_writable_bytes(); }
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCUDACXX_STD_VER > 17
 template<contiguous_iterator _It, class _EndOrSize>
     span(_It, _EndOrSize) -> span<remove_reference_t<iter_reference_t<_It>>>;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
 template<class _Tp, size_t _Sz>
     span(_Tp (&)[_Sz]) -> span<_Tp, _Sz>;
@@ -629,7 +629,7 @@ template<class _Tp, size_t _Sz>
 template<class _Tp, size_t _Sz>
     span(const array<_Tp, _Sz>&) -> span<const _Tp, _Sz>;
 
-#if defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if defined(_LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES)
 template<class _Container>
     span(_Container&) -> span<typename _Container::value_type>;
 
@@ -640,10 +640,10 @@ template<ranges::contiguous_range _Range>
     span(_Range&&) -> span<remove_reference_t<ranges::range_reference_t<_Range>>>;
 #endif
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP_SPAN
+#endif // _LIBCUDACXX_SPAN

diff  --git a/libcxx/include/sstream b/libcxx/include/sstream
index 602a1b55b4a9..8da15897fb4a 100644
--- a/libcxx/include/sstream
+++ b/libcxx/include/sstream
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_SSTREAM
-#define _LIBCPP_SSTREAM
+#ifndef _LIBCUDACXX_SSTREAM
+#define _LIBCUDACXX_SSTREAM
 
 /*
     sstream synopsis
@@ -188,20 +188,20 @@ typedef basic_stringstream<wchar_t> wstringstream;
 #include <string>
 #include <version>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 // basic_stringbuf
 
 template <class _CharT, class _Traits, class _Allocator>
-class _LIBCPP_TEMPLATE_VIS basic_stringbuf
+class _LIBCUDACXX_TEMPLATE_VIS basic_stringbuf
     : public basic_streambuf<_CharT, _Traits>
 {
 public:
@@ -222,15 +222,15 @@ private:
 
 public:
     // 30.8.2.1 [stringbuf.cons], constructors
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_stringbuf()
         : __hm_(nullptr), __mode_(ios_base::in | ios_base::out) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit basic_stringbuf(ios_base::openmode __wch)
         : __hm_(nullptr), __mode_(__wch) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit basic_stringbuf(const string_type& __s,
                              ios_base::openmode __wch = ios_base::in | ios_base::out)
         : __str_(__s.get_allocator()), __hm_(nullptr), __mode_(__wch)
@@ -255,7 +255,7 @@ protected:
     virtual int_type overflow (int_type __c = traits_type::eof());
     virtual pos_type seekoff(off_type __off, ios_base::seekdir __way,
                              ios_base::openmode __wch = ios_base::in | ios_base::out);
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     virtual pos_type seekpos(pos_type __sp,
                              ios_base::openmode __wch = ios_base::in | ios_base::out) {
         return seekoff(__sp, ios_base::beg, __wch);
@@ -286,7 +286,7 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::basic_stringbuf(basic_stringbuf&&
         __eout = __rhs.epptr() - __p;
     }
     ptr
diff _t __hm = __rhs.__hm_ == nullptr ? -1 : __rhs.__hm_ - __p;
-    __str_ = _VSTD::move(__rhs.__str_);
+    __str_ = _CUDA_VSTD::move(__rhs.__str_);
     __p = const_cast<char_type*>(__str_.data());
     if (__binp != -1)
         this->setg(__p + __binp, __p + __ninp, __p + __einp);
@@ -327,7 +327,7 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::operator=(basic_stringbuf&& __rhs)
         __eout = __rhs.epptr() - __p;
     }
     ptr
diff _t __hm = __rhs.__hm_ == nullptr ? -1 : __rhs.__hm_ - __p;
-    __str_ = _VSTD::move(__rhs.__str_);
+    __str_ = _CUDA_VSTD::move(__rhs.__str_);
     __p = const_cast<char_type*>(__str_.data());
     if (__binp != -1)
         this->setg(__p + __binp, __p + __ninp, __p + __einp);
@@ -395,7 +395,7 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::swap(basic_stringbuf& __rhs)
         __leout = this->epptr() - __p;
     }
     ptr
diff _t __lhm = __hm_ == nullptr ? -1 : __hm_ - __p;
-    _VSTD::swap(__mode_, __rhs.__mode_);
+    _CUDA_VSTD::swap(__mode_, __rhs.__mode_);
     __str_.swap(__rhs.__str_);
     __p = const_cast<char_type*>(__str_.data());
     if (__rbinp != -1)
@@ -429,7 +429,7 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::swap(basic_stringbuf& __rhs)
 }
 
 template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 swap(basic_stringbuf<_CharT, _Traits, _Allocator>& __x,
      basic_stringbuf<_CharT, _Traits, _Allocator>& __y)
@@ -536,10 +536,10 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::overflow(int_type __c)
         {
             if (!(__mode_ & ios_base::out))
                 return traits_type::eof();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
             try
             {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
                 ptr
diff _t __nout = this->pptr()  - this->pbase();
                 ptr
diff _t __hm = __hm_ - this->pbase();
                 __str_.push_back(char_type());
@@ -548,15 +548,15 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::overflow(int_type __c)
                 this->setp(__p, __p + __str_.size());
                 this->__pbump(__nout);
                 __hm_ = this->pbase() + __hm;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
             }
             catch (...)
             {
                 return traits_type::eof();
             }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
         }
-        __hm_ = _VSTD::max(this->pptr() + 1, __hm_);
+        __hm_ = _CUDA_VSTD::max(this->pptr() + 1, __hm_);
         if (__mode_ & ios_base::in)
         {
             char_type* __p = const_cast<char_type*>(__str_.data());
@@ -622,7 +622,7 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::seekoff(off_type __off,
 // basic_istringstream
 
 template <class _CharT, class _Traits, class _Allocator>
-class _LIBCPP_TEMPLATE_VIS basic_istringstream
+class _LIBCUDACXX_TEMPLATE_VIS basic_istringstream
     : public basic_istream<_CharT, _Traits>
 {
 public:
@@ -640,58 +640,58 @@ private:
 
 public:
     // 30.8.3.1 [istringstream.cons], constructors
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_istringstream()
         : basic_istream<_CharT, _Traits>(&__sb_), __sb_(ios_base::in) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit basic_istringstream(ios_base::openmode __wch)
         : basic_istream<_CharT, _Traits>(&__sb_), __sb_(__wch | ios_base::in) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit basic_istringstream(const string_type& __s,
                                  ios_base::openmode __wch = ios_base::in)
         : basic_istream<_CharT, _Traits>(&__sb_)
         , __sb_(__s, __wch | ios_base::in)
     { }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_istringstream(basic_istringstream&& __rhs)
-        : basic_istream<_CharT, _Traits>(_VSTD::move(__rhs))
-        , __sb_(_VSTD::move(__rhs.__sb_))
+        : basic_istream<_CharT, _Traits>(_CUDA_VSTD::move(__rhs))
+        , __sb_(_CUDA_VSTD::move(__rhs.__sb_))
     {
         basic_istream<_CharT, _Traits>::set_rdbuf(&__sb_);
     }
 
     // 27.8.2.2 Assign and swap:
     basic_istringstream& operator=(basic_istringstream&& __rhs) {
-        basic_istream<char_type, traits_type>::operator=(_VSTD::move(__rhs));
-        __sb_ = _VSTD::move(__rhs.__sb_);
+        basic_istream<char_type, traits_type>::operator=(_CUDA_VSTD::move(__rhs));
+        __sb_ = _CUDA_VSTD::move(__rhs.__sb_);
         return *this;
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void swap(basic_istringstream& __rhs) {
         basic_istream<char_type, traits_type>::swap(__rhs);
         __sb_.swap(__rhs.__sb_);
     }
 
     // 27.8.2.3 Members:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_stringbuf<char_type, traits_type, allocator_type>* rdbuf() const {
         return const_cast<basic_stringbuf<char_type, traits_type, allocator_type>*>(&__sb_);
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     string_type str() const {
         return __sb_.str();
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void str(const string_type& __s) {
         __sb_.str(__s);
     }
 };
 
 template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 swap(basic_istringstream<_CharT, _Traits, _Allocator>& __x,
      basic_istringstream<_CharT, _Traits, _Allocator>& __y)
@@ -702,7 +702,7 @@ swap(basic_istringstream<_CharT, _Traits, _Allocator>& __x,
 // basic_ostringstream
 
 template <class _CharT, class _Traits, class _Allocator>
-class _LIBCPP_TEMPLATE_VIS basic_ostringstream
+class _LIBCUDACXX_TEMPLATE_VIS basic_ostringstream
     : public basic_ostream<_CharT, _Traits>
 {
 public:
@@ -720,59 +720,59 @@ private:
 
 public:
     // 30.8.4.1 [ostringstream.cons], constructors
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_ostringstream()
         : basic_ostream<_CharT, _Traits>(&__sb_), __sb_(ios_base::out) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit basic_ostringstream(ios_base::openmode __wch)
         : basic_ostream<_CharT, _Traits>(&__sb_), __sb_(__wch | ios_base::out) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit basic_ostringstream(const string_type& __s,
                                  ios_base::openmode __wch = ios_base::out)
         : basic_ostream<_CharT, _Traits>(&__sb_)
         , __sb_(__s, __wch | ios_base::out)
     { }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_ostringstream(basic_ostringstream&& __rhs)
-        : basic_ostream<_CharT, _Traits>(_VSTD::move(__rhs))
-        , __sb_(_VSTD::move(__rhs.__sb_))
+        : basic_ostream<_CharT, _Traits>(_CUDA_VSTD::move(__rhs))
+        , __sb_(_CUDA_VSTD::move(__rhs.__sb_))
     {
         basic_ostream<_CharT, _Traits>::set_rdbuf(&__sb_);
     }
 
     // 27.8.2.2 Assign and swap:
     basic_ostringstream& operator=(basic_ostringstream&& __rhs) {
-        basic_ostream<char_type, traits_type>::operator=(_VSTD::move(__rhs));
-        __sb_ = _VSTD::move(__rhs.__sb_);
+        basic_ostream<char_type, traits_type>::operator=(_CUDA_VSTD::move(__rhs));
+        __sb_ = _CUDA_VSTD::move(__rhs.__sb_);
         return *this;
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void swap(basic_ostringstream& __rhs) {
         basic_ostream<char_type, traits_type>::swap(__rhs);
         __sb_.swap(__rhs.__sb_);
     }
 
     // 27.8.2.3 Members:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_stringbuf<char_type, traits_type, allocator_type>* rdbuf() const {
         return const_cast<basic_stringbuf<char_type, traits_type, allocator_type>*>(&__sb_);
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     string_type str() const {
         return __sb_.str();
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void str(const string_type& __s) {
         __sb_.str(__s);
     }
 };
 
 template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 swap(basic_ostringstream<_CharT, _Traits, _Allocator>& __x,
      basic_ostringstream<_CharT, _Traits, _Allocator>& __y)
@@ -783,7 +783,7 @@ swap(basic_ostringstream<_CharT, _Traits, _Allocator>& __x,
 // basic_stringstream
 
 template <class _CharT, class _Traits, class _Allocator>
-class _LIBCPP_TEMPLATE_VIS basic_stringstream
+class _LIBCUDACXX_TEMPLATE_VIS basic_stringstream
     : public basic_iostream<_CharT, _Traits>
 {
 public:
@@ -801,58 +801,58 @@ private:
 
 public:
     // 30.8.5.1 [stringstream.cons], constructors
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_stringstream()
         : basic_iostream<_CharT, _Traits>(&__sb_), __sb_(ios_base::in | ios_base::out) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit basic_stringstream(ios_base::openmode __wch)
         : basic_iostream<_CharT, _Traits>(&__sb_), __sb_(__wch) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit basic_stringstream(const string_type& __s,
                                 ios_base::openmode __wch = ios_base::in | ios_base::out)
         : basic_iostream<_CharT, _Traits>(&__sb_)
         , __sb_(__s, __wch)
     { }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_stringstream(basic_stringstream&& __rhs)
-        : basic_iostream<_CharT, _Traits>(_VSTD::move(__rhs))
-        , __sb_(_VSTD::move(__rhs.__sb_))
+        : basic_iostream<_CharT, _Traits>(_CUDA_VSTD::move(__rhs))
+        , __sb_(_CUDA_VSTD::move(__rhs.__sb_))
     {
         basic_istream<_CharT, _Traits>::set_rdbuf(&__sb_);
     }
 
     // 27.8.2.2 Assign and swap:
     basic_stringstream& operator=(basic_stringstream&& __rhs) {
-        basic_iostream<char_type, traits_type>::operator=(_VSTD::move(__rhs));
-        __sb_ = _VSTD::move(__rhs.__sb_);
+        basic_iostream<char_type, traits_type>::operator=(_CUDA_VSTD::move(__rhs));
+        __sb_ = _CUDA_VSTD::move(__rhs.__sb_);
         return *this;
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void swap(basic_stringstream& __rhs) {
         basic_iostream<char_type, traits_type>::swap(__rhs);
         __sb_.swap(__rhs.__sb_);
     }
 
     // 27.8.2.3 Members:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     basic_stringbuf<char_type, traits_type, allocator_type>* rdbuf() const {
         return const_cast<basic_stringbuf<char_type, traits_type, allocator_type>*>(&__sb_);
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     string_type str() const {
         return __sb_.str();
     }
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void str(const string_type& __s) {
         __sb_.str(__s);
     }
 };
 
 template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 void
 swap(basic_stringstream<_CharT, _Traits, _Allocator>& __x,
      basic_stringstream<_CharT, _Traits, _Allocator>& __y)
@@ -860,15 +860,15 @@ swap(basic_stringstream<_CharT, _Traits, _Allocator>& __x,
     __x.swap(__y);
 }
 
-#if defined(_LIBCPP_ABI_ENABLE_ADDITIONAL_IOSTREAM_EXPLICIT_INSTANTIATIONS_1)
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_stringbuf<char>;
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_stringstream<char>;
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostringstream<char>;
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_istringstream<char>;
+#if defined(_LIBCUDACXX_ABI_ENABLE_ADDITIONAL_IOSTREAM_EXPLICIT_INSTANTIATIONS_1)
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS basic_stringbuf<char>;
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS basic_stringstream<char>;
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS basic_ostringstream<char>;
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS basic_istringstream<char>;
 #endif
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP_SSTREAM
+#endif // _LIBCUDACXX_SSTREAM

diff  --git a/libcxx/include/stack b/libcxx/include/stack
index 86435c4559de..9646773653c5 100644
--- a/libcxx/include/stack
+++ b/libcxx/include/stack
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_STACK
-#define _LIBCPP_STACK
+#ifndef _LIBCUDACXX_STACK
+#define _LIBCUDACXX_STACK
 
 /*
     stack synopsis
@@ -107,7 +107,7 @@ template <class T, class Container>
 #include <type_traits>
 #include <version>
 
-#ifndef _LIBCPP_REMOVE_TRANSITIVE_INCLUDES
+#ifndef _LIBCUDACXX_REMOVE_TRANSITIVE_INCLUDES
 #  include <functional>
 #endif
 
@@ -115,26 +115,26 @@ template <class T, class Container>
 #include <compare>
 #include <initializer_list>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-template <class _Tp, class _Container = deque<_Tp> > class _LIBCPP_TEMPLATE_VIS stack;
+template <class _Tp, class _Container = deque<_Tp> > class _LIBCUDACXX_TEMPLATE_VIS stack;
 
 template <class _Tp, class _Container>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator==(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y);
 
 template <class _Tp, class _Container>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator< (const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y);
 
 template <class _Tp, class _Container /*= deque<_Tp>*/>
-class _LIBCPP_TEMPLATE_VIS stack
+class _LIBCUDACXX_TEMPLATE_VIS stack
 {
 public:
     typedef _Container                               container_type;
@@ -148,112 +148,112 @@ protected:
     container_type c;
 
 public:
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     stack()
         _NOEXCEPT_(is_nothrow_default_constructible<container_type>::value)
         : c() {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     stack(const stack& __q) : c(__q.c) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     stack& operator=(const stack& __q) {c = __q.c; return *this;}
 
 
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
     stack(stack&& __q)
         _NOEXCEPT_(is_nothrow_move_constructible<container_type>::value)
-        : c(_VSTD::move(__q.c)) {}
+        : c(_CUDA_VSTD::move(__q.c)) {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     stack& operator=(stack&& __q)
         _NOEXCEPT_(is_nothrow_move_assignable<container_type>::value)
-        {c = _VSTD::move(__q.c); return *this;}
+        {c = _CUDA_VSTD::move(__q.c); return *this;}
 
-    _LIBCPP_INLINE_VISIBILITY
-    explicit stack(container_type&& __c) : c(_VSTD::move(__c)) {}
-#endif // _LIBCPP_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
+    explicit stack(container_type&& __c) : c(_CUDA_VSTD::move(__c)) {}
+#endif // _LIBCUDACXX_CXX03_LANG
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     explicit stack(const container_type& __c) : c(__c) {}
 
     template <class _Alloc>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         explicit stack(const _Alloc& __a,
                        __enable_if_t<uses_allocator<container_type, _Alloc>::value>* = 0)
             : c(__a) {}
     template <class _Alloc>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         stack(const container_type& __c, const _Alloc& __a,
               __enable_if_t<uses_allocator<container_type, _Alloc>::value>* = 0)
             : c(__c, __a) {}
     template <class _Alloc>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         stack(const stack& __s, const _Alloc& __a,
               __enable_if_t<uses_allocator<container_type, _Alloc>::value>* = 0)
             : c(__s.c, __a) {}
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
     template <class _Alloc>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         stack(container_type&& __c, const _Alloc& __a,
               __enable_if_t<uses_allocator<container_type, _Alloc>::value>* = 0)
-            : c(_VSTD::move(__c), __a) {}
+            : c(_CUDA_VSTD::move(__c), __a) {}
     template <class _Alloc>
-        _LIBCPP_INLINE_VISIBILITY
+        _LIBCUDACXX_INLINE_VISIBILITY
         stack(stack&& __s, const _Alloc& __a,
               __enable_if_t<uses_allocator<container_type, _Alloc>::value>* = 0)
-            : c(_VSTD::move(__s.c), __a) {}
-#endif // _LIBCPP_CXX03_LANG
+            : c(_CUDA_VSTD::move(__s.c), __a) {}
+#endif // _LIBCUDACXX_CXX03_LANG
 
-#if _LIBCPP_STD_VER > 20
+#if _LIBCUDACXX_STD_VER > 20
     template <class _InputIterator,
               class = __enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>>
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     stack(_InputIterator __first, _InputIterator __last) : c(__first, __last) {}
 
     template <class _InputIterator,
               class _Alloc,
               class = __enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>,
               class = __enable_if_t<uses_allocator<container_type, _Alloc>::value>>
-    _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_HIDE_FROM_ABI
     stack(_InputIterator __first, _InputIterator __last, const _Alloc& __alloc) : c(__first, __last, __alloc) {}
 #endif
 
-    _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_NODISCARD_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY
     bool empty()     const      {return c.empty();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     size_type size() const      {return c.size();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     reference top()             {return c.back();}
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     const_reference top() const {return c.back();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void push(const value_type& __v) {c.push_back(__v);}
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
-    void push(value_type&& __v) {c.push_back(_VSTD::move(__v));}
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_INLINE_VISIBILITY
+    void push(value_type&& __v) {c.push_back(_CUDA_VSTD::move(__v));}
 
     template <class... _Args>
-        _LIBCPP_INLINE_VISIBILITY
-#if _LIBCPP_STD_VER > 14
+        _LIBCUDACXX_INLINE_VISIBILITY
+#if _LIBCUDACXX_STD_VER > 14
         decltype(auto) emplace(_Args&&... __args)
-        { return c.emplace_back(_VSTD::forward<_Args>(__args)...);}
+        { return c.emplace_back(_CUDA_VSTD::forward<_Args>(__args)...);}
 #else
         void      emplace(_Args&&... __args)
-        {        c.emplace_back(_VSTD::forward<_Args>(__args)...);}
+        {        c.emplace_back(_CUDA_VSTD::forward<_Args>(__args)...);}
 #endif
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void pop() {c.pop_back();}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void swap(stack& __s)
         _NOEXCEPT_(__is_nothrow_swappable<container_type>::value)
     {
-        using _VSTD::swap;
+        using _CUDA_VSTD::swap;
         swap(c, __s.c);
     }
 
@@ -268,7 +268,7 @@ public:
     operator< (const stack<T1, _C1>& __x, const stack<T1, _C1>& __y);
 };
 
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
 template<class _Container,
          class = enable_if_t<!__is_allocator<_Container>::value>
 >
@@ -284,7 +284,7 @@ stack(_Container, _Alloc)
     -> stack<typename _Container::value_type, _Container>;
 #endif
 
-#if _LIBCPP_STD_VER > 20
+#if _LIBCUDACXX_STD_VER > 20
 template<class _InputIterator,
          class = __enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>>
 stack(_InputIterator, _InputIterator)
@@ -299,7 +299,7 @@ stack(_InputIterator, _InputIterator, _Alloc)
 #endif
 
 template <class _Tp, class _Container>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator==(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y)
 {
@@ -307,7 +307,7 @@ operator==(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y)
 }
 
 template <class _Tp, class _Container>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator< (const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y)
 {
@@ -315,7 +315,7 @@ operator< (const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y)
 }
 
 template <class _Tp, class _Container>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator!=(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y)
 {
@@ -323,7 +323,7 @@ operator!=(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y)
 }
 
 template <class _Tp, class _Container>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator> (const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y)
 {
@@ -331,7 +331,7 @@ operator> (const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y)
 }
 
 template <class _Tp, class _Container>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator>=(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y)
 {
@@ -339,7 +339,7 @@ operator>=(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y)
 }
 
 template <class _Tp, class _Container>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 bool
 operator<=(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y)
 {
@@ -347,7 +347,7 @@ operator<=(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y)
 }
 
 template <class _Tp, class _Container>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCUDACXX_INLINE_VISIBILITY
 __enable_if_t<__is_swappable<_Container>::value, void>
 swap(stack<_Tp, _Container>& __x, stack<_Tp, _Container>& __y)
     _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
@@ -356,11 +356,11 @@ swap(stack<_Tp, _Container>& __x, stack<_Tp, _Container>& __y)
 }
 
 template <class _Tp, class _Container, class _Alloc>
-struct _LIBCPP_TEMPLATE_VIS uses_allocator<stack<_Tp, _Container>, _Alloc>
+struct _LIBCUDACXX_TEMPLATE_VIS uses_allocator<stack<_Tp, _Container>, _Alloc>
     : public uses_allocator<_Container, _Alloc>
 {
 };
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STACK
+#endif // _LIBCUDACXX_STACK

diff  --git a/libcxx/include/stdatomic.h b/libcxx/include/stdatomic.h
index d9550c44061c..f5cd7f7555c7 100644
--- a/libcxx/include/stdatomic.h
+++ b/libcxx/include/stdatomic.h
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_STDATOMIC_H
-#define _LIBCPP_STDATOMIC_H
+#ifndef _LIBCUDACXX_STDATOMIC_H
+#define _LIBCUDACXX_STDATOMIC_H
 
 /*
     stdatomic.h synopsis
@@ -117,11 +117,11 @@ using std::atomic_signal_fence                         // see below
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 20
+#if _LIBCUDACXX_STD_VER > 20
 
 #include <atomic>
 #include <version>
@@ -132,95 +132,95 @@ using std::atomic_signal_fence                         // see below
 
 #define _Atomic(_Tp) ::std::atomic<_Tp>
 
-using std::memory_order _LIBCPP_USING_IF_EXISTS;
-using std::memory_order_relaxed _LIBCPP_USING_IF_EXISTS;
-using std::memory_order_consume _LIBCPP_USING_IF_EXISTS;
-using std::memory_order_acquire _LIBCPP_USING_IF_EXISTS;
-using std::memory_order_release _LIBCPP_USING_IF_EXISTS;
-using std::memory_order_acq_rel _LIBCPP_USING_IF_EXISTS;
-using std::memory_order_seq_cst _LIBCPP_USING_IF_EXISTS;
-
-using std::atomic_flag _LIBCPP_USING_IF_EXISTS;
-
-using std::atomic_bool _LIBCPP_USING_IF_EXISTS;
-using std::atomic_char _LIBCPP_USING_IF_EXISTS;
-using std::atomic_schar _LIBCPP_USING_IF_EXISTS;
-using std::atomic_uchar _LIBCPP_USING_IF_EXISTS;
-using std::atomic_short _LIBCPP_USING_IF_EXISTS;
-using std::atomic_ushort _LIBCPP_USING_IF_EXISTS;
-using std::atomic_int _LIBCPP_USING_IF_EXISTS;
-using std::atomic_uint _LIBCPP_USING_IF_EXISTS;
-using std::atomic_long _LIBCPP_USING_IF_EXISTS;
-using std::atomic_ulong _LIBCPP_USING_IF_EXISTS;
-using std::atomic_llong _LIBCPP_USING_IF_EXISTS;
-using std::atomic_ullong _LIBCPP_USING_IF_EXISTS;
-using std::atomic_char8_t _LIBCPP_USING_IF_EXISTS;
-using std::atomic_char16_t _LIBCPP_USING_IF_EXISTS;
-using std::atomic_char32_t _LIBCPP_USING_IF_EXISTS;
-using std::atomic_wchar_t _LIBCPP_USING_IF_EXISTS;
-
-using std::atomic_int8_t _LIBCPP_USING_IF_EXISTS;
-using std::atomic_uint8_t _LIBCPP_USING_IF_EXISTS;
-using std::atomic_int16_t _LIBCPP_USING_IF_EXISTS;
-using std::atomic_uint16_t _LIBCPP_USING_IF_EXISTS;
-using std::atomic_int32_t _LIBCPP_USING_IF_EXISTS;
-using std::atomic_uint32_t _LIBCPP_USING_IF_EXISTS;
-using std::atomic_int64_t _LIBCPP_USING_IF_EXISTS;
-using std::atomic_uint64_t _LIBCPP_USING_IF_EXISTS;
-
-using std::atomic_int_least8_t _LIBCPP_USING_IF_EXISTS;
-using std::atomic_uint_least8_t _LIBCPP_USING_IF_EXISTS;
-using std::atomic_int_least16_t _LIBCPP_USING_IF_EXISTS;
-using std::atomic_uint_least16_t _LIBCPP_USING_IF_EXISTS;
-using std::atomic_int_least32_t _LIBCPP_USING_IF_EXISTS;
-using std::atomic_uint_least32_t _LIBCPP_USING_IF_EXISTS;
-using std::atomic_int_least64_t _LIBCPP_USING_IF_EXISTS;
-using std::atomic_uint_least64_t _LIBCPP_USING_IF_EXISTS;
-
-using std::atomic_int_fast8_t _LIBCPP_USING_IF_EXISTS;
-using std::atomic_uint_fast8_t _LIBCPP_USING_IF_EXISTS;
-using std::atomic_int_fast16_t _LIBCPP_USING_IF_EXISTS;
-using std::atomic_uint_fast16_t _LIBCPP_USING_IF_EXISTS;
-using std::atomic_int_fast32_t _LIBCPP_USING_IF_EXISTS;
-using std::atomic_uint_fast32_t _LIBCPP_USING_IF_EXISTS;
-using std::atomic_int_fast64_t _LIBCPP_USING_IF_EXISTS;
-using std::atomic_uint_fast64_t _LIBCPP_USING_IF_EXISTS;
-
-using std::atomic_intptr_t _LIBCPP_USING_IF_EXISTS;
-using std::atomic_uintptr_t _LIBCPP_USING_IF_EXISTS;
-using std::atomic_size_t _LIBCPP_USING_IF_EXISTS;
-using std::atomic_ptr
diff _t _LIBCPP_USING_IF_EXISTS;
-using std::atomic_intmax_t _LIBCPP_USING_IF_EXISTS;
-using std::atomic_uintmax_t _LIBCPP_USING_IF_EXISTS;
-
-using std::atomic_compare_exchange_strong _LIBCPP_USING_IF_EXISTS;
-using std::atomic_compare_exchange_strong_explicit _LIBCPP_USING_IF_EXISTS;
-using std::atomic_compare_exchange_weak _LIBCPP_USING_IF_EXISTS;
-using std::atomic_compare_exchange_weak_explicit _LIBCPP_USING_IF_EXISTS;
-using std::atomic_exchange _LIBCPP_USING_IF_EXISTS;
-using std::atomic_exchange_explicit _LIBCPP_USING_IF_EXISTS;
-using std::atomic_fetch_add _LIBCPP_USING_IF_EXISTS;
-using std::atomic_fetch_add_explicit _LIBCPP_USING_IF_EXISTS;
-using std::atomic_fetch_and _LIBCPP_USING_IF_EXISTS;
-using std::atomic_fetch_and_explicit _LIBCPP_USING_IF_EXISTS;
-using std::atomic_fetch_or _LIBCPP_USING_IF_EXISTS;
-using std::atomic_fetch_or_explicit _LIBCPP_USING_IF_EXISTS;
-using std::atomic_fetch_sub _LIBCPP_USING_IF_EXISTS;
-using std::atomic_fetch_sub_explicit _LIBCPP_USING_IF_EXISTS;
-using std::atomic_flag_clear _LIBCPP_USING_IF_EXISTS;
-using std::atomic_flag_clear_explicit _LIBCPP_USING_IF_EXISTS;
-using std::atomic_flag_test_and_set _LIBCPP_USING_IF_EXISTS;
-using std::atomic_flag_test_and_set_explicit _LIBCPP_USING_IF_EXISTS;
-using std::atomic_is_lock_free _LIBCPP_USING_IF_EXISTS;
-using std::atomic_load _LIBCPP_USING_IF_EXISTS;
-using std::atomic_load_explicit _LIBCPP_USING_IF_EXISTS;
-using std::atomic_store _LIBCPP_USING_IF_EXISTS;
-using std::atomic_store_explicit _LIBCPP_USING_IF_EXISTS;
-
-using std::atomic_signal_fence _LIBCPP_USING_IF_EXISTS;
-using std::atomic_thread_fence _LIBCPP_USING_IF_EXISTS;
-
-#elif defined(_LIBCPP_COMPILER_CLANG_BASED)
+using std::memory_order _LIBCUDACXX_USING_IF_EXISTS;
+using std::memory_order_relaxed _LIBCUDACXX_USING_IF_EXISTS;
+using std::memory_order_consume _LIBCUDACXX_USING_IF_EXISTS;
+using std::memory_order_acquire _LIBCUDACXX_USING_IF_EXISTS;
+using std::memory_order_release _LIBCUDACXX_USING_IF_EXISTS;
+using std::memory_order_acq_rel _LIBCUDACXX_USING_IF_EXISTS;
+using std::memory_order_seq_cst _LIBCUDACXX_USING_IF_EXISTS;
+
+using std::atomic_flag _LIBCUDACXX_USING_IF_EXISTS;
+
+using std::atomic_bool _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_char _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_schar _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_uchar _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_short _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_ushort _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_int _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_uint _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_long _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_ulong _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_llong _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_ullong _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_char8_t _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_char16_t _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_char32_t _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_wchar_t _LIBCUDACXX_USING_IF_EXISTS;
+
+using std::atomic_int8_t _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_uint8_t _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_int16_t _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_uint16_t _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_int32_t _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_uint32_t _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_int64_t _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_uint64_t _LIBCUDACXX_USING_IF_EXISTS;
+
+using std::atomic_int_least8_t _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_uint_least8_t _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_int_least16_t _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_uint_least16_t _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_int_least32_t _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_uint_least32_t _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_int_least64_t _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_uint_least64_t _LIBCUDACXX_USING_IF_EXISTS;
+
+using std::atomic_int_fast8_t _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_uint_fast8_t _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_int_fast16_t _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_uint_fast16_t _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_int_fast32_t _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_uint_fast32_t _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_int_fast64_t _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_uint_fast64_t _LIBCUDACXX_USING_IF_EXISTS;
+
+using std::atomic_intptr_t _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_uintptr_t _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_size_t _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_ptr
diff _t _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_intmax_t _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_uintmax_t _LIBCUDACXX_USING_IF_EXISTS;
+
+using std::atomic_compare_exchange_strong _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_compare_exchange_strong_explicit _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_compare_exchange_weak _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_compare_exchange_weak_explicit _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_exchange _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_exchange_explicit _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_fetch_add _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_fetch_add_explicit _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_fetch_and _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_fetch_and_explicit _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_fetch_or _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_fetch_or_explicit _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_fetch_sub _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_fetch_sub_explicit _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_flag_clear _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_flag_clear_explicit _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_flag_test_and_set _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_flag_test_and_set_explicit _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_is_lock_free _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_load _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_load_explicit _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_store _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_store_explicit _LIBCUDACXX_USING_IF_EXISTS;
+
+using std::atomic_signal_fence _LIBCUDACXX_USING_IF_EXISTS;
+using std::atomic_thread_fence _LIBCUDACXX_USING_IF_EXISTS;
+
+#elif defined(_LIBCUDACXX_COMPILER_CLANG_BASED)
 
 // Before C++23, we include the next <stdatomic.h> on the path to avoid hijacking
 // the header. We do this because Clang has historically shipped a <stdatomic.h>
@@ -230,6 +230,6 @@ using std::atomic_thread_fence _LIBCPP_USING_IF_EXISTS;
 #   include_next <stdatomic.h>
 # endif
 
-#endif // _LIBCPP_STD_VER > 20
+#endif // _LIBCUDACXX_STD_VER > 20
 
-#endif // _LIBCPP_STDATOMIC_H
+#endif // _LIBCUDACXX_STDATOMIC_H

diff  --git a/libcxx/include/stdbool.h b/libcxx/include/stdbool.h
index 0bc1aa8304ad..e8353e0ad45d 100644
--- a/libcxx/include/stdbool.h
+++ b/libcxx/include/stdbool.h
@@ -6,8 +6,8 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-#ifndef _LIBCPP_STDBOOL_H
-#define _LIBCPP_STDBOOL_H
+#ifndef _LIBCUDACXX_STDBOOL_H
+#define _LIBCUDACXX_STDBOOL_H
 
 /*
     stdbool.h synopsis
@@ -20,7 +20,7 @@
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
@@ -34,4 +34,4 @@
 #define __bool_true_false_are_defined 1
 #endif
 
-#endif // _LIBCPP_STDBOOL_H
+#endif // _LIBCUDACXX_STDBOOL_H

diff  --git a/libcxx/include/stddef.h b/libcxx/include/stddef.h
index 19e344f2a000..8884db648537 100644
--- a/libcxx/include/stddef.h
+++ b/libcxx/include/stddef.h
@@ -10,14 +10,14 @@
 #if defined(__need_ptr
diff _t) || defined(__need_size_t) || \
     defined(__need_wchar_t) || defined(__need_NULL) || defined(__need_wint_t)
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
 #include_next <stddef.h>
 
-#elif !defined(_LIBCPP_STDDEF_H)
-#define _LIBCPP_STDDEF_H
+#elif !defined(_LIBCUDACXX_STDDEF_H)
+#define _LIBCUDACXX_STDDEF_H
 
 /*
     stddef.h synopsis
@@ -38,7 +38,7 @@
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
@@ -48,4 +48,4 @@
     typedef decltype(nullptr) nullptr_t;
 #endif
 
-#endif // _LIBCPP_STDDEF_H
+#endif // _LIBCUDACXX_STDDEF_H

diff  --git a/libcxx/include/stdexcept b/libcxx/include/stdexcept
index ee5a296cd930..5c665e03ba9d 100644
--- a/libcxx/include/stdexcept
+++ b/libcxx/include/stdexcept
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_STDEXCEPT
-#define _LIBCPP_STDEXCEPT
+#ifndef _LIBCUDACXX_STDEXCEPT
+#define _LIBCUDACXX_STDEXCEPT
 
 /*
     stdexcept synopsis
@@ -47,39 +47,39 @@ public:
 #include <exception>
 #include <iosfwd>  // for string forward decl
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
-#ifndef _LIBCPP_ABI_VCRUNTIME
-class _LIBCPP_HIDDEN __libcpp_refstring
+#ifndef _LIBCUDACXX_ABI_VCRUNTIME
+class _LIBCUDACXX_HIDDEN __LIBCUDACXX_refstring
 {
     const char* __imp_;
 
     bool __uses_refcount() const;
 public:
-    explicit __libcpp_refstring(const char* __msg);
-    __libcpp_refstring(const __libcpp_refstring& __s) _NOEXCEPT;
-    __libcpp_refstring& operator=(const __libcpp_refstring& __s) _NOEXCEPT;
-    ~__libcpp_refstring();
+    explicit __LIBCUDACXX_refstring(const char* __msg);
+    __LIBCUDACXX_refstring(const __LIBCUDACXX_refstring& __s) _NOEXCEPT;
+    __LIBCUDACXX_refstring& operator=(const __LIBCUDACXX_refstring& __s) _NOEXCEPT;
+    ~__LIBCUDACXX_refstring();
 
     const char* c_str() const _NOEXCEPT {return __imp_;}
 };
-#endif // !_LIBCPP_ABI_VCRUNTIME
+#endif // !_LIBCUDACXX_ABI_VCRUNTIME
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
 namespace std  // purposefully not using versioning namespace
 {
 
-class _LIBCPP_EXCEPTION_ABI logic_error
+class _LIBCUDACXX_EXCEPTION_ABI logic_error
     : public exception
 {
-#ifndef _LIBCPP_ABI_VCRUNTIME
+#ifndef _LIBCUDACXX_ABI_VCRUNTIME
 private:
-    _VSTD::__libcpp_refstring __imp_;
+    _CUDA_VSTD::__LIBCUDACXX_refstring __imp_;
 public:
     explicit logic_error(const string&);
     explicit logic_error(const char*);
@@ -92,17 +92,17 @@ public:
     virtual const char* what() const _NOEXCEPT;
 #else
 public:
-    explicit logic_error(const _VSTD::string&); // Symbol uses versioned std::string
-    _LIBCPP_INLINE_VISIBILITY explicit logic_error(const char* __s) : exception(__s) {}
+    explicit logic_error(const _CUDA_VSTD::string&); // Symbol uses versioned std::string
+    _LIBCUDACXX_INLINE_VISIBILITY explicit logic_error(const char* __s) : exception(__s) {}
 #endif
 };
 
-class _LIBCPP_EXCEPTION_ABI runtime_error
+class _LIBCUDACXX_EXCEPTION_ABI runtime_error
     : public exception
 {
-#ifndef _LIBCPP_ABI_VCRUNTIME
+#ifndef _LIBCUDACXX_ABI_VCRUNTIME
 private:
-    _VSTD::__libcpp_refstring __imp_;
+    _CUDA_VSTD::__LIBCUDACXX_refstring __imp_;
 public:
     explicit runtime_error(const string&);
     explicit runtime_error(const char*);
@@ -115,96 +115,96 @@ public:
     virtual const char* what() const _NOEXCEPT;
 #else
 public:
-   explicit runtime_error(const _VSTD::string&); // Symbol uses versioned std::string
-   _LIBCPP_INLINE_VISIBILITY explicit runtime_error(const char* __s) : exception(__s) {}
-#endif // _LIBCPP_ABI_VCRUNTIME
+   explicit runtime_error(const _CUDA_VSTD::string&); // Symbol uses versioned std::string
+   _LIBCUDACXX_INLINE_VISIBILITY explicit runtime_error(const char* __s) : exception(__s) {}
+#endif // _LIBCUDACXX_ABI_VCRUNTIME
 };
 
-class _LIBCPP_EXCEPTION_ABI domain_error
+class _LIBCUDACXX_EXCEPTION_ABI domain_error
     : public logic_error
 {
 public:
-    _LIBCPP_INLINE_VISIBILITY explicit domain_error(const string& __s) : logic_error(__s) {}
-    _LIBCPP_INLINE_VISIBILITY explicit domain_error(const char* __s)   : logic_error(__s) {}
+    _LIBCUDACXX_INLINE_VISIBILITY explicit domain_error(const string& __s) : logic_error(__s) {}
+    _LIBCUDACXX_INLINE_VISIBILITY explicit domain_error(const char* __s)   : logic_error(__s) {}
 
-#ifndef _LIBCPP_ABI_VCRUNTIME
+#ifndef _LIBCUDACXX_ABI_VCRUNTIME
     domain_error(const domain_error&) _NOEXCEPT = default;
     virtual ~domain_error() _NOEXCEPT;
 #endif
 };
 
-class _LIBCPP_EXCEPTION_ABI invalid_argument
+class _LIBCUDACXX_EXCEPTION_ABI invalid_argument
     : public logic_error
 {
 public:
-    _LIBCPP_INLINE_VISIBILITY explicit invalid_argument(const string& __s) : logic_error(__s) {}
-    _LIBCPP_INLINE_VISIBILITY explicit invalid_argument(const char* __s)   : logic_error(__s) {}
+    _LIBCUDACXX_INLINE_VISIBILITY explicit invalid_argument(const string& __s) : logic_error(__s) {}
+    _LIBCUDACXX_INLINE_VISIBILITY explicit invalid_argument(const char* __s)   : logic_error(__s) {}
 
-#ifndef _LIBCPP_ABI_VCRUNTIME
+#ifndef _LIBCUDACXX_ABI_VCRUNTIME
     invalid_argument(const invalid_argument&) _NOEXCEPT = default;
     virtual ~invalid_argument() _NOEXCEPT;
 #endif
 };
 
-class _LIBCPP_EXCEPTION_ABI length_error
+class _LIBCUDACXX_EXCEPTION_ABI length_error
     : public logic_error
 {
 public:
-    _LIBCPP_INLINE_VISIBILITY explicit length_error(const string& __s) : logic_error(__s) {}
-    _LIBCPP_INLINE_VISIBILITY explicit length_error(const char* __s)   : logic_error(__s) {}
-#ifndef _LIBCPP_ABI_VCRUNTIME
+    _LIBCUDACXX_INLINE_VISIBILITY explicit length_error(const string& __s) : logic_error(__s) {}
+    _LIBCUDACXX_INLINE_VISIBILITY explicit length_error(const char* __s)   : logic_error(__s) {}
+#ifndef _LIBCUDACXX_ABI_VCRUNTIME
     length_error(const length_error&) _NOEXCEPT = default;
     virtual ~length_error() _NOEXCEPT;
 #endif
 };
 
-class _LIBCPP_EXCEPTION_ABI out_of_range
+class _LIBCUDACXX_EXCEPTION_ABI out_of_range
     : public logic_error
 {
 public:
-    _LIBCPP_INLINE_VISIBILITY explicit out_of_range(const string& __s) : logic_error(__s) {}
-    _LIBCPP_INLINE_VISIBILITY explicit out_of_range(const char* __s)   : logic_error(__s) {}
+    _LIBCUDACXX_INLINE_VISIBILITY explicit out_of_range(const string& __s) : logic_error(__s) {}
+    _LIBCUDACXX_INLINE_VISIBILITY explicit out_of_range(const char* __s)   : logic_error(__s) {}
 
-#ifndef _LIBCPP_ABI_VCRUNTIME
+#ifndef _LIBCUDACXX_ABI_VCRUNTIME
     out_of_range(const out_of_range&) _NOEXCEPT = default;
     virtual ~out_of_range() _NOEXCEPT;
 #endif
 };
 
-class _LIBCPP_EXCEPTION_ABI range_error
+class _LIBCUDACXX_EXCEPTION_ABI range_error
     : public runtime_error
 {
 public:
-    _LIBCPP_INLINE_VISIBILITY explicit range_error(const string& __s) : runtime_error(__s) {}
-    _LIBCPP_INLINE_VISIBILITY explicit range_error(const char* __s)   : runtime_error(__s) {}
+    _LIBCUDACXX_INLINE_VISIBILITY explicit range_error(const string& __s) : runtime_error(__s) {}
+    _LIBCUDACXX_INLINE_VISIBILITY explicit range_error(const char* __s)   : runtime_error(__s) {}
 
-#ifndef _LIBCPP_ABI_VCRUNTIME
+#ifndef _LIBCUDACXX_ABI_VCRUNTIME
     range_error(const range_error&) _NOEXCEPT = default;
     virtual ~range_error() _NOEXCEPT;
 #endif
 };
 
-class _LIBCPP_EXCEPTION_ABI overflow_error
+class _LIBCUDACXX_EXCEPTION_ABI overflow_error
     : public runtime_error
 {
 public:
-    _LIBCPP_INLINE_VISIBILITY explicit overflow_error(const string& __s) : runtime_error(__s) {}
-    _LIBCPP_INLINE_VISIBILITY explicit overflow_error(const char* __s)   : runtime_error(__s) {}
+    _LIBCUDACXX_INLINE_VISIBILITY explicit overflow_error(const string& __s) : runtime_error(__s) {}
+    _LIBCUDACXX_INLINE_VISIBILITY explicit overflow_error(const char* __s)   : runtime_error(__s) {}
 
-#ifndef _LIBCPP_ABI_VCRUNTIME
+#ifndef _LIBCUDACXX_ABI_VCRUNTIME
     overflow_error(const overflow_error&) _NOEXCEPT = default;
     virtual ~overflow_error() _NOEXCEPT;
 #endif
 };
 
-class _LIBCPP_EXCEPTION_ABI underflow_error
+class _LIBCUDACXX_EXCEPTION_ABI underflow_error
     : public runtime_error
 {
 public:
-    _LIBCPP_INLINE_VISIBILITY explicit underflow_error(const string& __s) : runtime_error(__s) {}
-    _LIBCPP_INLINE_VISIBILITY explicit underflow_error(const char* __s)   : runtime_error(__s) {}
+    _LIBCUDACXX_INLINE_VISIBILITY explicit underflow_error(const string& __s) : runtime_error(__s) {}
+    _LIBCUDACXX_INLINE_VISIBILITY explicit underflow_error(const char* __s)   : runtime_error(__s) {}
 
-#ifndef _LIBCPP_ABI_VCRUNTIME
+#ifndef _LIBCUDACXX_ABI_VCRUNTIME
     underflow_error(const underflow_error&) _NOEXCEPT = default;
     virtual ~underflow_error() _NOEXCEPT;
 #endif
@@ -212,99 +212,99 @@ public:
 
 } // namespace std
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 // in the dylib
-_LIBCPP_NORETURN _LIBCPP_FUNC_VIS void __throw_runtime_error(const char*);
+_LIBCUDACXX_NORETURN _LIBCUDACXX_FUNC_VIS void __throw_runtime_error(const char*);
 
-_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_NORETURN inline _LIBCUDACXX_INLINE_VISIBILITY
 void __throw_logic_error(const char*__msg)
 {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     throw logic_error(__msg);
 #else
     ((void)__msg);
-    _VSTD::abort();
+    _CUDA_VSTD::abort();
 #endif
 }
 
-_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_NORETURN inline _LIBCUDACXX_INLINE_VISIBILITY
 void __throw_domain_error(const char*__msg)
 {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     throw domain_error(__msg);
 #else
     ((void)__msg);
-    _VSTD::abort();
+    _CUDA_VSTD::abort();
 #endif
 }
 
-_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_NORETURN inline _LIBCUDACXX_INLINE_VISIBILITY
 void __throw_invalid_argument(const char*__msg)
 {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     throw invalid_argument(__msg);
 #else
     ((void)__msg);
-    _VSTD::abort();
+    _CUDA_VSTD::abort();
 #endif
 }
 
-_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_NORETURN inline _LIBCUDACXX_INLINE_VISIBILITY
 void __throw_length_error(const char*__msg)
 {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     throw length_error(__msg);
 #else
     ((void)__msg);
-    _VSTD::abort();
+    _CUDA_VSTD::abort();
 #endif
 }
 
-_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_NORETURN inline _LIBCUDACXX_INLINE_VISIBILITY
 void __throw_out_of_range(const char*__msg)
 {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     throw out_of_range(__msg);
 #else
     ((void)__msg);
-    _VSTD::abort();
+    _CUDA_VSTD::abort();
 #endif
 }
 
-_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_NORETURN inline _LIBCUDACXX_INLINE_VISIBILITY
 void __throw_range_error(const char*__msg)
 {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     throw range_error(__msg);
 #else
     ((void)__msg);
-    _VSTD::abort();
+    _CUDA_VSTD::abort();
 #endif
 }
 
-_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_NORETURN inline _LIBCUDACXX_INLINE_VISIBILITY
 void __throw_overflow_error(const char*__msg)
 {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     throw overflow_error(__msg);
 #else
     ((void)__msg);
-    _VSTD::abort();
+    _CUDA_VSTD::abort();
 #endif
 }
 
-_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
+_LIBCUDACXX_NORETURN inline _LIBCUDACXX_INLINE_VISIBILITY
 void __throw_underflow_error(const char*__msg)
 {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     throw underflow_error(__msg);
 #else
     ((void)__msg);
-    _VSTD::abort();
+    _CUDA_VSTD::abort();
 #endif
 }
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STDEXCEPT
+#endif // _LIBCUDACXX_STDEXCEPT

diff  --git a/libcxx/include/stdint.h b/libcxx/include/stdint.h
index ee71f62ab095..693505bfb2e6 100644
--- a/libcxx/include/stdint.h
+++ b/libcxx/include/stdint.h
@@ -7,12 +7,12 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_STDINT_H
+#ifndef _LIBCUDACXX_STDINT_H
 // AIX system headers need stdint.h to be re-enterable while _STD_TYPES_T
 // is defined until an inclusion of it without _STD_TYPES_T occurs, in which
 // case the header guard macro is defined.
 #if !defined(_AIX) || !defined(_STD_TYPES_T)
-#define _LIBCPP_STDINT_H
+#define _LIBCUDACXX_STDINT_H
 #endif // _STD_TYPES_T
 
 /*
@@ -105,7 +105,7 @@
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
@@ -122,4 +122,4 @@
 
 #include_next <stdint.h>
 
-#endif // _LIBCPP_STDINT_H
+#endif // _LIBCUDACXX_STDINT_H

diff  --git a/libcxx/include/stdio.h b/libcxx/include/stdio.h
index ad1b4c05f1fa..4294a737768c 100644
--- a/libcxx/include/stdio.h
+++ b/libcxx/include/stdio.h
@@ -9,14 +9,14 @@
 
 #if defined(__need_FILE) || defined(__need___FILE)
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
 #include_next <stdio.h>
 
-#elif !defined(_LIBCPP_STDIO_H)
-#define _LIBCPP_STDIO_H
+#elif !defined(_LIBCUDACXX_STDIO_H)
+#define _LIBCUDACXX_STDIO_H
 
 /*
     stdio.h synopsis
@@ -100,7 +100,7 @@ void perror(const char* s);
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
@@ -116,4 +116,4 @@ void perror(const char* s);
 
 #endif
 
-#endif // _LIBCPP_STDIO_H
+#endif // _LIBCUDACXX_STDIO_H

diff  --git a/libcxx/include/stdlib.h b/libcxx/include/stdlib.h
index e4dce9c54546..c7230696de4e 100644
--- a/libcxx/include/stdlib.h
+++ b/libcxx/include/stdlib.h
@@ -9,14 +9,14 @@
 
 #if defined(__need_malloc_and_calloc)
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
 #include_next <stdlib.h>
 
-#elif !defined(_LIBCPP_STDLIB_H)
-#define _LIBCPP_STDLIB_H
+#elif !defined(_LIBCUDACXX_STDLIB_H)
+#define _LIBCUDACXX_STDLIB_H
 
 /*
     stdlib.h synopsis
@@ -86,7 +86,7 @@ void *aligned_alloc(size_t alignment, size_t size);                       // C11
 
 #include <__config>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
@@ -107,25 +107,25 @@ extern "C++" {
 #endif
 
 // MSVCRT already has the correct prototype in <stdlib.h> if __cplusplus is defined
-#if !defined(_LIBCPP_MSVCRT) && !defined(__sun__)
-inline _LIBCPP_INLINE_VISIBILITY long abs(long __x) _NOEXCEPT {
+#if !defined(_LIBCUDACXX_MSVCRT) && !defined(__sun__)
+inline _LIBCUDACXX_INLINE_VISIBILITY long abs(long __x) _NOEXCEPT {
   return __builtin_labs(__x);
 }
-inline _LIBCPP_INLINE_VISIBILITY long long abs(long long __x) _NOEXCEPT {
+inline _LIBCUDACXX_INLINE_VISIBILITY long long abs(long long __x) _NOEXCEPT {
   return __builtin_llabs(__x);
 }
-#endif // !defined(_LIBCPP_MSVCRT) && !defined(__sun__)
+#endif // !defined(_LIBCUDACXX_MSVCRT) && !defined(__sun__)
 
 #if !defined(__sun__)
-inline _LIBCPP_INLINE_VISIBILITY float abs(float __lcpp_x) _NOEXCEPT {
+inline _LIBCUDACXX_INLINE_VISIBILITY float abs(float __lcpp_x) _NOEXCEPT {
   return __builtin_fabsf(__lcpp_x); // Use builtins to prevent needing math.h
 }
 
-inline _LIBCPP_INLINE_VISIBILITY double abs(double __lcpp_x) _NOEXCEPT {
+inline _LIBCUDACXX_INLINE_VISIBILITY double abs(double __lcpp_x) _NOEXCEPT {
   return __builtin_fabs(__lcpp_x);
 }
 
-inline _LIBCPP_INLINE_VISIBILITY long double
+inline _LIBCUDACXX_INLINE_VISIBILITY long double
 abs(long double __lcpp_x) _NOEXCEPT {
   return __builtin_fabsl(__lcpp_x);
 }
@@ -144,18 +144,18 @@ abs(long double __lcpp_x) _NOEXCEPT {
 #endif
 
 // MSVCRT already has the correct prototype in <stdlib.h> if __cplusplus is defined
-#if !defined(_LIBCPP_MSVCRT) && !defined(__sun__)
-inline _LIBCPP_INLINE_VISIBILITY ldiv_t div(long __x, long __y) _NOEXCEPT {
+#if !defined(_LIBCUDACXX_MSVCRT) && !defined(__sun__)
+inline _LIBCUDACXX_INLINE_VISIBILITY ldiv_t div(long __x, long __y) _NOEXCEPT {
   return ::ldiv(__x, __y);
 }
 #if !(defined(__FreeBSD__) && !defined(__LONG_LONG_SUPPORTED))
-inline _LIBCPP_INLINE_VISIBILITY lldiv_t div(long long __x,
+inline _LIBCUDACXX_INLINE_VISIBILITY lldiv_t div(long long __x,
                                              long long __y) _NOEXCEPT {
   return ::lldiv(__x, __y);
 }
 #endif
-#endif // _LIBCPP_MSVCRT / __sun__
+#endif // _LIBCUDACXX_MSVCRT / __sun__
 } // extern "C++"
 #endif // __cplusplus
 
-#endif // _LIBCPP_STDLIB_H
+#endif // _LIBCUDACXX_STDLIB_H

diff  --git a/libcxx/include/streambuf b/libcxx/include/streambuf
index 53a71720f11a..6961e57d594f 100644
--- a/libcxx/include/streambuf
+++ b/libcxx/include/streambuf
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_STREAMBUF
-#define _LIBCPP_STREAMBUF
+#ifndef _LIBCUDACXX_STREAMBUF
+#define _LIBCUDACXX_STREAMBUF
 
 /*
     streambuf synopsis
@@ -114,17 +114,17 @@ protected:
 #include <iosfwd>
 #include <version>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 template <class _CharT, class _Traits>
-class _LIBCPP_TEMPLATE_VIS basic_streambuf
+class _LIBCUDACXX_TEMPLATE_VIS basic_streambuf
 {
 public:
     // types:
@@ -140,7 +140,7 @@ public:
     virtual ~basic_streambuf();
 
     // 27.6.2.2.1 locales:
-    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
+    inline _LIBCUDACXX_HIDE_FROM_ABI_AFTER_V1
     locale pubimbue(const locale& __loc) {
         imbue(__loc);
         locale __r = __loc_;
@@ -148,70 +148,70 @@ public:
         return __r;
     }
 
-    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
+    inline _LIBCUDACXX_HIDE_FROM_ABI_AFTER_V1
     locale getloc() const { return __loc_; }
 
     // 27.6.2.2.2 buffer and positioning:
-    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
+    inline _LIBCUDACXX_HIDE_FROM_ABI_AFTER_V1
     basic_streambuf* pubsetbuf(char_type* __s, streamsize __n)
     { return setbuf(__s, __n); }
 
-    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
+    inline _LIBCUDACXX_HIDE_FROM_ABI_AFTER_V1
     pos_type pubseekoff(off_type __off, ios_base::seekdir __way,
                         ios_base::openmode __which = ios_base::in | ios_base::out)
     { return seekoff(__off, __way, __which); }
 
-    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
+    inline _LIBCUDACXX_HIDE_FROM_ABI_AFTER_V1
     pos_type pubseekpos(pos_type __sp,
                         ios_base::openmode __which = ios_base::in | ios_base::out)
     { return seekpos(__sp, __which); }
 
-    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
+    inline _LIBCUDACXX_HIDE_FROM_ABI_AFTER_V1
     int pubsync() { return sync(); }
 
     // Get and put areas:
     // 27.6.2.2.3 Get area:
-    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
+    inline _LIBCUDACXX_HIDE_FROM_ABI_AFTER_V1
     streamsize in_avail() {
         if (__ninp_ < __einp_)
             return static_cast<streamsize>(__einp_ - __ninp_);
         return showmanyc();
     }
 
-    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
+    inline _LIBCUDACXX_HIDE_FROM_ABI_AFTER_V1
     int_type snextc() {
         if (sbumpc() == traits_type::eof())
             return traits_type::eof();
         return sgetc();
     }
 
-    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
+    inline _LIBCUDACXX_HIDE_FROM_ABI_AFTER_V1
     int_type sbumpc() {
         if (__ninp_ == __einp_)
             return uflow();
         return traits_type::to_int_type(*__ninp_++);
     }
 
-    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
+    inline _LIBCUDACXX_HIDE_FROM_ABI_AFTER_V1
     int_type sgetc() {
         if (__ninp_ == __einp_)
             return underflow();
         return traits_type::to_int_type(*__ninp_);
     }
 
-    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
+    inline _LIBCUDACXX_HIDE_FROM_ABI_AFTER_V1
     streamsize sgetn(char_type* __s, streamsize __n)
     { return xsgetn(__s, __n); }
 
     // 27.6.2.2.4 Putback:
-    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
+    inline _LIBCUDACXX_HIDE_FROM_ABI_AFTER_V1
     int_type sputbackc(char_type __c) {
         if (__binp_ == __ninp_ || !traits_type::eq(__c, __ninp_[-1]))
             return pbackfail(traits_type::to_int_type(__c));
         return traits_type::to_int_type(*--__ninp_);
     }
 
-    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
+    inline _LIBCUDACXX_HIDE_FROM_ABI_AFTER_V1
     int_type sungetc() {
         if (__binp_ == __ninp_)
           return pbackfail();
@@ -219,7 +219,7 @@ public:
     }
 
     // 27.6.2.2.5 Put area:
-    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
+    inline _LIBCUDACXX_HIDE_FROM_ABI_AFTER_V1
     int_type sputc(char_type __c) {
         if (__nout_ == __eout_)
             return overflow(traits_type::to_int_type(__c));
@@ -227,7 +227,7 @@ public:
         return traits_type::to_int_type(__c);
     }
 
-    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
+    inline _LIBCUDACXX_HIDE_FROM_ABI_AFTER_V1
     streamsize sputn(const char_type* __s, streamsize __n)
     { return xsputn(__s, __n); }
 
@@ -238,14 +238,14 @@ protected:
     void swap(basic_streambuf& __rhs);
 
     // 27.6.2.3.2 Get area:
-    _LIBCPP_INLINE_VISIBILITY char_type* eback() const {return __binp_;}
-    _LIBCPP_INLINE_VISIBILITY char_type* gptr()  const {return __ninp_;}
-    _LIBCPP_INLINE_VISIBILITY char_type* egptr() const {return __einp_;}
+    _LIBCUDACXX_INLINE_VISIBILITY char_type* eback() const {return __binp_;}
+    _LIBCUDACXX_INLINE_VISIBILITY char_type* gptr()  const {return __ninp_;}
+    _LIBCUDACXX_INLINE_VISIBILITY char_type* egptr() const {return __einp_;}
 
-    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
+    inline _LIBCUDACXX_HIDE_FROM_ABI_AFTER_V1
     void gbump(int __n) { __ninp_ += __n; }
 
-    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
+    inline _LIBCUDACXX_HIDE_FROM_ABI_AFTER_V1
     void setg(char_type* __gbeg, char_type* __gnext, char_type* __gend) {
         __binp_ = __gbeg;
         __ninp_ = __gnext;
@@ -253,17 +253,17 @@ protected:
     }
 
     // 27.6.2.3.3 Put area:
-    _LIBCPP_INLINE_VISIBILITY char_type* pbase() const {return __bout_;}
-    _LIBCPP_INLINE_VISIBILITY char_type* pptr()  const {return __nout_;}
-    _LIBCPP_INLINE_VISIBILITY char_type* epptr() const {return __eout_;}
+    _LIBCUDACXX_INLINE_VISIBILITY char_type* pbase() const {return __bout_;}
+    _LIBCUDACXX_INLINE_VISIBILITY char_type* pptr()  const {return __nout_;}
+    _LIBCUDACXX_INLINE_VISIBILITY char_type* epptr() const {return __eout_;}
 
-    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
+    inline _LIBCUDACXX_HIDE_FROM_ABI_AFTER_V1
     void pbump(int __n) { __nout_ += __n; }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCUDACXX_INLINE_VISIBILITY
     void __pbump(streamsize __n) { __nout_ += __n; }
 
-    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
+    inline _LIBCUDACXX_HIDE_FROM_ABI_AFTER_V1
     void setp(char_type* __pbeg, char_type* __pend) {
         __bout_ = __nout_ = __pbeg;
         __eout_ = __pend;
@@ -350,13 +350,13 @@ template <class _CharT, class _Traits>
 void
 basic_streambuf<_CharT, _Traits>::swap(basic_streambuf& __sb)
 {
-    _VSTD::swap(__loc_, __sb.__loc_);
-    _VSTD::swap(__binp_, __sb.__binp_);
-    _VSTD::swap(__ninp_, __sb.__ninp_);
-    _VSTD::swap(__einp_, __sb.__einp_);
-    _VSTD::swap(__bout_, __sb.__bout_);
-    _VSTD::swap(__nout_, __sb.__nout_);
-    _VSTD::swap(__eout_, __sb.__eout_);
+    _CUDA_VSTD::swap(__loc_, __sb.__loc_);
+    _CUDA_VSTD::swap(__binp_, __sb.__binp_);
+    _CUDA_VSTD::swap(__ninp_, __sb.__ninp_);
+    _CUDA_VSTD::swap(__einp_, __sb.__einp_);
+    _CUDA_VSTD::swap(__bout_, __sb.__bout_);
+    _CUDA_VSTD::swap(__nout_, __sb.__nout_);
+    _CUDA_VSTD::swap(__eout_, __sb.__eout_);
 }
 
 template <class _CharT, class _Traits>
@@ -412,8 +412,8 @@ basic_streambuf<_CharT, _Traits>::xsgetn(char_type* __s, streamsize __n)
     {
         if (__ninp_ < __einp_)
         {
-            const streamsize __len = _VSTD::min(static_cast<streamsize>(INT_MAX),
-                                _VSTD::min(__einp_ - __ninp_, __n - __i));
+            const streamsize __len = _CUDA_VSTD::min(static_cast<streamsize>(INT_MAX),
+                                _CUDA_VSTD::min(__einp_ - __ninp_, __n - __i));
             traits_type::copy(__s, __ninp_, __len);
             __s +=  __len;
             __i +=  __len;
@@ -471,7 +471,7 @@ basic_streambuf<_CharT, _Traits>::xsputn(const char_type* __s, streamsize __n)
         }
         else
         {
-            streamsize __chunk_size = _VSTD::min(__eout_ - __nout_, __n - __i);
+            streamsize __chunk_size = _CUDA_VSTD::min(__eout_ - __nout_, __n - __i);
             traits_type::copy(__nout_, __s, __chunk_size);
             __nout_ += __chunk_size;
             __s     += __chunk_size;
@@ -488,14 +488,14 @@ basic_streambuf<_CharT, _Traits>::overflow(int_type)
     return traits_type::eof();
 }
 
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_streambuf<char>;
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_streambuf<wchar_t>;
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS basic_streambuf<char>;
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS basic_streambuf<wchar_t>;
 
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ios<char>;
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ios<wchar_t>;
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS basic_ios<char>;
+extern template class _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS basic_ios<wchar_t>;
 
-_LIBCPP_END_NAMESPACE_STD
+_LIBCUDACXX_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCUDACXX_POP_MACROS
 
-#endif // _LIBCPP_STREAMBUF
+#endif // _LIBCUDACXX_STREAMBUF

diff  --git a/libcxx/include/string b/libcxx/include/string
index 3723dc8a3938..4d9b6fa99c80 100644
--- a/libcxx/include/string
+++ b/libcxx/include/string
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_STRING
-#define _LIBCPP_STRING
+#ifndef _LIBCUDACXX_STRING
+#define _LIBCUDACXX_STRING
 
 /*
     string synopsis
@@ -552,11 +552,11 @@ basic_string<char32_t> operator "" s( const char32_t *str, size_t len );
 #include <type_traits>
 #include <version>
 
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
 #  include <cwchar>
 #endif
 
-#ifndef _LIBCPP_REMOVE_TRANSITIVE_INCLUDES
+#ifndef _LIBCUDACXX_REMOVE_TRANSITIVE_INCLUDES
 #  include <algorithm>
 #  include <functional>
 #  include <iterator>
@@ -579,45 +579,45 @@ basic_string<char32_t> operator "" s( const char32_t *str, size_t len );
 #include <compare>
 #include <initializer_list>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#if !defined(_LIBCUDACXX_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
+_LIBCUDACXX_PUSH_MACROS
 #include <__undef_macros>
 
 
-_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCUDACXX_BEGIN_NAMESPACE_STD
 
 // basic_string
 
 template<class _CharT, class _Traits, class _Allocator>
 basic_string<_CharT, _Traits, _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 operator+(const basic_string<_CharT, _Traits, _Allocator>& __x,
           const basic_string<_CharT, _Traits, _Allocator>& __y);
 
 template<class _CharT, class _Traits, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 basic_string<_CharT, _Traits, _Allocator>
 operator+(const _CharT* __x, const basic_string<_CharT,_Traits,_Allocator>& __y);
 
 template<class _CharT, class _Traits, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 basic_string<_CharT, _Traits, _Allocator>
 operator+(_CharT __x, const basic_string<_CharT,_Traits,_Allocator>& __y);
 
 template<class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 basic_string<_CharT, _Traits, _Allocator>
 operator+(const basic_string<_CharT, _Traits, _Allocator>& __x, const _CharT* __y);
 
 template<class _CharT, class _Traits, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 basic_string<_CharT, _Traits, _Allocator>
 operator+(const basic_string<_CharT, _Traits, _Allocator>& __x, _CharT __y);
 
-extern template _LIBCPP_FUNC_VIS string operator+<char, char_traits<char>, allocator<char> >(char const*, string const&);
+extern template _LIBCUDACXX_FUNC_VIS string operator+<char, char_traits<char>, allocator<char> >(char const*, string const&);
 
 template <class _Iter>
 struct __string_is_trivial_iterator : public false_type {};
@@ -636,7 +636,7 @@ struct __can_be_converted_to_string_view : public _BoolConstant<
      !is_convertible<const _Tp&, const _CharT*>::value
     > {};
 
-#ifndef _LIBCPP_HAS_NO_CHAR8_T
+#ifndef _LIBCUDACXX_HAS_NO_CHAR8_T
 typedef basic_string<char8_t> u8string;
 #endif
 typedef basic_string<char16_t> u16string;
@@ -646,12 +646,12 @@ struct __uninitialized_size_tag {};
 
 template<class _CharT, class _Traits, class _Allocator>
 class
-    _LIBCPP_TEMPLATE_VIS
-#ifndef _LIBCPP_HAS_NO_CHAR8_T
-    _LIBCPP_PREFERRED_NAME(u8string)
+    _LIBCUDACXX_TEMPLATE_VIS
+#ifndef _LIBCUDACXX_HAS_NO_CHAR8_T
+    _LIBCUDACXX_PREFERRED_NAME(u8string)
 #endif
-    _LIBCPP_PREFERRED_NAME(u16string)
-    _LIBCPP_PREFERRED_NAME(u32string)
+    _LIBCUDACXX_PREFERRED_NAME(u16string)
+    _LIBCUDACXX_PREFERRED_NAME(u32string)
     basic_string
 {
 public:
@@ -684,7 +684,7 @@ public:
 private:
     static_assert(CHAR_BIT == 8, "This implementation assumes that one byte contains 8 bits");
 
-#ifdef _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
+#ifdef _LIBCUDACXX_ABI_ALTERNATE_STRING_LAYOUT
 
     struct __long
     {
@@ -718,15 +718,15 @@ private:
 // This does not impact the short string representation, since we never need the MSB
 // for representing the size of a short string anyway.
 
-#ifdef _LIBCPP_BIG_ENDIAN
+#ifdef _LIBCUDACXX_BIG_ENDIAN
     static const size_type __endian_factor = 2;
 #else
     static const size_type __endian_factor = 1;
 #endif
 
-#else // _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
+#else // _LIBCUDACXX_ABI_ALTERNATE_STRING_LAYOUT
 
-#ifdef _LIBCPP_BIG_ENDIAN
+#ifdef _LIBCUDACXX_BIG_ENDIAN
     static const size_type __endian_factor = 1;
 #else
     static const size_type __endian_factor = 2;
@@ -738,7 +738,7 @@ private:
     // size used, e.g., it is 4 bytes on AIX. See D128285 for details.
     struct __long
     {
-        struct _LIBCPP_PACKED {
+        struct _LIBCUDACXX_PACKED {
             size_type __is_long_ : 1;
             size_type __cap_ : sizeof(size_type) * CHAR_BIT - 1;
         };
@@ -751,7 +751,7 @@ private:
 
     struct __short
     {
-        struct _LIBCPP_PACKED {
+        struct _LIBCUDACXX_PACKED {
             unsigned char __is_long_ : 1;
             unsigned char __size_ : 7;
         };
@@ -759,7 +759,7 @@ private:
         value_type __data_[__min_cap];
     };
 
-#endif // _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
+#endif // _LIBCUDACXX_ABI_ALTERNATE_STRING_LAYOUT
 
     static_assert(sizeof(__short) == (sizeof(value_type) * (__min_cap + 1)), "__short has an unexpected size.");
 
@@ -787,7 +787,7 @@ private:
     // Construct a string with the given allocator and enough storage to hold `__size` characters, but
     // don't initialize the characters. The contents of the string, including the null terminator, must be
     // initialized separately.
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     explicit basic_string(__uninitialized_size_tag, size_type __size, const allocator_type& __a)
             : __r_(__default_init_tag(), __a) {
         if (__size > max_size())
@@ -807,207 +807,207 @@ private:
     }
 
 public:
-    _LIBCPP_TEMPLATE_DATA_VIS
+    _LIBCUDACXX_TEMPLATE_DATA_VIS
     static const size_type npos = -1;
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 basic_string()
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 basic_string()
         _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value);
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 explicit basic_string(const allocator_type& __a)
-#if _LIBCPP_STD_VER <= 14
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 explicit basic_string(const allocator_type& __a)
+#if _LIBCUDACXX_STD_VER <= 14
         _NOEXCEPT_(is_nothrow_copy_constructible<allocator_type>::value);
 #else
         _NOEXCEPT;
 #endif
 
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 basic_string(const basic_string& __str);
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 basic_string(const basic_string& __str, const allocator_type& __a);
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 basic_string(const basic_string& __str);
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 basic_string(const basic_string& __str, const allocator_type& __a);
 
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     basic_string(basic_string&& __str)
-#if _LIBCPP_STD_VER <= 14
+#if _LIBCUDACXX_STD_VER <= 14
         _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value);
 #else
         _NOEXCEPT;
 #endif
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     basic_string(basic_string&& __str, const allocator_type& __a);
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
     template <class = __enable_if_t<__is_allocator<_Allocator>::value, nullptr_t> >
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     basic_string(const _CharT* __s) : __r_(__default_init_tag(), __default_init_tag()) {
-      _LIBCPP_ASSERT(__s != nullptr, "basic_string(const char*) detected nullptr");
+      _LIBCUDACXX_ASSERT(__s != nullptr, "basic_string(const char*) detected nullptr");
       __init(__s, traits_type::length(__s));
       std::__debug_db_insert_c(this);
     }
 
     template <class = __enable_if_t<__is_allocator<_Allocator>::value, nullptr_t> >
-        _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+        _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
         basic_string(const _CharT* __s, const _Allocator& __a);
 
-#if _LIBCPP_STD_VER > 20
+#if _LIBCUDACXX_STD_VER > 20
     basic_string(nullptr_t) = delete;
 #endif
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     basic_string(const _CharT* __s, size_type __n);
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     basic_string(const _CharT* __s, size_type __n, const _Allocator& __a);
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     basic_string(size_type __n, _CharT __c);
 
     template <class = __enable_if_t<__is_allocator<_Allocator>::value, nullptr_t> >
-        _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+        _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
         basic_string(size_type __n, _CharT __c, const _Allocator& __a);
 
-    _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     basic_string(const basic_string& __str, size_type __pos, size_type __n,
                  const _Allocator& __a = _Allocator());
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     basic_string(const basic_string& __str, size_type __pos,
                  const _Allocator& __a = _Allocator());
 
     template<class _Tp, class = __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value && !__is_same_uncvref<_Tp, basic_string>::value> >
-        _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_AFTER_CXX17
+        _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
         basic_string(const _Tp& __t, size_type __pos, size_type __n,
                      const allocator_type& __a = allocator_type());
 
     template<class _Tp, class = __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
                                           !__is_same_uncvref<_Tp, basic_string>::value> >
-        _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_AFTER_CXX17
+        _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
         explicit basic_string(const _Tp& __t);
 
     template<class _Tp, class = __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value && !__is_same_uncvref<_Tp, basic_string>::value> >
-        _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_AFTER_CXX17
+        _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
         explicit basic_string(const _Tp& __t, const allocator_type& __a);
 
     template<class _InputIterator, class = __enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value> >
-        _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+        _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
         basic_string(_InputIterator __first, _InputIterator __last);
     template<class _InputIterator, class = __enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value> >
-        _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+        _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
         basic_string(_InputIterator __first, _InputIterator __last, const allocator_type& __a);
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     basic_string(initializer_list<_CharT> __il);
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     basic_string(initializer_list<_CharT> __il, const _Allocator& __a);
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
-    inline _LIBCPP_CONSTEXPR_AFTER_CXX17 ~basic_string();
+    inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 ~basic_string();
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     operator __self_view() const _NOEXCEPT { return __self_view(data(), size()); }
 
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 basic_string& operator=(const basic_string& __str);
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 basic_string& operator=(const basic_string& __str);
 
     template <class _Tp, class = __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
                                                !__is_same_uncvref<_Tp, basic_string>::value> >
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 basic_string& operator=(const _Tp& __t) {
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 basic_string& operator=(const _Tp& __t) {
       __self_view __sv = __t;
       return assign(__sv);
     }
 
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     basic_string& operator=(basic_string&& __str)
         _NOEXCEPT_((__noexcept_move_assign_container<_Allocator, __alloc_traits>::value));
-     _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+     _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     basic_string& operator=(initializer_list<value_type> __il) {return assign(__il.begin(), __il.size());}
 #endif
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     basic_string& operator=(const value_type* __s) {return assign(__s);}
-#if _LIBCPP_STD_VER > 20
+#if _LIBCUDACXX_STD_VER > 20
     basic_string& operator=(nullptr_t) = delete;
 #endif
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 basic_string& operator=(value_type __c);
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 basic_string& operator=(value_type __c);
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     iterator begin() _NOEXCEPT
         {return iterator(this, __get_pointer());}
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     const_iterator begin() const _NOEXCEPT
         {return const_iterator(this, __get_pointer());}
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     iterator end() _NOEXCEPT
         {return iterator(this, __get_pointer() + size());}
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     const_iterator end() const _NOEXCEPT
         {return const_iterator(this, __get_pointer() + size());}
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     reverse_iterator rbegin() _NOEXCEPT
         {return reverse_iterator(end());}
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     const_reverse_iterator rbegin() const _NOEXCEPT
         {return const_reverse_iterator(end());}
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     reverse_iterator rend() _NOEXCEPT
         {return reverse_iterator(begin());}
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     const_reverse_iterator rend() const _NOEXCEPT
         {return const_reverse_iterator(begin());}
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     const_iterator cbegin() const _NOEXCEPT
         {return begin();}
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     const_iterator cend() const _NOEXCEPT
         {return end();}
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     const_reverse_iterator crbegin() const _NOEXCEPT
         {return rbegin();}
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     const_reverse_iterator crend() const _NOEXCEPT
         {return rend();}
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 size_type size() const _NOEXCEPT
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 size_type size() const _NOEXCEPT
         {return __is_long() ? __get_long_size() : __get_short_size();}
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 size_type length() const _NOEXCEPT {return size();}
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 size_type max_size() const _NOEXCEPT;
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 size_type capacity() const _NOEXCEPT {
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 size_type length() const _NOEXCEPT {return size();}
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 size_type max_size() const _NOEXCEPT;
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 size_type capacity() const _NOEXCEPT {
         return (__is_long() ? __get_long_cap() : static_cast<size_type>(__min_cap)) - 1;
     }
 
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 void resize(size_type __n, value_type __c);
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 void resize(size_type __n) { resize(__n, value_type()); }
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 void resize(size_type __n, value_type __c);
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 void resize(size_type __n) { resize(__n, value_type()); }
 
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 void reserve(size_type __requested_capacity);
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 void reserve(size_type __requested_capacity);
 
-#if _LIBCPP_STD_VER > 20
+#if _LIBCUDACXX_STD_VER > 20
     template <class _Op>
-    _LIBCPP_HIDE_FROM_ABI constexpr
+    _LIBCUDACXX_HIDE_FROM_ABI constexpr
     void resize_and_overwrite(size_type __n, _Op __op) {
       __resize_default_init(__n);
-      __erase_to_end(std::move(__op)(data(), _LIBCPP_AUTO_CAST(__n)));
+      __erase_to_end(std::move(__op)(data(), _LIBCUDACXX_AUTO_CAST(__n)));
     }
 #endif
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 void __resize_default_init(size_type __n);
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 void __resize_default_init(size_type __n);
 
-    _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_HIDE_FROM_ABI void reserve() _NOEXCEPT { shrink_to_fit(); }
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 void shrink_to_fit() _NOEXCEPT;
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 void clear() _NOEXCEPT;
+    _LIBCUDACXX_DEPRECATED_IN_CXX20 _LIBCUDACXX_HIDE_FROM_ABI void reserve() _NOEXCEPT { shrink_to_fit(); }
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 void shrink_to_fit() _NOEXCEPT;
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 void clear() _NOEXCEPT;
 
-    _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_NODISCARD_AFTER_CXX17 _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     bool empty() const _NOEXCEPT {return size() == 0;}
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     const_reference operator[](size_type __pos) const _NOEXCEPT;
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 reference operator[](size_type __pos) _NOEXCEPT;
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 reference operator[](size_type __pos) _NOEXCEPT;
 
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 const_reference at(size_type __n) const;
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 reference       at(size_type __n);
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 const_reference at(size_type __n) const;
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 reference       at(size_type __n);
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 basic_string& operator+=(const basic_string& __str) {
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 basic_string& operator+=(const basic_string& __str) {
         return append(__str);
     }
 
     template <class _Tp>
-    _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     __enable_if_t
         <
             __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value
@@ -1018,35 +1018,35 @@ public:
         __self_view __sv = __t; return append(__sv);
     }
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 basic_string& operator+=(const value_type* __s) {
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 basic_string& operator+=(const value_type* __s) {
         return append(__s);
     }
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 basic_string& operator+=(value_type __c) {
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 basic_string& operator+=(value_type __c) {
         push_back(__c);
         return *this;
     }
 
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     basic_string& operator+=(initializer_list<value_type> __il) { return append(__il); }
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     basic_string& append(const basic_string& __str);
 
     template <class _Tp>
-    _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     __enable_if_t<
             __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value
             && !__is_same_uncvref<_Tp, basic_string>::value,
             basic_string&
         >
                   append(const _Tp& __t) { __self_view __sv = __t; return append(__sv.data(), __sv.size()); }
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 basic_string& append(const basic_string& __str, size_type __pos, size_type __n=npos);
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 basic_string& append(const basic_string& __str, size_type __pos, size_type __n=npos);
 
     template <class _Tp>
-    _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     __enable_if_t
         <
             __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value
@@ -1054,67 +1054,67 @@ public:
             basic_string&
         >
                   append(const _Tp& __t, size_type __pos, size_type __n=npos);
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 basic_string& append(const value_type* __s, size_type __n);
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 basic_string& append(const value_type* __s);
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 basic_string& append(size_type __n, value_type __c);
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 basic_string& append(const value_type* __s, size_type __n);
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 basic_string& append(const value_type* __s);
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 basic_string& append(size_type __n, value_type __c);
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     void __append_default_init(size_type __n);
 
     template<class _InputIterator>
-    _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
+    _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
     __enable_if_t
         <
             __is_exactly_cpp17_input_iterator<_InputIterator>::value,
             basic_string&
         >
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     append(_InputIterator __first, _InputIterator __last) {
       const basic_string __temp(__first, __last, __alloc());
       append(__temp.data(), __temp.size());
       return *this;
     }
     template<class _ForwardIterator>
-    _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
+    _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
     __enable_if_t
         <
             __is_cpp17_forward_iterator<_ForwardIterator>::value,
             basic_string&
         >
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     append(_ForwardIterator __first, _ForwardIterator __last);
 
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     basic_string& append(initializer_list<value_type> __il) {return append(__il.begin(), __il.size());}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 void push_back(value_type __c);
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 void pop_back();
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 reference       front() _NOEXCEPT;
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 const_reference front() const _NOEXCEPT;
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 reference       back() _NOEXCEPT;
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 const_reference back() const _NOEXCEPT;
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 void push_back(value_type __c);
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 void pop_back();
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 reference       front() _NOEXCEPT;
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 const_reference front() const _NOEXCEPT;
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 reference       back() _NOEXCEPT;
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 const_reference back() const _NOEXCEPT;
 
     template <class _Tp>
-    _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     __enable_if_t
         <
             __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
             basic_string&
         >
                  assign(const _Tp & __t) { __self_view __sv = __t; return assign(__sv.data(), __sv.size()); }
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     basic_string& assign(const basic_string& __str) { return *this = __str; }
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     basic_string& assign(basic_string&& __str)
         _NOEXCEPT_((__noexcept_move_assign_container<_Allocator, __alloc_traits>::value))
         {*this = std::move(__str); return *this;}
 #endif
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 basic_string& assign(const basic_string& __str, size_type __pos, size_type __n=npos);
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 basic_string& assign(const basic_string& __str, size_type __pos, size_type __n=npos);
     template <class _Tp>
-    _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     __enable_if_t
         <
             __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value
@@ -1122,11 +1122,11 @@ public:
             basic_string&
         >
                   assign(const _Tp & __t, size_type __pos, size_type __n=npos);
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 basic_string& assign(const value_type* __s, size_type __n);
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 basic_string& assign(const value_type* __s);
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 basic_string& assign(size_type __n, value_type __c);
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 basic_string& assign(const value_type* __s, size_type __n);
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 basic_string& assign(const value_type* __s);
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 basic_string& assign(size_type __n, value_type __c);
     template<class _InputIterator>
-    _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     __enable_if_t
         <
             __is_exactly_cpp17_input_iterator<_InputIterator>::value,
@@ -1134,23 +1134,23 @@ public:
         >
         assign(_InputIterator __first, _InputIterator __last);
     template<class _ForwardIterator>
-    _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     __enable_if_t
         <
             __is_cpp17_forward_iterator<_ForwardIterator>::value,
             basic_string&
         >
         assign(_ForwardIterator __first, _ForwardIterator __last);
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     basic_string& assign(initializer_list<value_type> __il) {return assign(__il.begin(), __il.size());}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     basic_string& insert(size_type __pos1, const basic_string& __str);
 
     template <class _Tp>
-    _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     __enable_if_t
         <
             __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
@@ -1160,23 +1160,23 @@ public:
     { __self_view __sv = __t; return insert(__pos1, __sv.data(), __sv.size()); }
 
     template <class _Tp>
-    _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     __enable_if_t
         <
             __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value && !__is_same_uncvref<_Tp, basic_string>::value,
             basic_string&
         >
                   insert(size_type __pos1, const _Tp& __t, size_type __pos2, size_type __n=npos);
-    _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     basic_string& insert(size_type __pos1, const basic_string& __str, size_type __pos2, size_type __n=npos);
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 basic_string& insert(size_type __pos, const value_type* __s, size_type __n);
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 basic_string& insert(size_type __pos, const value_type* __s);
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 basic_string& insert(size_type __pos, size_type __n, value_type __c);
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 iterator      insert(const_iterator __pos, value_type __c);
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 basic_string& insert(size_type __pos, const value_type* __s, size_type __n);
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 basic_string& insert(size_type __pos, const value_type* __s);
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 basic_string& insert(size_type __pos, size_type __n, value_type __c);
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 iterator      insert(const_iterator __pos, value_type __c);
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     iterator      insert(const_iterator __pos, size_type __n, value_type __c);
     template<class _InputIterator>
-    _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     __enable_if_t
         <
             __is_exactly_cpp17_input_iterator<_InputIterator>::value,
@@ -1184,55 +1184,55 @@ public:
         >
         insert(const_iterator __pos, _InputIterator __first, _InputIterator __last);
     template<class _ForwardIterator>
-    _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     __enable_if_t
         <
             __is_cpp17_forward_iterator<_ForwardIterator>::value,
             iterator
         >
         insert(const_iterator __pos, _ForwardIterator __first, _ForwardIterator __last);
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     iterator insert(const_iterator __pos, initializer_list<value_type> __il)
                     {return insert(__pos, __il.begin(), __il.end());}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 basic_string& erase(size_type __pos = 0, size_type __n = npos);
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 basic_string& erase(size_type __pos = 0, size_type __n = npos);
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     iterator      erase(const_iterator __pos);
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     iterator      erase(const_iterator __first, const_iterator __last);
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     basic_string& replace(size_type __pos1, size_type __n1, const basic_string& __str);
 
     template <class _Tp>
-    _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     __enable_if_t
         <
             __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
             basic_string&
         >
                   replace(size_type __pos1, size_type __n1, const _Tp& __t) { __self_view __sv = __t; return replace(__pos1, __n1, __sv.data(), __sv.size()); }
-    _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     basic_string& replace(size_type __pos1, size_type __n1, const basic_string& __str, size_type __pos2, size_type __n2=npos);
     template <class _Tp>
-    _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     __enable_if_t
         <
             __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value  && !__is_same_uncvref<_Tp, basic_string>::value,
             basic_string&
         >
                   replace(size_type __pos1, size_type __n1, const _Tp& __t, size_type __pos2, size_type __n2=npos);
-    _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     basic_string& replace(size_type __pos, size_type __n1, const value_type* __s, size_type __n2);
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 basic_string& replace(size_type __pos, size_type __n1, const value_type* __s);
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 basic_string& replace(size_type __pos, size_type __n1, size_type __n2, value_type __c);
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 basic_string& replace(size_type __pos, size_type __n1, const value_type* __s);
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 basic_string& replace(size_type __pos, size_type __n1, size_type __n2, value_type __c);
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     basic_string& replace(const_iterator __i1, const_iterator __i2, const basic_string& __str);
 
     template <class _Tp>
-    _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     __enable_if_t
         <
             __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
@@ -1240,162 +1240,162 @@ public:
         >
                   replace(const_iterator __i1, const_iterator __i2, const _Tp& __t) { __self_view __sv = __t; return replace(__i1 - begin(), __i2 - __i1, __sv); }
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     basic_string& replace(const_iterator __i1, const_iterator __i2, const value_type* __s, size_type __n);
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     basic_string& replace(const_iterator __i1, const_iterator __i2, const value_type* __s);
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     basic_string& replace(const_iterator __i1, const_iterator __i2, size_type __n, value_type __c);
     template<class _InputIterator>
-    _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     __enable_if_t
         <
             __is_cpp17_input_iterator<_InputIterator>::value,
             basic_string&
         >
         replace(const_iterator __i1, const_iterator __i2, _InputIterator __j1, _InputIterator __j2);
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     basic_string& replace(const_iterator __i1, const_iterator __i2, initializer_list<value_type> __il)
         {return replace(__i1, __i2, __il.begin(), __il.end());}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 size_type copy(value_type* __s, size_type __n, size_type __pos = 0) const;
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 size_type copy(value_type* __s, size_type __n, size_type __pos = 0) const;
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     basic_string substr(size_type __pos = 0, size_type __n = npos) const;
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     void swap(basic_string& __str)
-#if _LIBCPP_STD_VER >= 14
+#if _LIBCUDACXX_STD_VER >= 14
         _NOEXCEPT;
 #else
         _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
                     __is_nothrow_swappable<allocator_type>::value);
 #endif
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     const value_type* c_str() const _NOEXCEPT {return data();}
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     const value_type* data() const _NOEXCEPT  {return std::__to_address(__get_pointer());}
-#if _LIBCPP_STD_VER > 14 || defined(_LIBCPP_BUILDING_LIBRARY)
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+#if _LIBCUDACXX_STD_VER > 14 || defined(_LIBCUDACXX_BUILDING_LIBRARY)
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     value_type* data()             _NOEXCEPT  {return std::__to_address(__get_pointer());}
 #endif
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     allocator_type get_allocator() const _NOEXCEPT {return __alloc();}
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     size_type find(const basic_string& __str, size_type __pos = 0) const _NOEXCEPT;
 
     template <class _Tp>
-    _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     __enable_if_t
         <
             __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
             size_type
         >
               find(const _Tp& __t, size_type __pos = 0) const _NOEXCEPT;
-    _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     size_type find(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     size_type find(const value_type* __s, size_type __pos = 0) const _NOEXCEPT;
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 size_type find(value_type __c, size_type __pos = 0) const _NOEXCEPT;
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 size_type find(value_type __c, size_type __pos = 0) const _NOEXCEPT;
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     size_type rfind(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT;
 
     template <class _Tp>
-    _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     __enable_if_t
         <
             __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
             size_type
         >
               rfind(const _Tp& __t, size_type __pos = npos) const _NOEXCEPT;
-    _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     size_type rfind(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     size_type rfind(const value_type* __s, size_type __pos = npos) const _NOEXCEPT;
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 size_type rfind(value_type __c, size_type __pos = npos) const _NOEXCEPT;
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 size_type rfind(value_type __c, size_type __pos = npos) const _NOEXCEPT;
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     size_type find_first_of(const basic_string& __str, size_type __pos = 0) const _NOEXCEPT;
 
     template <class _Tp>
-    _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     __enable_if_t
         <
             __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
             size_type
         >
               find_first_of(const _Tp& __t, size_type __pos = 0) const _NOEXCEPT;
-    _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     size_type find_first_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     size_type find_first_of(const value_type* __s, size_type __pos = 0) const _NOEXCEPT;
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     size_type find_first_of(value_type __c, size_type __pos = 0) const _NOEXCEPT;
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     size_type find_last_of(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT;
 
     template <class _Tp>
-    _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     __enable_if_t
         <
             __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
             size_type
         >
               find_last_of(const _Tp& __t, size_type __pos = npos) const _NOEXCEPT;
-    _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     size_type find_last_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     size_type find_last_of(const value_type* __s, size_type __pos = npos) const _NOEXCEPT;
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     size_type find_last_of(value_type __c, size_type __pos = npos) const _NOEXCEPT;
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     size_type find_first_not_of(const basic_string& __str, size_type __pos = 0) const _NOEXCEPT;
 
     template <class _Tp>
-    _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     __enable_if_t
         <
             __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
             size_type
         >
               find_first_not_of(const _Tp &__t, size_type __pos = 0) const _NOEXCEPT;
-    _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     size_type find_first_not_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     size_type find_first_not_of(const value_type* __s, size_type __pos = 0) const _NOEXCEPT;
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     size_type find_first_not_of(value_type __c, size_type __pos = 0) const _NOEXCEPT;
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     size_type find_last_not_of(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT;
 
     template <class _Tp>
-    _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     __enable_if_t
         <
             __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
             size_type
         >
               find_last_not_of(const _Tp& __t, size_type __pos = npos) const _NOEXCEPT;
-    _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     size_type find_last_not_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     size_type find_last_not_of(const value_type* __s, size_type __pos = npos) const _NOEXCEPT;
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     size_type find_last_not_of(value_type __c, size_type __pos = npos) const _NOEXCEPT;
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     int compare(const basic_string& __str) const _NOEXCEPT;
 
     template <class _Tp>
-    _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     __enable_if_t
         <
             __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
@@ -1404,7 +1404,7 @@ public:
         compare(const _Tp &__t) const _NOEXCEPT;
 
     template <class _Tp>
-    _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     __enable_if_t
         <
             __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
@@ -1412,108 +1412,108 @@ public:
         >
          compare(size_type __pos1, size_type __n1, const _Tp& __t) const;
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     int compare(size_type __pos1, size_type __n1, const basic_string& __str) const;
-    _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     int compare(size_type __pos1, size_type __n1, const basic_string& __str, size_type __pos2,
                 size_type __n2 = npos) const;
 
     template <class _Tp>
-    inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
         __enable_if_t
         <
             __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value  && !__is_same_uncvref<_Tp, basic_string>::value,
             int
         >
         compare(size_type __pos1, size_type __n1, const _Tp& __t, size_type __pos2, size_type __n2=npos) const;
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 int compare(const value_type* __s) const _NOEXCEPT;
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 int compare(size_type __pos1, size_type __n1, const value_type* __s) const;
-    _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 int compare(const value_type* __s) const _NOEXCEPT;
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 int compare(size_type __pos1, size_type __n1, const value_type* __s) const;
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     int compare(size_type __pos1, size_type __n1, const value_type* __s, size_type __n2) const;
 
-#if _LIBCPP_STD_VER > 17
-    constexpr _LIBCPP_HIDE_FROM_ABI
+#if _LIBCUDACXX_STD_VER > 17
+    constexpr _LIBCUDACXX_HIDE_FROM_ABI
     bool starts_with(__self_view __sv) const noexcept
     { return __self_view(data(), size()).starts_with(__sv); }
 
-    constexpr _LIBCPP_HIDE_FROM_ABI
+    constexpr _LIBCUDACXX_HIDE_FROM_ABI
     bool starts_with(value_type __c) const noexcept
     { return !empty() && _Traits::eq(front(), __c); }
 
-    constexpr _LIBCPP_HIDE_FROM_ABI
+    constexpr _LIBCUDACXX_HIDE_FROM_ABI
     bool starts_with(const value_type* __s) const noexcept
     { return starts_with(__self_view(__s)); }
 
-    constexpr _LIBCPP_HIDE_FROM_ABI
+    constexpr _LIBCUDACXX_HIDE_FROM_ABI
     bool ends_with(__self_view __sv) const noexcept
     { return __self_view(data(), size()).ends_with( __sv); }
 
-    constexpr _LIBCPP_HIDE_FROM_ABI
+    constexpr _LIBCUDACXX_HIDE_FROM_ABI
     bool ends_with(value_type __c) const noexcept
     { return !empty() && _Traits::eq(back(), __c); }
 
-    constexpr _LIBCPP_HIDE_FROM_ABI
+    constexpr _LIBCUDACXX_HIDE_FROM_ABI
     bool ends_with(const value_type* __s) const noexcept
     { return ends_with(__self_view(__s)); }
 #endif
 
-#if _LIBCPP_STD_VER > 20
-    constexpr _LIBCPP_HIDE_FROM_ABI
+#if _LIBCUDACXX_STD_VER > 20
+    constexpr _LIBCUDACXX_HIDE_FROM_ABI
     bool contains(__self_view __sv) const noexcept
     { return __self_view(data(), size()).contains(__sv); }
 
-    constexpr _LIBCPP_HIDE_FROM_ABI
+    constexpr _LIBCUDACXX_HIDE_FROM_ABI
     bool contains(value_type __c) const noexcept
     { return __self_view(data(), size()).contains(__c); }
 
-    constexpr _LIBCPP_HIDE_FROM_ABI
+    constexpr _LIBCUDACXX_HIDE_FROM_ABI
     bool contains(const value_type* __s) const
     { return __self_view(data(), size()).contains(__s); }
 #endif
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 bool __invariants() const;
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 bool __invariants() const;
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 void __clear_and_shrink() _NOEXCEPT;
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 void __clear_and_shrink() _NOEXCEPT;
 
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
+#ifdef _LIBCUDACXX_ENABLE_DEBUG_MODE
 
     bool __dereferenceable(const const_iterator* __i) const;
     bool __decrementable(const const_iterator* __i) const;
     bool __addable(const const_iterator* __i, ptr
diff _t __n) const;
     bool __subscriptable(const const_iterator* __i, ptr
diff _t __n) const;
 
-#endif // _LIBCPP_ENABLE_DEBUG_MODE
+#endif // _LIBCUDACXX_ENABLE_DEBUG_MODE
 
 private:
     template<class _Alloc>
-    inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    inline _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     bool friend operator==(const basic_string<char, char_traits<char>, _Alloc>& __lhs,
                            const basic_string<char, char_traits<char>, _Alloc>& __rhs) _NOEXCEPT;
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 void __shrink_or_extend(size_type __target_capacity);
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 void __shrink_or_extend(size_type __target_capacity);
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     bool __is_long() const _NOEXCEPT {
-        if (__libcpp_is_constant_evaluated())
+        if (__LIBCUDACXX_is_constant_evaluated())
             return true;
         return __r_.first().__s.__is_long_;
     }
 
-    static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 void __begin_lifetime(pointer __begin, size_type __n) {
-#if _LIBCPP_STD_VER > 17
-        if (__libcpp_is_constant_evaluated()) {
+    static _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 void __begin_lifetime(pointer __begin, size_type __n) {
+#if _LIBCUDACXX_STD_VER > 17
+        if (__LIBCUDACXX_is_constant_evaluated()) {
             for (size_type __i = 0; __i != __n; ++__i)
                 std::construct_at(std::addressof(__begin[__i]));
         }
 #else
         (void)__begin;
         (void)__n;
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCUDACXX_STD_VER > 17
     }
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 void __default_init() {
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 void __default_init() {
         __zero();
-        if (__libcpp_is_constant_evaluated()) {
+        if (__LIBCUDACXX_is_constant_evaluated()) {
             size_type __sz = __recommend(0) + 1;
             pointer __ptr = __alloc_traits::allocate(__alloc(), __sz);
             __begin_lifetime(__ptr, __sz);
@@ -1523,18 +1523,18 @@ private:
         }
     }
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 void __deallocate_constexpr() {
-        if (__libcpp_is_constant_evaluated() && __get_pointer() != nullptr)
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 void __deallocate_constexpr() {
+        if (__LIBCUDACXX_is_constant_evaluated() && __get_pointer() != nullptr)
             __alloc_traits::deallocate(__alloc(), __get_pointer(), __get_long_cap());
     }
 
-    _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI static bool __fits_in_sso(size_type __sz) {
+    _LIBCUDACXX_CONSTEXPR _LIBCUDACXX_HIDE_FROM_ABI static bool __fits_in_sso(size_type __sz) {
         // SSO is disabled during constant evaluation because `__is_long` isn't constexpr friendly
-        return !__libcpp_is_constant_evaluated() && (__sz < __min_cap);
+        return !__LIBCUDACXX_is_constant_evaluated() && (__sz < __min_cap);
     }
 
     template <class _ForwardIterator>
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
     iterator __insert_from_safe_copy(size_type __n, size_type __ip, _ForwardIterator __first, _ForwardIterator __last) {
         size_type __sz = size();
         size_type __cap = capacity();
@@ -1560,80 +1560,80 @@ private:
         return begin() + __ip;
     }
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 allocator_type& __alloc() _NOEXCEPT { return __r_.second(); }
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR const allocator_type& __alloc() const _NOEXCEPT { return __r_.second(); }
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 allocator_type& __alloc() _NOEXCEPT { return __r_.second(); }
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR const allocator_type& __alloc() const _NOEXCEPT { return __r_.second(); }
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     void __set_short_size(size_type __s) _NOEXCEPT {
-        _LIBCPP_ASSERT(__s < __min_cap, "__s should never be greater than or equal to the short string capacity");
+        _LIBCUDACXX_ASSERT(__s < __min_cap, "__s should never be greater than or equal to the short string capacity");
         __r_.first().__s.__size_ = __s;
         __r_.first().__s.__is_long_ = false;
     }
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     size_type __get_short_size() const _NOEXCEPT {
-        _LIBCPP_ASSERT(!__r_.first().__s.__is_long_, "String has to be short when trying to get the short size");
+        _LIBCUDACXX_ASSERT(!__r_.first().__s.__is_long_, "String has to be short when trying to get the short size");
         return __r_.first().__s.__size_;
     }
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     void __set_long_size(size_type __s) _NOEXCEPT
         {__r_.first().__l.__size_ = __s;}
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     size_type __get_long_size() const _NOEXCEPT
         {return __r_.first().__l.__size_;}
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     void __set_size(size_type __s) _NOEXCEPT
         {if (__is_long()) __set_long_size(__s); else __set_short_size(__s);}
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     void __set_long_cap(size_type __s) _NOEXCEPT {
         __r_.first().__l.__cap_ = __s / __endian_factor;
         __r_.first().__l.__is_long_ = true;
     }
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     size_type __get_long_cap() const _NOEXCEPT {
         return __r_.first().__l.__cap_ * __endian_factor;
     }
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     void __set_long_pointer(pointer __p) _NOEXCEPT
         {__r_.first().__l.__data_ = __p;}
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     pointer __get_long_pointer() _NOEXCEPT
         {return __r_.first().__l.__data_;}
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     const_pointer __get_long_pointer() const _NOEXCEPT
         {return __r_.first().__l.__data_;}
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     pointer __get_short_pointer() _NOEXCEPT
         {return pointer_traits<pointer>::pointer_to(__r_.first().__s.__data_[0]);}
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     const_pointer __get_short_pointer() const _NOEXCEPT
         {return pointer_traits<const_pointer>::pointer_to(__r_.first().__s.__data_[0]);}
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     pointer __get_pointer() _NOEXCEPT
         {return __is_long() ? __get_long_pointer() : __get_short_pointer();}
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     const_pointer __get_pointer() const _NOEXCEPT
         {return __is_long() ? __get_long_pointer() : __get_short_pointer();}
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     void __zero() _NOEXCEPT {
         __r_.first() = __rep();
     }
 
     template <size_type __a> static
-        _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+        _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
         size_type __align_it(size_type __s) _NOEXCEPT
             {return (__s + (__a-1)) & ~(__a-1);}
     enum {__alignment = 16};
-    static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    static _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     size_type __recommend(size_type __s) _NOEXCEPT
     {
         if (__s < __min_cap) {
-            if (__libcpp_is_constant_evaluated())
+            if (__LIBCUDACXX_is_constant_evaluated())
                 return static_cast<size_type>(__min_cap);
             else
                 return static_cast<size_type>(__min_cap) - 1;
@@ -1644,11 +1644,11 @@ private:
         return __guess;
     }
 
-    inline _LIBCPP_CONSTEXPR_AFTER_CXX17
+    inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     void __init(const value_type* __s, size_type __sz, size_type __reserve);
-    inline _LIBCPP_CONSTEXPR_AFTER_CXX17
+    inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     void __init(const value_type* __s, size_type __sz);
-    inline _LIBCPP_CONSTEXPR_AFTER_CXX17
+    inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     void __init(size_type __n, value_type __c);
 
     // Slow path for the (inlined) copy constructor for 'long' strings.
@@ -1659,10 +1659,10 @@ private:
     // to call the __init() functions as those are marked as inline which may
     // result in over-aggressive inlining by the compiler, where our aim is
     // to only inline the fast path code directly in the ctor.
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 void __init_copy_ctor_external(const value_type* __s, size_type __sz);
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 void __init_copy_ctor_external(const value_type* __s, size_type __sz);
 
     template <class _InputIterator>
-    inline _LIBCPP_CONSTEXPR_AFTER_CXX17
+    inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     __enable_if_t
     <
         __is_exactly_cpp17_input_iterator<_InputIterator>::value
@@ -1670,17 +1670,17 @@ private:
     __init(_InputIterator __first, _InputIterator __last);
 
     template <class _ForwardIterator>
-    inline _LIBCPP_CONSTEXPR_AFTER_CXX17
+    inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     __enable_if_t
     <
         __is_cpp17_forward_iterator<_ForwardIterator>::value
     >
     __init(_ForwardIterator __first, _ForwardIterator __last);
 
-    _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     void __grow_by(size_type __old_cap, size_type __delta_cap, size_type __old_sz,
                    size_type __n_copy,  size_type __n_del,     size_type __n_add = 0);
-    _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     void __grow_by_and_replace(size_type __old_cap, size_type __delta_cap, size_type __old_sz,
                                size_type __n_copy,  size_type __n_del,
                                size_type __n_add, const value_type* __p_new_stuff);
@@ -1689,21 +1689,21 @@ private:
     // have proof that the input does not alias the current instance.
     // For example, operator=(basic_string) performs a 'self' check.
     template <bool __is_short>
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 basic_string& __assign_no_alias(const value_type* __s, size_type __n);
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 basic_string& __assign_no_alias(const value_type* __s, size_type __n);
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     void __erase_to_end(size_type __pos);
 
     // __erase_external_with_move is invoked for erase() invocations where
     // `n ~= npos`, likely requiring memory moves on the string data.
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 void __erase_external_with_move(size_type __pos, size_type __n);
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 void __erase_external_with_move(size_type __pos, size_type __n);
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     void __copy_assign_alloc(const basic_string& __str)
         {__copy_assign_alloc(__str, integral_constant<bool,
                       __alloc_traits::propagate_on_container_copy_assignment::value>());}
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     void __copy_assign_alloc(const basic_string& __str, true_type)
         {
             if (__alloc() == __str.__alloc())
@@ -1729,24 +1729,24 @@ private:
             }
         }
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     void __copy_assign_alloc(const basic_string&, false_type) _NOEXCEPT
         {}
 
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+#ifndef _LIBCUDACXX_CXX03_LANG
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     void __move_assign(basic_string& __str, false_type)
         _NOEXCEPT_(__alloc_traits::is_always_equal::value);
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     void __move_assign(basic_string& __str, true_type)
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
         _NOEXCEPT;
 #else
         _NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value);
 #endif
 #endif
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     void
     __move_assign_alloc(basic_string& __str)
         _NOEXCEPT_(
@@ -1755,20 +1755,20 @@ private:
     {__move_assign_alloc(__str, integral_constant<bool,
                       __alloc_traits::propagate_on_container_move_assignment::value>());}
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     void __move_assign_alloc(basic_string& __c, true_type)
         _NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
         {
             __alloc() = std::move(__c.__alloc());
         }
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     void __move_assign_alloc(basic_string&, false_type)
         _NOEXCEPT
         {}
 
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 basic_string& __assign_external(const value_type* __s);
-    _LIBCPP_CONSTEXPR_AFTER_CXX17 basic_string& __assign_external(const value_type* __s, size_type __n);
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 basic_string& __assign_external(const value_type* __s);
+    _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 basic_string& __assign_external(const value_type* __s, size_type __n);
 
     // Assigns the value in __s, guaranteed to be __n < __min_cap in length.
     inline basic_string& __assign_short(const value_type* __s, size_type __n) {
@@ -1780,7 +1780,7 @@ private:
       return *this;
     }
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     basic_string& __null_terminate_at(value_type* __p, size_type __newsz) {
       __set_size(__newsz);
       __invalidate_iterators_past(__newsz);
@@ -1788,53 +1788,53 @@ private:
       return *this;
     }
 
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 void __invalidate_iterators_past(size_type);
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 void __invalidate_iterators_past(size_type);
 
     template<class _Tp>
-    _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17
+    _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     bool __addr_in_range(_Tp&& __t) const {
         // assume that the ranges overlap, because we can't check during constant evaluation
-        if (__libcpp_is_constant_evaluated())
+        if (__LIBCUDACXX_is_constant_evaluated())
           return true;
         const volatile void *__p = std::addressof(__t);
         return data() <= __p && __p <= data() + size();
     }
 
-    _LIBCPP_NORETURN _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_NORETURN _LIBCUDACXX_HIDE_FROM_ABI
     void __throw_length_error() const {
         std::__throw_length_error("basic_string");
     }
 
-    _LIBCPP_NORETURN _LIBCPP_HIDE_FROM_ABI
+    _LIBCUDACXX_NORETURN _LIBCUDACXX_HIDE_FROM_ABI
     void __throw_out_of_range() const {
         std::__throw_out_of_range("basic_string");
     }
 
-    friend _LIBCPP_CONSTEXPR_AFTER_CXX17 basic_string operator+<>(const basic_string&, const basic_string&);
-    friend _LIBCPP_CONSTEXPR_AFTER_CXX17 basic_string operator+<>(const value_type*, const basic_string&);
-    friend _LIBCPP_CONSTEXPR_AFTER_CXX17 basic_string operator+<>(value_type, const basic_string&);
-    friend _LIBCPP_CONSTEXPR_AFTER_CXX17 basic_string operator+<>(const basic_string&, const value_type*);
-    friend _LIBCPP_CONSTEXPR_AFTER_CXX17 basic_string operator+<>(const basic_string&, value_type);
+    friend _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 basic_string operator+<>(const basic_string&, const basic_string&);
+    friend _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 basic_string operator+<>(const value_type*, const basic_string&);
+    friend _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 basic_string operator+<>(value_type, const basic_string&);
+    friend _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 basic_string operator+<>(const basic_string&, const value_type*);
+    friend _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 basic_string operator+<>(const basic_string&, value_type);
 };
 
 // These declarations must appear before any functions are implicitly used
 // so that they have the correct visibility specifier.
-#define _LIBCPP_DECLARE(...) extern template __VA_ARGS__;
-#ifdef _LIBCPP_ABI_STRING_OPTIMIZED_EXTERNAL_INSTANTIATION
-    _LIBCPP_STRING_UNSTABLE_EXTERN_TEMPLATE_LIST(_LIBCPP_DECLARE, char)
-#   ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-        _LIBCPP_STRING_UNSTABLE_EXTERN_TEMPLATE_LIST(_LIBCPP_DECLARE, wchar_t)
+#define _LIBCUDACXX_DECLARE(...) extern template __VA_ARGS__;
+#ifdef _LIBCUDACXX_ABI_STRING_OPTIMIZED_EXTERNAL_INSTANTIATION
+    _LIBCUDACXX_STRING_UNSTABLE_EXTERN_TEMPLATE_LIST(_LIBCUDACXX_DECLARE, char)
+#   ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
+        _LIBCUDACXX_STRING_UNSTABLE_EXTERN_TEMPLATE_LIST(_LIBCUDACXX_DECLARE, wchar_t)
 #   endif
 #else
-    _LIBCPP_STRING_V1_EXTERN_TEMPLATE_LIST(_LIBCPP_DECLARE, char)
-#   ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-        _LIBCPP_STRING_V1_EXTERN_TEMPLATE_LIST(_LIBCPP_DECLARE, wchar_t)
+    _LIBCUDACXX_STRING_V1_EXTERN_TEMPLATE_LIST(_LIBCUDACXX_DECLARE, char)
+#   ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS
+        _LIBCUDACXX_STRING_V1_EXTERN_TEMPLATE_LIST(_LIBCUDACXX_DECLARE, wchar_t)
 #   endif
 #endif
-#undef _LIBCPP_DECLARE
+#undef _LIBCUDACXX_DECLARE
 
 
-#if _LIBCPP_STD_VER >= 17
+#if _LIBCUDACXX_STD_VER >= 17
 template<class _InputIterator,
          class _CharT = __iter_value_type<_InputIterator>,
          class _Allocator = allocator<_CharT>,
@@ -1863,12 +1863,12 @@ basic_string(basic_string_view<_CharT, _Traits>, _Sz, _Sz, const _Allocator& = _
 #endif
 
 template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void
 basic_string<_CharT, _Traits, _Allocator>::__invalidate_iterators_past(size_type __pos)
 {
-#ifdef _LIBCPP_ENABLE_DEBUG_MODE
-    if (!__libcpp_is_constant_evaluated()) {
+#ifdef _LIBCUDACXX_ENABLE_DEBUG_MODE
+    if (!__LIBCUDACXX_is_constant_evaluated()) {
         __c_node* __c = __get_db()->__find_c_and_lock(this);
         if (__c)
         {
@@ -1889,11 +1889,11 @@ basic_string<_CharT, _Traits, _Allocator>::__invalidate_iterators_past(size_type
     }
 #else
     (void)__pos;
-#endif // _LIBCPP_ENABLE_DEBUG_MODE
+#endif // _LIBCUDACXX_ENABLE_DEBUG_MODE
 }
 
 template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 basic_string<_CharT, _Traits, _Allocator>::basic_string()
     _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
      : __r_(__default_init_tag(), __default_init_tag())
@@ -1903,9 +1903,9 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string()
 }
 
 template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 basic_string<_CharT, _Traits, _Allocator>::basic_string(const allocator_type& __a)
-#if _LIBCPP_STD_VER <= 14
+#if _LIBCUDACXX_STD_VER <= 14
         _NOEXCEPT_(is_nothrow_copy_constructible<allocator_type>::value)
 #else
         _NOEXCEPT
@@ -1917,12 +1917,12 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const allocator_type& __
 }
 
 template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void basic_string<_CharT, _Traits, _Allocator>::__init(const value_type* __s,
                                                        size_type __sz,
                                                        size_type __reserve)
 {
-    if (__libcpp_is_constant_evaluated())
+    if (__LIBCUDACXX_is_constant_evaluated())
         __zero();
     if (__reserve > max_size())
         __throw_length_error();
@@ -1946,11 +1946,11 @@ void basic_string<_CharT, _Traits, _Allocator>::__init(const value_type* __s,
 }
 
 template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void
 basic_string<_CharT, _Traits, _Allocator>::__init(const value_type* __s, size_type __sz)
 {
-    if (__libcpp_is_constant_evaluated())
+    if (__LIBCUDACXX_is_constant_evaluated())
         __zero();
     if (__sz > max_size())
         __throw_length_error();
@@ -1975,37 +1975,37 @@ basic_string<_CharT, _Traits, _Allocator>::__init(const value_type* __s, size_ty
 
 template <class _CharT, class _Traits, class _Allocator>
 template <class>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 basic_string<_CharT, _Traits, _Allocator>::basic_string(const _CharT* __s, const _Allocator& __a)
     : __r_(__default_init_tag(), __a)
 {
-    _LIBCPP_ASSERT(__s != nullptr, "basic_string(const char*, allocator) detected nullptr");
+    _LIBCUDACXX_ASSERT(__s != nullptr, "basic_string(const char*, allocator) detected nullptr");
     __init(__s, traits_type::length(__s));
     std::__debug_db_insert_c(this);
 }
 
 template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 basic_string<_CharT, _Traits, _Allocator>::basic_string(const _CharT* __s, size_type __n)
      : __r_(__default_init_tag(), __default_init_tag())
 {
-    _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "basic_string(const char*, n) detected nullptr");
+    _LIBCUDACXX_ASSERT(__n == 0 || __s != nullptr, "basic_string(const char*, n) detected nullptr");
     __init(__s, __n);
     std::__debug_db_insert_c(this);
 }
 
 template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 basic_string<_CharT, _Traits, _Allocator>::basic_string(const _CharT* __s, size_type __n, const _Allocator& __a)
     : __r_(__default_init_tag(), __a)
 {
-    _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "basic_string(const char*, n, allocator) detected nullptr");
+    _LIBCUDACXX_ASSERT(__n == 0 || __s != nullptr, "basic_string(const char*, n, allocator) detected nullptr");
     __init(__s, __n);
     std::__debug_db_insert_c(this);
 }
 
 template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 basic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __str)
     : __r_(__default_init_tag(), __alloc_traits::select_on_container_copy_construction(__str.__alloc()))
 {
@@ -2018,7 +2018,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __st
 }
 
 template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 basic_string<_CharT, _Traits, _Allocator>::basic_string(
     const basic_string& __str, const allocator_type& __a)
     : __r_(__default_init_tag(), __a)
@@ -2032,10 +2032,10 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(
 }
 
 template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void basic_string<_CharT, _Traits, _Allocator>::__init_copy_ctor_external(
     const value_type* __s, size_type __sz) {
-  if (__libcpp_is_constant_evaluated())
+  if (__LIBCUDACXX_is_constant_evaluated())
     __zero();
   pointer __p;
   if (__fits_in_sso(__sz)) {
@@ -2054,12 +2054,12 @@ void basic_string<_CharT, _Traits, _Allocator>::__init_copy_ctor_external(
   traits_type::copy(std::__to_address(__p), __s, __sz + 1);
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
 template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 basic_string<_CharT, _Traits, _Allocator>::basic_string(basic_string&& __str)
-#if _LIBCPP_STD_VER <= 14
+#if _LIBCUDACXX_STD_VER <= 14
         _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)
 #else
         _NOEXCEPT
@@ -2073,7 +2073,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(basic_string&& __str)
 }
 
 template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 basic_string<_CharT, _Traits, _Allocator>::basic_string(basic_string&& __str, const allocator_type& __a)
     : __r_(__default_init_tag(), __a)
 {
@@ -2081,7 +2081,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(basic_string&& __str, co
         __init(std::__to_address(__str.__get_long_pointer()), __str.__get_long_size());
     else
     {
-        if (__libcpp_is_constant_evaluated()) {
+        if (__LIBCUDACXX_is_constant_evaluated()) {
             __zero();
             __r_.first().__l = __str.__r_.first().__l;
         } else {
@@ -2094,14 +2094,14 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(basic_string&& __str, co
         std::__debug_db_swap(this, &__str);
 }
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
 template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void
 basic_string<_CharT, _Traits, _Allocator>::__init(size_type __n, value_type __c)
 {
-    if (__libcpp_is_constant_evaluated())
+    if (__LIBCUDACXX_is_constant_evaluated())
         __zero();
     if (__n > max_size())
         __throw_length_error();
@@ -2125,7 +2125,7 @@ basic_string<_CharT, _Traits, _Allocator>::__init(size_type __n, value_type __c)
 }
 
 template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 basic_string<_CharT, _Traits, _Allocator>::basic_string(size_type __n, _CharT __c)
      : __r_(__default_init_tag(), __default_init_tag())
 {
@@ -2135,7 +2135,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(size_type __n, _CharT __
 
 template <class _CharT, class _Traits, class _Allocator>
 template <class>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 basic_string<_CharT, _Traits, _Allocator>::basic_string(size_type __n, _CharT __c, const _Allocator& __a)
     : __r_(__default_init_tag(), __a)
 {
@@ -2144,7 +2144,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(size_type __n, _CharT __
 }
 
 template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 basic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __str,
                                                         size_type __pos, size_type __n,
                                                         const _Allocator& __a)
@@ -2158,7 +2158,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __st
 }
 
 template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 basic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __str, size_type __pos,
                                                         const _Allocator& __a)
     : __r_(__default_init_tag(), __a)
@@ -2172,7 +2172,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __st
 
 template <class _CharT, class _Traits, class _Allocator>
 template <class _Tp, class>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 basic_string<_CharT, _Traits, _Allocator>::basic_string(
              const _Tp& __t, size_type __pos, size_type __n, const allocator_type& __a)
     : __r_(__default_init_tag(), __a)
@@ -2185,7 +2185,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(
 
 template <class _CharT, class _Traits, class _Allocator>
 template <class _Tp, class>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 basic_string<_CharT, _Traits, _Allocator>::basic_string(const _Tp & __t)
      : __r_(__default_init_tag(), __default_init_tag())
 {
@@ -2196,7 +2196,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const _Tp & __t)
 
 template <class _CharT, class _Traits, class _Allocator>
 template <class _Tp, class>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 basic_string<_CharT, _Traits, _Allocator>::basic_string(const _Tp & __t, const _Allocator& __a)
     : __r_(__default_init_tag(), __a)
 {
@@ -2207,7 +2207,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const _Tp & __t, const _
 
 template <class _CharT, class _Traits, class _Allocator>
 template <class _InputIterator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 __enable_if_t
 <
     __is_exactly_cpp17_input_iterator<_InputIterator>::value
@@ -2215,13 +2215,13 @@ __enable_if_t
 basic_string<_CharT, _Traits, _Allocator>::__init(_InputIterator __first, _InputIterator __last)
 {
     __default_init();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     try
     {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
     for (; __first != __last; ++__first)
         push_back(*__first);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     }
     catch (...)
     {
@@ -2229,19 +2229,19 @@ basic_string<_CharT, _Traits, _Allocator>::__init(_InputIterator __first, _Input
             __alloc_traits::deallocate(__alloc(), __get_long_pointer(), __get_long_cap());
         throw;
     }
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCUDACXX_NO_EXCEPTIONS
 }
 
 template <class _CharT, class _Traits, class _Allocator>
 template <class _ForwardIterator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 __enable_if_t
 <
     __is_cpp17_forward_iterator<_ForwardIterator>::value
 >
 basic_string<_CharT, _Traits, _Allocator>::__init(_ForwardIterator __first, _ForwardIterator __last)
 {
-    if (__libcpp_is_constant_evaluated())
+    if (__LIBCUDACXX_is_constant_evaluated())
         __zero();
     size_type __sz = static_cast<size_type>(std::distance(__first, __last));
     if (__sz > max_size())
@@ -2262,14 +2262,14 @@ basic_string<_CharT, _Traits, _Allocator>::__init(_ForwardIterator __first, _For
         __set_long_size(__sz);
     }
 
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     try
     {
-#endif  // _LIBCPP_NO_EXCEPTIONS
+#endif  // _LIBCUDACXX_NO_EXCEPTIONS
     for (; __first != __last; ++__first, (void) ++__p)
         traits_type::assign(*__p, *__first);
     traits_type::assign(*__p, value_type());
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCUDACXX_NO_EXCEPTIONS
     }
     catch (...)
     {
@@ -2277,12 +2277,12 @@ basic_string<_CharT, _Traits, _Allocator>::__init(_ForwardIterator __first, _For
             __alloc_traits::deallocate(__alloc(), __get_long_pointer(), __get_long_cap());
         throw;
     }
-#endif  // _LIBCPP_NO_EXCEPTIONS
+#endif  // _LIBCUDACXX_NO_EXCEPTIONS
 }
 
 template <class _CharT, class _Traits, class _Allocator>
 template<class _InputIterator, class>
-inline _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 basic_string<_CharT, _Traits, _Allocator>::basic_string(_InputIterator __first, _InputIterator __last)
      : __r_(__default_init_tag(), __default_init_tag())
 {
@@ -2292,7 +2292,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(_InputIterator __first,
 
 template <class _CharT, class _Traits, class _Allocator>
 template<class _InputIterator, class>
-inline _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 basic_string<_CharT, _Traits, _Allocator>::basic_string(_InputIterator __first, _InputIterator __last,
                                                         const allocator_type& __a)
     : __r_(__default_init_tag(), __a)
@@ -2301,10 +2301,10 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(_InputIterator __first,
     std::__debug_db_insert_c(this);
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
 template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 basic_string<_CharT, _Traits, _Allocator>::basic_string(
     initializer_list<_CharT> __il)
      : __r_(__default_init_tag(), __default_init_tag())
@@ -2314,7 +2314,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(
 }
 
 template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 basic_string<_CharT, _Traits, _Allocator>::basic_string(
     initializer_list<_CharT> __il, const _Allocator& __a)
     : __r_(__default_init_tag(), __a)
@@ -2323,10 +2323,10 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(
     std::__debug_db_insert_c(this);
 }
 
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCUDACXX_CXX03_LANG
 
 template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 basic_string<_CharT, _Traits, _Allocator>::~basic_string()
 {
     std::__debug_db_erase_c(this);
@@ -2335,7 +2335,7 @@ basic_string<_CharT, _Traits, _Allocator>::~basic_string()
 }
 
 template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void
 basic_string<_CharT, _Traits, _Allocator>::__grow_by_and_replace
     (size_type __old_cap, size_type __delta_cap, size_type __old_sz,
@@ -2361,7 +2361,7 @@ basic_string<_CharT, _Traits, _Allocator>::__grow_by_and_replace
     if (__sec_cp_sz != 0)
         traits_type::copy(std::__to_address(__p) + __n_copy + __n_add,
                           std::__to_address(__old_p) + __n_copy + __n_del, __sec_cp_sz);
-    if (__old_cap+1 != __min_cap || __libcpp_is_constant_evaluated())
+    if (__old_cap+1 != __min_cap || __LIBCUDACXX_is_constant_evaluated())
         __alloc_traits::deallocate(__alloc(), __old_p, __old_cap+1);
     __set_long_pointer(__p);
     __set_long_cap(__allocation.count);
@@ -2372,7 +2372,7 @@ basic_string<_CharT, _Traits, _Allocator>::__grow_by_and_replace
 
 template <class _CharT, class _Traits, class _Allocator>
 void
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 basic_string<_CharT, _Traits, _Allocator>::__grow_by(size_type __old_cap, size_type __delta_cap, size_type __old_sz,
                                                      size_type __n_copy,  size_type __n_del,     size_type __n_add)
 {
@@ -2395,7 +2395,7 @@ basic_string<_CharT, _Traits, _Allocator>::__grow_by(size_type __old_cap, size_t
         traits_type::copy(std::__to_address(__p) + __n_copy + __n_add,
                           std::__to_address(__old_p) + __n_copy + __n_del,
                           __sec_cp_sz);
-    if (__libcpp_is_constant_evaluated() || __old_cap + 1 != __min_cap)
+    if (__LIBCUDACXX_is_constant_evaluated() || __old_cap + 1 != __min_cap)
         __alloc_traits::deallocate(__alloc(), __old_p, __old_cap + 1);
     __set_long_pointer(__p);
     __set_long_cap(__allocation.count);
@@ -2405,7 +2405,7 @@ basic_string<_CharT, _Traits, _Allocator>::__grow_by(size_type __old_cap, size_t
 
 template <class _CharT, class _Traits, class _Allocator>
 template <bool __is_short>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 basic_string<_CharT, _Traits, _Allocator>&
 basic_string<_CharT, _Traits, _Allocator>::__assign_no_alias(
     const value_type* __s, size_type __n) {
@@ -2424,7 +2424,7 @@ basic_string<_CharT, _Traits, _Allocator>::__assign_no_alias(
 }
 
 template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 basic_string<_CharT, _Traits, _Allocator>&
 basic_string<_CharT, _Traits, _Allocator>::__assign_external(
     const value_type* __s, size_type __n) {
@@ -2441,18 +2441,18 @@ basic_string<_CharT, _Traits, _Allocator>::__assign_external(
 }
 
 template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 basic_string<_CharT, _Traits, _Allocator>&
 basic_string<_CharT, _Traits, _Allocator>::assign(const value_type* __s, size_type __n)
 {
-    _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string::assign received nullptr");
+    _LIBCUDACXX_ASSERT(__n == 0 || __s != nullptr, "string::assign received nullptr");
     return (__builtin_constant_p(__n) && __fits_in_sso(__n))
                ? __assign_short(__s, __n)
                : __assign_external(__s, __n);
 }
 
 template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 basic_string<_CharT, _Traits, _Allocator>&
 basic_string<_CharT, _Traits, _Allocator>::assign(size_type __n, value_type __c)
 {
@@ -2468,7 +2468,7 @@ basic_string<_CharT, _Traits, _Allocator>::assign(size_type __n, value_type __c)
 }
 
 template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 basic_string<_CharT, _Traits, _Allocator>&
 basic_string<_CharT, _Traits, _Allocator>::operator=(value_type __c)
 {
@@ -2490,7 +2490,7 @@ basic_string<_CharT, _Traits, _Allocator>::operator=(value_type __c)
 }
 
 template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 basic_string<_CharT, _Traits, _Allocator>&
 basic_string<_CharT, _Traits, _Allocator>::operator=(const basic_string& __str)
 {
@@ -2509,10 +2509,10 @@ basic_string<_CharT, _Traits, _Allocator>::operator=(const basic_string& __str)
   return *this;
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCUDACXX_CXX03_LANG
 
 template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void
 basic_string<_CharT, _Traits, _Allocator>::__move_assign(basic_string& __str, false_type)
     _NOEXCEPT_(__alloc_traits::is_always_equal::value)
@@ -2524,10 +2524,10 @@ basic_string<_CharT, _Traits, _Allocator>::__move_assign(basic_string& __str, fa
 }
 
 template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void
 basic_string<_CharT, _Traits, _Allocator>::__move_assign(basic_string& __str, true_type)
-#if _LIBCPP_STD_VER > 14
+#if _LIBCUDACXX_STD_VER > 14
     _NOEXCEPT
 #else
     _NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
@@ -2536,7 +2536,7 @@ basic_string<_CharT, _Traits, _Allocator>::__move_assign(basic_string& __str, tr
   if (__is_long()) {
     __alloc_traits::deallocate(__alloc(), __get_long_pointer(),
                                __get_long_cap());
-#if _LIBCPP_STD_VER <= 14
+#if _LIBCUDACXX_STD_VER <= 14
     if (!is_nothrow_move_assignable<allocator_type>::value) {
       __set_short_size(0);
       traits_type::assign(__get_short_pointer()[0], value_type());
@@ -2545,7 +2545,7 @@ basic_string<_CharT, _Traits, _Allocator>::__move_assign(basic_string& __str, tr
   }
   __move_assign_alloc(__str);
   __r_.first() = __str.__r_.first();
-  if (__libcpp_is_constant_evaluated()) {
+  if (__LIBCUDACXX_is_constant_evaluated()) {
     __str.__default_init();
   } else {
     __str.__set_short_size(0);
@@ -2554,7 +2554,7 @@ basic_string<_CharT, _Traits, _Allocator>::__move_assign(basic_string& __str, tr
 }
 
 template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 basic_string<_CharT, _Traits, _Allocator>&
 basic_string<_CharT, _Traits, _Allocator>::operator=(basic_string&& __str)
     _NOEXCEPT_((__noexcept_move_assign_container<_Allocator, __alloc_traits>::value))
@@ -2568,7 +2568,7 @@ basic_string<_CharT, _Traits, _Allocator>::operator=(basic_string&& __str)
 
 template <class _CharT, class _Traits, class _Allocator>
 template<class _InputIterator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 __enable_if_t
 <
      __is_exactly_cpp17_input_iterator<_InputIterator>::value,
@@ -2583,7 +2583,7 @@ basic_string<_CharT, _Traits, _Allocator>::assign(_InputIterator __first, _Input
 
 template <class _CharT, class _Traits, class _Allocator>
 template<class _ForwardIterator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 __enable_if_t
 <
     __is_cpp17_forward_iterator<_ForwardIterator>::value,
@@ -2619,7 +2619,7 @@ basic_string<_CharT, _Traits, _Allocator>::assign(_ForwardIterator __first, _For
 }
 
 template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 basic_string<_CharT, _Traits, _Allocator>&
 basic_string<_CharT, _Traits, _Allocator>::assign(const basic_string& __str, size_type __pos, size_type __n)
 {
@@ -2631,7 +2631,7 @@ basic_string<_CharT, _Traits, _Allocator>::assign(const basic_string& __str, siz
 
 template <class _CharT, class _Traits, class _Allocator>
 template <class _Tp>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 __enable_if_t
 <
     __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value
@@ -2649,18 +2649,18 @@ basic_string<_CharT, _Traits, _Allocator>::assign(const _Tp & __t, size_type __p
 
 
 template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 basic_string<_CharT, _Traits, _Allocator>&
 basic_string<_CharT, _Traits, _Allocator>::__assign_external(const value_type* __s) {
   return __assign_external(__s, traits_type::length(__s));
 }
 
 template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 basic_string<_CharT, _Traits, _Allocator>&
 basic_string<_CharT, _Traits, _Allocator>::assign(const value_type* __s)
 {
-    _LIBCPP_ASSERT(__s != nullptr, "string::assign received nullptr");
+    _LIBCUDACXX_ASSERT(__s != nullptr, "string::assign received nullptr");
     return __builtin_constant_p(*__s)
                ? (__fits_in_sso(traits_type::length(__s))
                       ? __assign_short(__s, traits_type::length(__s))
@@ -2670,11 +2670,11 @@ basic_string<_CharT, _Traits, _Allocator>::assign(const value_type* __s)
 // append
 
 template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 basic_string<_CharT, _Traits, _Allocator>&
 basic_string<_CharT, _Traits, _Allocator>::append(const value_type* __s, size_type __n)
 {
-    _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string::append received nullptr");
+    _LIBCUDACXX_ASSERT(__n == 0 || __s != nullptr, "string::append received nullptr");
     size_type __cap = capacity();
     size_type __sz = size();
     if (__cap - __sz >= __n)
@@ -2694,7 +2694,7 @@ basic_string<_CharT, _Traits, _Allocator>::append(const value_type* __s, size_ty
 }
 
 template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 basic_string<_CharT, _Traits, _Allocator>&
 basic_string<_CharT, _Traits, _Allocator>::append(size_type __n, value_type __c)
 {
@@ -2714,7 +2714,7 @@ basic_string<_CharT, _Traits, _Allocator>::append(size_type __n, value_type __c)
 }
 
 template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17 inline void
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17 inline void
 basic_string<_CharT, _Traits, _Allocator>::__append_default_init(size_type __n)
 {
     if (__n)
@@ -2731,7 +2731,7 @@ basic_string<_CharT, _Traits, _Allocator>::__append_default_init(size_type __n)
 }
 
 template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 void
 basic_string<_CharT, _Traits, _Allocator>::push_back(value_type __c)
 {
@@ -2770,7 +2770,7 @@ basic_string<_CharT, _Traits, _Allocator>::push_back(value_type __c)
 
 template <class _CharT, class _Traits, class _Allocator>
 template<class _ForwardIterator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 __enable_if_t
 <
     __is_cpp17_forward_iterator<_ForwardIterator>::value,
@@ -2805,7 +2805,7 @@ basic_string<_CharT, _Traits, _Allocator>::append(
 }
 
 template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 basic_string<_CharT, _Traits, _Allocator>&
 basic_string<_CharT, _Traits, _Allocator>::append(const basic_string& __str)
 {
@@ -2813,7 +2813,7 @@ basic_string<_CharT, _Traits, _Allocator>::append(const basic_string& __str)
 }
 
 template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 basic_string<_CharT, _Traits, _Allocator>&
 basic_string<_CharT, _Traits, _Allocator>::append(const basic_string& __str, size_type __pos, size_type __n)
 {
@@ -2825,7 +2825,7 @@ basic_string<_CharT, _Traits, _Allocator>::append(const basic_string& __str, siz
 
 template <class _CharT, class _Traits, class _Allocator>
 template <class _Tp>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
     __enable_if_t
     <
         __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value  && !__is_same_uncvref<_Tp, basic_string<_CharT, _Traits, _Allocator> >::value,
@@ -2841,27 +2841,27 @@ basic_string<_CharT, _Traits, _Allocator>::append(const _Tp & __t, size_type __p
 }
 
 template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 basic_string<_CharT, _Traits, _Allocator>&
 basic_string<_CharT, _Traits, _Allocator>::append(const value_type* __s)
 {
-    _LIBCPP_ASSERT(__s != nullptr, "string::append received nullptr");
+    _LIBCUDACXX_ASSERT(__s != nullptr, "string::append received nullptr");
     return append(__s, traits_type::length(__s));
 }
 
 // insert
 
 template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 basic_string<_CharT, _Traits, _Allocator>&
 basic_string<_CharT, _Traits, _Allocator>::insert(size_type __pos, const value_type* __s, size_type __n)
 {
-    _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string::insert received nullptr");
+    _LIBCUDACXX_ASSERT(__n == 0 || __s != nullptr, "string::insert received nullptr");
     size_type __sz = size();
     if (__pos > __sz)
         __throw_out_of_range();
     size_type __cap = capacity();
-    if (__libcpp_is_constant_evaluated()) {
+    if (__LIBCUDACXX_is_constant_evaluated()) {
         if (__cap - __sz >= __n)
             __grow_by_and_replace(__cap, 0, __sz, __pos, 0, __n, __s);
         else
@@ -2892,7 +2892,7 @@ basic_string<_CharT, _Traits, _Allocator>::insert(size_type __pos, const value_t
 }
 
 template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 basic_string<_CharT, _Traits, _Allocator>&
 basic_string<_CharT, _Traits, _Allocator>::insert(size_type __pos, size_type __n, value_type __c)
 {
@@ -2925,7 +2925,7 @@ basic_string<_CharT, _Traits, _Allocator>::insert(size_type __pos, size_type __n
 
 template <class _CharT, class _Traits, class _Allocator>
 template<class _InputIterator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 __enable_if_t
 <
    __is_exactly_cpp17_input_iterator<_InputIterator>::value,
@@ -2933,7 +2933,7 @@ __enable_if_t
 >
 basic_string<_CharT, _Traits, _Allocator>::insert(const_iterator __pos, _InputIterator __first, _InputIterator __last)
 {
-  _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(&__pos) == this,
+  _LIBCUDACXX_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(&__pos) == this,
                        "string::insert(iterator, range) called with an iterator not"
                        " referring to this string");
   const basic_string __temp(__first, __last, __alloc());
@@ -2942,7 +2942,7 @@ basic_string<_CharT, _Traits, _Allocator>::insert(const_iterator __pos, _InputIt
 
 template <class _CharT, class _Traits, class _Allocator>
 template<class _ForwardIterator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 __enable_if_t
 <
     __is_cpp17_forward_iterator<_ForwardIterator>::value,
@@ -2950,7 +2950,7 @@ __enable_if_t
 >
 basic_string<_CharT, _Traits, _Allocator>::insert(const_iterator __pos, _ForwardIterator __first, _ForwardIterator __last)
 {
-    _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(&__pos) == this,
+    _LIBCUDACXX_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(&__pos) == this,
                          "string::insert(iterator, range) called with an iterator not referring to this string");
 
     size_type __ip = static_cast<size_type>(__pos - begin());
@@ -2970,7 +2970,7 @@ basic_string<_CharT, _Traits, _Allocator>::insert(const_iterator __pos, _Forward
 }
 
 template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_CONSTEXPR_AFTER_CXX17
+inline _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 basic_string<_CharT, _Traits, _Allocator>&
 basic_string<_CharT, _Traits, _Allocator>::insert(size_type __pos1, const basic_string& __str)
 {
@@ -2978,7 +2978,7 @@ basic_string<_CharT, _Traits, _Allocator>::insert(size_type __pos1, const basic_
 }
 
 template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 basic_string<_CharT, _Traits, _Allocator>&
 basic_string<_CharT, _Traits, _Allocator>::insert(size_type __pos1, const basic_string& __str,
                                                   size_type __pos2, size_type __n)
@@ -2991,7 +2991,7 @@ basic_string<_CharT, _Traits, _Allocator>::insert(size_type __pos1, const basic_
 
 template <class _CharT, class _Traits, class _Allocator>
 template <class _Tp>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 __enable_if_t
 <
     __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value  && !__is_same_uncvref<_Tp, basic_string<_CharT, _Traits, _Allocator> >::value,
@@ -3008,20 +3008,20 @@ basic_string<_CharT, _Traits, _Allocator>::insert(size_type __pos1, const _Tp& _
 }
 
 template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 basic_string<_CharT, _Traits, _Allocator>&
 basic_string<_CharT, _Traits, _Allocator>::insert(size_type __pos, const value_type* __s)
 {
-    _LIBCPP_ASSERT(__s != nullptr, "string::insert received nullptr");
+    _LIBCUDACXX_ASSERT(__s != nullptr, "string::insert received nullptr");
     return insert(__pos, __s, traits_type::length(__s));
 }
 
 template <class _CharT, class _Traits, class _Allocator>
-_LIBCPP_CONSTEXPR_AFTER_CXX17
+_LIBCUDACXX_CONSTEXPR_AFTER_CXX17
 typename basic_string<_CharT, _Traits, _Allocator>::iterator
 basic_string<_CharT, _Traits, _Allocator>::insert(const_iterator __pos,