Code coverage for MKL-DNN related files in Release build
Created by: wojtuss
With the recent code coverage results from the Paddle Coverage Nightly builds the following two files are failing to reach 90% of line code coverage:
-
paddle_mkldnn_quantizer_config.h
: 83.3% -
lrn_mkldnn_op.cc
: 88.7%
The reason for 1. is that PaddlePaddle is being built in Release mode, and optimizations applied by the compiler prevented lcov
from a precise code coverage measurement. Running the code coverage test on the Debug build shows 100.0% line code coverage for this file. Following the document https://gcc.gnu.org/onlinedocs/gcc/Gcov-and-Optimization.html, if you want to prove that every single line in your program was executed, you should not compile with optimization at the same time.
We cannot improve the 2. case. The not covered part of the code is DNNL lrn
kernel implementation-specific and the behavior can change depending on the hardware we are running PaddlePaddle on and is out of our control.