Skip to content

Commit

Permalink
Merge pull request kokkos#222 from NexGenAnalytics/fix-gemm-infinite-…
Browse files Browse the repository at this point in the history
…recursion

Fix infinite recursion crash in `gemm` cross-test
  • Loading branch information
mhoemmen committed May 27, 2022
2 parents 4b4b634 + 098f6ef commit 3ddde76
Showing 1 changed file with 30 additions and 17 deletions.
47 changes: 30 additions & 17 deletions include/experimental/__p1673_bits/blas3_matrix_product.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -368,23 +368,6 @@ constexpr bool extractConj ()
template <class Exec, class A_t, class B_t, class C_t, class = void>
struct is_custom_matrix_product_avail : std::false_type {};

template <class Exec, class A_t, class B_t, class C_t>
struct is_custom_matrix_product_avail<
Exec, A_t, B_t, C_t,
std::enable_if_t<
std::is_void_v<
decltype(
matrix_product
(std::declval<Exec>(),
std::declval<A_t>(),
std::declval<B_t>(),
std::declval<C_t>()))
>
&& !linalg::impl::is_inline_exec_v<Exec>
>
>
: std::true_type{};

template <class Exec, class A_t, class B_t, class E_t, class C_t, class = void>
struct is_custom_matrix_product_with_update_avail : std::false_type {};

Expand Down Expand Up @@ -2235,6 +2218,36 @@ void hermitian_matrix_right_product(
hermitian_matrix_right_product(std::experimental::linalg::impl::default_exec_t(), A, t, B, E, C);
}

template <class Exec, class A_t, class B_t, class C_t>
struct is_custom_matrix_product_avail<
Exec, A_t, B_t, C_t,
std::enable_if_t<
std::is_void_v<
decltype(
matrix_product(
std::declval<Exec>(),
std::declval<A_t>(),
std::declval<B_t>(),
std::declval<C_t>()))
>
&& !std::is_same_v< // see #218
decltype(
std::experimental::linalg::matrix_product(
std::declval<Exec>(),
std::declval<A_t>(),
std::declval<B_t>(),
std::declval<C_t>())),
decltype(
matrix_product(
std::declval<Exec>(),
std::declval<A_t>(),
std::declval<B_t>(),
std::declval<C_t>()))
>
&& !linalg::impl::is_inline_exec_v<Exec>
>
>
: std::true_type{};

} // end namespace linalg
} // end inline namespace __p1673_version_0
Expand Down

0 comments on commit 3ddde76

Please sign in to comment.