Skip to content

Commit

Permalink
Tacho : compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
iyamazaki committed Nov 9, 2024
1 parent 1550fd9 commit c569cbd
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 20 deletions.
8 changes: 4 additions & 4 deletions packages/shylu/shylu_node/tacho/src/Tacho_Driver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,9 +393,9 @@ template <typename ValueType, typename DeviceType> struct Driver {
if (blk_size > 1) {
//condense graph before calling analyze
const size_type nnz = ap(m);
size_type m_graph = m / blk_size;
ordinal_type m_graph = m / blk_size;
size_type nnz_graph = nnz / (blk_size*blk_size);
TACHO_TEST_FOR_EXCEPTION((m != blk_size * m_graph || nnz != blk_size*blk_size * nnz_graph),
TACHO_TEST_FOR_EXCEPTION((m != blk_size * m_graph || nnz != size_type(blk_size*blk_size) * nnz_graph),
std::logic_error, "Failed to initialize the condensed graph");

size_type_array_host ap_graph
Expand All @@ -407,7 +407,7 @@ template <typename ValueType, typename DeviceType> struct Driver {
// condense the graph
nnz_graph = 0;
ap_graph(0) = 0;
for (size_type i = 0; i < m; i += blk_size) {
for (ordinal_type i = 0; i < m; i += blk_size) {
for (size_type k = ap(i); k < ap(i+1); k++) {
if (aj(k)%blk_size == 0) {
aj_graph(nnz_graph) = aj(k)/blk_size;
Expand All @@ -417,7 +417,7 @@ template <typename ValueType, typename DeviceType> struct Driver {
ap_graph((i/blk_size)+1) = nnz_graph;
}
}
TACHO_TEST_FOR_EXCEPTION((nnz != blk_size*blk_size * nnz_graph),
TACHO_TEST_FOR_EXCEPTION((nnz != size_type(blk_size*blk_size) * nnz_graph),
std::logic_error, "Failed to condense graph");
return analyze(m, ap, aj, m_graph, ap_graph, aj_graph, aw_graph, duplicate);
} else {
Expand Down
12 changes: 6 additions & 6 deletions packages/shylu/shylu_node/tacho/src/impl/Tacho_Lapack_Team.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,9 @@ template <typename T> struct LapackTeam {
Kokkos::parallel_reduce(
Kokkos::TeamVectorRange(member, 1 + iend),
[&](const int &i, reducer_value_type &update) {
const mag_type val = arith_traits::abs(ABR[i * as0]);
if (val > update.val) {
update.val = val;
const mag_type val_i = arith_traits::abs(ABR[i * as0]);
if (val_i > update.val_i) {
update.val = val_i;
update.loc = i;
}
},
Expand Down Expand Up @@ -324,9 +324,9 @@ template <typename T> struct LapackTeam {
Kokkos::parallel_reduce(
Kokkos::TeamVectorRange(member, 1 + iend),
[&](const int &i, reducer_value_type &update) {
const mag_type val = arith_traits::abs(ABR[i * as0]);
if (val > update.val) {
update.val = val;
const mag_type val_i = arith_traits::abs(ABR[i * as0]);
if (val_i > update.val) {
update.val = val_i;
update.loc = i;
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4281,9 +4281,6 @@ class NumericToolsLevelSet : public NumericToolsBase<ValueType, DeviceType> {
team_policy_update policy_update(1, 1, 1);
functor_type functor(_info, _factorize_mode, _level_sids, _piv, _buf, &rval);
if (pivot_tol > 0.0) {
using arith_traits = ArithTraits<value_type>;
using mag_type = typename arith_traits::mag_type;
const mag_type tol = sqrt(arith_traits::epsilon());
functor.setDiagPertubationTol(pivot_tol);
}
// get max vector length
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ template <typename SupernodeInfoType> struct TeamFunctor_ExtractCrs {
[&](const int& i) {
// diagonal block
ordinal_type j;
for (ordinal_type j = i; j < s.m; j++) {
for (j = i; j < s.m; j++) {
if (AT(i,j) != zero) {
int nnz = _rowptr[i+offm];
_colind[nnz] = j+offm;
Expand All @@ -202,8 +202,8 @@ template <typename SupernodeInfoType> struct TeamFunctor_ExtractCrs {
}
// off-diagonal blocksa
j = s.m;
for (ordinal_type id = s.sid_col_begin + 1; id < s.sid_col_end - 1; id++) {
for (ordinal_type k = _info.sid_block_colidx(id).second; k < _info.sid_block_colidx(id + 1).second; k++) {
for (ordinal_type blk_id = s.sid_col_begin + 1; blk_id < s.sid_col_end - 1; blk_id++) {
for (ordinal_type k = _info.sid_block_colidx(blk_id).second; k < _info.sid_block_colidx(blk_id + 1).second; k++) {
if (AT(i,j) != zero) {
int nnz = _rowptr[i+offm];
_colind[nnz] = _info.gid_colidx(k+offn);
Expand Down Expand Up @@ -262,8 +262,8 @@ template <typename SupernodeInfoType> struct TeamFunctor_ExtractCrs {
}
// off-diagonals (each thread extract col, needing atomic-add)
ordinal_type i = s.m;
for (ordinal_type id = s.sid_col_begin + 1; id < s.sid_col_end - 1; id++) {
for (ordinal_type k = _info.sid_block_colidx(id).second; k < _info.sid_block_colidx(id + 1).second; k++) {
for (ordinal_type blk_id = s.sid_col_begin + 1; blk_id < s.sid_col_end - 1; blk_id++) {
for (ordinal_type k = _info.sid_block_colidx(blk_id).second; k < _info.sid_block_colidx(blk_id + 1).second; k++) {
if (AL(i, j) != zero) {
ordinal_type gid_i = _info.gid_colidx(k+offn);
Kokkos::atomic_add(&(_rowptr[1+gid_i]), 1);
Expand Down Expand Up @@ -329,8 +329,8 @@ template <typename SupernodeInfoType> struct TeamFunctor_ExtractCrs {
}
// off-diagonals (each thread extract col, needing atomic-add)
ordinal_type i = s.m;
for (ordinal_type id = s.sid_col_begin + 1; id < s.sid_col_end - 1; id++) {
for (ordinal_type k = _info.sid_block_colidx(id).second; k < _info.sid_block_colidx(id + 1).second; k++) {
for (ordinal_type blk_id = s.sid_col_begin + 1; blk_id < s.sid_col_end - 1; blk_id++) {
for (ordinal_type k = _info.sid_block_colidx(blk_id).second; k < _info.sid_block_colidx(blk_id + 1).second; k++) {
if (AL(i, j) != zero) {
ordinal_type gid_i = _info.gid_colidx(k+offn);
ordinal_type nnz = Kokkos::atomic_fetch_add(&(_rowptr[gid_i]), 1);
Expand Down

0 comments on commit c569cbd

Please sign in to comment.