Kokkos Node API and Local Linear Algebra Kernels Version of the Day
CrsMatrix_DefaultMultiplyTests.hpp
Go to the documentation of this file.
00001 
00005   TEUCHOS_UNIT_TEST_TEMPLATE_3_DECL( DefaultSparseOps, NodeTest, Ordinal, Scalar, Node )
00006   {
00007     RCP<Node> node = getNode<Node>();
00008     typedef typename DefaultKernels<Scalar,Ordinal,Node>::SparseOps DSM;
00009     typedef CrsGraph<Ordinal,Node,DSM>                             GRPH;
00010     typedef CrsMatrix<Scalar,Ordinal,Node,DSM>                      MAT;
00011     typedef MultiVector<Scalar,Node>                                 MV;
00012     typedef Teuchos::ScalarTraits<Scalar>                            ST;
00013     typename DSM::template rebind<Scalar>::other dsm(node);
00014     TEST_EQUALITY(dsm.getNode(), node);
00015   }
00016 
00017   TEUCHOS_UNIT_TEST_TEMPLATE_3_DECL( DefaultSparseOps, ResubmitMatrix, Ordinal, Scalar, Node )
00018   {
00019     RCP<Node> node = getNode<Node>();
00020     typedef typename DefaultKernels<Scalar,Ordinal,Node>::SparseOps DSM;
00021     typedef CrsGraph<Ordinal,Node,DSM>                             GRPH;
00022     typedef CrsMatrix<Scalar,Ordinal,Node,DSM>                      MAT;
00023     typedef MultiVector<Scalar,Node>                                 MV;
00024     typedef Teuchos::ScalarTraits<Scalar>                            ST;
00025     const size_t numRows = 5;
00026     GRPH G(numRows,node);
00027     MAT  A(G);
00028     A.finalize(true);
00029     out << "\n**\n** Can't submit the values before the structure\n**\n";
00030     {
00031       typename DSM::template rebind<Scalar>::other dsm(node);
00032       TEST_THROW( dsm.initializeValues(A), std::runtime_error );
00033     }
00034     out << "\n**\n** Can't submit the graph twice\n**\n";
00035     {
00036       typename DSM::template rebind<Scalar>::other dsm(node);
00037       dsm.initializeStructure(G);
00038       TEST_THROW( dsm.initializeStructure(G), std::runtime_error );
00039     }
00040     out << "\n**\n** Can submit the graph again after calling clear\n**\n";
00041     {
00042       typename DSM::template rebind<Scalar>::other dsm(node);
00043       dsm.initializeStructure(G);
00044       dsm.clear();
00045       TEST_NOTHROW( dsm.initializeStructure(G) );
00046     }
00047     out << "\n**\n** Can submit the values twice\n**\n";
00048     {
00049       typename DSM::template rebind<Scalar>::other dsm(node);
00050       dsm.initializeStructure(G);
00051       dsm.initializeValues(A);
00052       TEST_NOTHROW( dsm.initializeValues(A) );
00053     }
00054   }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends