@@ -2905,20 +2905,27 @@ Status TensorrtExecutionProvider::CreateNodeComputeInfoFromGraph(const GraphView
2905
2905
trt_profiles.push_back (trt_builder->createOptimizationProfile ());
2906
2906
}
2907
2907
2908
+ #if defined(_MSC_VER)
2909
+ #pragma warning(push)
2910
+ #pragma warning(disable : 4996)
2911
+ #endif
2908
2912
// Check platform availability for low precision
2909
2913
if (fp16_enable_) {
2910
2914
if (!trt_builder->platformHasFastFp16 ()) {
2911
2915
fp16_enable_ = false ;
2912
2916
LOGS_DEFAULT (WARNING) << " [TensorRT EP] ORT_TENSORRT_FP16_ENABLE is set, but platform doesn't support fast native fp16" ;
2913
2917
}
2914
2918
}
2915
-
2919
+
2916
2920
if (int8_enable_) {
2917
2921
if (!trt_builder->platformHasFastInt8 ()) {
2918
2922
int8_enable_ = false ;
2919
2923
LOGS_DEFAULT (WARNING) << " [TensorRT EP] ORT_TENSORRT_INT8_ENABLE is set, but platform doesn't support fast native int8" ;
2920
2924
}
2921
2925
}
2926
+ #if defined(_MSC_VER)
2927
+ #pragma warning(pop)
2928
+ #endif
2922
2929
2923
2930
// Load INT8 calibration table
2924
2931
std::unordered_map<std::string, float > dynamic_range_map;
@@ -3130,12 +3137,12 @@ Status TensorrtExecutionProvider::CreateNodeComputeInfoFromGraph(const GraphView
3130
3137
" TensorRT EP could not deserialize engine from encrypted cache: " + encrypted_engine_cache_path);
3131
3138
}
3132
3139
} else {
3133
- // Set INT8 per tensor dynamic range
3134
- if (int8_enable_ && trt_builder->platformHasFastInt8 () && int8_calibration_cache_available_) {
3135
3140
#if defined(_MSC_VER)
3136
3141
#pragma warning(push)
3137
3142
#pragma warning(disable : 4996)
3138
3143
#endif
3144
+ // Set INT8 per tensor dynamic range
3145
+ if (int8_enable_ && trt_builder->platformHasFastInt8 () && int8_calibration_cache_available_) {
3139
3146
trt_config->setInt8Calibrator (nullptr );
3140
3147
#if defined(_MSC_VER)
3141
3148
#pragma warning(pop)
@@ -3542,13 +3549,12 @@ Status TensorrtExecutionProvider::CreateNodeComputeInfoFromGraph(const GraphView
3542
3549
for (auto trt_profile : trt_profiles) {
3543
3550
trt_config->addOptimizationProfile (trt_profile);
3544
3551
}
3545
-
3546
- // Set INT8 Per Tensor Dynamic range
3547
- if (trt_state->int8_enable && trt_builder->platformHasFastInt8 () && trt_state->int8_calibration_cache_available ) {
3548
3552
#if defined(_MSC_VER)
3549
3553
#pragma warning(push)
3550
3554
#pragma warning(disable : 4996)
3551
3555
#endif
3556
+ // Set INT8 Per Tensor Dynamic range
3557
+ if (trt_state->int8_enable && trt_builder->platformHasFastInt8 () && trt_state->int8_calibration_cache_available ) {
3552
3558
trt_config->setInt8Calibrator (nullptr );
3553
3559
#if defined(_MSC_VER)
3554
3560
#pragma warning(pop)
0 commit comments