diff --git a/onnxruntime/contrib_ops/cuda/bert/fast_gelu.cc b/onnxruntime/contrib_ops/cuda/bert/fast_gelu.cc index fff6300d42f08..e8974a29476b6 100644 --- a/onnxruntime/contrib_ops/cuda/bert/fast_gelu.cc +++ b/onnxruntime/contrib_ops/cuda/bert/fast_gelu.cc @@ -8,7 +8,8 @@ #include "contrib_ops/cpu/bert/bias_gelu_helper.h" #ifdef USE_ROCM #include "contrib_ops/rocm/bert/elementwise.h" -#else +#endif +#ifdef USE_CUDA #include "contrib_ops/cuda/bert/transformer_common.h" #endif @@ -62,7 +63,8 @@ Status FastGelu::ComputeInternal(OpKernelContext* context) const { reinterpret_cast(input->Data()), static_cast(input_length), (nullptr != bias) ? reinterpret_cast(bias->Data()) : nullptr, static_cast(bias_length), reinterpret_cast(output->MutableData())); -#else +#endif +#ifdef USE_CUDA return LaunchFastGeluKernel(GetDeviceProp(), Stream(context), static_cast(input_length),