From 92309187b3e736ddb5031a7e63eed42a89ed6f2c Mon Sep 17 00:00:00 2001 From: Sohaib Iftikhar Date: Tue, 2 May 2023 10:12:39 +0200 Subject: [PATCH] Allow compilation using clang when using cuda. (#15672) ### Description Currently compiling with clang + cuda leads to: ``` /code/build/_deps/onnxruntime-src/include/onnxruntime/core/common/make_string.h:33:6: error: call to function 'operator<<' that is neither visible in the template definition nor found by argument-dependent lookup ss << t; ^ /code/build/_deps/onnxruntime-src/include/onnxruntime/core/common/make_string.h:39:3: note: in instantiation of function template specialization 'onnxruntime::detail::MakeStringImpl>' requested here MakeStringImpl(ss, args...); ^ /code/build/_deps/onnxruntime-src/include/onnxruntime/core/common/make_string.h:46:3: note: in instantiation of function template specialization 'onnxruntime::detail::MakeStringImpl>' requested here MakeStringImpl(ss, args...); ^ /code/build/_deps/onnxruntime-src/include/onnxruntime/core/common/make_string.h:93:18: note: in instantiation of function template specialization 'onnxruntime::detail::MakeStringImpl>' requested here return detail::MakeStringImpl(detail::if_char_array_make_ptr_t(args)...); ^ /code/build/_deps/onnxruntime-src/onnxruntime/contrib_ops/cuda/quantization/qordered_ops/qordered_qdq.cc:73:12: note: in instantiation of function template specialization 'onnxruntime::MakeString>' requested here return ORT_MAKE_STATUS(ONNXRUNTIME, INVALID_ARGUMENT, "Shape not meet clean tile requirement!", dims); ^ /code/build/_deps/onnxruntime-src/include/onnxruntime/core/common/common.h:188:48: note: expanded from macro 'ORT_MAKE_STATUS' ::onnxruntime::MakeString(__VA_ARGS__)) ^ /code/build/_deps/onnxruntime-src/include/onnxruntime/core/framework/tensor_shape.h:201:15: note: 'operator<<' should be declared prior to the call site or in namespace 'gsl' std::ostream& operator<<(std::ostream& out, const TensorShape& shape); ^ 1 error generated. ``` --- .../contrib_ops/cuda/quantization/qordered_ops/qordered_qdq.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/onnxruntime/contrib_ops/cuda/quantization/qordered_ops/qordered_qdq.cc b/onnxruntime/contrib_ops/cuda/quantization/qordered_ops/qordered_qdq.cc index 5bd1fe4f45..3684bb5df1 100644 --- a/onnxruntime/contrib_ops/cuda/quantization/qordered_ops/qordered_qdq.cc +++ b/onnxruntime/contrib_ops/cuda/quantization/qordered_ops/qordered_qdq.cc @@ -1,5 +1,6 @@ +#include "core/framework/tensor_shape.h" #include "contrib_ops/cuda/quantization/qordered_ops/qordered_qdq.h" #include "contrib_ops/cuda/quantization/qordered_ops/qordered_qdq_impl.h" #include "gsl/gsl"