Loading Documentation/Examples/Algorithms/ParallelForExample.cu +2 −2 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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; Loading Documentation/Examples/Containers/ArrayExample_forElements.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -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` Loading Documentation/Examples/Containers/ArrayExample_reduceElements.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -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` Loading Documentation/Examples/Containers/ArrayViewExample.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -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 ) Loading Documentation/Examples/Containers/ArrayViewExample_forElements.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -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 Loading
Documentation/Examples/Algorithms/ParallelForExample.cu +2 −2 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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; Loading
Documentation/Examples/Containers/ArrayExample_forElements.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -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` Loading
Documentation/Examples/Containers/ArrayExample_reduceElements.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -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` Loading
Documentation/Examples/Containers/ArrayViewExample.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -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 ) Loading
Documentation/Examples/Containers/ArrayViewExample_forElements.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -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