[llvm] [OFFLOAD] Add plugin with support for Intel oneAPI Level Zero (PR #158900)
Alex Duran via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 20 07:41:23 PDT 2025
================
@@ -0,0 +1,67 @@
+//===--- Level Zero Target RTL Implementation -----------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+//
+// External and other auxilary definitions
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef OPENMP_LIBOMPTARGET_PLUGINS_NEXTGEN_LEVEL_ZERO_L0DEFS_H
+#define OPENMP_LIBOMPTARGET_PLUGINS_NEXTGEN_LEVEL_ZERO_L0DEFS_H
+
+#include "PluginInterface.h"
+#include "Shared/Requirements.h"
+#include "omptarget.h"
+
+enum class AllocOptionTy : int32_t {
+ ALLOC_OPT_NONE = 0,
+ ALLOC_OPT_REDUCTION_SCRATCH = 1,
+ ALLOC_OPT_REDUCTION_COUNTER = 2,
+ ALLOC_OPT_HOST_MEM = 3,
+ ALLOC_OPT_SLM = 4,
+};
+
+#ifndef EXTRACT_BITS
+// MSB=63, LSB=0
+#define EXTRACT_BITS(I64, HIGH, LOW) \
+ (((uint64_t)I64) >> (LOW)) & (((uint64_t)1 << ((HIGH) - (LOW) + 1)) - 1)
+#endif
+
+namespace llvm::omp::target::plugin {
+
+/// Default alignmnet for allocation
+constexpr size_t L0DefaultAlignment = 0;
----------------
adurang wrote:
It means is unspecified and level zero can freely choose.
https://github.com/llvm/llvm-project/pull/158900
More information about the llvm-commits
mailing list