TensorRT 10.0.1
NvInferRuntimeCommon.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: Copyright (c) 1993-2024 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 NV_INFER_RUNTIME_COMMON_H
19#define NV_INFER_RUNTIME_COMMON_H
20
31#define NV_INFER_INTERNAL_INCLUDE_RUNTIME_BASE 1
32#include "NvInferRuntimeBase.h"
33#undef NV_INFER_INTERNAL_INCLUDE_RUNTIME_BASE
35
36namespace nvinfer1
37{
56{
57public:
61 using PluginLibraryHandle = void*;
62
78 IPluginCreator& creator, AsciiChar const* const pluginNamespace) noexcept = 0;
79
93 TRT_DEPRECATED virtual IPluginCreator* const* getPluginCreatorList(int32_t* const numCreators) const noexcept = 0;
94
112 TRT_DEPRECATED virtual IPluginCreator* getPluginCreator(AsciiChar const* const pluginName,
113 AsciiChar const* const pluginVersion, AsciiChar const* const pluginNamespace = "") noexcept = 0;
114
115 // @cond SuppressDoxyWarnings
116 IPluginRegistry() = default;
117 IPluginRegistry(IPluginRegistry const&) = delete;
119 IPluginRegistry& operator=(IPluginRegistry const&) & = delete;
120 IPluginRegistry& operator=(IPluginRegistry&&) & = delete;
121 // @endcond
122
123protected:
124 virtual ~IPluginRegistry() noexcept = default;
125
126public:
143 virtual void setErrorRecorder(IErrorRecorder* const recorder) noexcept = 0;
144
160 virtual IErrorRecorder* getErrorRecorder() const noexcept = 0;
161
179 TRT_DEPRECATED virtual bool deregisterCreator(IPluginCreator const& creator) noexcept = 0;
180
189 virtual bool isParentSearchEnabled() const = 0;
190
198 virtual void setParentSearchEnabled(bool const enabled) = 0;
199
208 virtual PluginLibraryHandle loadLibrary(AsciiChar const* pluginPath) noexcept = 0;
209
216 virtual void deregisterLibrary(PluginLibraryHandle handle) noexcept = 0;
217
229 virtual bool registerCreator(IPluginCreatorInterface& creator, AsciiChar const* const pluginNamespace) noexcept = 0;
230
241 virtual IPluginCreatorInterface* const* getAllCreators(int32_t* const numCreators) const noexcept = 0;
242
254 virtual IPluginCreatorInterface* getCreator(AsciiChar const* const pluginName, AsciiChar const* const pluginVersion,
255 AsciiChar const* const pluginNamespace = "") noexcept = 0;
256
271 virtual bool deregisterCreator(IPluginCreatorInterface const& creator) noexcept = 0;
272
285 virtual IPluginResource* acquirePluginResource(AsciiChar const* key, IPluginResource* resource) noexcept = 0;
286
300 virtual int32_t releasePluginResource(AsciiChar const* key) noexcept = 0;
301};
302
303} // namespace nvinfer1
304
305#endif /* NV_INFER_RUNTIME_COMMON_H */
#define TRT_DEPRECATED
Definition: NvInferRuntimeBase.h:45
Single registration point for all plugins in an application. It is used to find plugin implementation...
Definition: NvInferRuntimeCommon.h:56
virtual IErrorRecorder * getErrorRecorder() const noexcept=0
Get the ErrorRecorder assigned to this interface.
virtual PluginLibraryHandle loadLibrary(AsciiChar const *pluginPath) noexcept=0
Load and register a shared library of plugins.
void * PluginLibraryHandle
Pointer for plugin library handle.
Definition: NvInferRuntimeCommon.h:61
virtual TRT_DEPRECATED bool registerCreator(IPluginCreator &creator, AsciiChar const *const pluginNamespace) noexcept=0
Register a plugin creator implementing IPluginCreator. Returns false if any plugin creator with the s...
virtual bool isParentSearchEnabled() const =0
Return whether the parent registry will be searched if a plugin is not found in this registry default...
virtual IPluginCreatorInterface *const * getAllCreators(int32_t *const numCreators) const noexcept=0
Return all registered plugin creators. Returns nullptr if none found.
virtual TRT_DEPRECATED IPluginCreator * getPluginCreator(AsciiChar const *const pluginName, AsciiChar const *const pluginVersion, AsciiChar const *const pluginNamespace="") noexcept=0
Return plugin creator based on plugin name, version, and namespace associated with plugin during netw...
virtual void setErrorRecorder(IErrorRecorder *const recorder) noexcept=0
Set the ErrorRecorder for this interface.
virtual int32_t releasePluginResource(AsciiChar const *key) noexcept=0
Decrement reference count for the resource with this key If reference count goes to zero after decrem...
virtual void setParentSearchEnabled(bool const enabled)=0
Set whether the parent registry will be searched if a plugin is not found in this registry.
virtual void deregisterLibrary(PluginLibraryHandle handle) noexcept=0
Deregister plugins associated with a library. Any resources acquired when the library was loaded will...
virtual IPluginResource * acquirePluginResource(AsciiChar const *key, IPluginResource *resource) noexcept=0
Get a plugin resource.
virtual TRT_DEPRECATED bool deregisterCreator(IPluginCreator const &creator) noexcept=0
Deregister a previously registered plugin creator implementing IPluginCreator.
virtual IPluginCreatorInterface * getCreator(AsciiChar const *const pluginName, AsciiChar const *const pluginVersion, AsciiChar const *const pluginNamespace="") noexcept=0
Return a registered plugin creator based on plugin name, version, and namespace associated with the p...
virtual TRT_DEPRECATED IPluginCreator *const * getPluginCreatorList(int32_t *const numCreators) const noexcept=0
Return all the registered plugin creators and the number of registered plugin creators....
Definition: NvInferRuntimeBase.h:856
Definition: NvInferRuntimePlugin.h:946
Definition: NvInferRuntimePlugin.h:933
Definition: NvInferRuntimeBase.h:1162
The TensorRT API version 1 namespace.
char_t AsciiChar
Definition: NvInferRuntimeBase.h:107

  Copyright © 2024 NVIDIA Corporation
  Privacy Policy | Manage My Privacy | Do Not Sell or Share My Data | Terms of Service | Accessibility | Corporate Policies | Product Security | Contact