[DML EP] Fix issue with --dml_path build option (#15972)

### Description
DML_PACKAGE_DIR cmake variable is not getting set properly when dml_path
build options is used.


### Motivation and Context
- Why is this change required? What problem does it solve?
It is required for DML Perf dashboard.
<!--- If it fixes an open issue, please link to the issue here. -->
This commit is contained in:
Sumit Agarwal 2023-05-24 19:20:40 -05:00 committed by GitHub
parent 63c9973b7a
commit 70d2dc8209
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View file

@ -72,12 +72,12 @@ else()
if (dml_EXTERNAL_PROJECT)
set(dml_preset_config $<IF:$<CONFIG:Debug>,debug,release>)
set(dml_preset_name ${onnxruntime_target_platform}-win-redist-${dml_preset_config})
target_compile_definitions(DirectML INTERFACE DML_TARGET_VERSION_USE_LATEST=1)
include(ExternalProject)
ExternalProject_Add(
directml_repo
GIT_REPOSITORY https://dev.azure.com/microsoft/WindowsAI/_git/DirectML
GIT_TAG 2290bd6495fdf8c35822816213516d13f3742cc9
GIT_TAG d460f0f46967bea878786f1bed69487692c779bf
GIT_SHALLOW OFF # not allowed when GIT_TAG is a commit SHA, which is preferred (it's stable, unlike branches)
GIT_PROGRESS ON
BUILD_IN_SOURCE ON
@ -95,6 +95,7 @@ else()
add_dependencies(DirectML directml_repo-install)
include_directories(BEFORE ${directml_install_path}/include)
else()
include_directories(${dml_INCLUDE_DIR})
include_directories(BEFORE ${dml_INCLUDE_DIR})
set(DML_PACKAGE_DIR ${dml_INCLUDE_DIR}/..)
endif()
endif()

View file

@ -906,7 +906,7 @@ if (onnxruntime_USE_TVM)
endif()
if (onnxruntime_USE_DML)
if (NOT dml_EXTERNAL_PROJECT)
if (NOT onnxruntime_USE_CUSTOM_DIRECTML)
set(dml_shared_lib_path ${DML_PACKAGE_DIR}/bin/${onnxruntime_target_platform}-win/${DML_SHARED_LIB})
else()
set(dml_shared_lib_path ${DML_PACKAGE_DIR}/bin/${DML_SHARED_LIB})