Skip to content

Commit

Permalink
fix(session): use directml conditonally
Browse files Browse the repository at this point in the history
  • Loading branch information
thewh1teagle committed Jul 20, 2024
1 parent 3e0efaa commit 17621db
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sherpa-onnx/csrc/session.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 17621db

Please sign in to comment.