oneDNN has a built-in benchmarking program call benchdnn.
For a complete description of the available options and working examples, see the https://github.com/oneapi-src/oneDNN/blob/master/tests/benchdnn/README.md "benchdnn readme".