Loading Documentation/Examples/Algorithms/SequentialForExample.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -10,10 +10,11 @@ using namespace TNL::Containers; template< typename Device > void printVector() { const int size( 36 ); const int size( 60 ); TNL::Containers::Vector< float, Device > v( size, 1.0 ); auto view = v.getView(); auto print = [=] __cuda_callable__ ( int i ) mutable { if( i % 5 == 0 ) printf( "v[ %d ] = %f \n", i, view[ i ] ); // we use printf because of compatibility with GPU kernels }; std::cout << "Printing vector using parallel for: " << std::endl; Loading Loading
Documentation/Examples/Algorithms/SequentialForExample.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -10,10 +10,11 @@ using namespace TNL::Containers; template< typename Device > void printVector() { const int size( 36 ); const int size( 60 ); TNL::Containers::Vector< float, Device > v( size, 1.0 ); auto view = v.getView(); auto print = [=] __cuda_callable__ ( int i ) mutable { if( i % 5 == 0 ) printf( "v[ %d ] = %f \n", i, view[ i ] ); // we use printf because of compatibility with GPU kernels }; std::cout << "Printing vector using parallel for: " << std::endl; Loading