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

Method setSafeTensorAddresses

samples/common/sampleInference.cpp:1680–1701  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1678}
1679
1680bool Bindings::setSafeTensorAddresses(nvinfer1::safe::IExecutionContext& context) const
1681{
1682 for (auto const& b : mNames)
1683 {
1684 auto const name = b.first.c_str();
1685 if (context.getEngine().getTensorIOMode(name) == nvinfer1::TensorIOMode::kINPUT)
1686 {
1687 if (!context.setInputTensorAddress(name, static_cast<void const*>(mDevicePointers[b.second])))
1688 {
1689 return false;
1690 }
1691 }
1692 else
1693 {
1694 if (!context.setOutputTensorAddress(name, mDevicePointers[b.second]))
1695 {
1696 return false;
1697 }
1698 }
1699 }
1700 return true;
1701}
1702
1703} // namespace sample

Callers 1

EnqueueSafeMethod · 0.80

Calls 3

c_strMethod · 0.80
getTensorIOModeMethod · 0.80
setInputTensorAddressMethod · 0.80

Tested by

no test coverage detected