Skip to content

Commit

Permalink
Merge pull request #242 from adah1972/remove-special-gcc-check
Browse files Browse the repository at this point in the history
Remove special gcc check
  • Loading branch information
mhoemmen authored Feb 16, 2023
2 parents a15c5ec + 757f4fa commit 458bd01
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 18 deletions.
16 changes: 3 additions & 13 deletions include/experimental/__p0009_bits/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,23 +198,13 @@ static_assert(_MDSPAN_CPLUSPLUS >= MDSPAN_CXX_STD_14, "mdspan requires C++14 or
#endif

#ifndef _MDSPAN_USE_CLASS_TEMPLATE_ARGUMENT_DEDUCTION
// GCC 10's CTAD seems sufficiently broken to prevent its use.
# if (defined(_MDSPAN_COMPILER_CLANG) || !defined(__GNUC__) || __GNUC__ >= 11) \
&& ((defined(__cpp_deduction_guides) && __cpp_deduction_guides >= 201703) \
|| (!defined(__cpp_deduction_guides) && MDSPAN_HAS_CXX_17))
# if (!defined(__NVCC__) || (__CUDACC_VER_MAJOR__ >= 11 && __CUDACC_VER_MINOR__ >= 7)) && \
((defined(__cpp_deduction_guides) && __cpp_deduction_guides >= 201703) || \
(!defined(__cpp_deduction_guides) && MDSPAN_HAS_CXX_17))
# define _MDSPAN_USE_CLASS_TEMPLATE_ARGUMENT_DEDUCTION 1
# endif
#endif

#ifndef _MDSPAN_USE_ALIAS_TEMPLATE_ARGUMENT_DEDUCTION
// GCC 10's CTAD seems sufficiently broken to prevent its use.
# if (defined(_MDSPAN_COMPILER_CLANG) || !defined(__GNUC__) || __GNUC__ >= 11) \
&& ((defined(__cpp_deduction_guides) && __cpp_deduction_guides >= 201907) \
|| (!defined(__cpp_deduction_guides) && MDSPAN_HAS_CXX_20))
# define _MDSPAN_USE_ALIAS_TEMPLATE_ARGUMENT_DEDUCTION 1
# endif
#endif

#ifndef _MDSPAN_USE_STANDARD_TRAIT_ALIASES
# if (defined(__cpp_lib_transformation_trait_aliases) && __cpp_lib_transformation_trait_aliases >= 201304) \
|| (!defined(__cpp_lib_transformation_trait_aliases) && MDSPAN_HAS_CXX_14)
Expand Down
6 changes: 4 additions & 2 deletions tests/test_layout_ctors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ TEST(TestLayoutLeftListInitialization, test_layout_left_extent_initialization) {
ASSERT_TRUE(m.is_exhaustive());
}

#if defined(_MDSPAN_USE_CLASS_TEMPLATE_ARGUMENT_DEDUCTION)
// FIXME: CUDA NVCC including 12.0 does not like CTAD on nested classes
#if defined(_MDSPAN_USE_CLASS_TEMPLATE_ARGUMENT_DEDUCTION) && !defined(__NVCC__)
TEST(TestLayoutLeftCTAD, test_layout_left_ctad) {
stdex::layout_left::mapping m{stdex::extents{16, 32}};
ASSERT_EQ(m.extents().rank(), 2);
Expand All @@ -227,7 +228,8 @@ TEST(TestLayoutRightListInitialization, test_layout_right_extent_initialization)
ASSERT_TRUE(m.is_exhaustive());
}

#if defined(_MDSPAN_USE_CLASS_TEMPLATE_ARGUMENT_DEDUCTION)
// FIXME: CUDA NVCC including 12.0 does not like CTAD on nested classes
#if defined(_MDSPAN_USE_CLASS_TEMPLATE_ARGUMENT_DEDUCTION) && !defined(__NVCC__)
TEST(TestLayoutRightCTAD, test_layout_right_ctad) {
stdex::layout_right::mapping m{stdex::extents{16, 32}};
ASSERT_EQ(m.extents().rank(), 2);
Expand Down
5 changes: 2 additions & 3 deletions tests/test_layout_stride.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ TYPED_TEST(TestLayoutEquality, equality_op) {
ASSERT_EQ(this->map1 == this->map2, this->equal);
}

// This fails on GCC 9.2 and others
#if defined(_MDSPAN_USE_CLASS_TEMPLATE_ARGUMENT_DEDUCTION)
// FIXME: CUDA NVCC including 12.0 does not like CTAD on nested classes
#if defined(_MDSPAN_USE_CLASS_TEMPLATE_ARGUMENT_DEDUCTION) && !defined(__NVCC__)
TEST(TestLayoutStrideCTAD, test_ctad) {
// This is not possible wiht the array constructor we actually provide
/*
Expand All @@ -167,7 +167,6 @@ TEST(TestLayoutStrideCTAD, test_ctad) {
ASSERT_EQ(m0.strides(), (std::array<std::size_t, 2>{1, 128}));
ASSERT_FALSE(m0.is_exhaustive());
*/

stdex::layout_stride::mapping m1{stdex::extents{16, 32}, std::array{1, 128}};
ASSERT_EQ(m1.extents().rank(), 2);
ASSERT_EQ(m1.extents().rank_dynamic(), 2);
Expand Down

0 comments on commit 458bd01

Please sign in to comment.