fix build failure with --cmake_extra_defines onnxruntime_DEBUG_NODE_INPUTS_OUTPUTS=1 (#8587)

* fix build failure with --cmake_extra_defines onnxruntime_DEBUG_NODE_INPUTS_OUTPUTS=1

* another compile error and add onnxruntime_USE_ROCM

* braces alignment

Co-authored-by: suffian khan <sukha@microsoft.com>
This commit is contained in:
Weixing Zhang 2021-08-03 09:02:49 -07:00 committed by GitHub
parent d14b08d09c
commit deab284e4c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View file

@ -1043,6 +1043,11 @@ if (NOT onnxruntime_ENABLE_TRAINING_TORCH_INTEROP)
DEPENDS ${all_dependencies}
)
if (onnxruntime_USE_ROCM)
target_include_directories(onnxruntime_test_debug_node_inputs_outputs PRIVATE ${onnxruntime_ROCM_HOME}/hipfft/include ${onnxruntime_ROCM_HOME}/include ${onnxruntime_ROCM_HOME}/hipcub/include ${onnxruntime_ROCM_HOME}/hiprand/include ${onnxruntime_ROCM_HOME}/rocrand/include)
target_include_directories(onnxruntime_test_debug_node_inputs_outputs PRIVATE ${ONNXRUNTIME_ROOT} ${CMAKE_CURRENT_BINARY_DIR}/amdgpu/onnxruntime)
endif(onnxruntime_USE_ROCM)
target_compile_definitions(onnxruntime_test_debug_node_inputs_outputs
PRIVATE DEBUG_NODE_INPUTS_OUTPUTS)
endif(onnxruntime_DEBUG_NODE_INPUTS_OUTPUTS)

View file

@ -851,9 +851,10 @@ std::vector<OrtValue> OpTester::ExecuteModel(
expected_shape.NumDimensions());
for (size_t d = 0; d < inferred_dims.size(); ++d) {
// check equal unless the input involved a symbolic dimension
if (inferred_dims[d] != -1)
if (inferred_dims[d] != -1) {
EXPECT_EQ(expected_shape[d], inferred_dims[d])
<< "Output idx = " << idx << " dim = " << d;
}
}
}
Check(expected_data, ort_value.Get<Tensor>(), provider_type);