G0-VLA / g0plus_dockerfile /docker-assets /data /TensorRT-10.13.0.35 /samples /common /sampleEntrypoints.h
| /* | |
| * SPDX-FileCopyrightText: Copyright (c) 1993-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | |
| * SPDX-License-Identifier: Apache-2.0 | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software | |
| * distributed under the License is distributed on an "AS IS" BASIS, | |
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| * See the License for the specific language governing permissions and | |
| * limitations under the License. | |
| */ | |
| //! \file sampleEntrypoints.h | |
| //! | |
| //! Declares and conditionally defines entrypoints needed to create base TensorRT objects, depending | |
| //! on whether the given sample uses TRT at link time or dynamically. Since common code is built once | |
| //! and shared across all samples (both link-time and dynamic TRT), it does not define these entrypoints, | |
| //! so each sample must define them individually. | |
| //! | |
| //! Samples that use TRT at link time can define DEFINE_TRT_ENTRYPOINTS before including this header to | |
| //! pick up the definitions here. | |
| extern nvinfer1::IBuilder* createBuilder(); | |
| extern nvinfer1::IRuntime* createRuntime(); | |
| extern nvinfer1::IRefitter* createRefitter(nvinfer1::ICudaEngine& engine); | |
| extern nvonnxparser::IParser* createONNXParser(nvinfer1::INetworkDefinition& network); | |
| // Allow opting out of individual entrypoints that are unused by the sample | |
| nvinfer1::IBuilder* createBuilder() | |
| { | |
| return nvinfer1::createInferBuilder(sample::gLogger.getTRTLogger()); | |
| return {}; | |
| } | |
| nvinfer1::IRuntime* createRuntime() | |
| { | |
| return nvinfer1::createInferRuntime(sample::gLogger.getTRTLogger()); | |
| return {}; | |
| } | |
| nvinfer1::IRefitter* createRefitter(nvinfer1::ICudaEngine& engine) | |
| { | |
| return nvinfer1::createInferRefitter(engine, sample::gLogger.getTRTLogger()); | |
| return {}; | |
| } | |
| nvonnxparser::IParser* createONNXParser(nvinfer1::INetworkDefinition& network) | |
| { | |
| return nvonnxparser::createParser(network, sample::gLogger.getTRTLogger()); | |
| return {}; | |
| } | |