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

Method convertToNativeDoubleFormat

Src/Base/AMReX_FabConv.cpp:1227–1263  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1225//
1226
1227void
1228RealDescriptor::convertToNativeDoubleFormat (double* out,
1229 Long nitems,
1230 std::istream& is,
1231 const RealDescriptor& id)
1232{
1233// BL_PROFILE("RD:convertToNativeDoubleFormat");
1234
1235 Long buffSize(std::min(Long(readBufferSize), nitems));
1236 char *bufr = new char[buffSize * id.numBytes()];
1237
1238 while (nitems > 0)
1239 {
1240 Long get = std::min(static_cast<Long>(readBufferSize), nitems);
1241 is.read(bufr, id.numBytes()*get);
1242 PD_convert(out,
1243 bufr,
1244 get,
1245 0,
1246 FPC::Native64RealDescriptor(),
1247 id,
1248 FPC::NativeLongDescriptor());
1249
1250 if(bAlwaysFixDenormals) {
1251 PD_fixdenormals(out, get, FPC::Native64RealDescriptor().format(),
1252 FPC::Native64RealDescriptor().order());
1253 }
1254 nitems -= get;
1255 out += get;
1256 }
1257
1258 if(is.fail()) {
1259 amrex::Error("convert(Real*,Long,istream&,RealDescriptor&) failed");
1260 }
1261
1262 delete [] bufr;
1263}
1264
1265}

Callers

nothing calls this directly

Calls 7

LongFunction · 0.85
PD_convertFunction · 0.85
PD_fixdenormalsFunction · 0.85
numBytesMethod · 0.80
readMethod · 0.45
formatMethod · 0.45
orderMethod · 0.45

Tested by

no test coverage detected