File tree Expand file tree Collapse file tree 2 files changed +3
-19
lines changed
include/pmacc/particles/memory Expand file tree Collapse file tree 2 files changed +3
-19
lines changed Original file line number Diff line number Diff line change 3636
3737#include < pmacc/verify.hpp>
3838
39+ #include < new>
40+
3941namespace 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 {
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments