From 06a9d8bdc2a850e94150600f2724db2837424f66 Mon Sep 17 00:00:00 2001 From: Tomas Oberhuber <tomas.oberhuber@fjfi.cvut.cz> Date: Tue, 19 Nov 2019 16:31:40 +0100 Subject: [PATCH] Fixed ParalleFor example. --- Documentation/Examples/Algorithms/ParallelForExample.cpp | 2 +- Documentation/Tutorials/ForLoops/StaticForExample-3.cpp | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 Documentation/Tutorials/ForLoops/StaticForExample-3.cpp diff --git a/Documentation/Examples/Algorithms/ParallelForExample.cpp b/Documentation/Examples/Algorithms/ParallelForExample.cpp index 46d23f58a8..87ea0d0cfb 100644 --- a/Documentation/Examples/Algorithms/ParallelForExample.cpp +++ b/Documentation/Examples/Algorithms/ParallelForExample.cpp @@ -16,7 +16,7 @@ void initVector( Vector< double, Device >& v, { auto view = v.getConstView(); auto init = [=] __cuda_callable__ ( int i, const double c ) mutable { - view[ i ] = c; + view[ i ] = c; } ParallelFor< Device >::exec( 0, v.getSize(), init, c ); } diff --git a/Documentation/Tutorials/ForLoops/StaticForExample-3.cpp b/Documentation/Tutorials/ForLoops/StaticForExample-3.cpp new file mode 100644 index 0000000000..7ee4afd72c --- /dev/null +++ b/Documentation/Tutorials/ForLoops/StaticForExample-3.cpp @@ -0,0 +1,4 @@ +for( int i = 0; i < Size; i++ ) +{ + a[ i ] = b[ i ] + c; sum += a[ i ]; +}; -- GitLab