MCPcopy Create free account
hub / github.com/Smorodov/Multitarget-tracker / dump

Method dump

src/Detector/tensorrt_yolo/common/sampleInference.cpp:1330–1396  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1328}
1329
1330void Binding::dump(std::ostream& os, Dims dims, Dims strides, int32_t vectorDim, int32_t spv,
1331 std::string const separator /*= " "*/) const
1332{
1333 void* outputBuffer{};
1334 if (outputAllocator != nullptr)
1335 {
1336 outputBuffer = outputAllocator->getBuffer()->getHostBuffer();
1337 // Overwrite dimensions with those reported by the output allocator.
1338 dims = outputAllocator->getFinalDims();
1339 os << "Final shape is " << dims << " reported by the output allocator." << std::endl;
1340 }
1341 else
1342 {
1343 outputBuffer = buffer->getHostBuffer();
1344 }
1345 switch (dataType)
1346 {
1347 case nvinfer1::DataType::kBOOL:
1348 {
1349 dumpBuffer<bool>(outputBuffer, separator, os, dims, strides, vectorDim, spv);
1350 break;
1351 }
1352 case nvinfer1::DataType::kINT32:
1353 {
1354 dumpBuffer<int32_t>(outputBuffer, separator, os, dims, strides, vectorDim, spv);
1355 break;
1356 }
1357 case nvinfer1::DataType::kINT8:
1358 {
1359 dumpBuffer<int8_t>(outputBuffer, separator, os, dims, strides, vectorDim, spv);
1360 break;
1361 }
1362 case nvinfer1::DataType::kFLOAT:
1363 {
1364 dumpBuffer<float>(outputBuffer, separator, os, dims, strides, vectorDim, spv);
1365 break;
1366 }
1367 case nvinfer1::DataType::kHALF:
1368 {
1369 dumpBuffer<__half>(outputBuffer, separator, os, dims, strides, vectorDim, spv);
1370 break;
1371 }
1372#if (NV_TENSORRT_MAJOR > 8)
1373 case nvinfer1::DataType::kBF16:
1374 {
1375 dumpBuffer<BFloat16>(outputBuffer, separator, os, dims, strides, vectorDim, spv);
1376 break;
1377 }
1378#endif
1379 case nvinfer1::DataType::kUINT8:
1380 {
1381 dumpBuffer<uint8_t>(outputBuffer, separator, os, dims, strides, vectorDim, spv);
1382 break;
1383 }
1384#if (NV_TENSORRT_MAJOR > 8)
1385 case nvinfer1::DataType::kINT64:
1386 {
1387 dumpBuffer<int64_t>(outputBuffer, separator, os, dims, strides, vectorDim, spv);

Callers 1

dumpBindingValuesMethod · 0.80

Calls 3

getFinalDimsMethod · 0.80
getHostBufferMethod · 0.45
getBufferMethod · 0.45

Tested by

no test coverage detected