76 lines · plain
1//===-- Platform.td - Platform definitions for Offload -----*- tablegen -*-===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8//9// This file contains Offload API definitions related to the Platform handle10//11//===----------------------------------------------------------------------===//12 13def ol_platform_info_t : Enum {14 let desc = "Supported platform info.";15 let is_typed = 1;16 let etors = [17 TaggedEtor<"NAME", "char[]", "The string denoting name of the platform. The size of the info needs to be dynamically queried.">,18 TaggedEtor<"VENDOR_NAME", "char[]", "The string denoting name of the vendor of the platform. The size of the info needs to be dynamically queried.">,19 TaggedEtor<"VERSION", "char[]", "The string denoting the version of the platform. The size of the info needs to be dynamically queried.">,20 TaggedEtor<"BACKEND", "ol_platform_backend_t", "The native backend of the platform.">21 ];22}23 24def ol_platform_backend_t : Enum {25 let desc = "Identifies the native backend of the platform.";26 let etors =[27 Etor<"UNKNOWN", "The backend is not recognized">,28 Etor<"CUDA", "The backend is CUDA">,29 Etor<"AMDGPU", "The backend is AMDGPU">,30 Etor<"HOST", "The backend is the host">,31 ];32}33 34def olGetPlatformInfo : Function {35 let desc = "Queries the given property of the platform.";36 let details = [37 "`olGetPlatformInfoSize` can be used to query the storage size "38 "required for the given query."39 ];40 let params = [41 Param<"ol_platform_handle_t", "Platform", "handle of the platform", PARAM_IN>,42 Param<"ol_platform_info_t", "PropName", "type of the info to retrieve", PARAM_IN>,43 Param<"size_t", "PropSize", "the number of bytes pointed to by pPlatformInfo.", PARAM_IN>,44 TypeTaggedParam<"void*", "PropValue", "array of bytes holding the info. "45 "If Size is not equal to or greater to the real number of bytes needed to return the info "46 "then the OL_ERRC_INVALID_SIZE error is returned and pPlatformInfo is not used.", PARAM_OUT,47 TypeInfo<"PropName" , "PropSize">>48 ];49 let returns = [50 Return<"OL_ERRC_UNSUPPORTED_ENUMERATION", [51 "If `PropName` is not supported by the platform."52 ]>,53 Return<"OL_ERRC_INVALID_SIZE", [54 "`PropSize == 0`",55 "If `PropSize` is less than the real number of bytes needed to return the info."56 ]>,57 Return<"OL_ERRC_INVALID_PLATFORM">58 ];59}60 61def olGetPlatformInfoSize : Function {62 let desc = "Returns the storage size of the given platform query.";63 let details = [];64 let params = [65 Param<"ol_platform_handle_t", "Platform", "handle of the platform", PARAM_IN>,66 Param<"ol_platform_info_t", "PropName", "type of the info to query", PARAM_IN>,67 Param<"size_t*", "PropSizeRet", "pointer to the number of bytes required to store the query", PARAM_OUT>68 ];69 let returns = [70 Return<"OL_ERRC_UNSUPPORTED_ENUMERATION", [71 "If `PropName` is not supported by the platform."72 ]>,73 Return<"OL_ERRC_INVALID_PLATFORM">74 ];75}76