TensorRT 10.0.0
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#include "NvInferRuntimeBase.h"
33
34namespace nvinfer1
35{
54{
55public:
59 using PluginLibraryHandle = void*;
60
72 virtual bool registerCreator(IPluginCreator& creator, AsciiChar const* const pluginNamespace) noexcept = 0;
73
85 virtual IPluginCreator* const* getPluginCreatorList(int32_t* const numCreators) const noexcept = 0;
86
101 virtual IPluginCreator* getPluginCreator(AsciiChar const* const pluginName, AsciiChar const* const pluginVersion,
102 AsciiChar const* const pluginNamespace = "") noexcept = 0;
103
104 // @cond SuppressDoxyWarnings
105 IPluginRegistry() = default;
106 IPluginRegistry(IPluginRegistry const&) = delete;
108 IPluginRegistry& operator=(IPluginRegistry const&) & = delete;
109 IPluginRegistry& operator=(IPluginRegistry&&) & = delete;
110 // @endcond
111
112protected:
113 virtual ~IPluginRegistry() noexcept = default;
114
115public:
132 virtual void setErrorRecorder(IErrorRecorder* const recorder) noexcept = 0;
133
149 virtual IErrorRecorder* getErrorRecorder() const noexcept = 0;
150
165 virtual bool deregisterCreator(IPluginCreator const& creator) noexcept = 0;
166
175 virtual bool isParentSearchEnabled() const = 0;
176
184 virtual void setParentSearchEnabled(bool const enabled) = 0;
185
194 virtual PluginLibraryHandle loadLibrary(AsciiChar const* pluginPath) noexcept = 0;
195
202 virtual void deregisterLibrary(PluginLibraryHandle handle) noexcept = 0;
203
215 virtual bool registerCreator(IPluginCreatorInterface& creator, AsciiChar const* const pluginNamespace) noexcept = 0;
216
227 virtual IPluginCreatorInterface* const* getAllCreators(int32_t* const numCreators) const noexcept = 0;
228
240 virtual IPluginCreatorInterface* getCreator(AsciiChar const* const pluginName, AsciiChar const* const pluginVersion,
241 AsciiChar const* const pluginNamespace = "") noexcept = 0;
242
257 virtual bool deregisterCreator(IPluginCreatorInterface const& creator) noexcept = 0;
258
271 virtual IPluginResource* acquirePluginResource(AsciiChar const* key, IPluginResource* resource) noexcept = 0;
272
286 virtual int32_t releasePluginResource(AsciiChar const* key) noexcept = 0;
287};
288
289} // namespace nvinfer1
290
291#endif /* NV_INFER_RUNTIME_COMMON_H */
Single registration point for all plugins in an application. It is used to find plugin implementation...
Definition: NvInferRuntimeCommon.h:54
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:59
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 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 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 IPluginCreator *const * getPluginCreatorList(int32_t *const numCreators) const noexcept=0
Return all the registered plugin creators and the number of registered plugin creators....
virtual bool deregisterCreator(IPluginCreator const &creator) noexcept=0
Deregister a previously registered plugin creator implementing IPluginCreator.
virtual IPluginResource * acquirePluginResource(AsciiChar const *key, IPluginResource *resource) noexcept=0
Get a plugin resource.
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...
Definition: NvInferRuntimeBase.h:850
Definition: NvInferRuntimePlugin.h:942
Definition: NvInferRuntimePlugin.h:929
Definition: NvInferRuntimeBase.h:1154
The TensorRT API version 1 namespace.
char_t AsciiChar
Definition: NvInferRuntimeBase.h:101

  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