MCPcopy Create free account
hub / github.com/BLAST-WarpX/warpx / fillWithConsecutiveIntegers

Function fillWithConsecutiveIntegers

Source/Particles/Sorting/SortingUtils.cpp:11–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9#include "SortingUtils.H"
10
11void fillWithConsecutiveIntegers( amrex::Gpu::DeviceVector<int>& v )
12{
13#ifdef AMREX_USE_GPU
14 // On GPU: Use amrex
15 auto data = v.data();
16 auto N = v.size();
17 AMREX_FOR_1D( N, i, {data[i] = i;});
18#else
19 // On CPU: Use std library
20 std::iota( v.begin(), v.end(), 0L );
21#endif
22}

Callers 1

Calls 4

dataMethod · 0.80
sizeMethod · 0.80
beginMethod · 0.80
endMethod · 0.80

Tested by

no test coverage detected