MCPcopy Create free account
hub / github.com/AMReX-Codes/amrex / convertFromNativeFloatFormat

Method convertFromNativeFloatFormat

Src/Base/AMReX_FabConv.cpp:1102–1137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1100//
1101
1102void
1103RealDescriptor::convertFromNativeFloatFormat (std::ostream& os,
1104 Long nitems,
1105 const float* in,
1106 const RealDescriptor& od)
1107{
1108// BL_PROFILE("RD:convertFromNativeFloatFormat");
1109 Long nitemsSave(nitems);
1110 Long buffSize(std::min(Long(writeBufferSize), nitems));
1111 const float *inSave(in);
1112 amrex::StreamRetry sr(os, "RD_cFNF", 4);
1113
1114 while(sr.TryOutput()) {
1115 nitems = nitemsSave;
1116 in = inSave;
1117
1118 char *bufr = new char[buffSize * od.numBytes()];
1119
1120 while (nitems > 0)
1121 {
1122 Long put = std::min(static_cast<Long>(writeBufferSize), nitems);
1123 PD_convert(bufr,
1124 in,
1125 put,
1126 0,
1127 od,
1128 FPC::Native32RealDescriptor(),
1129 FPC::NativeLongDescriptor());
1130 os.write(bufr, od.numBytes()*put);
1131 nitems -= put;
1132 in += put;
1133 }
1134
1135 delete [] bufr;
1136 }
1137}
1138
1139//
1140// Convert nitems doubles in native format to RealDescriptor format

Callers

nothing calls this directly

Calls 5

LongFunction · 0.85
PD_convertFunction · 0.85
TryOutputMethod · 0.80
numBytesMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected