MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT / dump

Method dump

samples/common/sampleInference.cpp:1328–1374  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1326}
1327
1328void Binding::dump(std::ostream& os, Dims dims, Dims strides, int32_t vectorDim, int32_t spv,
1329 std::string const separator /*= " "*/) const
1330{
1331 void* outputBuffer{};
1332 if (outputAllocator != nullptr)
1333 {
1334 outputBuffer = outputAllocator->getBuffer()->getHostBuffer();
1335 }
1336 else
1337 {
1338 outputBuffer = buffer->getHostBuffer();
1339 }
1340 switch (dataType)
1341 {
1342 case nvinfer1::DataType::kBOOL:
1343 {
1344 dumpBuffer<bool>(outputBuffer, separator, os, dims, strides, vectorDim, spv);
1345 break;
1346 }
1347 case nvinfer1::DataType::kINT32:
1348 {
1349 dumpBuffer<int32_t>(outputBuffer, separator, os, dims, strides, vectorDim, spv);
1350 break;
1351 }
1352 case nvinfer1::DataType::kINT8:
1353 {
1354 dumpBuffer<int8_t>(outputBuffer, separator, os, dims, strides, vectorDim, spv);
1355 break;
1356 }
1357 case nvinfer1::DataType::kFLOAT:
1358 {
1359 dumpBuffer<float>(outputBuffer, separator, os, dims, strides, vectorDim, spv);
1360 break;
1361 }
1362 case nvinfer1::DataType::kHALF:
1363 {
1364 dumpBuffer<__half>(outputBuffer, separator, os, dims, strides, vectorDim, spv);
1365 break;
1366 }
1367 case nvinfer1::DataType::kUINT8:
1368 {
1369 dumpBuffer<uint8_t>(outputBuffer, separator, os, dims, strides, vectorDim, spv);
1370 break;
1371 }
1372 case nvinfer1::DataType::kFP8: ASSERT(!"FP8 is not supported");
1373 }
1374}
1375
1376void Bindings::addBinding(TensorInfo const& tensorInfo, std::string const& fileName /*= ""*/)
1377{

Callers 9

to_yamlMethod · 0.80
device_infoFunction · 0.80
generate_build_metadataFunction · 0.80
_do_graph_surgeryFunction · 0.80
IExecutionContext>Method · 0.80
mainFunction · 0.80
executeMethod · 0.80

Calls 2

getHostBufferMethod · 0.45
getBufferMethod · 0.45

Tested by

no test coverage detected