Skip to content

Commit 09ad025

Browse files
committed
Remove deprecation warnings for TensorRT 10.5 builds
1 parent c415991 commit 09ad025

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

onnxruntime/core/providers/tensorrt/tensorrt_execution_provider.cc

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2938,14 +2938,28 @@ Status TensorrtExecutionProvider::CreateNodeComputeInfoFromGraph(const GraphView
29382938

29392939
// Check platform availability for low precision
29402940
if (fp16_enable_) {
2941+
#if defined(_MSC_VER)
2942+
#pragma warning(push)
2943+
#pragma warning(disable : 4996)
2944+
#endif
29412945
if (!trt_builder->platformHasFastFp16()) {
2946+
#if defined(_MSC_VER)
2947+
#pragma warning(pop)
2948+
#endif
29422949
fp16_enable_ = false;
29432950
LOGS_DEFAULT(WARNING) << "[TensorRT EP] ORT_TENSORRT_FP16_ENABLE is set, but platform doesn't support fast native fp16";
29442951
}
29452952
}
29462953

29472954
if (int8_enable_) {
2955+
#if defined(_MSC_VER)
2956+
#pragma warning(push)
2957+
#pragma warning(disable : 4996)
2958+
#endif
29482959
if (!trt_builder->platformHasFastInt8()) {
2960+
#if defined(_MSC_VER)
2961+
#pragma warning(pop)
2962+
#endif
29492963
int8_enable_ = false;
29502964
LOGS_DEFAULT(WARNING) << "[TensorRT EP] ORT_TENSORRT_INT8_ENABLE is set, but platform doesn't support fast native int8";
29512965
}
@@ -3161,12 +3175,12 @@ Status TensorrtExecutionProvider::CreateNodeComputeInfoFromGraph(const GraphView
31613175
"TensorRT EP could not deserialize engine from encrypted cache: " + encrypted_engine_cache_path);
31623176
}
31633177
} else {
3164-
// Set INT8 per tensor dynamic range
3165-
if (int8_enable_ && trt_builder->platformHasFastInt8() && int8_calibration_cache_available_) {
31663178
#if defined(_MSC_VER)
31673179
#pragma warning(push)
31683180
#pragma warning(disable : 4996)
31693181
#endif
3182+
// Set INT8 per tensor dynamic range
3183+
if (int8_enable_ && trt_builder->platformHasFastInt8() && int8_calibration_cache_available_) {
31703184
trt_config->setInt8Calibrator(nullptr);
31713185
#if defined(_MSC_VER)
31723186
#pragma warning(pop)
@@ -3573,13 +3587,12 @@ Status TensorrtExecutionProvider::CreateNodeComputeInfoFromGraph(const GraphView
35733587
for (auto trt_profile : trt_profiles) {
35743588
trt_config->addOptimizationProfile(trt_profile);
35753589
}
3576-
3577-
// Set INT8 Per Tensor Dynamic range
3578-
if (trt_state->int8_enable && trt_builder->platformHasFastInt8() && trt_state->int8_calibration_cache_available) {
35793590
#if defined(_MSC_VER)
35803591
#pragma warning(push)
35813592
#pragma warning(disable : 4996)
35823593
#endif
3594+
// Set INT8 Per Tensor Dynamic range
3595+
if (trt_state->int8_enable && trt_builder->platformHasFastInt8() && trt_state->int8_calibration_cache_available) {
35833596
trt_config->setInt8Calibrator(nullptr);
35843597
#if defined(_MSC_VER)
35853598
#pragma warning(pop)

0 commit comments

Comments
 (0)