From b95e35fd6740cb69818f68450bd52b10dfbcc26f Mon Sep 17 00:00:00 2001 From: Fahri Ali Rahman Date: Thu, 18 Jul 2024 17:47:16 +0700 Subject: [PATCH] fix constexpr conv tests on generic-ndarray test suite --- tests/constexpr/src/conv-1.cpp | 2 +- tests/constexpr/src/conv-2.cpp | 2 +- tests/constexpr/src/conv-3.cpp | 5 ++++- tests/constexpr/src/conv-4.cpp | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/constexpr/src/conv-1.cpp b/tests/constexpr/src/conv-1.cpp index b2467ef00..82525b562 100644 --- a/tests/constexpr/src/conv-1.cpp +++ b/tests/constexpr/src/conv-1.cpp @@ -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); \ diff --git a/tests/constexpr/src/conv-2.cpp b/tests/constexpr/src/conv-2.cpp index a29afa06a..02dc35bc3 100644 --- a/tests/constexpr/src/conv-2.cpp +++ b/tests/constexpr/src/conv-2.cpp @@ -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); \ diff --git a/tests/constexpr/src/conv-3.cpp b/tests/constexpr/src/conv-3.cpp index b07588364..ca156ff33 100644 --- a/tests/constexpr/src/conv-3.cpp +++ b/tests/constexpr/src/conv-3.cpp @@ -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); \ @@ -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) diff --git a/tests/constexpr/src/conv-4.cpp b/tests/constexpr/src/conv-4.cpp index e989fdf5a..6d649501a 100644 --- a/tests/constexpr/src/conv-4.cpp +++ b/tests/constexpr/src/conv-4.cpp @@ -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); \