brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.3 KiB · 075bf5b Raw
88 lines · plain
1//===-- Event.td - Event 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 event handle10//11//===----------------------------------------------------------------------===//12 13def olCreateEvent : Function {14    let desc = "Enqueue an event to `Queue` and return it.";15    let details = [16      "This event can be used with `olSyncEvent` and `olWaitEvents` and will be complete once all enqueued work prior to the `olCreateEvent` call is complete.",17    ];18    let params = [19        Param<"ol_queue_handle_t", "Queue", "queue to create the event for", PARAM_IN>,20        Param<"ol_event_handle_t*", "Event", "output pointer for the created event", PARAM_OUT>21    ];22    let returns = [];23}24 25def olDestroyEvent : Function {26    let desc = "Destroy the event and free all underlying resources.";27    let details = [];28    let params = [29        Param<"ol_event_handle_t", "Event", "handle of the event", PARAM_IN>30    ];31    let returns = [];32}33 34def olSyncEvent : Function {35    let desc = "Block the calling thread until the event is complete.";36    let details = [];37    let params = [38        Param<"ol_event_handle_t", "Event", "handle of the event", PARAM_IN>39    ];40    let returns = [];41}42 43def ol_event_info_t : Enum {44  let desc = "Supported event info.";45  let is_typed = 1;46  let etors = [47    TaggedEtor<"QUEUE", "ol_queue_handle_t", "The handle of the queue associated with the device.">,48    TaggedEtor<"IS_COMPLETE", "bool", "True if and only if the event is complete.">,49  ];50}51 52def olGetEventInfo : Function {53  let desc = "Queries the given property of the event.";54  let details = [55    "`olGetEventInfoSize` can be used to query the storage size "56    "required for the given query."57  ];58  let params = [59    Param<"ol_event_handle_t", "Event", "handle of the event", PARAM_IN>,60    Param<"ol_event_info_t", "PropName", "type of the info to retrieve", PARAM_IN>,61    Param<"size_t", "PropSize", "the number of bytes pointed to by PropValue.", PARAM_IN>,62    TypeTaggedParam<"void*", "PropValue", "array of bytes holding the info. "63      "If PropSize is not equal to or greater to the real number of bytes needed to return the info "64      "then the OL_ERRC_INVALID_SIZE error is returned and PropValue is not used.", PARAM_OUT,65      TypeInfo<"PropName" , "PropSize">>66  ];67  let returns = [68    Return<"OL_ERRC_INVALID_SIZE", [69      "`PropSize == 0`",70      "If `PropSize` is less than the real number of bytes needed to return the info."71    ]>,72    Return<"OL_ERRC_INVALID_EVENT">73  ];74}75 76def olGetEventInfoSize : Function {77  let desc = "Returns the storage size of the given event query.";78  let details = [];79  let params = [80    Param<"ol_event_handle_t", "Event", "handle of the event", PARAM_IN>,81    Param<"ol_event_info_t", "PropName", "type of the info to query", PARAM_IN>,82    Param<"size_t*", "PropSizeRet", "pointer to the number of bytes required to store the query", PARAM_OUT>83  ];84  let returns = [85    Return<"OL_ERRC_INVALID_EVENT">86  ];87}88