Skip to content

Commit

Permalink
remove random buggy identifier names macros.hpp
Browse files Browse the repository at this point in the history
  • Loading branch information
nmm0 committed Feb 13, 2025
1 parent 4497d86 commit 5c78466
Show file tree
Hide file tree
Showing 29 changed files with 245 additions and 249 deletions.
2 changes: 1 addition & 1 deletion benchmarks/copy/copy_layout_stride.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

using index_type = int;

_MDSPAN_INLINE_VARIABLE constexpr auto dyn = Kokkos::dynamic_extent;
MDSPAN_IMPL_INLINE_VARIABLE constexpr auto dyn = Kokkos::dynamic_extent;

template <class MDSpan, class... DynSizes>
void BM_MDSpan_Copy_2D_right(benchmark::State& state, MDSpan, DynSizes... dyn) {
Expand Down
5 changes: 2 additions & 3 deletions benchmarks/sum/sum_submdspan_right.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ constexpr T&& _repeated_with(T&& v) noexcept { return std::forward<T>(v); }

template <class T, class... Rest>
MDSPAN_FORCE_INLINE_FUNCTION
_MDSPAN_CONSTEXPR_14 void _do_sum_submdspan(
MDSPAN_IMPL_CONSTEXPR_14 void _do_sum_submdspan(
T& sum,
Kokkos::mdspan<T, Kokkos::extents<index_type>, Rest...> s
)
Expand All @@ -128,7 +128,7 @@ _MDSPAN_CONSTEXPR_14 void _do_sum_submdspan(

template <class T, size_t E, size_t... Es, class... Rest>
MDSPAN_FORCE_INLINE_FUNCTION
_MDSPAN_CONSTEXPR_14 void _do_sum_submdspan(
MDSPAN_IMPL_CONSTEXPR_14 void _do_sum_submdspan(
T& sum,
Kokkos::mdspan<T, Kokkos::extents<index_type, E, Es...>, Rest...> s
)
Expand Down Expand Up @@ -195,4 +195,3 @@ BENCHMARK_CAPTURE(
//================================================================================

BENCHMARK_MAIN();

6 changes: 3 additions & 3 deletions compilation_tests/ctest_constexpr_dereference.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ constexpr bool
multidimensional_single_element_stress_test_impl_1(
std::integer_sequence<size_t, Sizes...>
) {
return _MDSPAN_FOLD_AND(
return MDSPAN_IMPL_FOLD_AND(
multidimensional_single_element_stress_test_impl_2<Layout>(
std::make_index_sequence<Sizes>{}
) /* && ... */
Expand Down Expand Up @@ -226,7 +226,7 @@ stress_test_2d_single_element_stress_test_impl_1(
std::integer_sequence<size_t, Idxs2...>
)
{
return _MDSPAN_FOLD_AND(
return MDSPAN_IMPL_FOLD_AND(
stress_test_2d_single_element_stress_test_impl_2<Layout>(
idx1, std::integral_constant<size_t, Idxs2+1>{}
) /* && ... */
Expand All @@ -240,7 +240,7 @@ stress_test_2d_single_element_stress_test_impl_0(
std::integer_sequence<size_t, Idxs2...> idxs2
)
{
return _MDSPAN_FOLD_AND(
return MDSPAN_IMPL_FOLD_AND(
stress_test_2d_single_element_stress_test_impl_1<Layout>(
std::integral_constant<size_t, Idxs1+1>{}, idxs2
) /* && ... */
Expand Down
2 changes: 1 addition & 1 deletion compilation_tests/ctest_constexpr_submdspan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ constexpr bool
submdspan_single_element_stress_test_impl_1(
std::integer_sequence<size_t, Sizes...>
) {
return _MDSPAN_FOLD_AND(
return MDSPAN_IMPL_FOLD_AND(
submdspan_single_element_stress_test_impl_2<Layout>(
std::make_index_sequence<Sizes>{}
) /* && ... */
Expand Down
38 changes: 19 additions & 19 deletions include/experimental/__p0009_bits/compressed_pair.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ namespace detail {
template <class _T1, class _T2, class _Enable = void> struct __compressed_pair {
MDSPAN_IMPL_NO_UNIQUE_ADDRESS _T1 __t1_val{};
MDSPAN_IMPL_NO_UNIQUE_ADDRESS _T2 __t2_val{};
MDSPAN_FORCE_INLINE_FUNCTION _MDSPAN_CONSTEXPR_14 _T1 &__first() noexcept { return __t1_val; }
MDSPAN_FORCE_INLINE_FUNCTION MDSPAN_IMPL_CONSTEXPR_14 _T1 &__first() noexcept { return __t1_val; }
MDSPAN_FORCE_INLINE_FUNCTION constexpr _T1 const &__first() const noexcept {
return __t1_val;
}
MDSPAN_FORCE_INLINE_FUNCTION _MDSPAN_CONSTEXPR_14 _T2 &__second() noexcept { return __t2_val; }
MDSPAN_FORCE_INLINE_FUNCTION MDSPAN_IMPL_CONSTEXPR_14 _T2 &__second() noexcept { return __t2_val; }
MDSPAN_FORCE_INLINE_FUNCTION constexpr _T2 const &__second() const noexcept {
return __t2_val;
}
Expand All @@ -46,10 +46,10 @@ template <class _T1, class _T2, class _Enable = void> struct __compressed_pair {
MDSPAN_INLINE_FUNCTION_DEFAULTED
constexpr __compressed_pair(__compressed_pair &&) = default;
MDSPAN_INLINE_FUNCTION_DEFAULTED
_MDSPAN_CONSTEXPR_14_DEFAULTED __compressed_pair &
MDSPAN_IMPL_CONSTEXPR_14_DEFAULTED __compressed_pair &
operator=(__compressed_pair const &) = default;
MDSPAN_INLINE_FUNCTION_DEFAULTED
_MDSPAN_CONSTEXPR_14_DEFAULTED __compressed_pair &
MDSPAN_IMPL_CONSTEXPR_14_DEFAULTED __compressed_pair &
operator=(__compressed_pair &&) = default;
MDSPAN_INLINE_FUNCTION_DEFAULTED
~__compressed_pair() = default;
Expand All @@ -64,16 +64,16 @@ template <class _T1, class _T2, class _Enable = void> struct __compressed_pair {
template <class _T1, class _T2>
struct __compressed_pair<
_T1, _T2,
std::enable_if_t<_MDSPAN_TRAIT(std::is_empty, _T1) && !_MDSPAN_TRAIT(std::is_empty, _T2)>>
std::enable_if_t<MDSPAN_IMPL_TRAIT(std::is_empty, _T1) && !MDSPAN_IMPL_TRAIT(std::is_empty, _T2)>>
: private _T1 {
_T2 __t2_val{};
MDSPAN_FORCE_INLINE_FUNCTION _MDSPAN_CONSTEXPR_14 _T1 &__first() noexcept {
MDSPAN_FORCE_INLINE_FUNCTION MDSPAN_IMPL_CONSTEXPR_14 _T1 &__first() noexcept {
return *static_cast<_T1 *>(this);
}
MDSPAN_FORCE_INLINE_FUNCTION constexpr _T1 const &__first() const noexcept {
return *static_cast<_T1 const *>(this);
}
MDSPAN_FORCE_INLINE_FUNCTION _MDSPAN_CONSTEXPR_14 _T2 &__second() noexcept { return __t2_val; }
MDSPAN_FORCE_INLINE_FUNCTION MDSPAN_IMPL_CONSTEXPR_14 _T2 &__second() noexcept { return __t2_val; }
MDSPAN_FORCE_INLINE_FUNCTION constexpr _T2 const &__second() const noexcept {
return __t2_val;
}
Expand All @@ -85,10 +85,10 @@ struct __compressed_pair<
MDSPAN_INLINE_FUNCTION_DEFAULTED
constexpr __compressed_pair(__compressed_pair &&) = default;
MDSPAN_INLINE_FUNCTION_DEFAULTED
_MDSPAN_CONSTEXPR_14_DEFAULTED __compressed_pair &
MDSPAN_IMPL_CONSTEXPR_14_DEFAULTED __compressed_pair &
operator=(__compressed_pair const &) = default;
MDSPAN_INLINE_FUNCTION_DEFAULTED
_MDSPAN_CONSTEXPR_14_DEFAULTED __compressed_pair &
MDSPAN_IMPL_CONSTEXPR_14_DEFAULTED __compressed_pair &
operator=(__compressed_pair &&) = default;
MDSPAN_INLINE_FUNCTION_DEFAULTED
~__compressed_pair() = default;
Expand All @@ -101,14 +101,14 @@ struct __compressed_pair<
template <class _T1, class _T2>
struct __compressed_pair<
_T1, _T2,
std::enable_if_t<!_MDSPAN_TRAIT(std::is_empty, _T1) && _MDSPAN_TRAIT(std::is_empty, _T2)>>
std::enable_if_t<!MDSPAN_IMPL_TRAIT(std::is_empty, _T1) && MDSPAN_IMPL_TRAIT(std::is_empty, _T2)>>
: private _T2 {
_T1 __t1_val{};
MDSPAN_FORCE_INLINE_FUNCTION _MDSPAN_CONSTEXPR_14 _T1 &__first() noexcept { return __t1_val; }
MDSPAN_FORCE_INLINE_FUNCTION MDSPAN_IMPL_CONSTEXPR_14 _T1 &__first() noexcept { return __t1_val; }
MDSPAN_FORCE_INLINE_FUNCTION constexpr _T1 const &__first() const noexcept {
return __t1_val;
}
MDSPAN_FORCE_INLINE_FUNCTION _MDSPAN_CONSTEXPR_14 _T2 &__second() noexcept {
MDSPAN_FORCE_INLINE_FUNCTION MDSPAN_IMPL_CONSTEXPR_14 _T2 &__second() noexcept {
return *static_cast<_T2 *>(this);
}
MDSPAN_FORCE_INLINE_FUNCTION constexpr _T2 const &__second() const noexcept {
Expand All @@ -122,10 +122,10 @@ struct __compressed_pair<
MDSPAN_INLINE_FUNCTION_DEFAULTED
constexpr __compressed_pair(__compressed_pair &&) = default;
MDSPAN_INLINE_FUNCTION_DEFAULTED
_MDSPAN_CONSTEXPR_14_DEFAULTED __compressed_pair &
MDSPAN_IMPL_CONSTEXPR_14_DEFAULTED __compressed_pair &
operator=(__compressed_pair const &) = default;
MDSPAN_INLINE_FUNCTION_DEFAULTED
_MDSPAN_CONSTEXPR_14_DEFAULTED __compressed_pair &
MDSPAN_IMPL_CONSTEXPR_14_DEFAULTED __compressed_pair &
operator=(__compressed_pair &&) = default;
MDSPAN_INLINE_FUNCTION_DEFAULTED
~__compressed_pair() = default;
Expand All @@ -139,7 +139,7 @@ struct __compressed_pair<
template <class _T1, class _T2>
struct __compressed_pair<
_T1, _T2,
std::enable_if_t<_MDSPAN_TRAIT(std::is_empty, _T1) && _MDSPAN_TRAIT(std::is_empty, _T2)>>
std::enable_if_t<MDSPAN_IMPL_TRAIT(std::is_empty, _T1) && MDSPAN_IMPL_TRAIT(std::is_empty, _T2)>>
// We need to use the __no_unique_address_emulation wrapper here to avoid
// base class ambiguities.
#ifdef MDSPAN_IMPL_COMPILER_MSVC
Expand All @@ -155,13 +155,13 @@ struct __compressed_pair<
using __first_base_t = __no_unique_address_emulation<_T1, 0>;
using __second_base_t = __no_unique_address_emulation<_T2, 1>;

MDSPAN_FORCE_INLINE_FUNCTION _MDSPAN_CONSTEXPR_14 _T1 &__first() noexcept {
MDSPAN_FORCE_INLINE_FUNCTION MDSPAN_IMPL_CONSTEXPR_14 _T1 &__first() noexcept {
return this->__first_base_t::__ref();
}
MDSPAN_FORCE_INLINE_FUNCTION constexpr _T1 const &__first() const noexcept {
return this->__first_base_t::__ref();
}
MDSPAN_FORCE_INLINE_FUNCTION _MDSPAN_CONSTEXPR_14 _T2 &__second() noexcept {
MDSPAN_FORCE_INLINE_FUNCTION MDSPAN_IMPL_CONSTEXPR_14 _T2 &__second() noexcept {
return this->__second_base_t::__ref();
}
MDSPAN_FORCE_INLINE_FUNCTION constexpr _T2 const &__second() const noexcept {
Expand All @@ -175,10 +175,10 @@ struct __compressed_pair<
MDSPAN_INLINE_FUNCTION_DEFAULTED
constexpr __compressed_pair(__compressed_pair &&) = default;
MDSPAN_INLINE_FUNCTION_DEFAULTED
_MDSPAN_CONSTEXPR_14_DEFAULTED __compressed_pair &
MDSPAN_IMPL_CONSTEXPR_14_DEFAULTED __compressed_pair &
operator=(__compressed_pair const &) = default;
MDSPAN_INLINE_FUNCTION_DEFAULTED
_MDSPAN_CONSTEXPR_14_DEFAULTED __compressed_pair &
MDSPAN_IMPL_CONSTEXPR_14_DEFAULTED __compressed_pair &
operator=(__compressed_pair &&) = default;
MDSPAN_INLINE_FUNCTION_DEFAULTED
~__compressed_pair() = default;
Expand Down
2 changes: 1 addition & 1 deletion include/experimental/__p0009_bits/default_accessor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ struct default_accessor {
MDSPAN_TEMPLATE_REQUIRES(
class OtherElementType,
/* requires */ (
_MDSPAN_TRAIT(std::is_convertible, OtherElementType(*)[], element_type(*)[])
MDSPAN_IMPL_TRAIT(std::is_convertible, OtherElementType(*)[], element_type(*)[])
)
)
MDSPAN_INLINE_FUNCTION
Expand Down
2 changes: 1 addition & 1 deletion include/experimental/__p0009_bits/dynamic_extent.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace MDSPAN_IMPL_STANDARD_NAMESPACE {
#if defined(__cpp_lib_span)
using std::dynamic_extent;
#else
_MDSPAN_INLINE_VARIABLE constexpr auto dynamic_extent = std::numeric_limits<size_t>::max();
MDSPAN_IMPL_INLINE_VARIABLE constexpr auto dynamic_extent = std::numeric_limits<size_t>::max();
#endif
} // namespace MDSPAN_IMPL_STANDARD_NAMESPACE

Expand Down
26 changes: 13 additions & 13 deletions include/experimental/__p0009_bits/extents.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ struct __compare_extent_compatible : std::integral_constant<bool,
template <size_t... Extents, size_t... OtherExtents>
MDSPAN_INLINE_FUNCTION
static constexpr std::integral_constant<
bool, _MDSPAN_FOLD_AND(__compare_extent_compatible<Extents, OtherExtents>::value)>
bool, MDSPAN_IMPL_FOLD_AND(__compare_extent_compatible<Extents, OtherExtents>::value)>
__check_compatible_extents(
std::integral_constant<bool, true>,
std::integer_sequence<size_t, Extents...>,
Expand All @@ -64,8 +64,8 @@ template<class IndexType, class ... Arguments>
MDSPAN_INLINE_FUNCTION
static constexpr bool are_valid_indices() {
return
_MDSPAN_FOLD_AND(std::is_convertible<Arguments, IndexType>::value) &&
_MDSPAN_FOLD_AND(std::is_nothrow_constructible<IndexType, Arguments>::value);
MDSPAN_IMPL_FOLD_AND(std::is_convertible<Arguments, IndexType>::value) &&
MDSPAN_IMPL_FOLD_AND(std::is_nothrow_constructible<IndexType, Arguments>::value);
}

// ------------------------------------------------------------------
Expand Down Expand Up @@ -214,7 +214,7 @@ struct maybe_static_array {
using static_vals_t = static_array<TStatic, Values...>;
constexpr static size_t m_size = sizeof...(Values);
constexpr static size_t m_size_dynamic =
_MDSPAN_FOLD_PLUS_RIGHT((Values == dyn_tag), 0);
MDSPAN_IMPL_FOLD_PLUS_RIGHT((Values == dyn_tag), 0);

// Dynamic values member
MDSPAN_IMPL_NO_UNIQUE_ADDRESS possibly_empty_array<TDynamic, m_size_dynamic>
Expand Down Expand Up @@ -398,7 +398,7 @@ template <class IndexType, size_t... Extents> class extents {
private:
constexpr static rank_type m_rank = sizeof...(Extents);
constexpr static rank_type m_rank_dynamic =
_MDSPAN_FOLD_PLUS_RIGHT((Extents == dynamic_extent), /* + ... + */ 0);
MDSPAN_IMPL_FOLD_PLUS_RIGHT((Extents == dynamic_extent), /* + ... + */ 0);

// internal storage type using maybe_static_array
using vals_t =
Expand Down Expand Up @@ -428,9 +428,9 @@ template <class IndexType, size_t... Extents> class extents {
MDSPAN_TEMPLATE_REQUIRES(
class... OtherIndexTypes,
/* requires */ (
_MDSPAN_FOLD_AND(_MDSPAN_TRAIT(std::is_convertible, OtherIndexTypes,
MDSPAN_IMPL_FOLD_AND(MDSPAN_IMPL_TRAIT(std::is_convertible, OtherIndexTypes,
index_type) /* && ... */) &&
_MDSPAN_FOLD_AND(_MDSPAN_TRAIT(std::is_nothrow_constructible, index_type,
MDSPAN_IMPL_FOLD_AND(MDSPAN_IMPL_TRAIT(std::is_nothrow_constructible, index_type,
OtherIndexTypes) /* && ... */) &&
(sizeof...(OtherIndexTypes) == m_rank ||
sizeof...(OtherIndexTypes) == m_rank_dynamic)))
Expand All @@ -442,8 +442,8 @@ template <class IndexType, size_t... Extents> class extents {
class OtherIndexType, size_t N,
/* requires */
(
_MDSPAN_TRAIT(std::is_convertible, const OtherIndexType&, index_type) &&
_MDSPAN_TRAIT(std::is_nothrow_constructible, index_type,
MDSPAN_IMPL_TRAIT(std::is_convertible, const OtherIndexType&, index_type) &&
MDSPAN_IMPL_TRAIT(std::is_nothrow_constructible, index_type,
const OtherIndexType&) &&
(N == m_rank || N == m_rank_dynamic)))
MDSPAN_INLINE_FUNCTION
Expand All @@ -455,8 +455,8 @@ template <class IndexType, size_t... Extents> class extents {
MDSPAN_TEMPLATE_REQUIRES(
class OtherIndexType, size_t N,
/* requires */
(_MDSPAN_TRAIT(std::is_convertible, const OtherIndexType&, index_type) &&
_MDSPAN_TRAIT(std::is_nothrow_constructible, index_type, const OtherIndexType&) &&
(MDSPAN_IMPL_TRAIT(std::is_convertible, const OtherIndexType&, index_type) &&
MDSPAN_IMPL_TRAIT(std::is_nothrow_constructible, index_type, const OtherIndexType&) &&
(N == m_rank || N == m_rank_dynamic)))
MDSPAN_INLINE_FUNCTION
MDSPAN_CONDITIONAL_EXPLICIT(N != m_rank_dynamic)
Expand Down Expand Up @@ -650,7 +650,7 @@ check_upper_bound(InputIndexType user_index,

// Returning true to use AND fold instead of comma
// CPP14 mode doesn't like the use of void expressions
// with the way the _MDSPAN_FOLD_AND is set up
// with the way the MDSPAN_IMPL_FOLD_AND is set up
template<class InputIndex, class ExtentsIndexType>
MDSPAN_INLINE_FUNCTION
constexpr bool
Expand All @@ -673,7 +673,7 @@ check_all_indices_helper(std::index_sequence<RankIndices...>,
Indices... indices)
{
// Suppress warning about statement has no effect
(void) _MDSPAN_FOLD_AND(
(void) MDSPAN_IMPL_FOLD_AND(
(check_one_index(indices, exts.extent(RankIndices)))
);
}
Expand Down
2 changes: 1 addition & 1 deletion include/experimental/__p0009_bits/full_extent_t.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ namespace MDSPAN_IMPL_STANDARD_NAMESPACE {

struct full_extent_t { explicit full_extent_t() = default; };

_MDSPAN_INLINE_VARIABLE constexpr auto full_extent = full_extent_t{ };
MDSPAN_IMPL_INLINE_VARIABLE constexpr auto full_extent = full_extent_t{ };

} // namespace MDSPAN_IMPL_STANDARD_NAMESPACE
Loading

0 comments on commit 5c78466

Please sign in to comment.