From 17621db12683be9b1692591d68c519c022461218 Mon Sep 17 00:00:00 2001 From: thewh1teagle <61390950+thewh1teagle@users.noreply.github.com> Date: Sun, 21 Jul 2024 01:45:44 +0300 Subject: [PATCH] fix(session): use directml conditonally --- sherpa-onnx/csrc/session.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sherpa-onnx/csrc/session.cc b/sherpa-onnx/csrc/session.cc index 24fa5973e..50d4abfe6 100644 --- a/sherpa-onnx/csrc/session.cc +++ b/sherpa-onnx/csrc/session.cc @@ -19,7 +19,7 @@ #include "nnapi_provider_factory.h" // NOLINT #endif -#if defined(_WIN32) && defined(SHERPA_ONNX_ENABLE_DIRECTML) +#if defined(_WIN32) && SHERPA_ONNX_ENABLE_DIRECTML == 1 #include "dml_provider_factory.h" // NOLINT #endif @@ -172,7 +172,7 @@ static Ort::SessionOptions GetSessionOptionsImpl( break; } case Provider::kDirectML: { -#if defined(_WIN32) +#if defined(_WIN32) && SHERPA_ONNX_ENABLE_DIRECTML == 1 sess_opts.DisableMemPattern(); sess_opts.SetExecutionMode(ORT_SEQUENTIAL); int32_t device_id = 0;