[llvm] [SYCL] Add platform enumeration and info query using liboffload (PR #166927)

Dmitry Rogozhkin via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 12 08:35:03 PST 2025


================
@@ -0,0 +1,80 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBSYCL_OFFLOAD_UTILS
+#define _LIBSYCL_OFFLOAD_UTILS
+
+#include <sycl/__impl/backend.hpp>
+#include <sycl/__impl/detail/config.hpp>
+#include <sycl/__impl/exception.hpp>
+
+#include <OffloadAPI.h>
+
+_LIBSYCL_BEGIN_NAMESPACE_SYCL
+
+namespace detail {
+
+const char *stringifyErrorCode(ol_errc_t error);
+
+inline std::string formatCodeString(ol_result_t Result) {
+  return std::to_string(Result->Code) + " (" +
+         std::string(stringifyErrorCode(Result->Code)) + ")" + Result->Details;
----------------
dvrogozh wrote:

Just to double check: is a space needed on the closing bracket similar to the opening one? `+ ") "`?

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


More information about the llvm-commits mailing list