Commit 66d4b5b4 authored by Mehmet Deveci (-EXP)'s avatar Mehmet Deveci (-EXP)
Browse files

Fixing the incldue file name error with the kokkoskernels_experimental flag.

Changed the include file names, and name spaces.
Removed the experimental flag, the code compiles default as long as openmp is enabled.
This should fix #1660
parent 4664acb6
......@@ -56,11 +56,7 @@
#include "Tpetra_Import_Util2.hpp"
#include <algorithm>
#include "Teuchos_FancyOStream.hpp"
#ifdef HAVE_KOKKOSKERNELS_EXPERIMENTAL
#include "KokkosKernels_SPGEMM.hpp"
#endif
#include "KokkosSparse_spgemm.hpp"
/*! \file TpetraExt_MatrixMatrix_def.hpp
......@@ -1665,7 +1661,7 @@ void KernelWrappers<Scalar,LocalOrdinal,GlobalOrdinal,Node>::mult_A_B_newmatrix_
/*********************************************************************************************************/
// AB NewMatrix Kernel wrappers (KokkosKernels/OpenMP Version)
#if defined(HAVE_KOKKOSKERNELS_EXPERIMENTAL) && defined (HAVE_TPETRA_INST_OPENMP)
#if defined (HAVE_TPETRA_INST_OPENMP)
template<class Scalar,
class LocalOrdinal,
class GlobalOrdinal>
......@@ -1742,7 +1738,7 @@ void KernelWrappers<Scalar,LocalOrdinal,GlobalOrdinal,Kokkos::Compat::KokkosOpen
std::string alg = nodename+std::string(" algorithm");
// printf("DEBUG: Using kernel: %s\n",myalg.c_str());
if(!params.is_null() && params->isParameter(alg)) myalg = params->get(alg,myalg);
KokkosKernels::Experimental::Graph::SPGEMMAlgorithm alg_enum = KokkosKernels::Experimental::Graph::StringToSPGEMMAlgorithm(myalg);
KokkosSparse::SPGEMMAlgorithm alg_enum = KokkosSparse::StringToSPGEMMAlgorithm(myalg);
// We need to do this dance if either (a) We have Bimport or (b) We don't A's colMap is not the same as B's rowMap
if(!Bview.importMatrix.is_null() || (Bview.importMatrix.is_null() && (&*Aview.origMatrix->getGraph()->getColMap() != &*Bview.origMatrix->getGraph()->getRowMap()))) {
......@@ -1834,14 +1830,14 @@ void KernelWrappers<Scalar,LocalOrdinal,GlobalOrdinal,Kokkos::Compat::KokkosOpen
kh.create_spgemm_handle(alg_enum);
kh.set_team_work_size(team_work_size);
KokkosKernels::Experimental::Graph::spgemm_symbolic(&kh,AnumRows,BnumRows,BnumCols,Ak.graph.row_map,Ak.graph.entries,false,Bmerged->graph.row_map,Bmerged->graph.entries,false,row_mapC);
KokkosSparse::Experimental::spgemm_symbolic(&kh,AnumRows,BnumRows,BnumCols,Ak.graph.row_map,Ak.graph.entries,false,Bmerged->graph.row_map,Bmerged->graph.entries,false,row_mapC);
size_t c_nnz_size = kh.get_spgemm_handle()->get_c_nnz();
if (c_nnz_size){
entriesC = lno_nnz_view_t (Kokkos::ViewAllocateWithoutInitializing("entriesC"), c_nnz_size);
valuesC = scalar_view_t (Kokkos::ViewAllocateWithoutInitializing("valuesC"), c_nnz_size);
}
KokkosKernels::Experimental::Graph::spgemm_numeric(&kh,AnumRows,BnumRows,BnumCols,Ak.graph.row_map,Ak.graph.entries,Ak.values,false,Bmerged->graph.row_map,Bmerged->graph.entries,Bmerged->values,false,row_mapC,entriesC,valuesC);
KokkosSparse::Experimental::spgemm_numeric(&kh,AnumRows,BnumRows,BnumCols,Ak.graph.row_map,Ak.graph.entries,Ak.values,false,Bmerged->graph.row_map,Bmerged->graph.entries,Bmerged->values,false,row_mapC,entriesC,valuesC);
kh.destroy_spgemm_handle();
#ifdef HAVE_TPETRA_MMM_TIMINGS
......
......@@ -6,16 +6,14 @@ TRIBITS_ADD_EXECUTABLE_AND_TEST(
ARGS "--matnames-file=\"matrixsystems.xml\" --v"
)
IF (KokkosKernels_ENABLE_Experimental)
TRIBITS_ADD_EXECUTABLE_AND_TEST(
MatrixMatrixKernels_UnitTests
SOURCES
MatrixMatrixKernels_UnitTests.cpp
${TEUCHOS_STD_UNIT_TEST_MAIN}
ARGS "--matnames-file=\"matrixsystems.xml\" --v"
NUM_MPI_PROCS 1
)
ENDIF()
TRIBITS_ADD_EXECUTABLE_AND_TEST(
MatrixMatrixKernels_UnitTests
SOURCES
MatrixMatrixKernels_UnitTests.cpp
${TEUCHOS_STD_UNIT_TEST_MAIN}
ARGS "--matnames-file=\"matrixsystems.xml\" --v"
NUM_MPI_PROCS 1
)
......
......@@ -58,7 +58,7 @@
#include "MatrixMarket_Tpetra.hpp"
#include "Tpetra_RowMatrixTransposer.hpp"
#include <cmath>
#include "KokkosKernels_SPGEMM.hpp"
#include "KokkosSparse_spgemm.hpp"
#include "Tpetra_RowMatrixTransposer.hpp"
#include "Tpetra_Import_Util2.hpp"
......@@ -424,7 +424,7 @@ mult_test_results multiply_test_kernel(
std::string myalg = ALGORITHMS[alg];
printf("Testing algorithm %s on %s\n",myalg.c_str(),name.c_str());
KokkosKernels::Experimental::Graph::SPGEMMAlgorithm alg_enum = KokkosKernels::Experimental::Graph::StringToSPGEMMAlgorithm(myalg);
KokkosSparse::SPGEMMAlgorithm alg_enum = KokkosSparse::StringToSPGEMMAlgorithm(myalg);
typename KernelHandle::nnz_lno_t AnumRows = Ak.numRows();
typename KernelHandle::nnz_lno_t BnumRows = Bk.numRows();
typename KernelHandle::nnz_lno_t BnumCols = Bk.numCols();
......@@ -435,7 +435,7 @@ mult_test_results multiply_test_kernel(
kh.create_spgemm_handle(alg_enum);
// Symbolic
KokkosKernels::Experimental::Graph::spgemm_symbolic(&kh,AnumRows,BnumRows,BnumCols,Ak.graph.row_map,Ak.graph.entries,false,Bk.graph.row_map,Bk.graph.entries,false,row_mapC);
KokkosSparse::Experimental::spgemm_symbolic(&kh,AnumRows,BnumRows,BnumCols,Ak.graph.row_map,Ak.graph.entries,false,Bk.graph.row_map,Bk.graph.entries,false,row_mapC);
size_t c_nnz_size = kh.get_spgemm_handle()->get_c_nnz();
// printf("DEBUG: c_nnz_size = %d\n",c_nnz_size); // This isn't relevant for MKL
if (c_nnz_size){
......@@ -444,7 +444,7 @@ mult_test_results multiply_test_kernel(
}
// Numeric
KokkosKernels::Experimental::Graph::spgemm_numeric(&kh,AnumRows,BnumRows,BnumCols,Ak.graph.row_map,Ak.graph.entries,Ak.values,false,Bk.graph.row_map,Bk.graph.entries,Bk.values,false,row_mapC,entriesC,valuesC);
KokkosSparse::Experimental::spgemm_numeric(&kh,AnumRows,BnumRows,BnumCols,Ak.graph.row_map,Ak.graph.entries,Ak.values,false,Bk.graph.row_map,Bk.graph.entries,Bk.values,false,row_mapC,entriesC,valuesC);
kh.destroy_spgemm_handle();
// Sort
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment