Kokkos Node API and Local Linear Algebra Kernels Version of the Day
SimpleNodeExample.cpp
Go to the documentation of this file.
00001 #include "Kokkos_NodeExampleKernels.hpp"
00002 #include <Kokkos_DefaultNode.hpp>
00003 #include <Kokkos_NodeHelpers.hpp>
00004 
00009 int main() {
00010   typedef Kokkos::DefaultNode::DefaultNodeType NODE;
00011   const int VEC_LENGTH = 100;
00012 
00013   Teuchos::RCP<NODE> node = Kokkos::DefaultNode::getDefaultNode();
00014   Teuchos::ArrayRCP<int> x = node->allocBuffer<int>( VEC_LENGTH );
00015 
00016   KokkosExamples::initVec( node, x );
00017   int ret = KokkosExamples::reduceVec( node, x );
00018   std::cout << "Result is " << ret << std::endl;
00019   if (ret == (VEC_LENGTH-1)*VEC_LENGTH/2) std::cout << "End Result: TEST PASSED" << std::endl;
00020 
00021   return 0;
00022 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends