//===--- 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 // //===----------------------------------------------------------------------===// // // Async Queue wrapper for Level Zero. // //===----------------------------------------------------------------------===// #ifndef OPENMP_LIBOMPTARGET_PLUGINS_NEXTGEN_LEVEL_ZERO_ASYNCQUEUE_H #define OPENMP_LIBOMPTARGET_PLUGINS_NEXTGEN_LEVEL_ZERO_ASYNCQUEUE_H #include #include "L0Memory.h" namespace llvm::omp::target::plugin { /// Abstract queue that supports asynchronous command submission. struct AsyncQueueTy { /// List of events attached to submitted commands. llvm::SmallVector WaitEvents; /// Pending staging buffer to host copies. llvm::SmallVector> H2MList; /// Pending USM memory copy commands that must wait for kernel completion. llvm::SmallVector> USM2MList; /// Kernel event not signaled. ze_event_handle_t KernelEvent = nullptr; /// Clear data. void reset() { WaitEvents.clear(); H2MList.clear(); USM2MList.clear(); KernelEvent = nullptr; } }; using AsyncQueuePoolTy = ObjPool; } // namespace llvm::omp::target::plugin #endif // OPENMP_LIBOMPTARGET_PLUGINS_NEXTGEN_LEVEL_ZERO_ASYNCQUEUE_H