Skip to content

Commit

Permalink
WAR issues on gcc-7.
Browse files Browse the repository at this point in the history
  • Loading branch information
alliepiper committed Apr 5, 2024
1 parent 1989868 commit f395284
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions testing/enum_type_list.cu
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@

#include <type_traits>

// If using gcc version < 7, disable some tests to WAR a compiler bug. See NVIDIA/nvbench#39.
#if defined(__GNUC__) && __GNUC__ == 7
#define USING_GCC_7
#endif

enum class scoped_enum
{
val_1,
Expand Down Expand Up @@ -109,9 +114,11 @@ void test_int()

void test_scoped_enum()
{
#ifndef USING_GCC_7
ASSERT((
std::is_same_v<nvbench::enum_type_list<scoped_enum::val_1>,
nvbench::type_list<nvbench::enum_type<scoped_enum::val_1>>>));
#endif
ASSERT((
std::is_same_v<nvbench::enum_type_list<scoped_enum::val_1,
scoped_enum::val_2,
Expand All @@ -123,6 +130,7 @@ void test_scoped_enum()

void test_unscoped_enum()
{
#ifndef USING_GCC_7
ASSERT(
(std::is_same_v<nvbench::enum_type_list<unscoped_val_1>,
nvbench::type_list<nvbench::enum_type<unscoped_val_1>>>));
Expand All @@ -132,6 +140,7 @@ void test_unscoped_enum()
nvbench::type_list<nvbench::enum_type<unscoped_val_1>,
nvbench::enum_type<unscoped_val_2>,
nvbench::enum_type<unscoped_val_3>>>));
#endif
}

void test_scoped_enum_type_strings()
Expand Down

0 comments on commit f395284

Please sign in to comment.