Feature/optimiser debugging improvements#2244
Conversation
|
Sample output |
|
And the result from the shader |
|
From the sample log output you shared, my only comment would be that maybe we should add the current pass number ( |
doug-walker
left a comment
There was a problem hiding this comment.
I agree with Remi that it would be helpful to print the pass number.
| // Remove all ops for which isNoOp is true, including identity matrices. | ||
| int noops = optimizeIdentity ? RemoveNoOps(*this) : 0; | ||
| if (debugLoggingEnabled) | ||
| LogDebug(std::string("RemoveNoOps\n") + SerializeOpVec(*this, 4)); |
There was a problem hiding this comment.
The output is perhaps a bit difficult to read through since it's printing out the result at each step, even if there was no change. Each optimization function return 0 if no change was made, so for example, you could just print out the relevant items with (for this function):
if (noops > 0 && debugLoggingEnabled)
But I don't object to leaving it as is, if you find it more helpful.
f9b3524 to
4d9e394
Compare
Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com>
Add sstream to LogUtils.cpp which was previously being included by transitive dependency in Op.h Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com>
…stage Store the result of IsDebugLoggingEnabled() to avoid taking the internal mutex and to ensure either none or all the debugging will be output for the duration optimisation call. Avoid calling operator<< between character string literals which can be combined by the preprocessor Replace use of std::endl with "\n" Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com>
Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com>
Output Ops list only when it changes Ensure passes count is >=1 even when optimisation cannot be done. Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com>
259abb9 to
40944b6
Compare
|
I've rebased and tweaked to give a shorter output when a given optimisation makes no changes. Plus added the pass number. Please take another glance. |
…s variable when reporting the pass count. Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com>
|
Here is the current output vs previous |
Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com>
Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com>
08aebb1 to
b9595b2
Compare
Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com>
… pass the length of char* stings Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com>
Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com>
… and report in the summary Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com>
…ices Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com>
As we only care about there being a single expensive Op switch to std::any_of should return early once first matching Op is found. Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com>
Hoist it out of the loop and clear() on demand Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com>
…o function calls using std::as_const Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com>
…nst() usage Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com>
…mpliant Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com>
This is a couple of changes related to improving the debug output of the optimiser.
Basically it outputs the results of each stage within the passes, that allows for better reasoning about what changes though the process, I've tried to ensure we don't suffer too much from the overhead from the extra logging during non-debug conditions.
I have not done any performance evaluation to confirm this so far.
As a side effect there is also a slight change to the includes to remove the dependency on pystring in the op/optimiser code.