| 1 |
//@HEADER |
| 2 |
// ************************************************************************ |
| 3 |
// |
| 4 |
// Kokkos v. 4.0 |
| 5 |
// Copyright (2022) National Technology & Engineering |
| 6 |
// Solutions of Sandia, LLC (NTESS). |
| 7 |
// |
| 8 |
// Under the terms of Contract DE-NA0003525 with NTESS, |
| 9 |
// the U.S. Government retains certain rights in this software. |
| 10 |
// |
| 11 |
// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. |
| 12 |
// See https://kokkos.org/LICENSE for license information. |
| 13 |
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 14 |
// |
| 15 |
//@HEADER |
| 16 |
#ifndef KOKKOSBATCHED_INNER_GEMM_FIX_C_DECL_HPP |
| 17 |
#define KOKKOSBATCHED_INNER_GEMM_FIX_C_DECL_HPP |
| 18 |
|
| 19 |
/// \author Kyungjoo Kim ([email protected]) |
| 20 |
|
| 21 |
namespace KokkosBatched { |
| 22 |
|
| 23 |
template <int mb = 0, int nb = 0> |
| 24 |
struct InnerGemmFixC { |
| 25 |
const int _as0, _as1, _bs0, _bs1, _cs0, _cs1; |
| 26 |
|
| 27 |
KOKKOS_INLINE_FUNCTION |
| 28 |
InnerGemmFixC(const int as0, const int as1, const int bs0, const int bs1, const int cs0, const int cs1) |
| 29 |
: _as0(as0), _as1(as1), _bs0(bs0), _bs1(bs1), _cs0(cs0), _cs1(cs1) {} |
| 30 |
|
| 31 |
// serial rank update |
| 32 |
template <typename ScalarType, typename ValueType> |
| 33 |
KOKKOS_INLINE_FUNCTION int serial_invoke(const ScalarType alpha, const ValueType *KOKKOS_RESTRICT A, |
| 34 |
const ValueType *KOKKOS_RESTRICT B, const int k, |
| 35 |
/**/ ValueType *KOKKOS_RESTRICT C); |
| 36 |
|
| 37 |
// serial rank update for remainder |
| 38 |
template <typename ScalarType, typename ValueType> |
| 39 |
KOKKOS_INLINE_FUNCTION int serial_invoke(const ScalarType alpha, const ValueType *KOKKOS_RESTRICT A, |
| 40 |
const ValueType *KOKKOS_RESTRICT B, const int m, const int k, |
| 41 |
/**/ ValueType *KOKKOS_RESTRICT C); |
| 42 |
|
| 43 |
// serial rank update for remainder |
| 44 |
template <typename ScalarType, typename ValueType> |
| 45 |
KOKKOS_INLINE_FUNCTION int serial_invoke(const ScalarType alpha, const ValueType *KOKKOS_RESTRICT A, |
| 46 |
const ValueType *KOKKOS_RESTRICT B, const int m, const int n, const int k, |
| 47 |
/**/ ValueType *KOKKOS_RESTRICT C); |
| 48 |
|
| 49 |
template <typename MemberType, typename ScalarType, typename ValueType> |
| 50 |
KOKKOS_INLINE_FUNCTION int team_invoke(const MemberType &member, const ScalarType alpha, |
| 51 |
const ValueType *KOKKOS_RESTRICT A, const ValueType *KOKKOS_RESTRICT B, |
| 52 |
const int k, |
| 53 |
/**/ ValueType *KOKKOS_RESTRICT C); |
| 54 |
|
| 55 |
// team rank update for remainder |
| 56 |
template <typename MemberType, typename ScalarType, typename ValueType> |
| 57 |
KOKKOS_INLINE_FUNCTION int team_invoke(const MemberType &member, const ScalarType alpha, |
| 58 |
const ValueType *KOKKOS_RESTRICT A, const ValueType *KOKKOS_RESTRICT B, |
| 59 |
const int m, const int n, const int k, |
| 60 |
/**/ ValueType *KOKKOS_RESTRICT C); |
| 61 |
}; |
| 62 |
} // namespace KokkosBatched |
| 63 |
|
| 64 |
#endif |