diff --git a/src/CG.cpp b/src/CG.cpp index c174fcd..5b45a6b 100644 --- a/src/CG.cpp +++ b/src/CG.cpp @@ -147,12 +147,12 @@ int CG(const SparseMatrix & A, CGData & data, const Vector & b, Vector & x, local_int_1d_type orig_rows = A_Optimized-> orig_rows; Optivector * x_Optimized = (Optivector *) x.optimizationData; double_1d_type x_values = x_Optimized->values; - double_1d_type x_copy = double_1d_type("", x_values.dimension_0()); + double_1d_type x_copy = double_1d_type("", x_values.extent(0)); /* - for(int i = 0; i < x_values.dimension_0(); i++) + for(int i = 0; i < x_values.extent(0); i++) x_copy(orig_rows(i)) = x_values(i); */ - Kokkos::parallel_for(x_values.dimension_0(), PermuteX(orig_rows, x_copy, x_values)); + Kokkos::parallel_for(x_values.extent(0), PermuteX(orig_rows, x_copy, x_values)); //for(int i = 0; i < 10; i++) // std::cout<<"Px("<localMatrix; Coloring::array_type colors("colors", A.localNumberOfRows); - Coloring::array_type idx("idx", localMatrix.graph.row_map.dimension_0()); // Should be A.localNumberOfRows+1 length - Coloring::array_type adj("adj", localMatrix.graph.entries.dimension_0()); // Should be A.LocalNumberOfNonzeros. - Kokkos::parallel_for(localMatrix.graph.row_map.dimension_0(), fillIdx(idx, localMatrix.graph.row_map)); - Kokkos::parallel_for(localMatrix.graph.entries.dimension_0(), fillAdj(adj, localMatrix.graph.entries)); + Coloring::array_type idx("idx", localMatrix.graph.row_map.extent(0)); // Should be A.localNumberOfRows+1 length + Coloring::array_type adj("adj", localMatrix.graph.entries.extent(0)); // Should be A.LocalNumberOfNonzeros. + Kokkos::parallel_for(localMatrix.graph.row_map.extent(0), fillIdx(idx, localMatrix.graph.row_map)); + Kokkos::parallel_for(localMatrix.graph.entries.extent(0), fillAdj(adj, localMatrix.graph.entries)); Coloring c(A.localNumberOfRows, idx, adj, colors); c.color(false, false, false); // Flags are as follows... Use conflict List, Serial Resolve Conflict, Time and show. int numColors = c.getNumColors(); @@ -303,4 +303,4 @@ int doColoring(SparseMatrix & A){ if(A.Ac != 0) return doColoring(*A.Ac); return(0); } -#endif \ No newline at end of file +#endif diff --git a/src/KokkosSetup.hpp b/src/KokkosSetup.hpp index 5b01d7b..81ba8d0 100644 --- a/src/KokkosSetup.hpp +++ b/src/KokkosSetup.hpp @@ -7,10 +7,10 @@ This file is for the intention of creating things needed by Kokkos. #ifndef KOKKOS_SETUP #define KOKKOS_SETUP -#include +#include #include -#include +#include #include "Kokkos_UnorderedMap.hpp" #include "Geometry.hpp" // Just so we have the local_int_t and global_int_t definitions. @@ -62,8 +62,8 @@ typedef const_global_int_2d_type::HostMirror host_const_global_int_2d_type; typedef const_char_1d_type::HostMirror host_const_char_1d_type; //CrsMatrix typedefs //CrsMatrix types -typedef Kokkos::CrsMatrix local_matrix_type; -typedef Kokkos::CrsMatrix global_matrix_type; +typedef KokkosSparse::CrsMatrix local_matrix_type; +typedef KokkosSparse::CrsMatrix global_matrix_type; typedef local_matrix_type::values_type values_type; // View for matrix values, similar to double_1d_type. typedef local_matrix_type::index_type local_index_type; // View for column Indices, similar to local_int_1d_type. typedef global_matrix_type::index_type global_index_type; diff --git a/src/LevelSYMGS.cpp b/src/LevelSYMGS.cpp index d851428..d08234b 100644 --- a/src/LevelSYMGS.cpp +++ b/src/LevelSYMGS.cpp @@ -107,7 +107,7 @@ assert(x.localLength == A.localNumberOfColumns); // Make sure x contains space f Optivector * x_Optimized = (Optivector *) x.optimizationData; double_1d_type x_values = x_Optimized->values; - double_1d_type z("z", x_values.dimension_0()); + double_1d_type z("z", x_values.extent(0)); #ifdef KOKKOS_TEAM const int row_per_team=256; const int vector_size = 32; @@ -118,7 +118,7 @@ assert(x.localLength == A.localNumberOfColumns); // Make sure x contains space f int numberOfTeams = level_index_end - level_index_begin; Kokkos::parallel_for(team_policy(numberOfTeams/teamSizeMax + 1, teamSizeMax, vector_size), LeveledSweep(level_index_begin, level_index_end, localMatrix, f_lev_ind, r_values, x_values)); - execution_space::fence(); + execution_space().fence(); } for(int i = 0; i < b_numLevels; i++){ int level_index_begin = b_lev_map(i); @@ -126,10 +126,10 @@ assert(x.localLength == A.localNumberOfColumns); // Make sure x contains space f int numberOfTeams = level_index_end - level_index_begin; Kokkos::parallel_for(team_policy(numberOfTeams/teamSizeMax + 1, teamSizeMax, vector_size), LeveledSweep(level_index_begin, level_index_end, localMatrix, b_lev_ind, r_values, x_values)); - execution_space::fence(); + execution_space().fence(); } - + #else for(int i = 0; i < f_numLevels; i++){ int start = f_lev_map(i); diff --git a/src/LevelScheduler.cpp b/src/LevelScheduler.cpp index 69f8f81..187ca25 100644 --- a/src/LevelScheduler.cpp +++ b/src/LevelScheduler.cpp @@ -14,7 +14,7 @@ class fillColorsMap{ void operator()(const int & i)const{ int color = i+1; int total = 0; - for(unsigned j = 0; j < colors.dimension_0(); j++) + for(unsigned j = 0; j < colors.extent(0); j++) if(colors(j) == color) total++; colors_map(color) = total; } @@ -50,7 +50,7 @@ class fillColorsInd{ void operator()(const int & i)const{ int color = i+1; // Colors start at 1 and i starts at 0. int start = colors_map(i); - for(unsigned j = 0; j < colors.dimension_0(); j++){ + for(unsigned j = 0; j < colors.extent(0); j++){ if(colors(j) == color){ colors_ind(start) = j; start++; @@ -162,4 +162,4 @@ int levelSchedule(SparseMatrix & A){ else return(0); } -#endif \ No newline at end of file +#endif