Skip to content

Matrix product always falls back to native implementation  #248

Description

@srinivasyadav18

I am trying to implement HPX backend for matrix_product.
I am not certainly clear with this section of code (below).
The following always evalutes to false right ?
Because both qualified lookup and unqualified lookup of matrix_product return void, so the second part of the expression always evaluates to false and hence whole std::enable_if_t is false.

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{};

Which makes this : https://github.com/kokkos/stdBLAS/blob/main/include/experimental/__p1673_bits/blas3_matrix_product.hpp#L757 always false and hence falls backs to native sequential implementation.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions