Skip to content

Commit 00452bf

Browse files
committed
Style fixes
1 parent 22127c4 commit 00452bf

File tree

3 files changed

+35
-36
lines changed

3 files changed

+35
-36
lines changed

src/Simulation.C

+25-26
Original file line numberDiff line numberDiff line change
@@ -51,26 +51,25 @@ Simulation::Simulation(const YAML::Node& root_node)
5151
cudaDeviceGetLimit(&default_stack_size, cudaLimitStackSize);
5252
cudaDeviceSetLimit(cudaLimitStackSize, nalu_stack_size);
5353
#elif defined(KOKKOS_ENABLE_HIP)
54-
hipError_t err = hipDeviceGetLimit(&default_stack_size, hipLimitMallocHeapSize);
55-
if (err!=hipSuccess)
56-
{
57-
/*
58-
This might be useful at some point so keeping it and commenting out.
59-
60-
printf("%s %s %d : Failure %s in hipDeviceSetLimit\n",
61-
__FILE__,__FUNCTION__,__LINE__,hipGetErrorString(err));
62-
*/
54+
hipError_t err =
55+
hipDeviceGetLimit(&default_stack_size, hipLimitMallocHeapSize);
56+
if (err != hipSuccess) {
57+
/*
58+
This might be useful at some point so keeping it and commenting out.
59+
60+
printf("%s %s %d : Failure %s in hipDeviceSetLimit\n",
61+
__FILE__,__FUNCTION__,__LINE__,hipGetErrorString(err));
62+
*/
6363
}
6464

6565
err = hipDeviceSetLimit(hipLimitMallocHeapSize, nalu_stack_size);
66-
if (err!=hipSuccess)
67-
{
68-
/*
69-
This might be useful at some point so keeping it and commenting out.
70-
71-
printf("%s %s %d : Failure %s in hipDeviceSetLimit\n",
72-
__FILE__,__FUNCTION__,__LINE__,hipGetErrorString(err));
73-
*/
66+
if (err != hipSuccess) {
67+
/*
68+
This might be useful at some point so keeping it and commenting out.
69+
70+
printf("%s %s %d : Failure %s in hipDeviceSetLimit\n",
71+
__FILE__,__FUNCTION__,__LINE__,hipGetErrorString(err));
72+
*/
7473
}
7574
#endif
7675
}
@@ -84,15 +83,15 @@ Simulation::~Simulation()
8483
#if defined(KOKKOS_ENABLE_CUDA)
8584
cudaDeviceSetLimit(cudaLimitStackSize, default_stack_size);
8685
#elif defined(KOKKOS_ENABLE_HIP)
87-
hipError_t err = hipDeviceSetLimit(hipLimitMallocHeapSize, default_stack_size);
88-
if (err!=hipSuccess)
89-
{
90-
/*
91-
This might be useful at some point so keeping it and commenting out.
92-
93-
printf("%s %s %d : Failure %s in hipDeviceSetLimit\n",
94-
__FILE__,__FUNCTION__,__LINE__,hipGetErrorString(err));
95-
*/
86+
hipError_t err =
87+
hipDeviceSetLimit(hipLimitMallocHeapSize, default_stack_size);
88+
if (err != hipSuccess) {
89+
/*
90+
This might be useful at some point so keeping it and commenting out.
91+
92+
printf("%s %s %d : Failure %s in hipDeviceSetLimit\n",
93+
__FILE__,__FUNCTION__,__LINE__,hipGetErrorString(err));
94+
*/
9695
}
9796
#endif
9897
}

unit_tests.C

+8-9
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,15 @@ main(int argc, char** argv)
3131
#elif defined(KOKKOS_ENABLE_HIP)
3232
const size_t nalu_stack_size = 16384;
3333
hipError_t err = hipDeviceSetLimit(hipLimitMallocHeapSize, nalu_stack_size);
34-
if (err!=hipSuccess)
35-
{
36-
/*
37-
This might be useful at some point so keeping it and commenting out.
34+
if (err != hipSuccess) {
35+
/*
36+
This might be useful at some point so keeping it and commenting out.
3837
39-
sierra::nalu::NaluEnv::self().naluOutputP0()
40-
<< __FILE__ << " " << __FUNCTION__ << " " << __LINE__
41-
<< " : Failure " << hipGetErrorString(err) << " in hipDeviceSetLimit\n"
42-
<< std::endl;
43-
*/
38+
sierra::nalu::NaluEnv::self().naluOutputP0()
39+
<< __FILE__ << " " << __FUNCTION__ << " " << __LINE__
40+
<< " : Failure " << hipGetErrorString(err) << " in hipDeviceSetLimit\n"
41+
<< std::endl;
42+
*/
4443
}
4544
#endif
4645
// Create a dummy nested scope to ensure destructors are called before

unit_tests/UnitTestBasicKokkos.C

+2-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,8 @@ run_nested_parallel_for_thread_teams_test()
159159
// host_view2D, and the deep_copy is a no-op. That means that the parallel_for
160160
// which comes next, is updating the values of host_view2D.
161161
Kokkos::parallel_for(
162-
Kokkos::TeamPolicy<Kokkos::DefaultExecutionSpace>(N, NTHREADS_PER_DEVICE_TEAM),
162+
Kokkos::TeamPolicy<Kokkos::DefaultExecutionSpace>(
163+
N, NTHREADS_PER_DEVICE_TEAM),
163164
KOKKOS_LAMBDA(const TeamHandleType& team) {
164165
size_t i = team.league_rank();
165166
Kokkos::parallel_for(

0 commit comments

Comments
 (0)