Commit e805c0e9 authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Merge branch 'TO/matrices-adaptive-csr' into 'develop'

To/matrices adaptive csr

See merge request !91
parents db2daa5b 4f594e30
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ int main( int argc, char* argv[] )
    */
   Vector< double, Devices::Host > host_v1( 10 ), host_v2( 10 ), host_result( 10 );
   host_v1 = 1.0;
   host_v2.forEachElement( []__cuda_callable__ ( int i, double& v ) { v = i; } );
   host_v2.forAllElements( []__cuda_callable__ ( int i, double& v ) { v = i; } );
   vectorSum( host_v1, host_v2, 2.0, host_result );
   std::cout << "host_v1 = " << host_v1 << std::endl;
   std::cout << "host_v2 = " << host_v2 << std::endl;
@@ -48,7 +48,7 @@ int main( int argc, char* argv[] )
#ifdef HAVE_CUDA
   Vector< double, Devices::Cuda > cuda_v1( 10 ), cuda_v2( 10 ), cuda_result( 10 );
   cuda_v1 = 1.0;
   cuda_v2.forEachElement( []__cuda_callable__ ( int i, double& v ) { v = i; } );
   cuda_v2.forAllElements( []__cuda_callable__ ( int i, double& v ) { v = i; } );
   vectorSum( cuda_v1, cuda_v2, 2.0, cuda_result );
   std::cout << "cuda_v1 = " << cuda_v1 << std::endl;
   std::cout << "cuda_v2 = " << cuda_v2 << std::endl;
+1 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ void forElementsExample()
   /****
    * Initiate the elements of array `a`
    */
   a.forEachElement( [] __cuda_callable__ ( int i, float& value ) { value = i; } );
   a.forAllElements( [] __cuda_callable__ ( int i, float& value ) { value = i; } );

   /****
    * Initiate elements of array `b` with indexes 0-4 using `a_view`
+1 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ void reduceElementsExample()
   /****
    * Initiate the elements of array `a`
    */
   a.forEachElement( [] __cuda_callable__ ( int i, float& value ) { value = i; } );
   a.forAllElements( [] __cuda_callable__ ( int i, float& value ) { value = i; } );

   /****
    * Sum all elements of array `a`
+1 −1
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ void arrayViewExample()
   ArrayType a3( size );
   ViewType a3_view = a3.getView();
   auto f1 = [] __cuda_callable__ ( IndexType i, int& value ) { value = 2 * i; };
   a3_view.forEachElement( f1 );
   a3_view.forAllElements( f1 );

   for( int i = 0; i < size; i++ )
      if( a3_view.getElement( i ) != 2 * i )
+1 −1
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ void forElementsExample()
    * Create an ArrayView and use it for initiation of elements of array `a`
    */
   auto a_view = a.getView();
   a_view.forEachElement( [] __cuda_callable__ ( int i, float& value ) { value = i; } );
   a_view.forAllElements( [] __cuda_callable__ ( int i, float& value ) { value = i; } );

   /****
    * Initiate elements of array `b` with indexes 0-4 using `a_view`
Loading