From cd85a6333a24be1cc2dc1dd76dad5bf5cad60d55 Mon Sep 17 00:00:00 2001 From: Wei-Sheng Chin Date: Thu, 10 Nov 2022 09:56:19 -0800 Subject: [PATCH] Add Missing Test File (#13607) I built a new test infra for CUDA EP in #13016 but forgot adding the test to onnxruntime_test_all. Here is the missing file. Now, the `TestAll` function is really called in CI. --- .../providers/cuda/cuda_provider_factory.cc | 2 +- .../test/providers/cuda/cuda_provider_test.cc | 24 +++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 onnxruntime/test/providers/cuda/cuda_provider_test.cc diff --git a/onnxruntime/core/providers/cuda/cuda_provider_factory.cc b/onnxruntime/core/providers/cuda/cuda_provider_factory.cc index 146b06d77f878..d2beaca52a554 100644 --- a/onnxruntime/core/providers/cuda/cuda_provider_factory.cc +++ b/onnxruntime/core/providers/cuda/cuda_provider_factory.cc @@ -200,7 +200,7 @@ struct ProviderInfo_CUDA_Impl : ProviderInfo_CUDA { // TODO(wechi): brings disabled tests in onnxruntime/test/providers/cuda/* // back alive here. - return false; + return true; } #endif } g_info; diff --git a/onnxruntime/test/providers/cuda/cuda_provider_test.cc b/onnxruntime/test/providers/cuda/cuda_provider_test.cc new file mode 100644 index 0000000000000..a0348d166b074 --- /dev/null +++ b/onnxruntime/test/providers/cuda/cuda_provider_test.cc @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#ifndef NDEBUG +#include "gtest/gtest.h" +#include "core/common/status.h" +#include "core/providers/cuda/cuda_provider_factory.h" +#include +namespace onnxruntime { + +ProviderInfo_CUDA& GetProviderInfo_CUDA(); + +namespace test { +namespace cuda { +TEST(CUDAEPTEST, ALL) { + onnxruntime::ProviderInfo_CUDA& ep = onnxruntime::GetProviderInfo_CUDA(); + ASSERT_TRUE(ep.TestAll()); +} + +} // namespace test +} // namespace cuda +} // namespace onnxruntime + +#endif