diff --git a/include/etl/index.hpp b/include/etl/index.hpp index 29933bac..952bc719 100644 --- a/include/etl/index.hpp +++ b/include/etl/index.hpp @@ -93,10 +93,8 @@ constexpr size_t fast_index(size_t i) noexcept(assert_nothrow) { * \param j The index of the second dimension to access * \return The flat position of (i,j) */ -template +template constexpr size_t fast_index(size_t i, size_t j) noexcept(assert_nothrow) { - static_assert(is_2d, "Invalid number of dimensions for fast_index"); - if constexpr (decay_traits::storage_order == order::RowMajor) { cpp_assert(i < decay_traits::template dim<0>(), "Out of bounds"); cpp_assert(j < decay_traits::template dim<1>(), "Out of bounds"); @@ -117,10 +115,8 @@ constexpr size_t fast_index(size_t i, size_t j) noexcept(assert_nothrow) { * \param k The index of the third dimension to access * \return The flat position of (i,j,k) */ -template +template constexpr size_t fast_index(size_t i, size_t j, size_t k) noexcept(assert_nothrow) { - static_assert(is_3d, "Invalid number of dimensions for fast_index"); - if constexpr (decay_traits::storage_order == order::RowMajor) { cpp_assert(i < decay_traits::template dim<0>(), "Out of bounds"); cpp_assert(j < decay_traits::template dim<1>(), "Out of bounds"); @@ -144,10 +140,8 @@ constexpr size_t fast_index(size_t i, size_t j, size_t k) noexcept(assert_nothro * \param l The index of the fourth dimension to access * \return The flat position of (i,j,k,l) */ -template +template constexpr size_t fast_index(size_t i, size_t j, size_t k, size_t l) noexcept(assert_nothrow) { - static_assert(is_4d, "Invalid number of dimensions for fast_index"); - if constexpr (decay_traits::storage_order == order::RowMajor) { cpp_assert(i < decay_traits::template dim<0>(), "Out of bounds"); cpp_assert(j < decay_traits::template dim<1>(), "Out of bounds"); diff --git a/include/etl/op/flip_transformers.hpp b/include/etl/op/flip_transformers.hpp index 0b0a9b4f..b1cf6e8e 100644 --- a/include/etl/op/flip_transformers.hpp +++ b/include/etl/op/flip_transformers.hpp @@ -16,15 +16,13 @@ namespace etl { * * \tparam T The type on which the transformer is applied */ -template +template struct one_if_max_sub_transformer { using sub_type = T; ///< The type on which the expression works using value_type = value_t; ///< The type of valuie friend etl_traits; - static_assert(is_2d, "one_if_max_sub is only defined for 2D Matrix"); - static constexpr bool gpu_computable = impl::egblas::has_sone_if_max_sub && all_row_major && all_floating; private: