Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove special gcc check #242

Merged
merged 4 commits into from
Feb 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)) && \
mhoemmen marked this conversation as resolved.
Show resolved Hide resolved
((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
mhoemmen marked this conversation as resolved.
Show resolved Hide resolved
#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