Skip to content

Commit

Permalink
Style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
psakievich committed Dec 21, 2022
1 parent 22127c4 commit 00452bf
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 36 deletions.
51 changes: 25 additions & 26 deletions src/Simulation.C
Original file line number Diff line number Diff line change
Expand Up @@ -51,26 +51,25 @@ Simulation::Simulation(const YAML::Node& root_node)
cudaDeviceGetLimit(&default_stack_size, cudaLimitStackSize);
cudaDeviceSetLimit(cudaLimitStackSize, nalu_stack_size);
#elif defined(KOKKOS_ENABLE_HIP)
hipError_t err = hipDeviceGetLimit(&default_stack_size, hipLimitMallocHeapSize);
if (err!=hipSuccess)
{
/*
This might be useful at some point so keeping it and commenting out.
printf("%s %s %d : Failure %s in hipDeviceSetLimit\n",
__FILE__,__FUNCTION__,__LINE__,hipGetErrorString(err));
*/
hipError_t err =
hipDeviceGetLimit(&default_stack_size, hipLimitMallocHeapSize);
if (err != hipSuccess) {
/*
This might be useful at some point so keeping it and commenting out.
printf("%s %s %d : Failure %s in hipDeviceSetLimit\n",
__FILE__,__FUNCTION__,__LINE__,hipGetErrorString(err));
*/
}

err = hipDeviceSetLimit(hipLimitMallocHeapSize, nalu_stack_size);
if (err!=hipSuccess)
{
/*
This might be useful at some point so keeping it and commenting out.
printf("%s %s %d : Failure %s in hipDeviceSetLimit\n",
__FILE__,__FUNCTION__,__LINE__,hipGetErrorString(err));
*/
if (err != hipSuccess) {
/*
This might be useful at some point so keeping it and commenting out.
printf("%s %s %d : Failure %s in hipDeviceSetLimit\n",
__FILE__,__FUNCTION__,__LINE__,hipGetErrorString(err));
*/
}
#endif
}
Expand All @@ -84,15 +83,15 @@ Simulation::~Simulation()
#if defined(KOKKOS_ENABLE_CUDA)
cudaDeviceSetLimit(cudaLimitStackSize, default_stack_size);
#elif defined(KOKKOS_ENABLE_HIP)
hipError_t err = hipDeviceSetLimit(hipLimitMallocHeapSize, default_stack_size);
if (err!=hipSuccess)
{
/*
This might be useful at some point so keeping it and commenting out.
printf("%s %s %d : Failure %s in hipDeviceSetLimit\n",
__FILE__,__FUNCTION__,__LINE__,hipGetErrorString(err));
*/
hipError_t err =
hipDeviceSetLimit(hipLimitMallocHeapSize, default_stack_size);
if (err != hipSuccess) {
/*
This might be useful at some point so keeping it and commenting out.
printf("%s %s %d : Failure %s in hipDeviceSetLimit\n",
__FILE__,__FUNCTION__,__LINE__,hipGetErrorString(err));
*/
}
#endif
}
Expand Down
17 changes: 8 additions & 9 deletions unit_tests.C
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,15 @@ main(int argc, char** argv)
#elif defined(KOKKOS_ENABLE_HIP)
const size_t nalu_stack_size = 16384;
hipError_t err = hipDeviceSetLimit(hipLimitMallocHeapSize, nalu_stack_size);
if (err!=hipSuccess)
{
/*
This might be useful at some point so keeping it and commenting out.
if (err != hipSuccess) {
/*
This might be useful at some point so keeping it and commenting out.
sierra::nalu::NaluEnv::self().naluOutputP0()
<< __FILE__ << " " << __FUNCTION__ << " " << __LINE__
<< " : Failure " << hipGetErrorString(err) << " in hipDeviceSetLimit\n"
<< std::endl;
*/
sierra::nalu::NaluEnv::self().naluOutputP0()
<< __FILE__ << " " << __FUNCTION__ << " " << __LINE__
<< " : Failure " << hipGetErrorString(err) << " in hipDeviceSetLimit\n"
<< std::endl;
*/
}
#endif
// Create a dummy nested scope to ensure destructors are called before
Expand Down
3 changes: 2 additions & 1 deletion unit_tests/UnitTestBasicKokkos.C
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ run_nested_parallel_for_thread_teams_test()
// host_view2D, and the deep_copy is a no-op. That means that the parallel_for
// which comes next, is updating the values of host_view2D.
Kokkos::parallel_for(
Kokkos::TeamPolicy<Kokkos::DefaultExecutionSpace>(N, NTHREADS_PER_DEVICE_TEAM),
Kokkos::TeamPolicy<Kokkos::DefaultExecutionSpace>(
N, NTHREADS_PER_DEVICE_TEAM),
KOKKOS_LAMBDA(const TeamHandleType& team) {
size_t i = team.league_rank();
Kokkos::parallel_for(
Expand Down

0 comments on commit 00452bf

Please sign in to comment.