Skip to content

Commit

Permalink
Iluk deprecate experimental (#2495)
Browse files Browse the repository at this point in the history
* Sparse - SpILUK: move kernels out of Experimental namespace

Will make other commits to remove the usage through out the library.

Signed-off-by: Luc Berger-Vergiat <lberge@sandia.gov>

* Sparse - SpILUK: updating unit and performance tests

After moving the functions out of experimental we need to update
tests so we do not call it ourselves anymore.

Signed-off-by: Luc Berger-Vergiat <lberge@sandia.gov>

* Applying clang-format

Signed-off-by: Luc Berger-Vergiat <lberge@sandia.gov>

---------

Signed-off-by: Luc Berger-Vergiat <lberge@sandia.gov>
  • Loading branch information
lucbv authored Feb 6, 2025
1 parent 910b23b commit bdc57ac
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 16 deletions.
6 changes: 3 additions & 3 deletions perf_test/sparse/KokkosSparse_par_ilut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ void run_spiluk_test(benchmark::State& state, KernelHandle& kh, const sp_matrix_
if (measure_symbolic) {
state.ResumeTiming();
}
spiluk_symbolic(&kh, fill_lev, A_row_map, A_entries, L_row_map, L_entries, U_row_map, U_entries);
KokkosSparse::spiluk_symbolic(&kh, fill_lev, A_row_map, A_entries, L_row_map, L_entries, U_row_map, U_entries);
Kokkos::fence();
state.PauseTiming();

Expand All @@ -233,8 +233,8 @@ void run_spiluk_test(benchmark::State& state, KernelHandle& kh, const sp_matrix_

if (!measure_symbolic) {
state.ResumeTiming();
spiluk_numeric(&kh, fill_lev, A_row_map, A_entries, A_values, L_row_map, L_entries, L_values, U_row_map,
U_entries, U_values);
KokkosSparse::spiluk_numeric(&kh, fill_lev, A_row_map, A_entries, A_values, L_row_map, L_entries, L_values,
U_row_map, U_entries, U_values);
Kokkos::fence();
state.PauseTiming();
}
Expand Down
11 changes: 6 additions & 5 deletions perf_test/sparse/KokkosSparse_spiluk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ int test_spiluk_perf(std::vector<int> tests, std::string afilename, int kin, int
Kokkos::Timer timer;

timer.reset();
spiluk_symbolic(&kh, fill_lev, A.graph.row_map, A.graph.entries, L_row_map, L_entries, U_row_map, U_entries);
KokkosSparse::spiluk_symbolic(&kh, fill_lev, A.graph.row_map, A.graph.entries, L_row_map, L_entries, U_row_map,
U_entries);
std::cout << "ILU(" << fill_lev << ") Symbolic Time: " << timer.seconds() << std::endl;

Kokkos::resize(L_entries, kh.get_spiluk_handle()->get_nnzL());
Expand All @@ -179,8 +180,8 @@ int test_spiluk_perf(std::vector<int> tests, std::string afilename, int kin, int
std::cout << "nnzU: " << kh.get_spiluk_handle()->get_nnzU() << std::endl;

timer.reset();
spiluk_numeric(&kh, fill_lev, A.graph.row_map, A.graph.entries, A.values, L_row_map, L_entries, L_values,
U_row_map, U_entries, U_values);
KokkosSparse::spiluk_numeric(&kh, fill_lev, A.graph.row_map, A.graph.entries, A.values, L_row_map, L_entries,
L_values, U_row_map, U_entries, U_values);
Kokkos::fence();
std::cout << "ILU(" << fill_lev << ") Numeric Time: " << timer.seconds() << std::endl;

Expand Down Expand Up @@ -331,8 +332,8 @@ int test_spiluk_perf(std::vector<int> tests, std::string afilename, int kin, int

for (int i = 0; i < loop; i++) {
timer.reset();
spiluk_numeric(&kh, fill_lev, A.graph.row_map, A.graph.entries, A.values, L_row_map, L_entries, L_values,
U_row_map, U_entries, U_values);
KokkosSparse::spiluk_numeric(&kh, fill_lev, A.graph.row_map, A.graph.entries, A.values, L_row_map, L_entries,
L_values, U_row_map, U_entries, U_values);
Kokkos::fence();
double time = timer.seconds();
ave_time += time;
Expand Down
24 changes: 23 additions & 1 deletion sparse/src/KokkosSparse_spiluk.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include "KokkosSparse_spiluk_numeric_spec.hpp"

namespace KokkosSparse {
namespace Experimental {

#define KOKKOSKERNELS_SPILUK_SAME_TYPE(A, B) \
std::is_same<typename std::remove_const<A>::type, typename std::remove_const<B>::type>::value
Expand Down Expand Up @@ -412,6 +411,29 @@ void spiluk_numeric(KernelHandle* handle, typename KernelHandle::const_nnz_lno_t
U_rowmap_i, U_entries_i, U_values_i);
} // spiluk_numeric

namespace Experimental {

template <typename KernelHandle, typename ARowMapType, typename AEntriesType, typename LRowMapType,
typename LEntriesType, typename URowMapType, typename UEntriesType>
[[deprecated("spiluk_numeric was promoted out of Experimental, please use KokkosSparse::spiluk_numeric instead.")]] void
spiluk_symbolic(KernelHandle* handle, typename KernelHandle::const_nnz_lno_t fill_lev, ARowMapType& A_rowmap,
AEntriesType& A_entries, LRowMapType& L_rowmap, LEntriesType& L_entries, URowMapType& U_rowmap,
UEntriesType& U_entries, int nstreams = 1) {
KokkosSparse::spiluk_symbolic(handle, fill_lev, A_rowmap, A_entries, L_rowmap, L_entries, U_rowmap, U_entries,
nstreams);
}

template <typename KernelHandle, typename ARowMapType, typename AEntriesType, typename AValuesType,
typename LRowMapType, typename LEntriesType, typename LValuesType, typename URowMapType,
typename UEntriesType, typename UValuesType>
[[deprecated("spiluk_numeric was promoted out of Experimental, please use KokkosSparse::spiluk_numeric instead.")]] void
spiluk_numeric(KernelHandle* handle, typename KernelHandle::const_nnz_lno_t fill_lev, ARowMapType& A_rowmap,
AEntriesType& A_entries, AValuesType& A_values, LRowMapType& L_rowmap, LEntriesType& L_entries,
LValuesType& L_values, URowMapType& U_rowmap, UEntriesType& U_entries, UValuesType& U_values) {
KokkosSparse::spiluk_numeric(handle, fill_lev, A_rowmap, A_entries, A_values, L_rowmap, L_entries, L_values, U_rowmap,
U_entries, U_values);
}

template <class ExecutionSpace, typename KernelHandle, typename ARowMapType, typename AEntriesType,
typename AValuesType, typename LRowMapType, typename LEntriesType, typename LValuesType, typename URowMapType,
typename UEntriesType, typename UValuesType>
Expand Down
14 changes: 7 additions & 7 deletions sparse/unit_test/Test_Sparse_spiluk.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ struct SpilukTest {
RowMapType U_row_map("U_row_map", nrows + 1);
EntriesType U_entries("U_entries", spiluk_handle->get_nnzU());

spiluk_symbolic(&kh, fill_lev, row_map, entries, L_row_map, L_entries, U_row_map, U_entries);
KokkosSparse::spiluk_symbolic(&kh, fill_lev, row_map, entries, L_row_map, L_entries, U_row_map, U_entries);

Kokkos::fence();

Expand All @@ -247,8 +247,8 @@ struct SpilukTest {
ValuesType L_values("L_values", spiluk_handle->get_nnzL() * static_cast<size_t>(block_items));
ValuesType U_values("U_values", spiluk_handle->get_nnzU() * static_cast<size_t>(block_items));

spiluk_numeric(&kh, fill_lev, row_map, entries, values, L_row_map, L_entries, L_values, U_row_map, U_entries,
U_values);
KokkosSparse::spiluk_numeric(&kh, fill_lev, row_map, entries, values, L_row_map, L_entries, L_values, U_row_map,
U_entries, U_values);

Kokkos::fence();

Expand Down Expand Up @@ -493,8 +493,8 @@ struct SpilukTest {
U_entries_v[i] = EntriesType("U_entries", spiluk_handle->get_nnzU());

// Symbolic phase
spiluk_symbolic(kh_ptr_v[i], fill_lev, A_row_map_v[i], A_entries_v[i], L_row_map_v[i], L_entries_v[i],
U_row_map_v[i], U_entries_v[i], nstreams);
KokkosSparse::spiluk_symbolic(kh_ptr_v[i], fill_lev, A_row_map_v[i], A_entries_v[i], L_row_map_v[i],
L_entries_v[i], U_row_map_v[i], U_entries_v[i], nstreams);

Kokkos::fence();

Expand Down Expand Up @@ -612,8 +612,8 @@ struct SpilukTest {
U_entries_v[i] = EntriesType("U_entries", spiluk_handle->get_nnzU());

// Symbolic phase
spiluk_symbolic(kh_ptr_v[i], fill_lev, A_row_map_v[i], A_entries_v[i], L_row_map_v[i], L_entries_v[i],
U_row_map_v[i], U_entries_v[i], nstreams);
KokkosSparse::spiluk_symbolic(kh_ptr_v[i], fill_lev, A_row_map_v[i], A_entries_v[i], L_row_map_v[i],
L_entries_v[i], U_row_map_v[i], U_entries_v[i], nstreams);

Kokkos::fence();

Expand Down

0 comments on commit bdc57ac

Please sign in to comment.