MCPcopy Create free account
hub / github.com/AMReX-Codes/amrex / test_atomicAdd

Function test_atomicAdd

Tests/OpenMP/atomicAdd/main.cpp:8–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6using namespace amrex;
7
8void test_atomicAdd (MultiFab& mf)
9{
10
11#ifdef AMREX_USE_OMP
12#pragma omp parallel
13#endif
14 {
15 FArrayBox tmp;
16 for (MFIter mfi(mf,true); mfi.isValid(); ++mfi) {
17 Box const& tbx = mfi.growntilebox();
18 tmp.resize(tbx);
19 tmp.template setVal<RunOn::Host>(0.2);
20 mf[mfi].template atomicAdd<RunOn::Host>(tmp, tbx, tbx, 0, 0, 1);
21 }
22 }
23}
24
25void test_lockAdd (MultiFab& mf)
26{

Callers 1

mainFunction · 0.85

Calls 3

growntileboxMethod · 0.80
isValidMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected