diff --git a/onnxruntime/test/providers/cpu/model_tests.cc b/onnxruntime/test/providers/cpu/model_tests.cc index 23867f2c7c..a5015c18ce 100644 --- a/onnxruntime/test/providers/cpu/model_tests.cc +++ b/onnxruntime/test/providers/cpu/model_tests.cc @@ -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> 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.