TensorRT 11.3.0
NvInferConsistency.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: Copyright (c) 1993-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 NV_INFER_CONSISTENCY_CHECKER_H
19#define NV_INFER_CONSISTENCY_CHECKER_H
20
21// Indicates that IPluginChecker::validate() uses pointer/count tensor arguments.
22#define NV_INFER_PLUGIN_CHECKER_POINTER_COUNT_API 1
23
24#include "NvInferForwardDecl.h"
25#include "NvInferPluginBase.h"
26#include "NvInferSafeRuntime.h"
27#include <cstdint>
28
32
33namespace nvinfer2
34{
35namespace safe
36{
37// Forward declaration
38class ISafeRecorder;
39
40namespace consistency
41{
42
51{
52public:
58 virtual bool validate() noexcept = 0;
62 virtual ~IConsistencyChecker() = default;
63
64protected:
85 IConsistencyChecker& operator=(IConsistencyChecker const& other) & = delete;
97 IConsistencyChecker& operator=(IConsistencyChecker&& other) & = delete;
98};
99
109{
110public:
120 virtual bool validate(TensorDescriptor const* inputs, int32_t nbInputs, TensorDescriptor const* outputs,
121 int32_t nbOutputs, PluginFieldCollection* fc) noexcept
122 = 0;
123
127 virtual ~IPluginChecker() = default;
128
129protected:
138 IPluginChecker() = default;
144 IPluginChecker(IPluginChecker const& other) = delete;
150 IPluginChecker& operator=(IPluginChecker const& other) & = delete;
163};
164
178 nvinfer2::safe::ISafeRecorder& recorder, void const* blob, int64_t size,
179 char const* const* pluginBuildLibs = nullptr, int64_t nbPluginBuildLibs = 0) noexcept;
180
181} // namespace consistency
182
183} // namespace safe
184} // namespace nvinfer2
185
186#endif // NV_INFER_CONSISTENCY_CHECKER_H
Interface for extended recorder which allows error, warn, debug, or info messages to be recorded.
Definition: NvInferSafeRecorder.h:82
Validates a TRT engine (Serialized binary blob)
Definition: NvInferConsistency.h:51
virtual bool validate() noexcept=0
Check that a blob that was input to createConsistencyChecker method represents a valid TRT engine.
Interface for validating a plugin used in a TensorRT engine.
Definition: NvInferConsistency.h:109
IPluginChecker & operator=(IPluginChecker const &other) &=delete
Deleted copy assignment operator to maintain non-copyability.
IPluginChecker(IPluginChecker &&other)=delete
Deleted move constructor to maintain non-movability.
virtual bool validate(TensorDescriptor const *inputs, int32_t nbInputs, TensorDescriptor const *outputs, int32_t nbOutputs, PluginFieldCollection *fc) noexcept=0
Validate a plugin.
IPluginChecker & operator=(IPluginChecker &&other) &=delete
Deleted move assignment operator to maintain non-movability.
IPluginChecker(IPluginChecker const &other)=delete
Deleted copy constructor to maintain non-copyability.
IPluginChecker()=default
Default constructor for IPluginChecker.
virtual ~IPluginChecker()=default
De-allocates any internally allocated memory.
ErrorCode
Error codes that can be returned by TensorRT during execution.
Definition: NvInferRuntimeBase.h:317
nvinfer2::safe::ErrorCode createConsistencyChecker(IConsistencyChecker *&icc, nvinfer2::safe::ISafeRecorder &recorder, void const *blob, int64_t size, char const *const *pluginBuildLibs=nullptr, int64_t nbPluginBuildLibs=0) noexcept
Create an instance of an IConsistencyChecker class.
Definition: NvInferConsistency.h:34
Plugin field collection struct.
Definition: NvInferPluginBase.h:103
A simple record summarizing various properties of a network IO Tensor.
Definition: NvInferSafeRuntime.h:287

  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