Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jgfouca committed Feb 20, 2024
1 parent e05bb9a commit 47d5756
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions sparse/impl/KokkosSparse_spiluk_numeric_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ struct IlukWrap {

// multiply_subtract. C -= A * B
KOKKOS_INLINE_FUNCTION
void multiply_subtract(const scalar_t &A, const scalar_t &B, scalar_t &C) const {
void multiply_subtract(const scalar_t &A, const scalar_t &B,
scalar_t &C) const {
C -= A * B;
}

Expand Down Expand Up @@ -263,8 +264,7 @@ struct IlukWrap {
}

KOKKOS_INLINE_FUNCTION
void lset(const size_type block,
const ABlock &rhs) const {
void lset(const size_type block, const ABlock &rhs) const {
auto lblock = lget(block);
for (size_type i = 0; i < block_size; ++i) {
for (size_type j = 0; j < block_size; ++j) {
Expand All @@ -280,8 +280,7 @@ struct IlukWrap {
}

KOKKOS_INLINE_FUNCTION
void uset(const size_type block,
const ABlock &rhs) const {
void uset(const size_type block, const ABlock &rhs) const {
auto ublock = uget(block);
for (size_type i = 0; i < block_size; ++i) {
for (size_type j = 0; j < block_size; ++j) {
Expand Down Expand Up @@ -314,33 +313,32 @@ struct IlukWrap {
const LBlock &B,
CView &C) const {
// Use gemm. alpha is hardcoded to -1, beta hardcoded to 1
KokkosBatched::SerialGemm<KokkosBatched::Trans::NoTranspose,
KokkosBatched::Trans::NoTranspose,
KokkosBatched::Algo::Gemm::Unblocked>::
invoke<scalar_t, LBlock,
UBlock, LBlock>(
-1.0, A, B, 1.0, C);
KokkosBatched::SerialGemm<
KokkosBatched::Trans::NoTranspose, KokkosBatched::Trans::NoTranspose,
KokkosBatched::Algo::Gemm::Unblocked>::invoke<scalar_t, LBlock,
UBlock, LBlock>(
-1.0, A, B, 1.0, C);
}

// lget
KOKKOS_INLINE_FUNCTION
LBlock lget(const size_type block) const {
return LBlock(
L_values.data() + (block * block_items), block_size, block_size);
return LBlock(L_values.data() + (block * block_items), block_size,
block_size);
}

// uget
KOKKOS_INLINE_FUNCTION
UBlock uget(const size_type block) const {
return UBlock(
U_values.data() + (block * block_items), block_size, block_size);
return UBlock(U_values.data() + (block * block_items), block_size,
block_size);
}

// aget
KOKKOS_INLINE_FUNCTION
ABlock aget(const size_type block) const {
return ABlock(
A_values.data() + (block * block_items), block_size, block_size);
return ABlock(A_values.data() + (block * block_items), block_size,
block_size);
}

// uequal
Expand Down

0 comments on commit 47d5756

Please sign in to comment.