Skip to content

Commit

Permalink
Merge pull request #155 from neil-lindquist/fix-gmres
Browse files Browse the repository at this point in the history
Fix `Tile::offset` function
  • Loading branch information
neil-lindquist authored Dec 14, 2023
2 parents a82bcc1 + 2016d0b commit 8693751
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions include/slate/Tile.hh
Original file line number Diff line number Diff line change
Expand Up @@ -707,10 +707,26 @@ void Tile<scalar_t>::offset(int64_t i, int64_t j)
{
slate_assert(0 <= i && i < mb());
slate_assert(0 <= j && j < nb());
if (op_ == Op::NoTrans)

if ((op_ == Op::NoTrans) == (layout_ == Layout::ColMajor)) {
data_ = &data_[ i + j*stride_ ];
else
}
else {
data_ = &data_[ j + i*stride_ ];
}

if ((op_ == Op::NoTrans) == (user_layout_ == Layout::ColMajor)) {
user_data_ = &user_data_[ i + j*user_stride_ ];
if (ext_data_ != nullptr) {
ext_data_ = &ext_data_[ j + i*nb_];
}
}
else {
user_data_ = &user_data_[ j + i*user_stride_ ];
if (ext_data_ != nullptr) {
ext_data_ = &ext_data_[ i + j*mb_];
}
}
}

//------------------------------------------------------------------------------
Expand Down

0 comments on commit 8693751

Please sign in to comment.