Skip to content

Commit

Permalink
Merge pull request #318 from william76/coloring-vbd-test-fix
Browse files Browse the repository at this point in the history
Fix COLORING_VBD test failures on Cuda
  • Loading branch information
ndellingwood authored Oct 10, 2018
2 parents 7eac133 + 6b48ef3 commit 909ac4b
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/graph/KokkosGraph_graph_color.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ void graph_color_symbolic(
case COLORING_VBD:
case COLORING_VBDBIT:
typedef typename Impl::GraphColor_VBD <typename KernelHandle::GraphColoringHandleType, lno_row_view_t_, lno_nnz_view_t_> VBDGraphColoring;
gc = new VBDGraphColoring(num_rows, entries.dimension_0(), row_map, entries, gch);
gc = new VBDGraphColoring(num_rows, entries.extent(0), row_map, entries, gch);
break;

case COLORING_EB:
Expand Down
21 changes: 19 additions & 2 deletions unit_test/graph/Test_Graph_graph_color.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,26 @@ void test_coloring(lno_t numRows,size_type nnz, lno_t bandwidth, lno_t row_size_
graph_t static_graph (sym_adj, sym_xadj);
input_mat = crsMat_t("CrsMatrix", numCols, newValues, static_graph);

ColoringAlgorithm coloring_algorithms[] = {COLORING_DEFAULT, COLORING_SERIAL, COLORING_VB, COLORING_VBBIT, COLORING_VBCS, COLORING_EB, COLORING_VBD, COLORING_VBDBIT};
std::vector<ColoringAlgorithm> coloring_algorithms = { COLORING_DEFAULT
, COLORING_SERIAL
, COLORING_VB
, COLORING_VBBIT
, COLORING_VBCS
, COLORING_EB
};

#ifdef KOKKOS_ENABLE_CUDA
if( !std::is_same< typename device::execution_space, Kokkos::Cuda >::value )
{
coloring_algorithms.push_back(COLORING_VBD);
coloring_algorithms.push_back(COLORING_VBDBIT);
}
#else
coloring_algorithms.push_back(COLORING_VBD);
coloring_algorithms.push_back(COLORING_VBDBIT);
#endif

for (int ii = 0; ii < 8; ++ii){
for (size_t ii = 0; ii < coloring_algorithms.size(); ++ii) {
ColoringAlgorithm coloring_algorithm = coloring_algorithms[ii];
color_view_t vector_colors;
size_t num_colors;
Expand Down
17 changes: 14 additions & 3 deletions unit_test/graph/Test_Graph_graph_color_deterministic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,20 @@ void test_coloring_deterministic(lno_t numRows, size_type nnz) {
graph_t static_graph (adj, xadj);
crsMat_t input_mat("CrsMatrix", numCols, newValues, static_graph);

ColoringAlgorithm coloring_algorithms[] = {COLORING_VBD, COLORING_VBDBIT};
std::vector<ColoringAlgorithm> coloring_algorithms;

for (int ii = 0; ii < 2; ++ii){
#ifdef KOKKOS_ENABLE_CUDA
if( !std::is_same< typename device::execution_space, Kokkos::Cuda >::value )
{
coloring_algorithms.push_back(COLORING_VBD);
coloring_algorithms.push_back(COLORING_VBDBIT);
}
#else
coloring_algorithms.push_back(COLORING_VBD);
coloring_algorithms.push_back(COLORING_VBDBIT);
#endif

for (size_t ii = 0; ii < coloring_algorithms.size(); ++ii) {
ColoringAlgorithm coloring_algorithm = coloring_algorithms[ii];
color_view_t vector_colors;
size_t num_colors;
Expand All @@ -175,7 +186,7 @@ void test_coloring_deterministic(lno_t numRows, size_type nnz) {
}

EXPECT_TRUE( (num_conflict == 0));
//device::execution_space::finalize();
//device::execution_space::finalize();

}

Expand Down

0 comments on commit 909ac4b

Please sign in to comment.