@Namespace(value="nvinfer1") @NoOffset @Properties(inherit=nvinfer.class) public class ICudaEngine extends INoCopy
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Constructor and Description |
---|
ICudaEngine()
Default native constructor.
|
ICudaEngine(long size)
Native array allocator.
|
ICudaEngine(Pointer p)
Pointer cast constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
bindingIsInput(int bindingIndex)
Deprecated.
Deprecated in TensorRT 8.5. Superseded by getTensorIOMode().
|
IEngineInspector |
createEngineInspector()
\brief Create a new engine inspector which prints the layer information in an engine or an execution context.
|
IExecutionContext |
createExecutionContext()
\brief Create an execution context.
|
IExecutionContext |
createExecutionContextWithoutDeviceMemory()
\brief create an execution context without any device memory allocated
The memory for execution of this device context must be supplied by the application.
|
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. |
int |
getBindingBytesPerComponent(int bindingIndex)
Deprecated.
Deprecated in TensorRT 8.5. Superseded by getTensorBytesPerComponent().
|
int |
getBindingComponentsPerElement(int bindingIndex)
Deprecated.
Deprecated in TensorRT 8.5. Superseded by getTensorComponentsPerElement().
|
nvinfer.DataType |
getBindingDataType(int bindingIndex)
Deprecated.
Deprecated in TensorRT 8.5. Superseded by getTensorDataType().
|
Dims32 |
getBindingDimensions(int bindingIndex)
Deprecated.
Deprecated in TensorRT 8.5. Superseded by getTensorShape().
|
nvinfer.TensorFormat |
getBindingFormat(int bindingIndex)
Deprecated.
Deprecated in TensorRT 8.5. Superseded by getTensorFormat().
|
String |
getBindingFormatDesc(int bindingIndex)
Deprecated.
Deprecated in TensorRT 8.5. Superseded by getTensorFormatDesc().
|
int |
getBindingIndex(BytePointer name)
Deprecated.
|
int |
getBindingIndex(String name)
Deprecated.
Deprecated in TensorRT 8.5. Superseded by name-based methods. Use them instead of binding-index
based methods.
|
String |
getBindingName(int bindingIndex)
Deprecated.
Deprecated in TensorRT 8.5. Superseded by name-based methods. Use them instead of binding-index
based methods.
|
int |
getBindingVectorizedDim(int bindingIndex)
Deprecated.
Deprecated in TensorRT 8.5. Superseded by getTensorVectorizedDim().
|
long |
getDeviceMemorySize()
\brief Return the amount of device memory required by an execution context.
|
nvinfer.EngineCapability |
getEngineCapability()
\brief Determine what execution capability this engine has.
|
IErrorRecorder |
getErrorRecorder()
\brief Get the ErrorRecorder assigned to this interface.
|
nvinfer.HardwareCompatibilityLevel |
getHardwareCompatibilityLevel()
\brief Return the hardware compatibility level of this engine.
|
String |
getIOTensorName(int index)
\brief Return name of an IO tensor.
|
nvinfer.TensorLocation |
getLocation(int bindingIndex)
Deprecated.
Deprecated in TensorRT 8.5. Superseded by getTensorLocation().
|
int |
getMaxBatchSize()
Deprecated.
Deprecated in TensorRT 8.4.
|
String |
getName()
\brief Returns the name of the network associated with the engine.
|
int |
getNbAuxStreams()
\brief Return the number of auxiliary streams used by this engine.
|
int |
getNbBindings()
Deprecated.
Deprecated in TensorRT 8.5. Superseded by getNbIOTensors.
|
int |
getNbIOTensors()
\brief Return number of IO tensors.
|
int |
getNbLayers()
\brief Get the number of layers in the network.
|
int |
getNbOptimizationProfiles()
\brief Get the number of optimization profiles defined for this engine.
|
ICudaEngine |
getPointer(long i) |
Dims32 |
getProfileDimensions(int bindingIndex,
int profileIndex,
int select)
Deprecated.
|
Dims32 |
getProfileDimensions(int bindingIndex,
int profileIndex,
nvinfer.OptProfileSelector select)
Deprecated.
Deprecated in TensorRT 8.5. Superseded by getProfileShape().
|
Dims32 |
getProfileShape(BytePointer tensorName,
int profileIndex,
int select) |
Dims32 |
getProfileShape(String tensorName,
int profileIndex,
nvinfer.OptProfileSelector select)
\brief Get the minimum / optimum / maximum dimensions for an input tensor given its name under an optimization
profile.
|
IntBuffer |
getProfileShapeValues(int profileIndex,
int inputIndex,
int select)
Deprecated.
|
IntPointer |
getProfileShapeValues(int profileIndex,
int inputIndex,
nvinfer.OptProfileSelector select)
Deprecated.
Deprecated in TensorRT 8.5. Superseded by getShapeValues(). Difference between Execution and shape
tensor is superficial since TensorRT 8.5.
|
nvinfer.ProfilingVerbosity |
getProfilingVerbosity()
\brief Return the \ref ProfilingVerbosity the builder config was set to when the engine was built.
|
int |
getTacticSources()
\brief return the tactic sources required by this engine.
|
int |
getTensorBytesPerComponent(BytePointer tensorName) |
int |
getTensorBytesPerComponent(BytePointer tensorName,
int profileIndex) |
int |
getTensorBytesPerComponent(String tensorName)
\brief Return the number of bytes per component of an element, or -1 if the provided name does not map to an
input or output tensor.
|
int |
getTensorBytesPerComponent(String tensorName,
int profileIndex)
\brief Return the number of bytes per component of an element of given profile, or -1 if the provided name does
not map to an input or output tensor.
|
int |
getTensorComponentsPerElement(BytePointer tensorName) |
int |
getTensorComponentsPerElement(BytePointer tensorName,
int profileIndex) |
int |
getTensorComponentsPerElement(String tensorName)
\brief Return the number of components included in one element, or -1 if the provided name does not map to an
input or output tensor.
|
int |
getTensorComponentsPerElement(String tensorName,
int profileIndex)
\brief Return the number of components included in one element of given profile, or -1 if the provided name does
not map to an input or output tensor.
|
int |
getTensorDataType(BytePointer tensorName) |
nvinfer.DataType |
getTensorDataType(String tensorName)
\brief Determine the required data type for a buffer from its tensor name.
|
int |
getTensorFormat(BytePointer tensorName) |
int |
getTensorFormat(BytePointer tensorName,
int profileIndex) |
nvinfer.TensorFormat |
getTensorFormat(String tensorName)
\brief Return the tensor format, or TensorFormat::kLINEAR if the provided name does not map to an input or
output tensor.
|
nvinfer.TensorFormat |
getTensorFormat(String tensorName,
int profileIndex)
\brief Return the tensor format of given profile, or TensorFormat::kLINEAR if the provided name does not map to
an input or output tensor.
|
BytePointer |
getTensorFormatDesc(BytePointer tensorName) |
BytePointer |
getTensorFormatDesc(BytePointer tensorName,
int profileIndex) |
String |
getTensorFormatDesc(String tensorName)
\brief Return the human readable description of the tensor format, or empty string if the provided name does not
map to an input or output tensor.
|
String |
getTensorFormatDesc(String tensorName,
int profileIndex)
\brief Return the human readable description of the tensor format of given profile, or empty string if the
provided name does not map to an input or output tensor.
|
int |
getTensorIOMode(BytePointer tensorName) |
nvinfer.TensorIOMode |
getTensorIOMode(String tensorName)
\brief Determine whether a tensor is an input or output tensor.
|
int |
getTensorLocation(BytePointer tensorName) |
nvinfer.TensorLocation |
getTensorLocation(String tensorName)
\brief Get whether an input or output tensor must be on GPU or CPU.
|
Dims32 |
getTensorShape(BytePointer tensorName) |
Dims32 |
getTensorShape(String tensorName)
\brief Get shape of an input or output tensor.
|
int |
getTensorVectorizedDim(BytePointer tensorName) |
int |
getTensorVectorizedDim(BytePointer tensorName,
int profileIndex) |
int |
getTensorVectorizedDim(String tensorName)
\brief Return the dimension index that the buffer is vectorized, or -1 if the provided name does not
map to an input or output tensor.
|
int |
getTensorVectorizedDim(String tensorName,
int profileIndex)
\brief Return the dimension index that the buffer is vectorized of given profile, or -1 if the provided name
does not map to an input or output tensor.
|
boolean |
hasImplicitBatchDimension()
\brief Query whether the engine was built with an implicit batch dimension.
|
boolean |
isExecutionBinding(int bindingIndex)
Deprecated.
No name-based equivalent replacement. Use getTensorLocation() instead to know the location of tensor
data. Distinction between execution binding and shape binding is superficial since TensorRT 8.5.
|
boolean |
isRefittable()
\brief Return true if an engine can be refit.
|
boolean |
isShapeBinding(int bindingIndex)
Deprecated.
Use name-based isShapeInferenceIO() instead to know whether a tensor is a shape tensor.
|
boolean |
isShapeInferenceIO(BytePointer tensorName) |
boolean |
isShapeInferenceIO(String tensorName)
\brief True if tensor is required as input for shape calculations or is output from shape calculations.
|
ICudaEngine |
position(long position) |
IHostMemory |
serialize()
\brief Serialize the network to a stream.
|
void |
setErrorRecorder(IErrorRecorder recorder) |
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, zero
public ICudaEngine()
public ICudaEngine(long size)
Pointer.position(long)
.public ICudaEngine(Pointer p)
Pointer(Pointer)
.public ICudaEngine position(long position)
public ICudaEngine getPointer(long i)
getPointer
in class Pointer
@Deprecated @NoException(value=true) public int getNbBindings()
getBindingIndex()
@Deprecated @NoException(value=true) public int getBindingIndex(String name)
name
- The tensor name.getBindingName()
@Deprecated @NoException(value=true) public int getBindingIndex(@Cast(value="const char*") BytePointer name)
@Deprecated @NoException(value=true) public String getBindingName(int bindingIndex)
bindingIndex
- The binding index.getBindingIndex()
@Cast(value="bool") @Deprecated @NoException(value=true) public boolean bindingIsInput(int bindingIndex)
bindingIndex
- The binding index.getTensorIOMode()
@Deprecated @ByVal @Cast(value="nvinfer1::Dims*") @NoException(value=true) public Dims32 getBindingDimensions(int bindingIndex)
bindingIndex
- The binding index.getTensorShape()
@ByVal @Cast(value="nvinfer1::Dims*") @NoException(value=true) public Dims32 getTensorShape(String tensorName)
tensorName
- The name of an input or output tensor.@ByVal @Cast(value="nvinfer1::Dims*") @NoException(value=true) public Dims32 getTensorShape(@Cast(value="const char*") BytePointer tensorName)
@Deprecated @NoException(value=true) public nvinfer.DataType getBindingDataType(int bindingIndex)
bindingIndex
- The binding index.getTensorDataType()
@NoException(value=true) public nvinfer.DataType getTensorDataType(String tensorName)
tensorName
- The name of an input or output tensor.@NoException(value=true) @Cast(value="nvinfer1::DataType") public int getTensorDataType(@Cast(value="const char*") BytePointer tensorName)
@Deprecated @NoException(value=true) public int getMaxBatchSize()
@NoException(value=true) public int getNbLayers()
@NoException(value=true) public IHostMemory serialize()
IRuntime::deserializeCudaEngine()
@NoException(value=true) public IExecutionContext createExecutionContext()
IExecutionContext.
,
IExecutionContext::setOptimizationProfile()
@Deprecated @NoException(value=true) public void destroy()
delete
.
\warning Calling destroy on a managed pointer will result in a double-free error.@Deprecated @NoException(value=true) public nvinfer.TensorLocation getLocation(int bindingIndex)
bindingIndex
- The binding index.ITensor::getLocation()
,
getTensorLocation()
@NoException(value=true) public nvinfer.TensorLocation getTensorLocation(String tensorName)
tensorName
- The name of an input or output tensor.@NoException(value=true) @Cast(value="nvinfer1::TensorLocation") public int getTensorLocation(@Cast(value="const char*") BytePointer tensorName)
@Cast(value="bool") @NoException(value=true) public boolean isShapeInferenceIO(String tensorName)
@Cast(value="bool") @NoException(value=true) public boolean isShapeInferenceIO(@Cast(value="const char*") BytePointer tensorName)
@NoException(value=true) public nvinfer.TensorIOMode getTensorIOMode(String tensorName)
tensorName
- The name of an input or output tensor.@NoException(value=true) @Cast(value="nvinfer1::TensorIOMode") public int getTensorIOMode(@Cast(value="const char*") BytePointer tensorName)
@NoException(value=true) public IExecutionContext createExecutionContextWithoutDeviceMemory()
@Cast(value="size_t") @NoException(value=true) public long getDeviceMemorySize()
IExecutionContext::setDeviceMemory()
@Cast(value="bool") @NoException(value=true) public boolean isRefittable()
nvinfer1::createInferRefitter()
@Deprecated @NoException(value=true) public int getBindingBytesPerComponent(int bindingIndex)
bindingIndex
- The binding Index.getBindingVectorizedDim()
,
getTensorBytesPerComponent()
@NoException(value=true) public int getTensorBytesPerComponent(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.
\warning The function can only return the result of profile 0, and issues a warning message when there are
multiple profiles in the engine, use getTensorBytesPerComponent with profileIndex when there are multiple
profiles.getTensorVectorizedDim()
,
getTensorBytesPerComponent(tensorName, profileIndex)
@NoException(value=true) public int getTensorBytesPerComponent(@Cast(value="const char*") BytePointer tensorName)
@NoException(value=true) public int getTensorBytesPerComponent(String tensorName, int profileIndex)
tensorName
- The name of an input or output tensor.profileIndex
- The profile index to query
\warning The string tensorName must be null-terminated, and be at most 4096 bytes including the terminator.getTensorVectorizedDim(tensorName, profileIndex)
@NoException(value=true) public int getTensorBytesPerComponent(@Cast(value="const char*") BytePointer tensorName, int profileIndex)
@Deprecated @NoException(value=true) public int getBindingComponentsPerElement(int bindingIndex)
bindingIndex
- The binding Index.getBindingVectorizedDim()
@NoException(value=true) public int getTensorComponentsPerElement(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.
\warning The function can only return the result of profile 0, and issues a warning message when there
are multiple profiles in the engine, use getTensorComponentsPerElement with profileIndex when there are
multiple profiles.getTensorVectorizedDim()
,
getTensorComponentsPerElement(tensorName, profileIndex)
@NoException(value=true) public int getTensorComponentsPerElement(@Cast(value="const char*") BytePointer tensorName)
@NoException(value=true) public int getTensorComponentsPerElement(String tensorName, int profileIndex)
tensorName
- The name of an input or output tensor.profileIndex
- The profile index to query
\warning The string tensorName must be null-terminated, and be at most 4096 bytes including the terminator.getTensorVectorizedDim(tensorName, profileIndex)
@NoException(value=true) public int getTensorComponentsPerElement(@Cast(value="const char*") BytePointer tensorName, int profileIndex)
@Deprecated @NoException(value=true) public nvinfer.TensorFormat getBindingFormat(int bindingIndex)
bindingIndex
- The binding Index.getTensorFormat()
@NoException(value=true) public nvinfer.TensorFormat getTensorFormat(String tensorName)
getTensorFormat(tensorName, profileIndex)
@NoException(value=true) @Cast(value="nvinfer1::TensorFormat") public int getTensorFormat(@Cast(value="const char*") BytePointer tensorName)
@NoException(value=true) public nvinfer.TensorFormat getTensorFormat(String tensorName, int profileIndex)
tensorName
- The name of an input or output tensor.profileIndex
- The profile index to query the format for.
\warning The string tensorName must be null-terminated, and be at most 4096 bytes including the terminator.@NoException(value=true) @Cast(value="nvinfer1::TensorFormat") public int getTensorFormat(@Cast(value="const char*") BytePointer tensorName, int profileIndex)
@Deprecated @NoException(value=true) public String getBindingFormatDesc(int bindingIndex)
bindingIndex
- The binding Index.getTensorFormatDesc()
@NoException(value=true) public String getTensorFormatDesc(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.
\warning The function can only return the result of profile 0, and issues a warning message when there are
multiple profiles in the engine, use getTensorFormatDesc with profileIndex when there are multiple profiles.@NoException(value=true) @Cast(value="const char*") public BytePointer getTensorFormatDesc(@Cast(value="const char*") BytePointer tensorName)
@NoException(value=true) public String getTensorFormatDesc(String tensorName, int profileIndex)
tensorName
- The name of an input or output tensor.profileIndex
- The profile index to query the format for.
\warning The string tensorName must be null-terminated, and be at most 4096 bytes including the terminator.@NoException(value=true) @Cast(value="const char*") public BytePointer getTensorFormatDesc(@Cast(value="const char*") BytePointer tensorName, int profileIndex)
@Deprecated @NoException(value=true) public int getBindingVectorizedDim(int bindingIndex)
bindingIndex
- The binding Index.getTensorVectorizedDim()
@NoException(value=true) public int getTensorVectorizedDim(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.
\warning The function can only return the result of profile 0, and issues a warning message when there are
multiple profiles in the engine, use getTensorVectorizedDim with profileIndex when there are multiple profiles.@NoException(value=true) public int getTensorVectorizedDim(@Cast(value="const char*") BytePointer tensorName)
@NoException(value=true) public int getTensorVectorizedDim(String tensorName, int profileIndex)
tensorName
- The name of an input.profileIndex
- The profile index to query the format for.
\warning The string tensorName must be null-terminated, and be at most 4096 bytes including the terminator.@NoException(value=true) public int getTensorVectorizedDim(@Cast(value="const char*") BytePointer tensorName, int profileIndex)
@NoException(value=true) public String getName()
INetworkDefinition::setName(), INetworkDefinition::getName()
@NoException(value=true) public int getNbOptimizationProfiles()
IExecutionContext::setOptimizationProfile()
@Deprecated @ByVal @Cast(value="nvinfer1::Dims*") @NoException(value=true) public Dims32 getProfileDimensions(int bindingIndex, int profileIndex, nvinfer.OptProfileSelector select)
bindingIndex
- The input binding index, which must belong to the given profile,
or be between 0 and bindingsPerProfile-1 as described below.profileIndex
- The profile index, which must be between 0 and getNbOptimizationProfiles()-1.select
- Whether to query the minimum, optimum, or maximum dimensions for this binding.getProfileShape()
@Deprecated @ByVal @Cast(value="nvinfer1::Dims*") @NoException(value=true) public Dims32 getProfileDimensions(int bindingIndex, int profileIndex, @Cast(value="nvinfer1::OptProfileSelector") int select)
@ByVal @Cast(value="nvinfer1::Dims*") @NoException(value=true) public Dims32 getProfileShape(String tensorName, int profileIndex, nvinfer.OptProfileSelector select)
tensorName
- The name of an input tensor.profileIndex
- The profile index, which must be between 0 and getNbOptimizationProfiles()-1.select
- Whether to query the minimum, optimum, or maximum dimensions for this input tensor.@ByVal @Cast(value="nvinfer1::Dims*") @NoException(value=true) public Dims32 getProfileShape(@Cast(value="const char*") BytePointer tensorName, int profileIndex, @Cast(value="nvinfer1::OptProfileSelector") int select)
@Const @Deprecated @NoException(value=true) public IntPointer getProfileShapeValues(int profileIndex, int inputIndex, nvinfer.OptProfileSelector select)
profileIndex
- The profile index (must be between 0 and getNbOptimizationProfiles()-1)inputIndex
- The input index (must be between 0 and getNbBindings() - 1)select
- Whether to query the minimum, optimum, or maximum shape values for this binding.getShapeValues()
@Const @Deprecated @NoException(value=true) public IntBuffer getProfileShapeValues(int profileIndex, int inputIndex, @Cast(value="nvinfer1::OptProfileSelector") int select)
@Cast(value="bool") @Deprecated @NoException(value=true) public boolean isShapeBinding(int bindingIndex)
isShapeInferenceIO()
@Cast(value="bool") @Deprecated @NoException(value=true) public boolean isExecutionBinding(int bindingIndex)
getTensorLocation()
@NoException(value=true) public nvinfer.EngineCapability getEngineCapability()
@NoException(value=true) public void setErrorRecorder(IErrorRecorder recorder)
/**
@NoException(value=true) public IErrorRecorder getErrorRecorder()
setErrorRecorder()
@Cast(value="bool") @NoException(value=true) public boolean hasImplicitBatchDimension()
createNetworkV2
@Cast(value="nvinfer1::TacticSources") @NoException(value=true) public int getTacticSources()
IBuilderConfig::setTacticSources()
@NoException(value=true) public nvinfer.ProfilingVerbosity getProfilingVerbosity()
IBuilderConfig::setProfilingVerbosity()
@NoException(value=true) public IEngineInspector createEngineInspector()
IEngineInspector.
@NoException(value=true) public int getNbIOTensors()
getIOTensorName()
@NoException(value=true) public String getIOTensorName(int index)
index
- value between 0 and getNbIOTensors()-1getNbIOTensors()
@ByVal @NoException(value=true) public nvinfer.HardwareCompatibilityLevel getHardwareCompatibilityLevel()
@NoException(value=true) public int getNbAuxStreams()
IBuilderConfig::setMaxAuxStreams(), IExecutionContext::setAuxStreams()
Copyright © 2024. All rights reserved.