[llvm] [libsycl] add sycl::event and wait functionality to event & queue (PR #188793)

Alexey Bader via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 7 14:21:42 PDT 2026


================
@@ -0,0 +1,90 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// This file contains the declaration of the SYCL event class (SYCL
+/// 2020 4.6.6.), that represents the status of an operation that is being
+/// executed by the SYCL runtime.
+///
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBSYCL___IMPL_EVENT_HPP
+#define _LIBSYCL___IMPL_EVENT_HPP
+
+#include <sycl/__impl/backend.hpp>
+#include <sycl/__impl/detail/config.hpp>
+#include <sycl/__impl/detail/obj_utils.hpp>
+#include <sycl/__impl/info/desc_base.hpp>
+
+#include <memory>
+#include <vector>
+
+_LIBSYCL_BEGIN_NAMESPACE_SYCL
+
+class event;
+
+namespace detail {
+class EventImpl;
+template <typename T>
+using is_event_info_desc_t = typename is_info_desc<T, event>::return_type;
+} // namespace detail
+
+/// SYCL 2020 4.6.6. Event class.
+class _LIBSYCL_EXPORT event {
+public:
+  event(const event &rhs) = default;
+
+  event(event &&rhs) = default;
+
+  event &operator=(const event &rhs) = default;
+
+  event &operator=(event &&rhs) = default;
----------------
bader wrote:

```suggestion
  event(const event &rhs) = default;
  event(event &&rhs) = default;
  event &operator=(const event &rhs) = default;
  event &operator=(event &&rhs) = default;
```
Please, define the destructor to satisfy the rule of five.

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


More information about the llvm-commits mailing list