[Mlir-commits] [mlir] [mlir] Add `mlir_arm_runner_utils` library for use in integration tests (PR #78583)

Benjamin Maxwell llvmlistbot at llvm.org
Fri Jan 19 03:07:28 PST 2024


================
@@ -0,0 +1,60 @@
+//===- ArmRunnerUtils.cpp - Utilities for configuring architecture properties //
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include <iostream>
+#include <stdint.h>
+#include <string_view>
+
+#if (defined(_WIN32) || defined(__CYGWIN__))
+#define MLIR_ARMRUNNERUTILS_EXPORTED __declspec(dllexport)
+#else
+#define MLIR_ARMRUNNERUTILS_EXPORTED __attribute__((visibility("default")))
+#endif
+
+#ifdef __linux__
+#include <sys/prctl.h>
+#endif
+
+extern "C" {
+
+#define PR_VL_LEN_MASK 0xffff
+
+#ifndef PR_SVE_SET_VL
+#define PR_SVE_SET_VL 50
----------------
MacDue wrote:

It will work under QEMU. QEMU intercepts the `prctl()` and handles it, not the host kernel (which may no even support SVE or SME).

https://github.com/llvm/llvm-project/pull/78583


More information about the Mlir-commits mailing list