Provides an interface for supporting non-standard DNN layers.
Data Structures | |
struct | dwDNNPluginWeights |
Stores DNN weights. More... | |
Typedefs | |
typedef void * | _dwDNNPluginHandle_t |
_dwDNNPluginHandle_t can be optionally used for storing and accessing variables among the functions defined below. More... | |
Enumerations | |
enum | dwDNNPluginLayout { DW_DNN_PLUGIN_LAYOUT_LINEAR = 0, DW_DNN_PLUGIN_LAYOUT_NCHW = DW_DNN_PLUGIN_LAYOUT_LINEAR, DW_DNN_PLUGIN_LAYOUT_NC2HW2 = 1, DW_DNN_PLUGIN_LAYOUT_CHW2 = DW_DNN_PLUGIN_LAYOUT_NC2HW2, DW_DNN_PLUGIN_LAYOUT_NHWC8 = 2, DW_DNN_PLUGIN_LAYOUT_HWC8 = DW_DNN_PLUGIN_LAYOUT_NHWC8, DW_DNN_PLUGIN_LAYOUT_CHW4 = 3, DW_DNN_PLUGIN_LAYOUT_CHW16 = 4, DW_DNN_PLUGIN_LAYOUT_CHW32 = 5 } |
Represents different layouts for plugins. More... | |
Functions | |
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. More... | |
dwStatus | _dwDNNPlugin_enqueue (int32_t batchSize, const void *const *inputs, void **outputs, void *workspace, cudaStream_t stream, _dwDNNPluginHandle_t handle) |
Performs forward-pass. More... | |
dwStatus | _dwDNNPlugin_getNumOutputs (int32_t *numOutputs, _dwDNNPluginHandle_t handle) |
Returns number of outputs. More... | |
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. More... | |
dwStatus | _dwDNNPlugin_getSerializationSize (size_t *serializationSize, _dwDNNPluginHandle_t handle) |
Returns serialization size. More... | |
dwStatus | _dwDNNPlugin_getWorkspaceSize (size_t *workspaceSize, int32_t maxBatchSize, _dwDNNPluginHandle_t handle) |
Returns workspace size. More... | |
dwStatus | _dwDNNPlugin_initialize (_dwDNNPluginHandle_t *handle, const char8_t *layerName, const void *data, size_t length) |
Initializes the custom plugin from serialized bytes. More... | |
dwStatus | _dwDNNPlugin_initializeFromWeights (_dwDNNPluginHandle_t *handle, const char8_t *layerName, const dwDNNPluginWeights *weights, int32_t numWeights) |
Initializes the custom plugin from weights. More... | |
dwStatus | _dwDNNPlugin_release (_dwDNNPluginHandle_t handle) |
Releases the custom plugin. More... | |
dwStatus | _dwDNNPlugin_serialize (void *buffer, _dwDNNPluginHandle_t handle) |
Serializes the layer. More... | |
dwStatus | _dwDNNPlugin_supportsFormat (bool *res, dwPrecision precision, dwDNNPluginLayout pluginLayout, _dwDNNPluginHandle_t handle) |
Returns a flag indicating whether the given format is supported. More... | |
struct dwDNNPluginWeights |
Data Fields | ||
---|---|---|
int64_t | count | the number of weights in the array |
dwPrecision | precision | data type of the weights |
const void * | values | the weight values, in a contiguous array |
typedef void* _dwDNNPluginHandle_t |
_dwDNNPluginHandle_t can be optionally used for storing and accessing variables among the functions defined below.
Definition at line 87 of file DNNPlugin.h.
enum dwDNNPluginLayout |
Represents different layouts for plugins.
Definition at line 61 of file DNNPlugin.h.
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.
[in] | inputDimensions | Array of input dimensions |
[in] | numInputs | Number of inputs |
[in] | outputDimensions | Array of output dimensions |
[in] | numOutputs | Number of outputs |
[in] | precision | Precision |
[in] | layout | Layout |
[in] | maxBatchSize | Maximum batch size |
[in] | handle | Pointer to a DNN plugin object |
dwStatus _dwDNNPlugin_enqueue | ( | int32_t | batchSize, |
const void *const * | inputs, | ||
void ** | outputs, | ||
void * | workspace, | ||
cudaStream_t | stream, | ||
_dwDNNPluginHandle_t | handle | ||
) |
Performs forward-pass.
[in] | batchSize | Batch size |
[in] | inputs | Array of inputs |
[in] | outputs | Array of outputs |
[in] | workspace | Pointer to workspace |
[in] | stream | CUDA stream |
[in] | handle | Pointer to a DNN plugin object |
dwStatus _dwDNNPlugin_getNumOutputs | ( | int32_t * | numOutputs, |
_dwDNNPluginHandle_t | handle | ||
) |
Returns number of outputs.
[out] | numOutputs | Number of outputs |
[in] | handle | Pointer to a DNN plugin object |
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.
[out] | outputDimensions | Output dimensions |
[in] | outputIndex | Output index |
[in] | inputDimensions | Array of input dimensions |
[in] | numInputs | Number of inputs |
[in] | handle | Pointer to a DNN plugin object |
dwStatus _dwDNNPlugin_getSerializationSize | ( | size_t * | serializationSize, |
_dwDNNPluginHandle_t | handle | ||
) |
Returns serialization size.
[out] | serializationSize | Serialization size |
[in] | handle | Pointer to a DNN plugin object |
dwStatus _dwDNNPlugin_getWorkspaceSize | ( | size_t * | workspaceSize, |
int32_t | maxBatchSize, | ||
_dwDNNPluginHandle_t | handle | ||
) |
Returns workspace size.
[out] | workspaceSize | Workspace size |
[in] | maxBatchSize | Maximum batch size |
[in] | handle | Pointer to a DNN plugin object |
dwStatus _dwDNNPlugin_initialize | ( | _dwDNNPluginHandle_t * | handle, |
const char8_t * | layerName, | ||
const void * | data, | ||
size_t | length | ||
) |
Initializes the custom plugin from serialized bytes.
[out] | handle | Pointer to a DNN plugin object |
[in] | layerName | Name of the custom layer |
[in] | data | Serialized layer data |
[in] | length | Length of the serialized data |
dwStatus _dwDNNPlugin_initializeFromWeights | ( | _dwDNNPluginHandle_t * | handle, |
const char8_t * | layerName, | ||
const dwDNNPluginWeights * | weights, | ||
int32_t | numWeights | ||
) |
Initializes the custom plugin from weights.
[out] | handle | Pointer to a DNN Plugin object |
[in] | layerName | Name of the custom layer |
[in] | weights | Array of weights structure |
[in] | numWeights | Number of weights structure in weights |
dwStatus _dwDNNPlugin_release | ( | _dwDNNPluginHandle_t | handle | ) |
Releases the custom plugin.
[in] | handle | Pointer to a DNN plugin object |
dwStatus _dwDNNPlugin_serialize | ( | void * | buffer, |
_dwDNNPluginHandle_t | handle | ||
) |
Serializes the layer.
[out] | buffer | Buffer to store the layer to |
[in] | handle | Pointer to a DNN plugin object |
dwStatus _dwDNNPlugin_supportsFormat | ( | bool * | res, |
dwPrecision | precision, | ||
dwDNNPluginLayout | pluginLayout, | ||
_dwDNNPluginHandle_t | handle | ||
) |
Returns a flag indicating whether the given format is supported.
[out] | res | Flag indicating whether the given format is supported |
[in] | precision | Precision |
[in] | pluginLayout | Layout |
[in] | handle | Pointer to a DNN plugin object |