Skip to content

Conversation

@franzpoeschel
Copy link
Contributor

With openPMD/openPMD-api#1229 (merged as of version 0.15), openPMD-api deprecates the use of shareRaw(), introducing instead dedicated raw-pointer functions storeChunkRaw and loadChunkRaw.
This uses the new API if the version of openPMD-api is recent enough, mainly to avoid compilation warnings.

@psychocoderHPC

@psychocoderHPC psychocoderHPC added the warning code produces/produced a warning label May 26, 2023
@psychocoderHPC
Copy link
Member

Warning before this fix with openPMD 0.15.1

picongpu/plugins/openPMD/openPMDWriter.hpp: In member function ‘void picongpu::openPMD::openPMDWriter::writeRngStates(picongpu::openPMD::ThreadParams*)’:
picongpu/plugins/openPMD/openPMDWriter.hpp:743:35: warning: ‘std::shared_ptr<_Tp> openPMD::shareRaw(T*) [with T = char]’ is deprecated: For storing/loading data via raw pointers use storeChunkRaw<>()/loadChunkRaw<>() [-Wdeprecated-declarations]
  743 |                 mrc.storeChunk(
      |                 ~~~~~~~~~~~~~~~   ^   

@psychocoderHPC psychocoderHPC merged commit d59a183 into ComputationalRadiationPhysics:dev May 31, 2023
// getPointer() will wait for device->host transfer
ValueType* nativePtr = buffer.getHostBuffer().getPointer();
ReinterpretedType* rawPtr = reinterpret_cast<ReinterpretedType*>(nativePtr);
#if OPENPMDAPI_VERSION_GE(0, 15, 0)
Copy link
Member

@psychocoderHPC psychocoderHPC Jun 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BUG This makro was introduced with openpmd-api 0.14.5 and therefore the usage of this makro is breaking the compatibility to older version.

[update] my fold the makro is older and in 0.14.0 available too

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's available at least an 0.13 which is the oldest supported by PIConGPU https://github.com/openPMD/openPMD-api/blob/0.13.0/include/openPMD/version.hpp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

warning code produces/produced a warning

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants