Skip to content

Commit

Permalink
fix constexpr conv tests on generic-ndarray test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
alifahrri committed Jul 18, 2024
1 parent 90994dd commit b95e35f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tests/constexpr/src/conv-1.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#define NMTOOLS_CAST_ARRAYS_NESTED_VEC(...)

#if defined(NMTOOLS_TESTING_GENERIC_NDARRAY) && defined(NMTOOLS_BUILD_CONSTEXPR_TESTS)
#if defined(NMTOOLS_TESTING_GENERIC_NDARRAY)
#define NMTOOLS_CONSTEXPR_CAST_ARRAYS_EXTRA(name) \
constexpr inline auto name##_cs_fb = nmtools::cast(name, nmtools::array::kind::ndarray_cs_fb); \
constexpr inline auto name##_cs_hb = nmtools::cast(name, nmtools::array::kind::ndarray_cs_hb); \
Expand Down
2 changes: 1 addition & 1 deletion tests/constexpr/src/conv-2.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#define NMTOOLS_CAST_ARRAYS_NESTED_VEC(...)

#if defined(NMTOOLS_TESTING_GENERIC_NDARRAY) && defined(NMTOOLS_BUILD_CONSTEXPR_TESTS)
#if defined(NMTOOLS_TESTING_GENERIC_NDARRAY)
#define NMTOOLS_CONSTEXPR_CAST_ARRAYS_EXTRA(name) \
constexpr inline auto name##_cs_fb = nmtools::cast(name, nmtools::array::kind::ndarray_cs_fb); \
constexpr inline auto name##_cs_hb = nmtools::cast(name, nmtools::array::kind::ndarray_cs_hb); \
Expand Down
5 changes: 4 additions & 1 deletion tests/constexpr/src/conv-3.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#define NMTOOLS_CAST_ARRAYS_NESTED_VEC(...)

#if defined(NMTOOLS_TESTING_GENERIC_NDARRAY) && defined(NMTOOLS_BUILD_CONSTEXPR_TESTS)
#if defined(NMTOOLS_TESTING_GENERIC_NDARRAY)
#define NMTOOLS_CONSTEXPR_CAST_ARRAYS_EXTRA(name) \
constexpr inline auto name##_cs_fb = nmtools::cast(name, nmtools::array::kind::ndarray_cs_fb); \
constexpr inline auto name##_cs_hb = nmtools::cast(name, nmtools::array::kind::ndarray_cs_hb); \
Expand Down Expand Up @@ -104,9 +104,12 @@ TEST_CASE("constexpr_conv2d(case11)" * doctest::test_suite("array::conv2d"))
CONSTEXPR_CONV2D_SUBCASE( case11, input_hs_hb, weight_hs_hb, None, stride_ct, padding_ct );
#endif

// NOTE: error: 'constexpr' evaluation operation count exceeds limit of 33554432 (use '-fconstexpr-ops-limit=' to increase the limit)
#if 0
CONSTEXPR_CONV2D_SUBCASE( case11, input_ls_fb, weight_ls_fb, None, stride_ct, padding_ct );
CONSTEXPR_CONV2D_SUBCASE( case11, input_ls_hb, weight_ls_hb, None, stride_ct, padding_ct );
#endif
#endif
}

// also hit constexpr limit on gcc (at least on 11.4)
Expand Down
2 changes: 1 addition & 1 deletion tests/constexpr/src/conv-4.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#define NMTOOLS_CAST_ARRAYS_NESTED_VEC(...)

#if defined(NMTOOLS_TESTING_GENERIC_NDARRAY) && defined(NMTOOLS_BUILD_CONSTEXPR_TESTS)
#if defined(NMTOOLS_TESTING_GENERIC_NDARRAY)
#define NMTOOLS_CONSTEXPR_CAST_ARRAYS_EXTRA(name) \
constexpr inline auto name##_cs_fb = nmtools::cast(name, nmtools::array::kind::ndarray_cs_fb); \
constexpr inline auto name##_cs_hb = nmtools::cast(name, nmtools::array::kind::ndarray_cs_hb); \
Expand Down

0 comments on commit b95e35f

Please sign in to comment.