[Mlir-commits] [mlir] 4eee0cf - [MLIR] Reuse the path to runner_utils libraries (#108579)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed Sep 18 05:48:46 PDT 2024


Author: Tulio Magno Quites Machado Filho
Date: 2024-09-18T09:48:40-03:00
New Revision: 4eee0cfc8a922fc952ce94130505eb0e7aad6935

URL: https://github.com/llvm/llvm-project/commit/4eee0cfc8a922fc952ce94130505eb0e7aad6935
DIFF: https://github.com/llvm/llvm-project/commit/4eee0cfc8a922fc952ce94130505eb0e7aad6935.diff

LOG: [MLIR] Reuse the path to runner_utils libraries (#108579)

Prefer to get the path to libmlir_runner_utils and
libmlir_c_runner_utils via %mlir_runner_utils and %mlir_c_runner_utils.
Fallback to the previous paths only if they aren't defined.

This ensures the test will pass regardless of the build configuration
used downstream.

Added: 
    

Modified: 
    mlir/test/python/execution_engine.py

Removed: 
    


################################################################################
diff  --git a/mlir/test/python/execution_engine.py b/mlir/test/python/execution_engine.py
index 1cdda63eefe300..7c375ce81de0eb 100644
--- a/mlir/test/python/execution_engine.py
+++ b/mlir/test/python/execution_engine.py
@@ -1,4 +1,4 @@
-# RUN: %PYTHON %s 2>&1 | FileCheck %s
+# RUN: env MLIR_RUNNER_UTILS=%mlir_runner_utils MLIR_C_RUNNER_UTILS=%mlir_c_runner_utils %PYTHON %s 2>&1 | FileCheck %s
 # REQUIRES: host-supports-jit
 import gc, sys, os, tempfile
 from mlir.ir import *
@@ -7,6 +7,12 @@
 from mlir.runtime import *
 from ml_dtypes import bfloat16, float8_e5m2
 
+MLIR_RUNNER_UTILS = os.getenv(
+    "MLIR_RUNNER_UTILS", "../../../../lib/libmlir_runner_utils.so"
+)
+MLIR_C_RUNNER_UTILS = os.getenv(
+    "MLIR_C_RUNNER_UTILS", "../../../../lib/libmlir_c_runner_utils.so"
+)
 
 # Log everything to stderr and flush so that we have a unified stream to match
 # errors/info emitted by MLIR to stderr.
@@ -700,8 +706,8 @@ def testSharedLibLoad():
             ]
         else:
             shared_libs = [
-                "../../../../lib/libmlir_runner_utils.so",
-                "../../../../lib/libmlir_c_runner_utils.so",
+                MLIR_RUNNER_UTILS,
+                MLIR_C_RUNNER_UTILS,
             ]
 
         execution_engine = ExecutionEngine(
@@ -743,8 +749,8 @@ def testNanoTime():
             ]
         else:
             shared_libs = [
-                "../../../../lib/libmlir_runner_utils.so",
-                "../../../../lib/libmlir_c_runner_utils.so",
+                MLIR_RUNNER_UTILS,
+                MLIR_C_RUNNER_UTILS,
             ]
 
         execution_engine = ExecutionEngine(


        


More information about the Mlir-commits mailing list