From deab284e4cdd2ea57bd322ecf5ac7129b1c34e79 Mon Sep 17 00:00:00 2001 From: Weixing Zhang Date: Tue, 3 Aug 2021 09:02:49 -0700 Subject: [PATCH] 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 --- cmake/onnxruntime_unittests.cmake | 5 +++++ onnxruntime/test/providers/provider_test_utils.cc | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/cmake/onnxruntime_unittests.cmake b/cmake/onnxruntime_unittests.cmake index 39e79b740b..87f76a0529 100644 --- a/cmake/onnxruntime_unittests.cmake +++ b/cmake/onnxruntime_unittests.cmake @@ -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) diff --git a/onnxruntime/test/providers/provider_test_utils.cc b/onnxruntime/test/providers/provider_test_utils.cc index 6374e441d5..49fc345616 100644 --- a/onnxruntime/test/providers/provider_test_utils.cc +++ b/onnxruntime/test/providers/provider_test_utils.cc @@ -851,9 +851,10 @@ std::vector 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(), provider_type);