Commit 372b437b authored by Alain O' Miniussi's avatar Alain O' Miniussi
Browse files

(try to) make test gpu compatible.

refs #602
parent 50fe4ffc
......@@ -51,17 +51,17 @@ main(int argc, char* argv[]) {
arr2d<real> density = grid->profileView("density");
arr2d<real> energy = grid->profileView("energy");
for(int i = 0; i < nr; ++i) {
int ii = grid->radiusIndexMin() + i;
for(int h = 0; h < ni; ++h) {
radv(i,h) = ii*10+h+0.1;
phiv(i,h) = ii*10+h+0.2;
thetav(i,h) = ii*10+h+0.3;
density(i,h) = ii*10+h+0.4;
energy(i,h) = ii*10+h+0.5;
}
}
int iBase = grid->radiusIndexMin();
Kokkos::parallel_for(grid->range2({0,0}, {nr,ni}),
KOKKOS_LAMBDA(int i, int h) {
int ii = iBase+i;
radv(i,h) = ii*10+h+0.1;
phiv(i,h) = ii*10+h+0.2;
thetav(i,h) = ii*10+h+0.3;
density(i,h) = ii*10+h+0.4;
energy(i,h) = ii*10+h+0.5;
});
DiskProfiles profiles1(*grid, radv, phiv, thetav, density, energy);
{
bool writer = world.rank() == 0;
......@@ -82,7 +82,7 @@ main(int argc, char* argv[]) {
real thetavdiff = *maxAbsDiff(profiles1.velocity().theta(), profiles2.velocity().theta());
real densitydiff = *maxAbsDiff(profiles1.density(), profiles2.density());
real energydiff = *maxAbsDiff(*profiles1.energy(), *profiles2.energy());
real gradvdiff = fmpi::all_reduce(world, radvdiff, fmpi::maximum<real>());
real gphivdiff = fmpi::all_reduce(world, phivdiff, fmpi::maximum<real>());
real gthetavdiff = fmpi::all_reduce(world, thetavdiff, fmpi::maximum<real>());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment