From ddea1e48df47a3467141e360b828a41426336cd4 Mon Sep 17 00:00:00 2001 From: cloudhan Date: Mon, 8 Aug 2022 10:32:01 +0800 Subject: [PATCH] Avoid false-positive dependent name lookup error by not depending on auto keyword (#12483) * Workaround false positive error produced by clang ROCm's hip clang complaints that "use 'template' keyword to treat 'Foo' as a dependent template name" where Foo is not a dependent template name. Instead, avoid the using of auto keyword fixes the error here. --- onnxruntime/core/providers/cuda/object_detection/roialign.cc | 2 +- onnxruntime/core/providers/cuda/tensor/upsample.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/onnxruntime/core/providers/cuda/object_detection/roialign.cc b/onnxruntime/core/providers/cuda/object_detection/roialign.cc index 554e347f99..64f318f141 100644 --- a/onnxruntime/core/providers/cuda/object_detection/roialign.cc +++ b/onnxruntime/core/providers/cuda/object_detection/roialign.cc @@ -40,7 +40,7 @@ Status RoiAlign::ComputeInternal(OpKernelContext* context) const { return status; } - auto& Y = *context->Output(0, {num_rois, x_dims[1], this->output_height_, this->output_width_}); + Tensor& Y = *context->Output(0, {num_rois, x_dims[1], this->output_height_, this->output_width_}); int64_t output_size = Y.Shape().Size(); if (output_size > 0) { diff --git a/onnxruntime/core/providers/cuda/tensor/upsample.cc b/onnxruntime/core/providers/cuda/tensor/upsample.cc index 706513fa31..d403314cdd 100644 --- a/onnxruntime/core/providers/cuda/tensor/upsample.cc +++ b/onnxruntime/core/providers/cuda/tensor/upsample.cc @@ -155,8 +155,8 @@ Status Upsample::ComputeInternal(OpKernelContext* context) const { return BaseCompute(context, roi, scales_, output_dims); } - const auto* scales = context->Input(scales_input_idx_); - const auto* sizes = context->Input(sizes_input_idx_); + const Tensor* scales = context->Input(scales_input_idx_); + const Tensor* sizes = context->Input(sizes_input_idx_); if (scales_cached_) { ORT_ENFORCE(sizes == nullptr, "Only one of scales or sizes must be provided as input.");