TensorRT 10.0.1
NvInferConsistency.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_CONSISTENCY_H
19#define NV_INFER_CONSISTENCY_H
20
21#include "NvInferConsistencyImpl.h"
22#define NV_INFER_INTERNAL_INCLUDE_RUNTIME_BASE 1
23#include "NvInferRuntimeBase.h"
24#undef NV_INFER_INTERNAL_INCLUDE_RUNTIME_BASE
26
30
31namespace nvinfer1
32{
33
34namespace consistency
35{
36
45{
46public:
53 bool validate() const noexcept
54 {
55 return mImpl->validate();
56 }
57
61 virtual ~IConsistencyChecker() = default;
62
63protected:
64 apiv::VConsistencyChecker* mImpl;
70};
71
84{
85public:
100 virtual bool validate(char const* name, void const* serialData, size_t serialLength, PluginTensorDesc const* in,
101 size_t nbInputs, PluginTensorDesc const* out, size_t nbOutputs, int64_t workspaceSize) const noexcept = 0;
102
103 IPluginChecker() = default;
104 virtual ~IPluginChecker() override = default;
105
106protected:
111};
112
113} // namespace consistency
114
115} // namespace nvinfer1
116
117extern "C" TENSORRTAPI void* createConsistencyChecker_INTERNAL(void* logger, void const* blob, size_t size,
118 int32_t version);
119
120namespace nvinfer1
121{
122
123namespace consistency
124{
132namespace // anonymous
133{
134
135inline IConsistencyChecker* createConsistencyChecker(ILogger& logger, void const* blob, size_t size)
136{
137 return static_cast<IConsistencyChecker*>(
139}
140
141} // namespace
142
143} // namespace consistency
144
145} // namespace nvinfer1
146
147#endif // NV_INFER_CONSISTENCY_H
void * createConsistencyChecker_INTERNAL(void *logger, void const *blob, size_t size, int32_t version)
Internal C entry point for creating IConsistencyChecker.
#define TENSORRTAPI
Definition: NvInferRuntimeBase.h:59
#define NV_TENSORRT_VERSION
Definition: NvInferRuntimeBase.h:93
Application-implemented logging interface for the builder, refitter and runtime.
Definition: NvInferRuntimeBase.h:682
Validates a serialized engine blob.
Definition: NvInferConsistency.h:45
IConsistencyChecker(IConsistencyChecker &&other)=delete
virtual ~IConsistencyChecker()=default
De-allocates any internally allocated memory.
IConsistencyChecker & operator=(IConsistencyChecker const &other)=delete
IConsistencyChecker(IConsistencyChecker const &other)=delete
apiv::VConsistencyChecker * mImpl
Definition: NvInferConsistency.h:64
bool validate() const noexcept
Check that a blob that was input to createConsistencyChecker method represents a valid engine.
Definition: NvInferConsistency.h:53
IConsistencyChecker & operator=(IConsistencyChecker &&other)=delete
Consistency Checker plugin class for user implemented Plugins.
Definition: NvInferConsistency.h:84
IPluginChecker & operator=(IPluginChecker const &) &=default
virtual bool validate(char const *name, void const *serialData, size_t serialLength, PluginTensorDesc const *in, size_t nbInputs, PluginTensorDesc const *out, size_t nbOutputs, int64_t workspaceSize) const noexcept=0
Called during IConsistencyChecker::validate. Allows users to provide custom validation of serialized ...
IPluginChecker(IPluginChecker &&)=default
IPluginChecker(IPluginChecker const &)=default
virtual ~IPluginChecker() override=default
IPluginChecker & operator=(IPluginChecker &&) &=default
Definition: NvInferRuntimePlugin.h:946
IConsistencyChecker * createConsistencyChecker(ILogger &logger, void const *blob, size_t size)
Definition: NvInferConsistency.h:135
The TensorRT API version 1 namespace.
Fields that a plugin might see for an input or output.
Definition: NvInferRuntimePlugin.h:67

  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