From a22dc65a81387f30979fcb5b421be2d4c36116f8 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Wed, 12 Apr 2023 22:16:59 -0700 Subject: [PATCH] Add a missing header to cuda_common.h (#15489) ### Description The following three lines are needed before including some cutlass header files, because cutlass uses "and"/"or" keywords. Generally it should not be a problem without this header, but nvcc is not strictly compliant to C++ standard. ```c++ #ifdef __cplusplus #include #endif ``` We didn't hit this problem because the above code exists in absl. We always include absl headers first. However, ABSL recently deleted them! https://github.com/abseil/abseil-cpp/pull/1246 The cutlass dependency was introduced in #14343 , after we had abseil. --- onnxruntime/core/providers/cuda/cuda_common.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/onnxruntime/core/providers/cuda/cuda_common.h b/onnxruntime/core/providers/cuda/cuda_common.h index 1176ea2713..3dbe61b827 100644 --- a/onnxruntime/core/providers/cuda/cuda_common.h +++ b/onnxruntime/core/providers/cuda/cuda_common.h @@ -3,6 +3,12 @@ #pragma once +// The following three lines were copied from ABSL +// cutlass needs them, because cutlass uses "and"/"or" keywords +#ifdef __cplusplus +#include +#endif + #include "core/providers/shared_library/provider_api.h" #include "core/common/status.h" #include "core/framework/float16.h"