@Namespace(value="nvinfer1") @NoOffset @Properties(inherit=nvinfer.class) public class IExecutionContext extends INoCopy
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter| Constructor and Description |
|---|
IExecutionContext()
Default native constructor.
|
IExecutionContext(long size)
Native array allocator.
|
IExecutionContext(Pointer p)
Pointer cast constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
allInputDimensionsSpecified()
\brief Whether all dynamic dimensions of input tensors have been specified
|
boolean |
allInputShapesSpecified()
\brief Whether all input shape bindings have been specified
|
void |
destroy()
Deprecated.
Deprecated in TRT 8.0. Superseded by
delete.
\warning Calling destroy on a managed pointer will result in a double-free error. |
boolean |
enqueue(int batchSize,
Pointer bindings,
org.bytedeco.cuda.cudart.CUstream_st stream,
org.bytedeco.cuda.cudart.CUevent_st inputConsumed)
Deprecated.
|
boolean |
enqueue(int batchSize,
PointerPointer bindings,
org.bytedeco.cuda.cudart.CUstream_st stream,
org.bytedeco.cuda.cudart.CUevent_st inputConsumed)
Deprecated.
Deprecated in TensorRT 8.4. Superseded by enqueueV2() if the network is created with
NetworkDefinitionCreationFlag::kEXPLICIT_BATCH flag.
|
boolean |
enqueueV2(Pointer bindings,
org.bytedeco.cuda.cudart.CUstream_st stream,
org.bytedeco.cuda.cudart.CUevent_st inputConsumed)
Deprecated.
|
boolean |
enqueueV2(PointerPointer bindings,
org.bytedeco.cuda.cudart.CUstream_st stream,
org.bytedeco.cuda.cudart.CUevent_st inputConsumed)
Deprecated.
Superseded by enqueueV3(). Deprecated in TensorRT 8.5
|
boolean |
enqueueV3(org.bytedeco.cuda.cudart.CUstream_st stream)
\brief Enqueue inference on a stream.
|
boolean |
execute(int batchSize,
Pointer bindings)
Deprecated.
|
boolean |
execute(int batchSize,
PointerPointer bindings)
Deprecated.
Deprecated in TensorRT 8.4. Superseded by executeV2() if the network is created with
NetworkDefinitionCreationFlag::kEXPLICIT_BATCH flag.
\warning This function will trigger layer resource updates if hasImplicitBatchDimension()
returns true and batchSize changes between subsequent calls, possibly resulting
in performance bottlenecks.
|
boolean |
executeV2(Pointer bindings) |
boolean |
executeV2(PointerPointer bindings)
\brief Synchronously execute inference a network.
|
Dims32 |
getBindingDimensions(int bindingIndex)
Deprecated.
Deprecated in TensorRT 8.5. Superseded by getTensorShape().
|
boolean |
getDebugSync()
\brief Get the debug sync flag.
|
ICudaEngine |
getEngine()
\brief Get the associated engine.
|
boolean |
getEnqueueEmitsProfile()
\brief Get the enqueueEmitsProfile state.
|
IErrorRecorder |
getErrorRecorder()
\brief Get the ErrorRecorder assigned to this interface.
|
org.bytedeco.cuda.cudart.CUevent_st |
getInputConsumedEvent()
\brief The event associated with consuming the input.
|
long |
getMaxOutputSize(BytePointer tensorName) |
long |
getMaxOutputSize(String tensorName)
\brief Get upper bound on an output tensor's size, in bytes, based on
the current optimization profile and input dimensions.
|
String |
getName()
\brief Return the name of the execution context.
|
nvinfer.ProfilingVerbosity |
getNvtxVerbosity()
\brief Get the NVTX verbosity of the execution context.
|
int |
getOptimizationProfile()
\brief Get the index of the currently selected optimization profile.
|
IOutputAllocator |
getOutputAllocator(BytePointer tensorName) |
IOutputAllocator |
getOutputAllocator(String tensorName)
\brief Get output allocator associated with output tensor of given name, or nullptr if the provided name does
not map to an output tensor.
|
Pointer |
getOutputTensorAddress(BytePointer tensorName) |
Pointer |
getOutputTensorAddress(String tensorName)
\brief Get memory address for given output.
|
long |
getPersistentCacheLimit()
\brief Get the maximum size for persistent cache usage.
|
IExecutionContext |
getPointer(long i) |
IProfiler |
getProfiler()
\brief Get the profiler.
|
boolean |
getShapeBinding(int bindingIndex,
int[] data)
Deprecated.
|
boolean |
getShapeBinding(int bindingIndex,
IntBuffer data)
Deprecated.
|
boolean |
getShapeBinding(int bindingIndex,
IntPointer data)
Deprecated.
Deprecated in TensorRT 8.5. Superseded by getTensorAddress() or getOutputTensorAddress().
|
Dims32 |
getStrides(int bindingIndex)
Deprecated.
Deprecated in TensorRT 8.5. Superseded by getTensorStrides().
|
IGpuAllocator |
getTemporaryStorageAllocator()
\brief Get allocator set by setTemporaryStorageAllocator.
|
Pointer |
getTensorAddress(BytePointer tensorName) |
Pointer |
getTensorAddress(String tensorName)
\brief Get memory address bound to given input or output tensor, or nullptr if the provided name does not map to
an input or output tensor.
|
Dims32 |
getTensorShape(BytePointer tensorName) |
Dims32 |
getTensorShape(String tensorName)
\brief Return the shape of the given input or output.
|
Dims32 |
getTensorStrides(BytePointer tensorName) |
Dims32 |
getTensorStrides(String tensorName)
\brief Return the strides of the buffer for the given tensor name.
|
int |
inferShapes(int nbMaxNames,
byte[] tensorNames) |
int |
inferShapes(int nbMaxNames,
ByteBuffer tensorNames) |
int |
inferShapes(int nbMaxNames,
BytePointer tensorNames) |
int |
inferShapes(int nbMaxNames,
PointerPointer tensorNames)
\brief Run shape calculations.
|
IExecutionContext |
position(long position) |
boolean |
reportToProfiler()
\brief Calculate layer timing info for the current optimization profile in IExecutionContext
and update the profiler after one iteration of inference launch.
|
void |
setAuxStreams(org.bytedeco.cuda.cudart.CUstream_st auxStreams,
int nbStreams)
\brief Set the auxiliary streams that TensorRT should launch kernels on in the next enqueueV3() call.
|
boolean |
setBindingDimensions(int bindingIndex,
Dims32 dimensions)
Deprecated.
Deprecated in TensorRT 8.5. Superseded by setInputShape().
|
void |
setDebugSync(boolean sync)
\brief Set the debug sync flag.
|
void |
setDeviceMemory(Pointer memory)
\brief Set the device memory for use by this execution context.
|
void |
setEnqueueEmitsProfile(boolean enqueueEmitsProfile)
\brief Set whether enqueue emits layer timing to the profiler
If set to true (default), enqueue is synchronous and does layer timing profiling implicitly if
there is a profiler attached.
|
void |
setErrorRecorder(IErrorRecorder recorder) |
boolean |
setInputConsumedEvent(org.bytedeco.cuda.cudart.CUevent_st event)
\brief Mark input as consumed.
|
boolean |
setInputShape(BytePointer tensorName,
Dims32 dims) |
boolean |
setInputShape(String tensorName,
Dims32 dims)
\brief Set shape of given input.
|
boolean |
setInputShapeBinding(int bindingIndex,
int[] data)
Deprecated.
|
boolean |
setInputShapeBinding(int bindingIndex,
IntBuffer data)
Deprecated.
|
boolean |
setInputShapeBinding(int bindingIndex,
IntPointer data)
Deprecated.
Deprecated in TensorRT 8.5. Superseded by setInputTensorAddress() or setTensorAddress().
|
boolean |
setInputTensorAddress(BytePointer tensorName,
Pointer data) |
boolean |
setInputTensorAddress(String tensorName,
Pointer data)
\brief Set memory address for given input.
|
void |
setName(BytePointer name) |
void |
setName(String name)
\brief Set the name of the execution context.
|
boolean |
setNvtxVerbosity(int verbosity) |
boolean |
setNvtxVerbosity(nvinfer.ProfilingVerbosity verbosity)
\brief Set the verbosity of the NVTX markers in the execution context.
|
boolean |
setOptimizationProfile(int profileIndex)
Deprecated.
Superseded by setOptimizationProfileAsync. Deprecated prior to TensorRT 8.0 and will be
removed in 9.0.
|
boolean |
setOptimizationProfileAsync(int profileIndex,
org.bytedeco.cuda.cudart.CUstream_st stream)
\brief Select an optimization profile for the current context with async
semantics.
|
boolean |
setOutputAllocator(BytePointer tensorName,
IOutputAllocator outputAllocator) |
boolean |
setOutputAllocator(String tensorName,
IOutputAllocator outputAllocator)
\brief Set output allocator to use for output tensor of given name.
|
void |
setPersistentCacheLimit(long size)
\brief Set the maximum size for persistent cache usage.
|
void |
setProfiler(IProfiler profiler)
\brief Set the profiler.
|
boolean |
setTemporaryStorageAllocator(IGpuAllocator allocator)
\brief Specify allocator to use for internal temporary storage.
|
boolean |
setTensorAddress(BytePointer tensorName,
Pointer data) |
boolean |
setTensorAddress(String tensorName,
Pointer data)
\brief Set memory address for given input or output tensor.
|
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, getDirectBufferAddress, getPointer, getPointer, getPointer, hashCode, interruptDeallocatorThread, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetAddress, offsetof, offsetof, parseBytes, physicalBytes, physicalBytesInaccurate, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, sizeof, toString, totalBytes, totalCount, totalPhysicalBytes, withDeallocator, zeropublic IExecutionContext()
public IExecutionContext(long size)
Pointer.position(long).public IExecutionContext(Pointer p)
Pointer(Pointer).public IExecutionContext position(long position)
public IExecutionContext getPointer(long i)
getPointer in class Pointer@Cast(value="bool") @Deprecated @NoException(value=true) public boolean execute(int batchSize, @Cast(value="void*const*") PointerPointer bindings)
batchSize - The batch size. This is at most the max batch size value supplied to the builder when the
engine was built. If the network is created with NetworkDefinitionCreationFlag::kEXPLICIT_BATCH flag, please use
executeV2() instead, and this batchSize argument has no effect.bindings - An array of pointers to input and output buffers for the network.ICudaEngine::getMaxBatchSize()@Cast(value="bool") @Deprecated @NoException(value=true) public boolean execute(int batchSize, @Cast(value="void*const*") @ByPtrPtr Pointer bindings)
@Cast(value="bool") @Deprecated @NoException(value=true) public boolean enqueue(int batchSize, @Cast(value="void*const*") PointerPointer bindings, org.bytedeco.cuda.cudart.CUstream_st stream, @ByPtrPtr org.bytedeco.cuda.cudart.CUevent_st inputConsumed)
batchSize - The batch size. This is at most the max batch size value supplied to the builder when the
engine was built. If the network is created with NetworkDefinitionCreationFlag::kEXPLICIT_BATCH flag, please use
enqueueV3() instead, and this batchSize argument has no effect.bindings - An array of pointers to input and output buffers for the network.stream - A cuda stream on which the inference kernels will be enqueued.inputConsumed - An optional event which will be signaled when the input buffers can be refilled with new
data.ICudaEngine::getMaxBatchSize()
\warning Calling enqueue() in from the same IExecutionContext object with different CUDA streams concurrently
results in undefined behavior. To perform inference concurrently in multiple streams, use one execution
context per stream.
\warning This function will trigger layer resource updates if hasImplicitBatchDimension()
returns true and batchSize changes between subsequent calls, possibly resulting in performance
bottlenecks.@Cast(value="bool") @Deprecated @NoException(value=true) public boolean enqueue(int batchSize, @Cast(value="void*const*") @ByPtrPtr Pointer bindings, org.bytedeco.cuda.cudart.CUstream_st stream, @ByPtrPtr org.bytedeco.cuda.cudart.CUevent_st inputConsumed)
@NoException(value=true) public void setDebugSync(@Cast(value="bool") boolean sync)
getDebugSync()@Cast(value="bool") @NoException(value=true) public boolean getDebugSync()
setDebugSync()@NoException(value=true) public void setProfiler(IProfiler profiler)
getProfiler()@NoException(value=true) public IProfiler getProfiler()
setProfiler()@Const @ByRef @NoException(value=true) public ICudaEngine getEngine()
ICudaEngine@Deprecated @NoException(value=true) public void destroy()
delete.
\warning Calling destroy on a managed pointer will result in a double-free error.@NoException(value=true) public void setName(String name)
getName()@NoException(value=true) public void setName(@Cast(value="const char*") BytePointer name)
@NoException(value=true) public String getName()
setName()@NoException(value=true) public void setDeviceMemory(Pointer memory)
ICudaEngine::createExecutionContextWithoutDeviceMemory()@Deprecated @ByVal @Cast(value="nvinfer1::Dims*") @NoException(value=true) public Dims32 getStrides(int bindingIndex)
bindingIndex - The binding index.getTensorStrides()@ByVal @Cast(value="nvinfer1::Dims*") @NoException(value=true) public Dims32 getTensorStrides(String tensorName)
tensorName - The name of an input or output tensor.
\warning The string tensorName must be null-terminated, and be at most 4096 bytes including the terminator.@ByVal @Cast(value="nvinfer1::Dims*") @NoException(value=true) public Dims32 getTensorStrides(@Cast(value="const char*") BytePointer tensorName)
@Cast(value="bool") @Deprecated @NoException(value=true) public boolean setOptimizationProfile(int profileIndex)
profileIndex - Index of the profile. It must lie between 0 and
getEngine().getNbOptimizationProfiles() - 1
The selected profile will be used in subsequent calls to executeV2()/enqueueV2()/enqueueV3().
When an optimization profile is switched via this API, TensorRT may
enqueue GPU memory copy operations required to set up the new profile during the subsequent
enqueueV2()/enqueueV3() operations. To avoid these calls during enqueueV2()/enqueueV3(), use
setOptimizationProfileAsync() instead.
If the associated CUDA engine does not have inputs with dynamic shapes, this method need not be
called, in which case the default profile index of 0 will be used (this is particularly
the case for all safe engines).
setOptimizationProfile() must be called before calling setBindingDimensions() and
setInputShapeBinding() for all dynamic input tensors or input shape tensors, which in
turn must be called before executeV2()/enqueueV2()/enqueueV3().
\warning This function will trigger layer resource updates on the next
call of enqueueV2()/enqueueV3()/executeV2(), possibly resulting in performance bottlenecks.IExecutionContext::setOptimizationProfileAsync()@NoException(value=true) public int getOptimizationProfile()
@Cast(value="bool") @Deprecated @NoException(value=true) public boolean setBindingDimensions(int bindingIndex, @ByVal @Cast(value="nvinfer1::Dims*") Dims32 dimensions)
bindingIndex - index of an input tensor whose dimensions must be compatible with
the network definition (i.e. only the wildcard dimension -1 can be replaced with a
new dimension >= 0).dimensions - specifies the dimensions of the input tensor. It must be in the valid
range for the currently selected optimization profile, and the corresponding engine must
not be safety-certified.
This method requires the engine to be built without an implicit batch dimension.
This method will fail unless a valid optimization profile is defined for the current
execution context (getOptimizationProfile() must not be -1).
For all dynamic non-output bindings (which have at least one wildcard dimension of -1),
this method needs to be called before either enqueueV2() or executeV2() may be called.
This can be checked using the method allInputDimensionsSpecified().
\warning This function will trigger layer resource updates on the next
call of enqueueV2()/executeV2(), possibly resulting in performance bottlenecks,
if the dimensions are different than the previous set dimensions.setInputShape()@Cast(value="bool") @NoException(value=true) public boolean setInputShape(String tensorName, @Cast(value="const nvinfer1::Dims*") @ByRef Dims32 dims)
tensorName - The name of an input tensor.dims - The shape of an input tensor.@Cast(value="bool") @NoException(value=true) public boolean setInputShape(@Cast(value="const char*") BytePointer tensorName, @Cast(value="const nvinfer1::Dims*") @ByRef Dims32 dims)
@Deprecated @ByVal @Cast(value="nvinfer1::Dims*") @NoException(value=true) public Dims32 getBindingDimensions(int bindingIndex)
ICudaEngine::getProfileDimensions(),
getTensorShape()@ByVal @Cast(value="nvinfer1::Dims*") @NoException(value=true) public Dims32 getTensorShape(String tensorName)
tensorName - The name of an input or output tensor.
Return Dims{-1, {}} if the provided name does not map to an input or output tensor.
Otherwise return the shape of the input or output tensor.
A dimension in an input tensor will have a -1 wildcard value if all the following are true:
* setInputShape() has not yet been called for this tensor
* The dimension is a runtime dimension that is not implicitly constrained to be a single value.
A dimension in an output tensor will have a -1 wildcard value if the dimension depends
on values of execution tensors OR if all the following are true:
* It is a runtime dimension.
* setInputShape() has NOT been called for some input tensor(s) with a runtime shape.
* setTensorAddress() has NOT been called for some input tensor(s) with isShapeInferenceIO() = true.
An output tensor may also have -1 wildcard dimensions if its shape depends on values of tensors supplied to
enqueueV3().
If the request is for the shape of an output tensor with runtime dimensions,
all input tensors with isShapeInferenceIO() = true should have their value already set,
since these values might be needed to compute the output shape.
Examples of an input dimension that is implicitly constrained to a single value:
* The optimization profile specifies equal min and max values.
* The dimension is named and only one value meets the optimization profile requirements
for dimensions with that name.
\warning The string tensorName must be null-terminated, and be at most 4096 bytes including the terminator.@ByVal @Cast(value="nvinfer1::Dims*") @NoException(value=true) public Dims32 getTensorShape(@Cast(value="const char*") BytePointer tensorName)
@Cast(value="bool") @Deprecated @NoException(value=true) public boolean setInputShapeBinding(int bindingIndex, @Const IntPointer data)
bindingIndex - index of an input tensor for which
ICudaEngine::isShapeBinding(bindingIndex) and ICudaEngine::bindingIsInput(bindingIndex)
are both true.data - pointer to values of the input tensor. The number of values should be
the product of the dimensions returned by getBindingDimensions(bindingIndex).
If ICudaEngine::isShapeBinding(bindingIndex) and ICudaEngine::bindingIsInput(bindingIndex)
are both true, this method must be called before enqueueV2() or executeV2() may be called.
This method will fail unless a valid optimization profile is defined for the current
execution context (getOptimizationProfile() must not be -1).
\warning This function will trigger layer resource updates on the next call of
enqueueV2()/executeV2(), possibly resulting in performance bottlenecks, if the
shapes are different than the previous set shapes.setTensorAddress()@Cast(value="bool") @Deprecated @NoException(value=true) public boolean setInputShapeBinding(int bindingIndex, @Const IntBuffer data)
@Cast(value="bool") @Deprecated @NoException(value=true) public boolean setInputShapeBinding(int bindingIndex, @Const int[] data)
@Cast(value="bool") @Deprecated @NoException(value=true) public boolean getShapeBinding(int bindingIndex, IntPointer data)
bindingIndex - index of an input or output tensor for which
ICudaEngine::isShapeBinding(bindingIndex) is true.data - pointer to where values will be written. The number of values written is
the product of the dimensions returned by getBindingDimensions(bindingIndex).
If ICudaEngine::bindingIsInput(bindingIndex) is false, then both
allInputDimensionsSpecified() and allInputShapesSpecified() must be true
before calling this method. The method will also fail if no valid optimization profile
has been set for the current execution context, i.e. if getOptimizationProfile() returns -1.getTensorAddress() getOutputTensorAddress()@Cast(value="bool") @Deprecated @NoException(value=true) public boolean getShapeBinding(int bindingIndex, IntBuffer data)
@Cast(value="bool") @Deprecated @NoException(value=true) public boolean getShapeBinding(int bindingIndex, int[] data)
@Cast(value="bool") @NoException(value=true) public boolean allInputDimensionsSpecified()
setBindingDimensions(bindingIndex,dimensions)@Cast(value="bool") @NoException(value=true) public boolean allInputShapesSpecified()
isShapeBinding(bindingIndex)@NoException(value=true) public void setErrorRecorder(IErrorRecorder recorder)
/**@NoException(value=true) public IErrorRecorder getErrorRecorder()
setErrorRecorder()@Cast(value="bool") @NoException(value=true) public boolean executeV2(@Cast(value="void*const*") PointerPointer bindings)
bindings - An array of pointers to input and output buffers for the network.ICudaEngine::getMaxBatchSize()@Cast(value="bool") @NoException(value=true) public boolean executeV2(@Cast(value="void*const*") @ByPtrPtr Pointer bindings)
@Cast(value="bool") @Deprecated @NoException(value=true) public boolean enqueueV2(@Cast(value="void*const*") PointerPointer bindings, org.bytedeco.cuda.cudart.CUstream_st stream, @ByPtrPtr org.bytedeco.cuda.cudart.CUevent_st inputConsumed)
bindings - An array of pointers to input and output buffers for the network.stream - A cuda stream on which the inference kernels will be enqueuedinputConsumed - An optional event which will be signaled when the input buffers can be refilled with new
dataICudaEngine::getMaxBatchSize() IExecutionContext::enqueueV3()
\note Calling enqueueV2() with a stream in CUDA graph capture mode has a known issue. If dynamic shapes are
used, the first enqueueV2() call after a setInputShapeBinding() call will cause failure in stream capture
due to resource allocation. Please call enqueueV2() once before capturing the graph.
\warning Calling enqueueV2() in from the same IExecutionContext object with different CUDA streams concurrently
results in undefined behavior. To perform inference concurrently in multiple streams, use one execution
context per stream.@Cast(value="bool") @Deprecated @NoException(value=true) public boolean enqueueV2(@Cast(value="void*const*") @ByPtrPtr Pointer bindings, org.bytedeco.cuda.cudart.CUstream_st stream, @ByPtrPtr org.bytedeco.cuda.cudart.CUevent_st inputConsumed)
@Cast(value="bool") @NoException(value=true) public boolean setOptimizationProfileAsync(int profileIndex, org.bytedeco.cuda.cudart.CUstream_st stream)
profileIndex - Index of the profile. The value must lie between 0 and
getEngine().getNbOptimizationProfiles() - 1stream - A cuda stream on which the cudaMemcpyAsyncs may be
enqueued
When an optimization profile is switched via this API, TensorRT may
require that data is copied via cudaMemcpyAsync. It is the
applicationâs responsibility to guarantee that synchronization between
the profile sync stream and the enqueue stream occurs.
The selected profile will be used in subsequent calls to executeV2()/enqueueV2()/enqueueV3().
If the associated CUDA engine has inputs with dynamic shapes, the optimization profile must
be set with its corresponding profileIndex before calling execute or enqueue. If no execution
context is assigned optimization profile 0 and a new context is created for an engine,
setOptimizationProfile(0) is called implicitly. This functionality is deprecated in TensorRT 8.6
and will instead default all optimization profiles to 0 starting in TensorRT 9.0.
If the associated CUDA engine does not have inputs with dynamic shapes,
this method need not be called, in which case the default profile index
of 0 will be used.
setOptimizationProfileAsync() must be called before calling
setBindingDimensions() and setInputShapeBinding() for all dynamic input
tensors or input shape tensors, which in turn must be called before
executeV2()/enqueueV2()/enqueueV3().
\warning This function will trigger layer resource updates on the next call of
enqueueV2()/executeV2()/enqueueV3(), possibly resulting in performance bottlenecks.
\warning Not synchronizing the stream used at enqueue with the stream
used to set optimization profile asynchronously using this API will
result in undefined behavior.ICudaEngine::getNbOptimizationProfiles(),
IExecutionContext::setOptimizationProfile()@NoException(value=true) public void setEnqueueEmitsProfile(@Cast(value="bool") boolean enqueueEmitsProfile)
IExecutionContext::getEnqueueEmitsProfile(),
IExecutionContext::reportToProfiler()@Cast(value="bool") @NoException(value=true) public boolean getEnqueueEmitsProfile()
IExecutionContext::setEnqueueEmitsProfile()@Cast(value="bool") @NoException(value=true) public boolean reportToProfiler()
IExecutionContext::setEnqueueEmitsProfile(),
IExecutionContext::getEnqueueEmitsProfile()@Cast(value="bool") @NoException(value=true) public boolean setTensorAddress(String tensorName, Pointer data)
tensorName - The name of an input or output tensor.data - The pointer (void*) to the data owned by the user.getTensorShape() setOutputAllocator() IOutputAllocator@Cast(value="bool") @NoException(value=true) public boolean setTensorAddress(@Cast(value="const char*") BytePointer tensorName, Pointer data)
@Const @NoException(value=true) public Pointer getTensorAddress(String tensorName)
tensorName - The name of an input or output tensor.
Use method getOutputTensorAddress() if a non-const pointer for an output tensor is required.
\warning The string tensorName must be null-terminated, and be at most 4096 bytes including the terminator.getOutputTensorAddress()@Const @NoException(value=true) public Pointer getTensorAddress(@Cast(value="const char*") BytePointer tensorName)
@Cast(value="bool") @NoException(value=true) public boolean setInputTensorAddress(String tensorName, @Const Pointer data)
tensorName - The name of an input tensor.data - The pointer (void const*) to the const data owned by the user.setTensorAddress()@Cast(value="bool") @NoException(value=true) public boolean setInputTensorAddress(@Cast(value="const char*") BytePointer tensorName, @Const Pointer data)
@NoException(value=true) public Pointer getOutputTensorAddress(String tensorName)
tensorName - The name of an output tensor.getTensorAddress()@NoException(value=true) public Pointer getOutputTensorAddress(@Cast(value="const char*") BytePointer tensorName)
@NoException(value=true) public int inferShapes(int nbMaxNames, @Cast(value="const char**") PointerPointer tensorNames)
nbMaxNames - Maximum number of names to write to tensorNames.
When the return value is a positive value n and tensorNames != nullptr,
the names of min(n,nbMaxNames) insufficiently specified input tensors are
written to tensorNames.tensorNames - Buffer in which to place names of insufficiently specified input tensors.@NoException(value=true) public int inferShapes(int nbMaxNames, @Cast(value="const char**") @ByPtrPtr BytePointer tensorNames)
@NoException(value=true) public int inferShapes(int nbMaxNames, @Cast(value="const char**") @ByPtrPtr ByteBuffer tensorNames)
@NoException(value=true) public int inferShapes(int nbMaxNames, @Cast(value="const char**") @ByPtrPtr byte[] tensorNames)
@Cast(value="bool") @NoException(value=true) public boolean setInputConsumedEvent(org.bytedeco.cuda.cudart.CUevent_st event)
event - The cuda event that is triggered after all input tensors have been consumed.
\warning The set event must be valid during the inferece.@NoException(value=true) public org.bytedeco.cuda.cudart.CUevent_st getInputConsumedEvent()
@Cast(value="bool") @NoException(value=true) public boolean setOutputAllocator(String tensorName, IOutputAllocator outputAllocator)
tensorName - The name of an output tensor.outputAllocator - IOutputAllocator for the tensors.IOutputAllocator@Cast(value="bool") @NoException(value=true) public boolean setOutputAllocator(@Cast(value="const char*") BytePointer tensorName, IOutputAllocator outputAllocator)
@NoException(value=true) public IOutputAllocator getOutputAllocator(String tensorName)
IOutputAllocator@NoException(value=true) public IOutputAllocator getOutputAllocator(@Cast(value="const char*") BytePointer tensorName)
@Cast(value="int64_t") @NoException(value=true) public long getMaxOutputSize(String tensorName)
tensorName - The name of an output tensor.@Cast(value="int64_t") @NoException(value=true) public long getMaxOutputSize(@Cast(value="const char*") BytePointer tensorName)
@Cast(value="bool") @NoException(value=true) public boolean setTemporaryStorageAllocator(IGpuAllocator allocator)
allocator - pointer to allocator to use. Pass nullptr to revert to using TensorRT's
default allocator.setOutputAllocator()@NoException(value=true) public IGpuAllocator getTemporaryStorageAllocator()
@Cast(value="bool") @NoException(value=true) public boolean enqueueV3(org.bytedeco.cuda.cudart.CUstream_st stream)
stream - A cuda stream on which the inference kernels will be enqueued.@NoException(value=true) public void setPersistentCacheLimit(@Cast(value="size_t") long size)
size - the size of persistent cache limitation in bytes.
The default is 0 Bytes.getPersistentCacheLimit@Cast(value="size_t") @NoException(value=true) public long getPersistentCacheLimit()
setPersistentCacheLimit@Cast(value="bool") @NoException(value=true) public boolean setNvtxVerbosity(nvinfer.ProfilingVerbosity verbosity)
verbosity - The verbosity of the NVTX markers.getNvtxVerbosity(),
ICudaEngine::getProfilingVerbosity()@Cast(value="bool") @NoException(value=true) public boolean setNvtxVerbosity(@Cast(value="nvinfer1::ProfilingVerbosity") int verbosity)
@NoException(value=true) public nvinfer.ProfilingVerbosity getNvtxVerbosity()
setNvtxVerbosity()@NoException(value=true) public void setAuxStreams(@ByPtrPtr org.bytedeco.cuda.cudart.CUstream_st auxStreams, int nbStreams)
auxStreams - The pointer to an array of cudaStream_t with the array length equal to nbStreams.nbStreams - The number of auxiliary streams provided. If nbStreams is greater than
engine->getNbAuxStreams(), then only the first engine->getNbAuxStreams() streams will be used. If
nbStreams is less than engine->getNbAuxStreams(), such as setting nbStreams to 0, then TensorRT
will use the provided streams for the first nbStreams auxiliary streams, and will create additional
streams internally for the rest of the auxiliary streams.
\note The provided auxiliary streams must not be the default stream and must all be different to avoid
deadlocks.enqueueV3(), IBuilderConfig::setMaxAuxStreams(), ICudaEngine::getNbAuxStreams()Copyright © 2024. All rights reserved.