Reland "[mlir] add support for verification in integration tests"
authorTobias Gysi <tobias.gysi@gmail.com>
Sun, 14 Feb 2021 19:21:47 +0000 (20:21 +0100)
committerTobias Gysi <tobias.gysi@gmail.com>
Sun, 14 Feb 2021 19:30:05 +0000 (20:30 +0100)
commit99f3510b413768d8e5a7ad06af5e127ba7fee331
treee21f1c25d86a1fb0c284e593cabdc42425d0a53c
parent28315df073328601a5369773ce53156e979bd9d0
Reland "[mlir] add support for verification in integration tests"

The patch extends the runner utils by verification methods that compare two memrefs. The methods compare the content of the two memrefs and print success if the data is identical up to a small numerical error. The methods are meant to simplify the development of integration tests that compare the results against a reference implementation (cf. the updates to the linalg matmul integration tests).

Originally landed in 5fa893c (https://reviews.llvm.org/D96326) and reverted in dd719fd due to a Windows build failure.

Changes:
- Remove the max function that requires the "algorithm" header on Windows
- Eliminate the truncation warning in the float specialization of verifyElem by using a float constant

Reviewed By: Kayjukh

Differential Revision: https://reviews.llvm.org/D96593
mlir/include/mlir/ExecutionEngine/RunnerUtils.h
mlir/integration_test/Dialect/Linalg/CPU/benchmark_matmul.mlir
mlir/integration_test/Dialect/Linalg/CPU/benchmark_matmul_column_major.mlir
mlir/integration_test/Dialect/Linalg/CPU/benchmark_matmul_column_major_as_row_major.mlir
mlir/integration_test/Dialect/Linalg/CPU/benchmark_matmul_i8_i8_i32.mlir
mlir/lib/ExecutionEngine/RunnerUtils.cpp