NVIDIA DeepStream SDK API Reference

9.1 Release
9.1/sources/libs/ds3d/inference_custom_lib/ds3d_v2x_infer_custom_preprocess/pillars-scatter.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2022-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef _PillarsScatter_H_
19 #define _PillarsScatter_H_
20 
21 #include <NvInferPlugin.h>
22 
23 #include <numeric>
24 #include <string>
25 #include <vector>
26 
27 namespace nvinfer1 {
28 namespace plugin {
29 
30 class PillarsScatterPlugin : public nvinfer1::IPluginV2DynamicExt {
31  public:
32  PillarsScatterPlugin() = delete;
33  PillarsScatterPlugin(const void* data, size_t length);
34  PillarsScatterPlugin(size_t h, size_t w);
35  // IPluginV2DynamicExt Methods
36  nvinfer1::IPluginV2DynamicExt* clone() const noexcept override;
37  nvinfer1::DimsExprs getOutputDimensions(int outputIndex, const nvinfer1::DimsExprs* inputs, int nbInputs,
38  nvinfer1::IExprBuilder& exprBuilder) noexcept override;
39  bool supportsFormatCombination(int pos, const nvinfer1::PluginTensorDesc* inOut, int nbInputs, int nbOutputs) noexcept override;
40  void configurePlugin(const nvinfer1::DynamicPluginTensorDesc* in, int nbInputs, const nvinfer1::DynamicPluginTensorDesc* out,
41  int nbOutputs) noexcept override;
42  size_t getWorkspaceSize(const nvinfer1::PluginTensorDesc* inputs, int nbInputs, const nvinfer1::PluginTensorDesc* outputs,
43  int nbOutputs) const noexcept override;
44  int enqueue(const nvinfer1::PluginTensorDesc* inputDesc, const nvinfer1::PluginTensorDesc* outputDesc,
45  const void* const* inputs, void* const* outputs, void* workspace, cudaStream_t stream) noexcept override;
46  // IPluginV2Ext Methods
47  nvinfer1::DataType getOutputDataType(int index, const nvinfer1::DataType* inputTypes, int nbInputs) const noexcept override;
48  // IPluginV2 Methods
49  const char* getPluginType() const noexcept override;
50  const char* getPluginVersion() const noexcept override;
51  int getNbOutputs() const noexcept override;
52  int initialize() noexcept override;
53  void terminate() noexcept override;
54  size_t getSerializationSize() const noexcept override;
55  void serialize(void* buffer) const noexcept override;
56  void destroy() noexcept override;
57  void setPluginNamespace(const char* pluginNamespace) noexcept override;
58  const char* getPluginNamespace() const noexcept override;
59 
60  private:
61  std::string mNamespace;
62  size_t bev_h_;
63  size_t bev_w_;
64 };
65 
66 class PillarsScatterPluginCreator : public nvinfer1::IPluginCreator {
67  public:
68  PillarsScatterPluginCreator();
69  const char* getPluginName() const noexcept override;
70  const char* getPluginVersion() const noexcept override;
71  const nvinfer1::PluginFieldCollection* getFieldNames() noexcept override;
72  nvinfer1::IPluginV2* createPlugin(const char* name, const nvinfer1::PluginFieldCollection* fc) noexcept override;
73  nvinfer1::IPluginV2* deserializePlugin(const char* name, const void* serialData, size_t serialLength) noexcept override;
74  void setPluginNamespace(const char* pluginNamespace) noexcept override;
75  const char* getPluginNamespace() const noexcept override;
76 
77  private:
78  nvinfer1::PluginFieldCollection mFC;
79  std::vector<nvinfer1::PluginField> mPluginAttributes;
80  std::string mNamespace;
81 };
82 
83 } // namespace plugin
84 } // namespace nvinfer1
85 
86 #endif
cudaStream_t
struct CUstream_st * cudaStream_t
Forward declaration of cudaStream_t.
Definition: sources/includes/nvbufsurftransform.h:35
nvinfer1::plugin::PillarsScatterPlugin::configurePlugin
void configurePlugin(const nvinfer1::DynamicPluginTensorDesc *in, int nbInputs, const nvinfer1::DynamicPluginTensorDesc *out, int nbOutputs) noexcept override
nvinfer1::plugin::PillarsScatterPlugin::getWorkspaceSize
size_t getWorkspaceSize(const nvinfer1::PluginTensorDesc *inputs, int nbInputs, const nvinfer1::PluginTensorDesc *outputs, int nbOutputs) const noexcept override
nvinfer1::plugin::PillarsScatterPlugin::supportsFormatCombination
bool supportsFormatCombination(int pos, const nvinfer1::PluginTensorDesc *inOut, int nbInputs, int nbOutputs) noexcept override
ds3d::DataType
DataType
Definition: sources/includes/ds3d/common/idatatype.h:82
nvinfer1::plugin::PillarsScatterPlugin::getPluginNamespace
const char * getPluginNamespace() const noexcept override
nvinfer1::plugin::PillarsScatterPlugin::destroy
void destroy() noexcept override
nvinfer1::plugin::PillarsScatterPlugin::setPluginNamespace
void setPluginNamespace(const char *pluginNamespace) noexcept override
nvinfer1::plugin::PillarsScatterPlugin::getPluginType
const char * getPluginType() const noexcept override
nvinfer1::plugin::PillarsScatterPlugin::getSerializationSize
size_t getSerializationSize() const noexcept override
nvinfer1
Definition: sources/libs/ds3d/inference_custom_lib/ds3d_v2x_infer_custom_preprocess/bevpool.h:27
nvinfer1::plugin::PillarsScatterPlugin::getOutputDimensions
nvinfer1::DimsExprs getOutputDimensions(int outputIndex, const nvinfer1::DimsExprs *inputs, int nbInputs, nvinfer1::IExprBuilder &exprBuilder) noexcept override
nvinfer1::plugin::PillarsScatterPlugin::clone
nvinfer1::IPluginV2DynamicExt * clone() const noexcept override
nvinfer1::plugin::PillarsScatterPlugin::PillarsScatterPlugin
PillarsScatterPlugin()=delete
nvinfer1::plugin::PillarsScatterPlugin::initialize
int initialize() noexcept override
nvinfer1::plugin::PillarsScatterPlugin::enqueue
int enqueue(const nvinfer1::PluginTensorDesc *inputDesc, const nvinfer1::PluginTensorDesc *outputDesc, const void *const *inputs, void *const *outputs, void *workspace, cudaStream_t stream) noexcept override
nvinfer1::plugin::PillarsScatterPlugin::serialize
void serialize(void *buffer) const noexcept override
nvinfer1::plugin::PillarsScatterPlugin::terminate
void terminate() noexcept override
nvinfer1::plugin::PillarsScatterPlugin::getOutputDataType
nvinfer1::DataType getOutputDataType(int index, const nvinfer1::DataType *inputTypes, int nbInputs) const noexcept override
nvinfer1::plugin::PillarsScatterPlugin::getNbOutputs
int getNbOutputs() const noexcept override
nvinfer1::plugin::PillarsScatterPlugin::getPluginVersion
const char * getPluginVersion() const noexcept override