Skip to content

Commit ceeaeaa

Browse files
authored
clean some IS_TRT_VERSION_GE(7200) (PaddlePaddle#75864)
1 parent 0481988 commit ceeaeaa

File tree

3 files changed

+0
-26
lines changed

3 files changed

+0
-26
lines changed

paddle/fluid/inference/tensorrt/plugin/anchor_generator_op_plugin.cu

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -549,11 +549,7 @@ bool AnchorGeneratorPluginDynamic::supportsFormatCombination(
549549
// anchor generator doesn't read input raw data, only need the shape info
550550
auto type = inOut[pos].type;
551551
auto format = inOut[pos].format;
552-
#if IS_TRT_VERSION_GE(7234)
553552
if (pos == 0) return true;
554-
#else
555-
if (pos == 0) return format == nvinfer1::TensorFormat::kLINEAR;
556-
#endif
557553
return (type == nvinfer1::DataType::kFLOAT &&
558554
format == nvinfer1::TensorFormat::kLINEAR);
559555
}
@@ -850,11 +846,7 @@ bool PIRAnchorGeneratorPluginDynamic::supportsFormatCombination(
850846
// anchor generator doesn't read input raw data, only need the shape info
851847
auto type = inOut[pos].type;
852848
auto format = inOut[pos].format;
853-
#if IS_TRT_VERSION_GE(7234)
854849
if (pos == 0) return true;
855-
#else
856-
if (pos == 0) return format == nvinfer1::TensorFormat::kLINEAR;
857-
#endif
858850
return (type == nvinfer1::DataType::kFLOAT &&
859851
format == nvinfer1::TensorFormat::kLINEAR);
860852
}

paddle/fluid/inference/tensorrt/plugin/custom_generic_plugin.cu

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,8 @@ void validate(const std::string& op_type,
3737
"float32", "float16", "int8", "int32"};
3838
std::unordered_set<std::string> supports_tensor_formats = {
3939
"LINEAR", "CHW32", "CHW2", "HWC8", "CHW4"};
40-
#if IS_TRT_VERSION_GE(7200)
4140
supports_tensor_formats.insert("DHWC8");
42-
#endif
43-
#if IS_TRT_VERSION_GE(8000)
4441
supports_tensor_formats.insert("HWC16");
45-
#endif
4642
// refer to
4743
// https://docs.nvidia.com/deeplearning/tensorrt/developer-guide/index.html#ipluginv2
4844
PADDLE_ENFORCE_GE(supports_dtypes.count(datatype),
@@ -76,12 +72,8 @@ void validate(const std::string& op_type,
7672
if (datatype == "float16") {
7773
std::unordered_set<std::string> supports_formats_tmp = {
7874
"LINEAR", "CHW2", "HWC8", "CHW4"};
79-
#if IS_TRT_VERSION_GE(7200)
8075
supports_formats_tmp.insert("DHWC8");
81-
#endif
82-
#if IS_TRT_VERSION_GE(8000)
8376
supports_formats_tmp.insert("HWC16");
84-
#endif
8577
PADDLE_ENFORCE_GE(supports_formats_tmp.count(tensor_format),
8678
0,
8779
common::errors::InvalidArgument(
@@ -180,14 +172,10 @@ nvinfer1::TensorFormat getTrtTensorFormat(std::string tensor_format) {
180172
return nvinfer1::TensorFormat::kHWC8;
181173
} else if (tensor_format == "CHW4") {
182174
return nvinfer1::TensorFormat::kCHW4;
183-
#if IS_TRT_VERSION_GE(7200)
184175
} else if (tensor_format == "DHWC8") {
185176
return nvinfer1::TensorFormat::kDHWC8;
186-
#endif
187-
#if IS_TRT_VERSION_GE(8000)
188177
} else if (tensor_format == "HWC16") {
189178
return nvinfer1::TensorFormat::kHWC16;
190-
#endif
191179
} else {
192180
PADDLE_THROW(common::errors::Unimplemented("Unsupported tensor format [%s]",
193181
tensor_format));

paddle/fluid/inference/tensorrt/plugin/elementwiseadd_transpose_op_plugin.cu

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,8 @@ bool ElementwiseAddTransposePluginDynamic::supportsFormatCombination(
8686
}
8787
// output 0
8888
if (pos == 2) {
89-
// 7.0.0.11 test_pcpvt_base_trt_fp16.py failed if support C8.
90-
// Only support linear format in lower versions of TRT
91-
#if IS_TRT_VERSION_GE(7100)
9289
bool support_format = in.format == nvinfer1::TensorFormat::kLINEAR ||
9390
in.format == nvinfer1::TensorFormat::kHWC8;
94-
#else
95-
bool support_format = in.format == nvinfer1::TensorFormat::kLINEAR;
96-
#endif
9791

9892
return (in.type == in_out[0].type) && (support_format);
9993
}

0 commit comments

Comments
 (0)