Skip to content

[TRT-EP] Ignore deprecated warnings for TRT APIs #25105

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kevinch-nv
Copy link
Contributor

Description

In TensorRT 10.12, weakly-typed network and related APIs have been marked deprecated. Ignore these deprecated API warnings for the Windows build.

@jywu-msft jywu-msft requested review from chilo-ms and Copilot June 18, 2025 17:51
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds MSVC-specific pragmas to suppress deprecation warnings (C4996) for TensorRT’s weakly-typed APIs on Windows builds.

  • Wraps key code sections with #pragma warning(push/disable:4996) and #pragma warning(pop) under _MSC_VER
  • Targets layer normalization fallback, precision flag setting, and INT8 configuration blocks
Comments suppressed due to low confidence (1)

onnxruntime/core/providers/tensorrt/tensorrt_execution_provider.cc:2972

  • [nitpick] Add a brief comment here (and at other pragma blocks) to explain which deprecated TensorRT APIs trigger warning C4996, so future maintainers understand the rationale for silencing it.
#if defined(_MSC_VER)

Comment on lines +2972 to +2974
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable : 4996)
Copy link
Preview

Copilot AI Jun 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider defining and using a helper macro (e.g., ORT_DISABLE_DEPRECATION_WARNINGS_MSVC) to wrap the push/disable:4996/pop sequence and avoid repeating identical pragmas throughout the file.

Suggested change
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable : 4996)
ORT_DISABLE_DEPRECATION_WARNINGS_MSVC

Copilot uses AI. Check for mistakes.

Signed-off-by: Kevin Chen <kevinch@nvidia.com>
@chilo-ms
Copy link
Contributor

/azp run Linux QNN CI Pipeline,Win_TRT_Minimal_CUDA_Test_CI,Windows ARM64 QNN CI Pipeline,Windows GPU Doc Gen CI Pipeline,Windows x64 QNN CI Pipeline

Copy link

Azure Pipelines successfully started running 5 pipeline(s).

@chilo-ms
Copy link
Contributor

please help address format issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants