[llvm-branch-commits] [llvm] [libsycl] add sycl::event and wait functionality to event & queue (PR #188793)
Sergey Semenov via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Fri Mar 27 05:56:24 PDT 2026
================
@@ -0,0 +1,68 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBSYCL_EVENT_IMPL
+#define _LIBSYCL_EVENT_IMPL
+
+#include <sycl/__impl/detail/config.hpp>
+#include <sycl/__impl/queue.hpp>
+
+#include <OffloadAPI.h>
+
+#include <memory>
+
+_LIBSYCL_BEGIN_NAMESPACE_SYCL
+namespace detail {
+
+class PlatformImpl;
+
+class EventImpl {
+ // Helper to limit EventImpl creation.
+ struct PrivateTag {
+ explicit PrivateTag() = default;
+ };
+
+public:
+ /// Constructs a SYCL event instance using the provided
+ /// offload event instance.
+ ///
+ /// \param Event is a raw offload library handle representing event.
+ /// \param Platform is a platform this event belongs to.
+ EventImpl(ol_event_handle_t Event, PlatformImpl &Platform, PrivateTag)
+ : MOffloadEvent(Event), MPlatform(Platform) {}
+
+ static std::shared_ptr<EventImpl>
+ createEventWithHandle(ol_event_handle_t Event, PlatformImpl &Queue) {
+ return std::make_shared<EventImpl>(Event, Queue, PrivateTag{});
+ }
+
+ /// Releases handle to the corresponding liboffload event.
----------------
sergey-semenov wrote:
```suggestion
/// Releases the handle to the corresponding liboffload event.
```
https://github.com/llvm/llvm-project/pull/188793
More information about the llvm-branch-commits
mailing list