38#ifndef DW_DNN_PLUGIN_H_
39#define DW_DNN_PLUGIN_H_
217 int32_t outputIndex,
const dwBlobSize* inputDimensions,
242 int32_t numInputs, int32_t numOutputs,
371 int32_t outputIndex,
const bool* inputIsBroadcasted,
397 const dwPrecision* inputPrecisions, int32_t numInputs,
422DW_DEPRECATED(
"WARNING: will be removed in the next major release")
434DW_DEPRECATED("WARNING: will be removed in the next major release")
436 const
void* data,
size_t length);
443DW_DEPRECATED("WARNING: will be removed in the next major release")
458DW_DEPRECATED("WARNING: will be removed in the next major release")
460 int32_t numInputs, const
dwBlobSize* outputDimensions,
473DW_DEPRECATED("WARNING: will be removed in the next major release")
dwStatus
Status definition.
NVIDIA DriveWorks API: Core Types
float float32_t
Specifies POD types.
#define DW_DEPRECATED(msg)
float32_t scale
Tensor scale.
int64_t count
the number of weights in the array
int32_t numFields
Number of dwDNNPluginField entries.
const char8_t * pluginLibraryPath
Path to a plugin shared object.
const void * data
Plugin field attribute data.
const void * values
the weight values, in a contiguous array
dwDNNPluginLayout layout
Tensor layout.
dwPrecision precision
Tensor precision.
const dwDNNPluginField * fields
Pointer to dwDNNPluginField entries.
dwBlobSize dims
Tensor dimensions.
dwPrecision precision
data type of the weights
size_t numCustomLayers
Number of custom layers.
int32_t length
Number of data entries in the plugin attribute.
dwDNNPluginFieldType type
Plugin fild attribute type.
const dwDNNCustomLayer * customLayers
Array of custom layers.
const char8_t * name
Plugin field attribute name.
const char8_t * layerName
Name of the custom layer.
void const * _dwConstDNNPluginHandle_t
dwStatus _dwDNNPlugin_configureWithFormat(const dwBlobSize *inputDimensions, int32_t numInputs, const dwBlobSize *outputDimensions, int32_t numOutputs, dwPrecision precision, dwDNNPluginLayout layout, int32_t maxBatchSize, _dwDNNPluginHandle_t handle)
Configures the plugin with given format.
dwDNNPluginFieldType
Plugin field type.
dwStatus _dwDNNPlugin_create(_dwDNNPluginHandle_t *handle)
Creates a custom plugin.
dwStatus _dwDNNPlugin_clone(_dwDNNPluginHandle_t *out, _dwDNNPluginHandle_t handle)
Clones the plugin.
dwStatus _dwDNNPlugin_serialize(void *buffer, _dwDNNPluginHandle_t handle)
Serializes the plugin to buffer.
dwStatus _dwDNNPlugin_supportsFormatCombination(bool *res, int32_t index, const dwDNNPluginTensorDesc *inOut, int32_t numInputs, int32_t numOutputs, _dwConstDNNPluginHandle_t handle)
Returns a flag indicating whether the given format is supported.
dwStatus _dwDNNPlugin_getPluginNamespace(const char8_t **pluginNamespace, _dwConstDNNPluginHandle_t handle)
Returns plugin namespace.
dwStatus _dwDNNPlugin_getWorkspaceSize(size_t *workspaceSize, int32_t maxBatchSize, _dwDNNPluginHandle_t handle)
Returns workspace size.
void * _dwDNNPluginHandle_t
_dwDNNPluginHandle_t can be optionally used for storing and accessing variables among the functions d...
dwStatus _dwDNNPlugin_initialize(_dwDNNPluginHandle_t *handle, const char8_t *layerName, const void *data, size_t length)
Initializes the custom plugin from serialized bytes.
dwStatus _dwDNNPlugin_deserializeFromFieldCollection(const char8_t *name, const dwDNNPluginFieldCollection *fieldCollection, _dwDNNPluginHandle_t handle)
Deserializes plugin from field collection.
dwStatus _dwDNNPlugin_getPluginVersion(const char8_t **pluginVersion, _dwConstDNNPluginHandle_t handle)
Returns plugin version as string.
dwStatus _dwDNNPlugin_getPluginType(const char8_t **pluginType, _dwConstDNNPluginHandle_t handle)
Returns the plugin type as string.
dwStatus _dwDNNPlugin_canBroadcastInputAcrossBatch(bool *canBroadcastInputAcrossBatch, int32_t inputIndex, _dwConstDNNPluginHandle_t handle)
Returns whether plugin can use input that is broadcast across batch without replication.
dwStatus _dwDNNPlugin_deserializeFromWeights(const dwDNNPluginWeights *weights, int32_t numWeights, _dwDNNPluginHandle_t handle)
Deserializes plugin from weights.
dwStatus _dwDNNPlugin_setup(_dwDNNPluginHandle_t handle)
Initializes the created plugin.
dwStatus _dwDNNPlugin_configurePlugin(const dwDNNPluginTensorDesc *inputDescs, int32_t numInputs, const dwDNNPluginTensorDesc *outputDescs, int32_t numOutputs, _dwDNNPluginHandle_t handle)
Configures the plugin with given format.
dwStatus _dwDNNPlugin_destroy(_dwDNNPluginHandle_t handle)
Destroys the plugin.
dwStatus _dwDNNPlugin_isOutputBroadcastAcrossBatch(bool *isOutputBroadcastAcrossBatch, int32_t outputIndex, const bool *inputIsBroadcasted, int32_t numInputs, _dwConstDNNPluginHandle_t handle)
Returns whether output is broadcast across batch.
dwStatus _dwDNNPlugin_enqueue(int32_t batchSize, const void *const *inputs, void **outputs, void *workspace, cudaStream_t stream, _dwDNNPluginHandle_t handle)
Performs forward-pass.
dwStatus _dwDNNPlugin_initializeFromWeights(_dwDNNPluginHandle_t *handle, const char8_t *layerName, const dwDNNPluginWeights *weights, int32_t numWeights)
Initializes the custom plugin from weights.
dwStatus _dwDNNPlugin_getSerializationSize(size_t *serializationSize, _dwDNNPluginHandle_t handle)
Returns serialization size.
dwStatus _dwDNNPlugin_setPluginNamespace(const char8_t *pluginNamespace, _dwDNNPluginHandle_t handle)
Sets plugin namespace.
dwStatus _dwDNNPlugin_release(_dwDNNPluginHandle_t handle)
Releases the custom plugin.
dwStatus _dwDNNPlugin_getNumOutputs(int32_t *numOutputs, _dwDNNPluginHandle_t handle)
Returns number of outputs.
dwDNNPluginLayout
Represents different layouts for plugins.
dwStatus _dwDNNPlugin_supportsFormat(bool *res, dwPrecision precision, dwDNNPluginLayout pluginLayout, _dwDNNPluginHandle_t handle)
Returns a flag indicating whether the given format is supported.
dwStatus _dwDNNPlugin_getPluginFieldCollection(dwDNNPluginFieldCollection *fieldCollection, _dwDNNPluginHandle_t handle)
Returns a list of fields that needs to be passed to plugin at creation.
dwStatus _dwDNNPlugin_getOutputPrecision(dwPrecision *outputPrecision, int32_t outputIndex, const dwPrecision *inputPrecisions, int32_t numInputs, _dwConstDNNPluginHandle_t handle)
Returns output precision at given index given the input precisions.
dwStatus _dwDNNPlugin_deserializeFromBuffer(const char8_t *name, const void *buffer, size_t len, _dwDNNPluginHandle_t handle)
Deserializes plugin from buffer.
dwStatus _dwDNNPlugin_terminate(_dwDNNPluginHandle_t handle)
Terminates the plugin.
dwStatus _dwDNNPlugin_getOutputDimensions(dwBlobSize *outputDimensions, int32_t outputIndex, const dwBlobSize *inputDimensions, int32_t numInputs, _dwDNNPluginHandle_t handle)
Returns output dimensions of an output at a given index based on inputDimensions.
@ DW_DNN_PLUGIN_FIELD_TYPE_FLOAT16
FP16 field type.
@ DW_DNN_PLUGIN_FIELD_TYPE_FLOAT64
FP64 field type.
@ DW_DNN_PLUGIN_FIELD_TYPE_CHAR
char field type.
@ DW_DNN_PLUGIN_FIELD_TYPE_INT8
INT8 field type.
@ DW_DNN_PLUGIN_FIELD_TYPE_FLOAT32
FP32 field type.
@ DW_DNN_PLUGIN_FIELD_TYPE_UNKNOWN
Unknown field type.
@ DW_DNN_PLUGIN_FIELD_TYPE_DIMS
dwBlobSize field type.
@ DW_DNN_PLUGIN_FIELD_TYPE_INT16
INT16 field type.
@ DW_DNN_PLUGIN_FIELD_TYPE_INT32
INT32 field type.
@ DW_DNN_PLUGIN_LAYOUT_DLA_LINEAR
CHW DLA planar format.
@ DW_DNN_PLUGIN_LAYOUT_NHWC8
HWC with 8-element packed channels. (C must be a multiple of 8)
@ DW_DNN_PLUGIN_LAYOUT_NCHW
CHW.
@ DW_DNN_PLUGIN_LAYOUT_CHW4
CHW with 4-element packed channels.
@ DW_DNN_PLUGIN_LAYOUT_NC2HW2
CHW with 2-element packed channels.
@ DW_DNN_PLUGIN_LAYOUT_CHW2
CHW with 2-element packed channels.
@ DW_DNN_PLUGIN_LAYOUT_DLA_HWC4
HWC DLA image format.
@ DW_DNN_PLUGIN_LAYOUT_CHW32
CHW with 32-element packed channels.
@ DW_DNN_PLUGIN_LAYOUT_CDHW32
CDHW with 32-element packed channels.
@ DW_DNN_PLUGIN_LAYOUT_LINEAR
CHW.
@ DW_DNN_PLUGIN_LAYOUT_HWC8
HWC with 8-element packed channels. (C must be a multiple of 8)
@ DW_DNN_PLUGIN_LAYOUT_DHWC8
DHWC with 8-element packed channels. (C must be a multiple of 8)
@ DW_DNN_PLUGIN_LAYOUT_CHW16
CHW with 16-element packed channels.
@ DW_DNN_PLUGIN_LAYOUT_HWC
HWC Non-vectorized channel-last format.
Specifies plugin configuration.
Specified plugin configuration.
DNN plugin field colleciton.
DNN Plugin tensor descriptor.