From: Mehdi Amini Date: Tue, 9 Nov 2021 18:11:59 +0000 (+0000) Subject: Revert "[mlir] Add nano precision clock to execution engine" X-Git-Tag: upstream/15.0.7~26308 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c296609b68d0253d7baef9b8275c72d8ed112758;p=platform%2Fupstream%2Fllvm.git Revert "[mlir] Add nano precision clock to execution engine" This reverts commit 48d1f099d492b0d796743d1528f09947e4d2d864. Broke the MLIR buildbots --- diff --git a/mlir/lib/ExecutionEngine/RunnerUtils.cpp b/mlir/lib/ExecutionEngine/RunnerUtils.cpp index 3a5f471..83ead7c 100644 --- a/mlir/lib/ExecutionEngine/RunnerUtils.cpp +++ b/mlir/lib/ExecutionEngine/RunnerUtils.cpp @@ -14,7 +14,6 @@ //===----------------------------------------------------------------------===// #include "mlir/ExecutionEngine/RunnerUtils.h" -#include extern "C" void _mlir_ciface_print_memref_shape_i8(UnrankedMemRefType *M) { @@ -76,14 +75,6 @@ extern "C" void _mlir_ciface_print_memref_f64(UnrankedMemRefType *M) { impl::printMemRef(*M); } -extern "C" int64_t _mlir_ciface_nano_time() { - auto now = std::chrono::high_resolution_clock::now(); - auto duration = now.time_since_epoch(); - auto nanoseconds = - std::chrono::duration_cast(duration); - return nanoseconds.count(); -} - extern "C" void print_memref_i32(int64_t rank, void *ptr) { UnrankedMemRefType descriptor = {rank, ptr}; _mlir_ciface_print_memref_i32(&descriptor); diff --git a/mlir/test/python/execution_engine.py b/mlir/test/python/execution_engine.py index d837354..ffb0de9 100644 --- a/mlir/test/python/execution_engine.py +++ b/mlir/test/python/execution_engine.py @@ -358,36 +358,3 @@ def testSharedLibLoad(): run(testSharedLibLoad) - - -# Test that nano time clock is available. -# CHECK-LABEL: TEST: testNanoTime -def testNanoTime(): - with Context(): - module = Module.parse(""" - module { - func @main() attributes { llvm.emit_c_interface } { - %now = call @nano_time() : () -> i64 - %memref = memref.alloca() : memref<1xi64> - %c0 = arith.constant 0 : index - memref.store %memref[%c0] : memref<1xi64> - call @print_memref_i64(%memref) : (memref<*xi64) -> () - return - } - func private @nano_time() -> i64 attributes { llvm.emit_c_interface } - func private @print_memref_i64(memref<*xi64>) attributes { llvm.emit_c_interface } - }""") - - execution_engine = ExecutionEngine( - lowerToLLVM(module), - opt_level=3, - shared_libs=[ - "../../../../lib/libmlir_runner_utils.so", - "../../../../lib/libmlir_c_runner_utils.so" - ]) - execution_engine.invoke("main", arg0_memref_ptr) - # CHECK: Unranked Memref - # CHECK: [{{.*}}] - - -run(testNanoTime)