Skip to content

Commit

Permalink
Exclude the GPU reporting if Cuda is not enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin D. Weinberg committed Oct 29, 2023
1 parent a14ba0a commit 7c5bda5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions src/Cube.H
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,11 @@ private:
std::cout << std::string(60, '=') << std::endl;
std::cout << "Time in CPU: "
<< duration0.count()-duration1.count() << std::endl;
#if HAVE_LIBCUDA==1
if (c->cC->cudaDevice>=0) {
std::cout << "Time in GPU: " << duration1.count() << std::endl;
}
#endif
std::cout << std::string(60, '=') << std::endl;
}
}
Expand Down
12 changes: 6 additions & 6 deletions src/Cube.cc
Original file line number Diff line number Diff line change
Expand Up @@ -289,14 +289,14 @@ void * Cube::determine_acceleration_and_potential_thread(void * arg)
double z = cC->Pos(i, 2);

// Recursion multipliers
auto stepx = exp(kfac*x);
auto stepy = exp(kfac*y);
auto stepz = exp(kfac*z);
auto stepx = std::exp(kfac*x);
auto stepy = std::exp(kfac*y);
auto stepz = std::exp(kfac*z);

// Initial values (note sign change)
auto startx = exp(-kfac*(x*nmaxx));
auto starty = exp(-kfac*(y*nmaxy));
auto startz = exp(-kfac*(z*nmaxz));
auto startx = std::exp(-kfac*(x*nmaxx));
auto starty = std::exp(-kfac*(y*nmaxy));
auto startz = std::exp(-kfac*(z*nmaxz));

std::complex<double> facx, facy, facz;
int ix, iy, iz;
Expand Down

0 comments on commit 7c5bda5

Please sign in to comment.