Skip to content

Commit

Permalink
c++17: add [[fallthrough]] attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
cwpearson committed May 14, 2024
1 parent a5794bb commit e1f06ec
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion graph/impl/KokkosGraph_Distance2Color_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ class GraphColorDistance2 {
colors_out = color_view_type("Graph Colors", this->nr);
}
switch (this->gc_handle->get_coloring_algo_type()) {
case COLORING_D2_VB_BIT_EF: using_edge_filtering = true;
case COLORING_D2_VB_BIT_EF: using_edge_filtering = true; [[fallthrough]];
case COLORING_D2_VB_BIT:
case COLORING_D2_VB: compute_d2_coloring_vb(colors_out); break;
case COLORING_D2_NB_BIT: compute_d2_coloring_nb(colors_out); break;
Expand Down
5 changes: 1 addition & 4 deletions graph/src/KokkosGraph_Triangle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,7 @@ void triangle_generic(KernelHandle *handle, typename KernelHandle::nnz_lno_t m,
spgemmHandleType *sh = handle->get_spgemm_handle();
switch (sh->get_algorithm_type()) {
// case SPGEMM_KK_TRIANGLE_LL:
case SPGEMM_KK_TRIANGLE_AI:
case SPGEMM_KK_TRIANGLE_IA:
case SPGEMM_KK_TRIANGLE_IA_UNION:
default: {
case SPGEMM_KK_TRIANGLE_AI case SPGEMM_KK_TRIANGLE_IA case SPGEMM_KK_TRIANGLE_IA_UNION default: {
KokkosSparse::Impl::KokkosSPGEMM<
KernelHandle, alno_row_view_t_, alno_nnz_view_t_,
typename KernelHandle::in_scalar_nnz_view_t, blno_row_view_t_,
Expand Down
2 changes: 2 additions & 0 deletions perf_test/sparse/KokkosSparse_sptrsv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ int test_sptrsv_perf(std::vector<int> tests, const std::string &lfilename,
#else
std::cout << "CUSPARSE not enabled: Fall through to defaults"
<< std::endl;
[[fallthrough]];
#endif
default:
kh.create_sptrsv_handle(SPTRSVAlgorithm::SEQLVLSCHD_TP1, nrows,
Expand Down Expand Up @@ -681,6 +682,7 @@ int test_sptrsv_perf(std::vector<int> tests, const std::string &lfilename,
#else
std::cout << "CUSPARSE not enabled: Fall through to defaults"
<< std::endl;
[[fallthrough]];
#endif
default:
kh.create_sptrsv_handle(SPTRSVAlgorithm::SEQLVLSCHD_TP1, nrows,
Expand Down
2 changes: 1 addition & 1 deletion sparse/impl/KokkosSparse_spgemm_impl_memaccess.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ void KokkosSPGEMM<HandleType, a_row_view_t_, a_lno_nnz_view_t_,
cache_1_line_count);
}
} break;
case 2: hyper_thread_ind = 1;
case 2: hyper_thread_ind = 1; [[fallthrough]];
case 1: {
nnz_lno_t result_col_ind =
result_col + (hyper_thread_ind - 1) * b_col_cnt;
Expand Down

0 comments on commit e1f06ec

Please sign in to comment.