Specific DML version latest and fix compile error

This commit is contained in:
Jeff 2020-04-14 16:38:23 -07:00
parent 67443c0e17
commit 1950391570
2 changed files with 5 additions and 4 deletions

View file

@ -431,6 +431,8 @@ if (onnxruntime_USE_DML)
add_dependencies(onnxruntime_providers_dml ${onnxruntime_EXTERNAL_DEPENDENCIES})
target_include_directories(onnxruntime_providers_dml PRIVATE ${ONNXRUNTIME_ROOT} ${ONNXRUNTIME_ROOT}/../cmake/external/wil/include)
add_definitions(-DDML_TARGET_VERSION_USE_LATEST=1)
if (NOT onnxruntime_USE_CUSTOM_DIRECTML)
if(NOT onnxruntime_target_platform STREQUAL "x86" AND NOT onnxruntime_target_platform STREQUAL "x64")
message(FATAL_ERROR "Target platform ${onnxruntime_target_platform} is not supported by DML")

View file

@ -446,11 +446,10 @@ public:
float maxValue = FLT_MAX;
if (kernelInfo.IsInputValid(1))
{
minValue = ReadScalarTensorCastToFloat64(kernelInfo.GetConstantInputTensor(1));
minValue = static_cast<float>(ReadScalarTensorCastToFloat64(kernelInfo.GetConstantInputTensor(1)));
}
if (kernelInfo.IsInputValid(2))
{
maxValue = ReadScalarTensorCastToFloat64(kernelInfo.GetConstantInputTensor(2));
if (kernelInfo.IsInputValid(2)) {
maxValue = static_cast<float>(ReadScalarTensorCastToFloat64(kernelInfo.GetConstantInputTensor(2)));
}
DML_ELEMENT_WISE_CLIP_OPERATOR_DESC opDesc = {};