lass="m-code"><span class="c1">// assigns each element to 1 over the range [gpu_data, gpu_data + 1000)</span>
<span class="n">cudaflow</span><span class="p">.</span><span class="n">for_each</span><span class="p">(</span><span class="n">gpu_data</span><span class="p">,</span><span class="w"> </span><span class="n">gpu_data</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="mi">1000</span><span class="p">,</span><span class="w"> </span><span class="p">[]</span><span cla