Skip to content

Commit

Permalink
fix builds enabling onnxruntime_DEBUG_NODE_INPUTS_OUTPUTS (#2369)
Browse files Browse the repository at this point in the history
* fix builds enabling onnxruntime_DEBUG_NODE_INPUTS_OUTPUTS

* update
  • Loading branch information
jywu-msft authored Nov 11, 2019
1 parent 53ed36a commit 0c6e9f9
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
25 changes: 25 additions & 0 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ The complete list of build options can be found by running `./build.sh (or .\bui
**Options**
* [OpenMP](#OpenMP)
* [OpenBLAS](#OpenBLAS)
* [DebugNodeInputsOutputs](#DebugNodeInputsOutputs)
**Architectures**
* [x86](#x86)
Expand Down Expand Up @@ -424,6 +425,30 @@ The DirectML execution provider supports building for both x64 and x86 architect
---
### DebugNodeInputsOutputs
OnnxRuntime supports build options for enabling debugging of intermediate tensor shapes and data.
#### Build Instructions
##### Set onnxruntime_DEBUG_NODE_INPUTS_OUTPUTS=1
Dump tensor input/output shapes for all nodes to stdout.
```
# Linux
./build.sh --cmake_extra_defines onnxruntime_DEBUG_NODE_INPUTS_OUTPUTS=1
# Windows
.\build.bat --cmake_extra_defines onnxruntime_DEBUG_NODE_INPUTS_OUTPUTS=1
```
##### Set onnxruntime_DEBUG_NODE_INPUTS_OUTPUTS=2
Dump tensor input/output shapes and output data for all nodes to stdout.
```
# Linux
./build.sh --cmake_extra_defines onnxruntime_DEBUG_NODE_INPUTS_OUTPUTS=2
# Windows
.\build.bat --cmake_extra_defines onnxruntime_DEBUG_NODE_INPUTS_OUTPUTS=2
```
##### Set onnxruntime_DEBUG_NODE_INPUTS_OUTPUTS=0
To disable this functionality after previously enabling, set onnxruntime_DEBUG_NODE_INPUTS_OUTPUTS=0 or delete CMakeCache.txt.
---
## Architectures
### x86
#### Build Intsructions
Expand Down
2 changes: 2 additions & 0 deletions onnxruntime/core/framework/utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,8 @@ void DumpNodeOutputs(OpKernelContext& context, const Node& node, const SessionSt
std::cout << " failed to transfer data to cpu.\n";
}
}
#else
ORT_UNUSED_PARAMETER(session_state);
#endif
}
}
Expand Down

0 comments on commit 0c6e9f9

Please sign in to comment.