Enable xnnpack ep works in current windows xnn ci (#21951)

### Description
The EP wasn't added in session option in onnxruntime_test_all.



### Motivation and Context
After this PR
onnxruntime_test_all --gtest_filter=\*xnnpack\*maxpool\* can step into
8c5336449d/onnxruntime/core/providers/xnnpack/nn/max_pool.cc (L209)

---------

Co-authored-by: Yi Zhang <your@email.com>
This commit is contained in:
Yi Zhang 2024-09-04 01:02:00 +08:00 committed by GitHub
parent 5c74539ab7
commit 4962252c8f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -261,6 +261,11 @@ TEST_P(ModelTest, Run) {
else if (provider_name == "armnn") {
ASSERT_ORT_STATUS_OK(OrtSessionOptionsAppendExecutionProvider_ArmNN(ortso));
}
#endif
#ifdef USE_XNNPACK
else if (provider_name == "xnnpack") {
ortso.AppendExecutionProvider("XNNPACK");
}
#endif
OrtSession* ort_session;
OrtStatus* ort_st = OrtApis::CreateSession(*ort_env, model_path.c_str(), ortso, &ort_session);
@ -425,6 +430,9 @@ static constexpr ORT_STRING_VIEW provider_name_acl = ORT_TSTR("acl");
#ifdef USE_ARMNN
static constexpr ORT_STRING_VIEW provider_name_armnn = ORT_TSTR("armnn");
#endif
#ifdef USE_XNNPACK
static constexpr ORT_STRING_VIEW provider_name_xnnpack = ORT_TSTR("xnnpack");
#endif
static constexpr ORT_STRING_VIEW provider_name_dml = ORT_TSTR("dml");
::std::vector<::std::basic_string<ORTCHAR_T>> GetParameterStrings() {
@ -472,6 +480,9 @@ static constexpr ORT_STRING_VIEW provider_name_dml = ORT_TSTR("dml");
#ifdef USE_DML
provider_names[provider_name_dml] = {opset7, opset8, opset9, opset10, opset11, opset12, opset13, opset14, opset15, opset16, opset17, opset18};
#endif
#ifdef USE_XNNPACK
provider_names[provider_name_xnnpack] = {opset12, opset13, opset14, opset15, opset16, opset17, opset18};
#endif
#if defined(ENABLE_TRAINING_CORE) && defined(USE_CUDA)
// Removing the CPU EP tests from CUDA build for training as these tests are already run in the CPU pipelines.