From 9b75be3d3e7fc19ae1abfc9e64737b2a8863ab21 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Mon, 28 Jun 2021 07:58:02 -0700 Subject: [PATCH] Fix a warning in pool.cc (#8168) The warning is: "Potential comparison of a constant with another constant. at D:\a_work\1\s\onnxruntime\core\providers\cuda\nn\pool.cc@167,21". It was found by VS static code analyzer in our CUDA EP. --- onnxruntime/core/providers/cuda/nn/pool.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onnxruntime/core/providers/cuda/nn/pool.cc b/onnxruntime/core/providers/cuda/nn/pool.cc index b9ee3975e1..70a7de80ec 100644 --- a/onnxruntime/core/providers/cuda/nn/pool.cc +++ b/onnxruntime/core/providers/cuda/nn/pool.cc @@ -164,7 +164,7 @@ Status Pool::ComputeInternal(OpKernelContext* context) const { } cudnnPoolingMode_t mode = CUDNN_POOLING_MAX; - if (PoolType::type == onnxruntime::PoolType::kAveragePool) { + if constexpr (PoolType::type == onnxruntime::PoolType::kAveragePool) { mode = pool_attrs_.count_include_pad ? CUDNN_POOLING_AVERAGE_COUNT_INCLUDE_PADDING : CUDNN_POOLING_AVERAGE_COUNT_EXCLUDE_PADDING; }