[llvm] Revert "Reland of #108413: [Offload] Introduce offload-tblgen and initial new API implementation" (PR #118541)

via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 3 12:39:03 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-offload

Author: Jan Patrick Lehr (jplehr)

<details>
<summary>Changes</summary>

Reverts llvm/llvm-project#<!-- -->118503

Broke bot https://lab.llvm.org/staging/#/builders/131/builds/9701/steps/5/logs/stdio

---

Patch is 187.06 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/118541.diff


56 Files Affected:

- (modified) offload/CMakeLists.txt (-3) 
- (modified) offload/cmake/OpenMPTesting.cmake (-12) 
- (removed) offload/liboffload/API/APIDefs.td (-212) 
- (removed) offload/liboffload/API/CMakeLists.txt (-25) 
- (removed) offload/liboffload/API/Common.td (-141) 
- (removed) offload/liboffload/API/Device.td (-106) 
- (removed) offload/liboffload/API/OffloadAPI.td (-15) 
- (removed) offload/liboffload/API/Platform.td (-112) 
- (removed) offload/liboffload/API/README.md (-150) 
- (removed) offload/liboffload/CMakeLists.txt (-37) 
- (removed) offload/liboffload/README.md (-8) 
- (removed) offload/liboffload/exports (-6) 
- (removed) offload/liboffload/include/OffloadImpl.hpp (-94) 
- (removed) offload/liboffload/include/generated/OffloadAPI.h (-610) 
- (removed) offload/liboffload/include/generated/OffloadEntryPoints.inc (-441) 
- (removed) offload/liboffload/include/generated/OffloadFuncs.inc (-34) 
- (removed) offload/liboffload/include/generated/OffloadImplFuncDecls.inc (-38) 
- (removed) offload/liboffload/include/generated/OffloadPrint.hpp (-428) 
- (removed) offload/liboffload/src/Helpers.hpp (-95) 
- (removed) offload/liboffload/src/OffloadImpl.cpp (-247) 
- (removed) offload/liboffload/src/OffloadLib.cpp (-44) 
- (modified) offload/plugins-nextgen/common/include/PluginInterface.h (-4) 
- (modified) offload/test/lit.cfg (+1-2) 
- (modified) offload/test/lit.site.cfg.in (-1) 
- (removed) offload/test/tools/offload-tblgen/default_returns.td (-40) 
- (removed) offload/test/tools/offload-tblgen/entry_points.td (-37) 
- (removed) offload/test/tools/offload-tblgen/functions_basic.td (-39) 
- (removed) offload/test/tools/offload-tblgen/functions_code_loc.td (-26) 
- (removed) offload/test/tools/offload-tblgen/functions_ranged_param.td (-36) 
- (removed) offload/test/tools/offload-tblgen/print_enum.td (-34) 
- (removed) offload/test/tools/offload-tblgen/print_function.td (-38) 
- (removed) offload/test/tools/offload-tblgen/type_tagged_enum.td (-76) 
- (removed) offload/tools/offload-tblgen/APIGen.cpp (-229) 
- (removed) offload/tools/offload-tblgen/CMakeLists.txt (-24) 
- (removed) offload/tools/offload-tblgen/EntryPointGen.cpp (-138) 
- (removed) offload/tools/offload-tblgen/FuncsGen.cpp (-74) 
- (removed) offload/tools/offload-tblgen/GenCommon.hpp (-67) 
- (removed) offload/tools/offload-tblgen/Generators.hpp (-23) 
- (removed) offload/tools/offload-tblgen/PrintGen.cpp (-226) 
- (removed) offload/tools/offload-tblgen/RecordTypes.hpp (-227) 
- (removed) offload/tools/offload-tblgen/offload-tblgen.cpp (-101) 
- (modified) offload/unittests/CMakeLists.txt (+1-2) 
- (removed) offload/unittests/OffloadAPI/CMakeLists.txt (-16) 
- (removed) offload/unittests/OffloadAPI/common/Environment.cpp (-96) 
- (removed) offload/unittests/OffloadAPI/common/Environment.hpp (-17) 
- (removed) offload/unittests/OffloadAPI/common/Fixtures.hpp (-64) 
- (removed) offload/unittests/OffloadAPI/device/olDeviceInfo.hpp (-21) 
- (removed) offload/unittests/OffloadAPI/device/olGetDevice.cpp (-39) 
- (removed) offload/unittests/OffloadAPI/device/olGetDeviceCount.cpp (-28) 
- (removed) offload/unittests/OffloadAPI/device/olGetDeviceInfo.cpp (-76) 
- (removed) offload/unittests/OffloadAPI/device/olGetDeviceInfoSize.cpp (-58) 
- (removed) offload/unittests/OffloadAPI/platform/olGetPlatform.cpp (-28) 
- (removed) offload/unittests/OffloadAPI/platform/olGetPlatformCount.cpp (-22) 
- (removed) offload/unittests/OffloadAPI/platform/olGetPlatformInfo.cpp (-76) 
- (removed) offload/unittests/OffloadAPI/platform/olGetPlatformInfoSize.cpp (-57) 
- (removed) offload/unittests/OffloadAPI/platform/olPlatformInfo.hpp (-20) 


``````````diff
diff --git a/offload/CMakeLists.txt b/offload/CMakeLists.txt
index deae8d1a6b50c6..e24f0faa912117 100644
--- a/offload/CMakeLists.txt
+++ b/offload/CMakeLists.txt
@@ -353,9 +353,6 @@ add_subdirectory(tools)
 # Build target agnostic offloading library.
 add_subdirectory(src)
 
-add_subdirectory(tools/offload-tblgen)
-add_subdirectory(liboffload)
-
 # Add tests.
 add_subdirectory(test)
 
diff --git a/offload/cmake/OpenMPTesting.cmake b/offload/cmake/OpenMPTesting.cmake
index f97def2c52eba9..6609d6301d0f93 100644
--- a/offload/cmake/OpenMPTesting.cmake
+++ b/offload/cmake/OpenMPTesting.cmake
@@ -48,17 +48,6 @@ function(find_standalone_test_dependencies)
     return()
   endif()
 
-  find_program(OFFLOAD_TBLGEN_EXECUTABLE
-    NAMES offload-tblgen
-    PATHS ${OPENMP_LLVM_TOOLS_DIR})
-  if (NOT OFFLOAD_TBLGEN_EXECUTABLE)
-    message(STATUS "Cannot find 'offload-tblgen'.")
-    message(STATUS "Please put 'not' in your PATH, set OFFLOAD_TBLGEN_EXECUTABLE to its full path, or point OPENMP_LLVM_TOOLS_DIR to its directory.")
-    message(WARNING "The check targets will not be available!")
-    set(ENABLE_CHECK_TARGETS FALSE PARENT_SCOPE)
-    return()
-  endif()
-
   find_program(OPENMP_NOT_EXECUTABLE
     NAMES not
     PATHS ${OPENMP_LLVM_TOOLS_DIR})
@@ -93,7 +82,6 @@ else()
     set(OPENMP_FILECHECK_EXECUTABLE ${LLVM_RUNTIME_OUTPUT_INTDIR}/FileCheck)
   endif()
   set(OPENMP_NOT_EXECUTABLE ${LLVM_RUNTIME_OUTPUT_INTDIR}/not)
-  set(OFFLOAD_TBLGEN_EXECUTABLE ${LLVM_RUNTIME_OUTPUT_INTDIR}/offload-tblgen)
   set(OFFLOAD_DEVICE_INFO_EXECUTABLE ${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-offload-device-info)
 endif()
 
diff --git a/offload/liboffload/API/APIDefs.td b/offload/liboffload/API/APIDefs.td
deleted file mode 100644
index 60c1b85d26911e..00000000000000
--- a/offload/liboffload/API/APIDefs.td
+++ /dev/null
@@ -1,212 +0,0 @@
-//===-- APIDefs.td - Base definitions for Offload tablegen -*- tablegen -*-===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the class definitions used to implement the Offload API,
-// as well as helper functions used to help populate relevant records.
-// See offload/API/README.md for more detailed documentation.
-//
-//===----------------------------------------------------------------------===//
-
-// Prefix for API naming. This could be hard-coded in the future when a value
-// is agreed upon.
-defvar PREFIX = "OL";
-defvar prefix = !tolower(PREFIX);
-
-// Parameter flags
-defvar PARAM_IN = 0x1;
-defvar PARAM_OUT = 0x2;
-defvar PARAM_OPTIONAL = 0x4;
-defvar PARAM_IN_OPTIONAL = !or(PARAM_IN, PARAM_OPTIONAL);
-defvar PARAM_OUT_OPTIONAL = !or(PARAM_OUT, PARAM_OPTIONAL);
-
-// Does the type end with '_handle_t'?
-class IsHandleType<string Type> {
-  // size("_handle_t") == 9
-  bit ret = !if(!lt(!size(Type), 9), 0,
-                !ne(!find(Type, "_handle_t", !sub(!size(Type), 9)), -1));
-}
-
-// Does the type end with '*'?
-class IsPointerType<string Type> {
-  bit ret = !ne(!find(Type, "*", !sub(!size(Type), 1)), -1);
-}
-
-// Describes the valid range of a pointer parameter that reperesents an array
-class Range<string Begin, string End> {
-  string begin = Begin;
-  string end = End;
-}
-
-// Names the parameters that indicate the type and size of the data pointed to
-// by an opaque pointer parameter
-class TypeInfo<string TypeEnum, string TypeSize> {
-  string enum = TypeEnum;
-  string size = TypeSize;
-}
-
-class Param<string Type, string Name, string Desc, bits<3> Flags = 0> {
-  string type = Type;
-  string name = Name;
-  string desc = Desc;
-  bits<3> flags = Flags;
-  Range range = Range<"", "">;
-  TypeInfo type_info = TypeInfo<"", "">;
-  bit IsHandle = IsHandleType<type>.ret;
-  bit IsPointer = IsPointerType<type>.ret;
-}
-
-// A parameter whose range is described by other parameters in the function.
-class RangedParam<string Type, string Name, string Desc, bits<3> Flags, Range ParamRange> : Param<Type, Name, Desc, Flags> {
-  let range = ParamRange;
-}
-
-// A parameter (normally of type void*) which has its pointee type and size
-// described by other parameters in the function.
-class TypeTaggedParam<string Type, string Name, string Desc, bits<3> Flags, TypeInfo ParamTypeInfo> : Param<Type, Name, Desc, Flags> {
-  let type_info = ParamTypeInfo;
-}
-
-class Return<string Value, list<string> Conditions = []> {
-  string value = Value;
-  list<string> conditions = Conditions;
-}
-
-class ShouldCheckHandle<Param P> {
-  bit ret = !and(P.IsHandle, !eq(!and(PARAM_OPTIONAL, P.flags), 0));
-}
-
-class ShouldCheckPointer<Param P> {
-  bit ret = !and(P.IsPointer, !eq(!and(PARAM_OPTIONAL, P.flags), 0));
-}
-
-// For a list of returns that contains a specific return code, find and append
-// new conditions to that return
-class AppendConditionsToReturn<list<Return> Returns, string ReturnValue,
-                               list<string> Conditions> {
-  list<Return> ret =
-      !foreach(Ret, Returns,
-               !if(!eq(Ret.value, ReturnValue),
-                   Return<Ret.value, Ret.conditions#Conditions>, Ret));
-}
-
-// Add null handle checks to a function's return value descriptions
-class AddHandleChecksToReturns<list<Param> Params, list<Return> Returns> {
-  list<string> handle_params =
-      !foreach(P, Params, !if(ShouldCheckHandle<P>.ret, P.name, ""));
-  list<string> handle_params_filt =
-      !filter(param, handle_params, !ne(param, ""));
-  list<string> handle_param_conds =
-      !foreach(handle, handle_params_filt, "`NULL == "#handle#"`");
-
-  // Does the list of returns already contain ERROR_INVALID_NULL_HANDLE?
-  bit returns_has_inv_handle = !foldl(
-      0, Returns, HasErr, Ret,
-      !or(HasErr, !eq(Ret.value, PREFIX#"_ERRC_INVALID_NULL_HANDLE")));
-
-  list<Return> returns_out = !if(returns_has_inv_handle,
-        AppendConditionsToReturn<Returns, PREFIX # "_ERRC_INVALID_NULL_HANDLE", handle_param_conds>.ret,
-        !listconcat(Returns, [Return<PREFIX # "_ERRC_INVALID_NULL_HANDLE", handle_param_conds>])
-    );
-}
-
-// Add null pointer checks to a function's return value descriptions
-class AddPointerChecksToReturns<list<Param> Params, list<Return> Returns> {
-  list<string> ptr_params =
-      !foreach(P, Params, !if(ShouldCheckPointer<P>.ret, P.name, ""));
-  list<string> ptr_params_filt = !filter(param, ptr_params, !ne(param, ""));
-  list<string> ptr_param_conds =
-      !foreach(ptr, ptr_params_filt, "`NULL == "#ptr#"`");
-
-  // Does the list of returns already contain ERROR_INVALID_NULL_POINTER?
-  bit returns_has_inv_ptr = !foldl(
-      0, Returns, HasErr, Ret,
-      !or(HasErr, !eq(Ret.value, PREFIX#"_ERRC_INVALID_NULL_POINTER")));
-  list<Return> returns_out = !if(returns_has_inv_ptr,
-        AppendConditionsToReturn<Returns, PREFIX # "_ERRC_INVALID_NULL_POINTER", ptr_param_conds>.ret,
-        !listconcat(Returns, [Return<PREFIX # "_ERRC_INVALID_NULL_POINTER", ptr_param_conds>])
-    );
-}
-
-defvar DefaultReturns = [Return<PREFIX#"_RESULT_SUCCESS">,
-                         Return<PREFIX#"_ERRC_UNINITIALIZED">,
-                         Return<PREFIX#"_ERRC_DEVICE_LOST">];
-
-class APIObject {
-  string name;
-  string desc;
-}
-
-class Function : APIObject {
-  list<Param> params;
-  list<Return> returns;
-  list<string> details = [];
-  list<string> analogues = [];
-
-  list<Return> returns_with_def = !listconcat(DefaultReturns, returns);
-  list<Return> all_returns = AddPointerChecksToReturns<params,
-        AddHandleChecksToReturns<params, returns_with_def>.returns_out>.returns_out;
-}
-
-class Etor<string Name, string Desc> {
-  string name = Name;
-  string desc = Desc;
-  string tagged_type;
-}
-
-class TaggedEtor<string Name, string Type, string Desc> : Etor<Name, Desc> {
-  let tagged_type = Type;
-}
-
-class Enum : APIObject {
-  // This refers to whether the enumerator descriptions specify a return
-  // type for functions where this enum may be used as an output type. If set,
-  // all Etor values must be TaggedEtor records
-  bit is_typed = 0;
-
-  list<Etor> etors = [];
-}
-
-class StructMember<string Type, string Name, string Desc> {
-  string type = Type;
-  string name = Name;
-  string desc = Desc;
-}
-
-defvar DefaultPropStructMembers =
-    [StructMember<prefix#"_structure_type_t", "stype",
-                  "type of this structure">,
-     StructMember<"void*", "pNext", "pointer to extension-specific structure">];
-
-class StructHasInheritedMembers<string BaseClass> {
-  bit ret = !or(!eq(BaseClass, prefix#"_base_properties_t"),
-                !eq(BaseClass, prefix#"_base_desc_t"));
-}
-
-class Struct : APIObject {
-  string base_class = "";
-  list<StructMember> members;
-  list<StructMember> all_members =
-      !if(StructHasInheritedMembers<base_class>.ret,
-          DefaultPropStructMembers, [])#members;
-}
-
-class Typedef : APIObject { string value; }
-
-class FptrTypedef : APIObject {
-  list<Param> params;
-  list<Return> returns;
-}
-
-class Macro : APIObject {
-  string value;
-
-  string condition;
-  string alt_value;
-}
-
-class Handle : APIObject;
diff --git a/offload/liboffload/API/CMakeLists.txt b/offload/liboffload/API/CMakeLists.txt
deleted file mode 100644
index 8fd6cb539374a5..00000000000000
--- a/offload/liboffload/API/CMakeLists.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-# The OffloadGenerate target is used to regenerate the generated files in the
-# include directory. These files are checked in with the rest of the source,
-# therefore it is only needed when making changes to the API.
-
-find_program(CLANG_FORMAT clang-format PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH)
-if (CLANG_FORMAT)
-    set(LLVM_TARGET_DEFINITIONS ${CMAKE_CURRENT_SOURCE_DIR}/OffloadAPI.td)
-
-    tablegen(OFFLOAD OffloadAPI.h -gen-api)
-    tablegen(OFFLOAD OffloadEntryPoints.inc -gen-entry-points)
-    tablegen(OFFLOAD OffloadFuncs.inc -gen-func-names)
-    tablegen(OFFLOAD OffloadImplFuncDecls.inc -gen-impl-func-decls)
-    tablegen(OFFLOAD OffloadPrint.hpp -gen-print-header)
-
-    set(OFFLOAD_GENERATED_FILES ${TABLEGEN_OUTPUT})
-    add_public_tablegen_target(OffloadGenerate)
-    add_custom_command(TARGET OffloadGenerate POST_BUILD COMMAND ${CLANG_FORMAT}
-        -i ${OFFLOAD_GENERATED_FILES})
-    add_custom_command(TARGET OffloadGenerate POST_BUILD COMMAND ${CMAKE_COMMAND}
-        -E copy_if_different ${OFFLOAD_GENERATED_FILES} "${CMAKE_CURRENT_SOURCE_DIR}/../include/generated")
-else()
-    message(WARNING "clang-format was not found, so the OffloadGenerate target\
-        will not be available. Offload will still build, but you will not be\
-        able to make changes to the API.")
-endif()
diff --git a/offload/liboffload/API/Common.td b/offload/liboffload/API/Common.td
deleted file mode 100644
index 5b19d1d47129ef..00000000000000
--- a/offload/liboffload/API/Common.td
+++ /dev/null
@@ -1,141 +0,0 @@
-def : Macro {
-  let name = "OL_VERSION_MAJOR";
-  let desc = "Major version of the Offload API";
-  let value = "0";
-}
-
-def : Macro {
-  let name = "OL_VERSION_MINOR";
-  let desc = "Minor version of the Offload API";
-  let value = "0";
-}
-
-def : Macro {
-  let name = "OL_VERSION_PATCH";
-  let desc = "Patch version of the Offload API";
-  let value = "1";
-}
-
-def : Macro {
-  let name = "OL_APICALL";
-  let desc = "Calling convention for all API functions";
-  let condition = "defined(_WIN32)";
-  let value = "__cdecl";
-  let alt_value = "";
-}
-
-def : Macro {
-  let name = "OL_APIEXPORT";
-  let desc = "Microsoft-specific dllexport storage-class attribute";
-  let condition = "defined(_WIN32)";
-  let value = "__declspec(dllexport)";
-  let alt_value = "";
-}
-
-def : Macro {
-  let name = "OL_DLLEXPORT";
-  let desc = "Microsoft-specific dllexport storage-class attribute";
-  let condition = "defined(_WIN32)";
-  let value = "__declspec(dllexport)";
-}
-
-def : Macro {
-  let name = "OL_DLLEXPORT";
-  let desc = "GCC-specific dllexport storage-class attribute";
-  let condition = "__GNUC__ >= 4";
-  let value = "__attribute__ ((visibility (\"default\")))";
-  let alt_value = "";
-}
-
-def : Handle {
-  let name = "ol_platform_handle_t";
-  let desc = "Handle of a platform instance";
-}
-
-def : Handle {
-  let name = "ol_device_handle_t";
-  let desc = "Handle of platform's device object";
-}
-
-def : Handle {
-  let name = "ol_context_handle_t";
-  let desc = "Handle of context object";
-}
-
-def : Enum {
-  let name = "ol_errc_t";
-  let desc = "Defines Return/Error codes";
-  let etors =[
-    Etor<"SUCCESS", "Success">,
-    Etor<"INVALID_VALUE", "Invalid Value">,
-    Etor<"INVALID_PLATFORM", "Invalid platform">,
-    Etor<"DEVICE_NOT_FOUND", "Device not found">,
-    Etor<"INVALID_DEVICE", "Invalid device">,
-    Etor<"DEVICE_LOST", "Device hung, reset, was removed, or driver update occurred">,
-    Etor<"UNINITIALIZED", "plugin is not initialized or specific entry-point is not implemented">,
-    Etor<"OUT_OF_RESOURCES", "Out of resources">,
-    Etor<"UNSUPPORTED_VERSION", "generic error code for unsupported versions">,
-    Etor<"UNSUPPORTED_FEATURE", "generic error code for unsupported features">,
-    Etor<"INVALID_ARGUMENT", "generic error code for invalid arguments">,
-    Etor<"INVALID_NULL_HANDLE", "handle argument is not valid">,
-    Etor<"INVALID_NULL_POINTER", "pointer argument may not be nullptr">,
-    Etor<"INVALID_SIZE", "invalid size or dimensions (e.g., must not be zero, or is out of bounds)">,
-    Etor<"INVALID_ENUMERATION", "enumerator argument is not valid">,
-    Etor<"UNSUPPORTED_ENUMERATION", "enumerator argument is not supported by the device">,
-    Etor<"UNKNOWN", "Unknown or internal error">
-  ];
-}
-
-def : Struct {
-  let name = "ol_error_struct_t";
-  let desc = "Details of the error condition returned by an API call";
-  let members = [
-    StructMember<"ol_errc_t", "Code", "The error code">,
-    StructMember<"const char*", "Details", "String containing error details">
-  ];
-}
-
-def : Typedef {
-  let name = "ol_result_t";
-  let desc = "Result type returned by all entry points.";
-  let value = "const ol_error_struct_t*";
-}
-
-def : Macro {
-  let name = "OL_SUCCESS";
-  let desc = "Success condition";
-  let value = "NULL";
-}
-
-def : Struct {
-  let name = "ol_code_location_t";
-  let desc = "Code location information that can optionally be associated with an API call";
-  let members = [
-    StructMember<"const char*", "FunctionName", "Function name">,
-    StructMember<"const char*", "SourceFile", "Source code file">,
-    StructMember<"uint32_t", "LineNumber", "Source code line number">,
-    StructMember<"uint32_t", "ColumnNumber", "Source code column number">
-  ];
-}
-
-def : Function {
-  let name = "olInit";
-  let desc = "Perform initialization of the Offload library and plugins";
-  let details = [
-    "This must be the first API call made by a user of the Offload library",
-    "Each call will increment an internal reference count that is decremented by `olShutDown`"
-  ];
-  let params = [];
-  let returns = [];
-}
-
-def : Function {
-  let name = "olShutDown";
-  let desc = "Release the resources in use by Offload";
-  let details = [
-    "This decrements an internal reference count. When this reaches 0, all resources will be released",
-    "Subsequent API calls made after this are not valid"
-  ];
-  let params = [];
-  let returns = [];
-}
diff --git a/offload/liboffload/API/Device.td b/offload/liboffload/API/Device.td
deleted file mode 100644
index 30c0b71fe7b37c..00000000000000
--- a/offload/liboffload/API/Device.td
+++ /dev/null
@@ -1,106 +0,0 @@
-//===-- Device.td - Device definitions for Offload ---------*- tablegen -*-===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains Offload API definitions related to the Device handle
-//
-//===----------------------------------------------------------------------===//
-
-def : Enum {
-  let name = "ol_device_type_t";
-  let desc = "Supported device types";
-  let etors =[
-    Etor<"DEFAULT", "The default device type as preferred by the runtime">,
-    Etor<"ALL", "Devices of all types">,
-    Etor<"GPU", "GPU device type">,
-    Etor<"CPU", "CPU device type">,
-  ];
-}
-
-def : Enum {
-  let name = "ol_device_info_t";
-  let desc = "Supported device info";
-  let is_typed = 1;
-  let etors =[
-    TaggedEtor<"TYPE", "ol_device_type_t", "type of the device">,
-    TaggedEtor<"PLATFORM", "ol_platform_handle_t", "the platform associated with the device">,
-    TaggedEtor<"NAME", "char[]", "Device name">,
-    TaggedEtor<"VENDOR", "char[]", "Device vendor">,
-    TaggedEtor<"DRIVER_VERSION", "char[]", "Driver version">
-  ];
-}
-
-def : Function {
-  let name = "olGetDeviceCount";
-  let desc = "Retrieves the number of available devices within a platform";
-  let params = [
-    Param<"ol_platform_handle_t", "Platform", "handle of the platform instance", PARAM_IN>,
-    Param<"uint32_t*", "NumDevices", "pointer to the number of devices.", PARAM_OUT>
-  ];
-  let returns = [];
-}
-
-def : Function {
-  let name = "olGetDevice";
-  let desc = "Retrieves devices within a platform";
-  let details = [
-    "Multiple calls to this function will return identical device handles, in the same order.",
-  ];
-  let params = [
-    Param<"ol_platform_handle_t", "Platform", "handle of the platform instance", PARAM_IN>,
-    Param<"uint32_t", "NumEntries", "the number of devices to be added to phDevices, which must be greater than zero", PARAM_IN>,
-    RangedParam<"ol_device_handle_t*", "Devices", "Array of device handles. "
-        "If NumEntries is less than the number of devices available, then this function shall only retrieve that number of devices.", PARAM_OUT,
-        Range<"0", "NumEntries">>
-  ];
-  let returns = [
-    Return<"OL_ERRC_INVALID_SIZE", [
-      "`NumEntries == 0`"
-    ]>
-  ];
-}
-
-def : Function {
-  let name = "olGetDeviceInfo";
-  let desc = "Queries the given property of the device";
-  let details = [];
-  let params = [
-    Param<"ol_device_handle_t", "Device", "handle of the device instance", PARAM_IN>,
-    Param<"ol_device_info_t", "PropName", "type of the info to retrieve", PARAM_IN>,
-    Param<"size_t", "PropSize", "the number of bytes pointed to by PropValue.", PARAM_IN>,
-    TypeTaggedParam<"void*", "PropValue", "array of bytes holding the info. If PropSize is not equal to or greater than the real "
-                    "number of bytes needed to return the info then the OL_ERRC_INVALID_SIZE error is returned and "
-                    "PropValue is not used.", PARAM_OUT, TypeInfo<"PropName" , "PropSize">>
-  ];
-  let returns = [
-    Return<"OL_ERRC_UNSUPPORTED_ENUMERATION", [
-      "If `PropName` is not supported by the device."
-    ]>,
-    Return<"OL_ERRC_INVALID_SIZE", [
-      "`PropSize == 0`",
-      "If `PropSize` is less than the real number of bytes needed to return the info."
-    ]>,
-    Return<"OL_ERRC_INVALID_DEVICE">
-  ];
-}
-
-def : Function {
-  let name = "olGetDeviceInfoSize";
-  let desc = "Returns the storage size of the given device query";
-  let details = [];
-  let params = [
-    Param<"ol_device_handle_t", "Device", "handle of the device instance", PARAM_IN>,
-    Param<"ol_device_info_t", "PropName", "type of the info to retrieve", PARAM_IN>,
-    Param<"size_t*", "PropSizeRet", "pointer to the number of bytes required to store the query", PARAM_OUT>
-  ];
-  let returns = [
-    Return<"OL_ERRC_UNSUPPORTED_ENUMERATION", [
-      "If `PropName` is not supported by the device."
-    ]>,
-    Return<"OL_ERRC_INVALID_DEVICE">
-  ];
-}
diff --git a/offload/liboffload/API/OffloadAPI.td b/offload/liboffload/API/OffloadAPI.td
deleted file mode 100644
index 8a0c3c40581223..00000000000000
--- a/offload/liboffload/API/OffloadAPI.td
+++ /dev/null
@@ -1,15 +0,0 @@
-//===-- OffloadAPI.td - Root tablegen file for Offload -----*- tablegen -*-===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt f...
[truncated]

``````````

</details>


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


More information about the llvm-commits mailing list