Skip to content

Commit 9cab05d

Browse files
authored
Merge pull request #5573 from ikbuibui/fixes/pmacc_dead_code
Small pmacc fixes
2 parents 9e1addd + b61d139 commit 9cab05d

File tree

2 files changed

+3
-19
lines changed

2 files changed

+3
-19
lines changed

include/pmacc/particles/memory/boxes/ParticlesBox.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636

3737
#include <pmacc/verify.hpp>
3838

39+
#include <new>
40+
3941
namespace pmacc
4042
{
4143
/**
@@ -103,7 +105,7 @@ namespace pmacc
103105
#if (BOOST_LANG_CUDA || BOOST_COMP_HIP)
104106
tmp = (FrameType*) m_deviceHeapHandle.malloc(worker.getAcc(), sizeof(FrameType));
105107
#else
106-
tmp = new FrameType;
108+
tmp = new(std::nothrow) FrameType;
107109
#endif
108110
if(tmp != nullptr)
109111
{

include/pmacc/particles/memory/dataTypes/SuperCell.hpp

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,8 @@ namespace pmacc
6767
mustShiftVal = value;
6868
}
6969

70-
// clang-format tries to reformat this and looses the #if while the #endif persists
71-
// clang-format off
7270
//! get number of particle in the last frame
7371
HDINLINE uint32_t getSizeLastFrame() const
74-
#if(ALPAKA_ACC_GPU_HIP_ENABLED && (HIP_VERSION_MAJOR * 100 + HIP_VERSION_MINOR) == 502)
75-
/* ROCm 5.2.0 producing particle loss in KernelShiftParticles if this method is defined as `const`.
76-
* see: https://github.com/ComputationalRadiationPhysics/picongpu/issues/4305
77-
*/
78-
volatile
79-
#endif
80-
// clang-format on
8172
{
8273
constexpr uint32_t frameSize = T_FrameType::frameSize;
8374

@@ -95,16 +86,7 @@ namespace pmacc
9586
return numParticles ? ((numParticles - 1u) % frameSize + 1u) : 0u;
9687
}
9788

98-
// clang-format tries to reformat this and looses the #if while the #endif persists
99-
// clang-format off
10089
HDINLINE uint32_t getNumParticles() const
101-
#if(ALPAKA_ACC_GPU_HIP_ENABLED && (HIP_VERSION_MAJOR * 100 + HIP_VERSION_MINOR) == 502)
102-
/* ROCm 5.2.0 producing particle loss in KernelShiftParticles if this method is defined as `const`.
103-
* see: https://github.com/ComputationalRadiationPhysics/picongpu/issues/4305
104-
*/
105-
volatile
106-
#endif
107-
// clang-format on
10890
{
10991
return numParticles;
11092
}

0 commit comments

Comments
 (0)