DPC++ Runtime
Runtime libraries for oneAPI DPC++
event.hpp
Go to the documentation of this file.
1
//==---------------- event.hpp --- SYCL event ------------------------------==//
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-exception
6
//
7
//===----------------------------------------------------------------------===//
8
9
#pragma once
10
11
#include <
sycl/backend_types.hpp
>
// for backend, backend_return_t
12
#include <
sycl/detail/defines_elementary.hpp
>
// for __SYCL2020_DEPRECATED
13
#include <
sycl/detail/export.hpp
>
// for __SYCL_EXPORT
14
#include <
sycl/detail/info_desc_helpers.hpp
>
// for is_event_info_desc, is_...
15
#include <
sycl/detail/owner_less_base.hpp
>
// for OwnerLessBase
16
#include <
sycl/detail/pi.h
>
// for pi_native_handle
17
18
#ifdef __SYCL_INTERNAL_API
19
#include <
sycl/detail/cl.h
>
20
#endif
21
22
#include <cstddef>
// for size_t
23
#include <memory>
// for shared_ptr, hash
24
#include <variant>
// for hash
25
#include <vector>
// for vector
26
27
namespace
sycl
{
28
inline
namespace
_V1 {
29
// Forward declaration
30
class
context;
31
32
template
<backend BackendName,
class
SyclObjectT>
33
auto
get_native
(
const
SyclObjectT &Obj)
34
-> backend_return_t<BackendName, SyclObjectT>;
35
36
namespace
detail {
37
class
event_impl;
38
}
39
44
class
__SYCL_EXPORT
event
:
public
detail::OwnerLessBase<event> {
45
public
:
49
event
();
50
57
#ifdef __SYCL_INTERNAL_API
58
event
(cl_event ClEvent,
const
context
&SyclContext);
59
#endif
60
61
event
(
const
event
&rhs) =
default
;
62
63
event
(
event
&&rhs) =
default
;
64
65
event
&
operator=
(
const
event
&rhs) =
default
;
66
67
event
&
operator=
(
event
&&rhs) =
default
;
68
69
bool
operator==(
const
event
&rhs)
const
;
70
71
bool
operator!=(
const
event
&rhs)
const
;
72
76
__SYCL2020_DEPRECATED
(
77
"is_host() is deprecated as the host device is no longer supported."
)
78
bool
is_host()
const
;
79
86
std::vector<event> get_wait_list();
87
89
void
wait();
90
94
static
void
wait(
const
std::vector<event> &EventList);
95
101
void
wait_and_throw();
102
110
static
void
wait_and_throw(
const
std::vector<event> &EventList);
111
115
template
<
typename
Param>
116
typename
detail::is_event_info_desc<Param>::return_type get_info()
const
;
117
129
template
<
typename
Param>
130
typename
detail::is_event_profiling_info_desc<Param>::return_type
131
get_profiling_info()
const
;
132
136
backend
get_backend()
const
noexcept
;
137
138
private
:
139
event
(std::shared_ptr<detail::event_impl> EventImpl);
140
141
pi_native_handle
getNative()
const
;
142
143
std::vector<pi_native_handle> getNativeVector()
const
;
144
145
std::shared_ptr<detail::event_impl> impl;
146
147
template
<
class
Obj>
148
friend
decltype(Obj::impl)
detail::getSyclObjImpl
(
const
Obj &SyclObject);
149
150
template
<
class
T>
151
friend
T
detail::createSyclObjFromImpl
(decltype(T::impl) ImplObj);
152
153
template
<backend BackendName,
class
SyclObjectT>
154
friend
auto
get_native
(
const
SyclObjectT &Obj)
155
->
backend_return_t<BackendName, SyclObjectT>
;
156
};
157
158
}
// namespace _V1
159
}
// namespace sycl
160
161
namespace
std
{
162
template
<>
struct
hash<
sycl
::event> {
163
size_t
operator()
(
const
sycl::event
&e)
const
{
164
return
hash<std::shared_ptr<sycl::detail::event_impl>>()(
165
sycl::detail::getSyclObjImpl
(e));
166
}
167
};
168
}
// namespace std
sycl::_V1::__SYCL2020_DEPRECATED
signed char __SYCL2020_DEPRECATED
Definition:
aliases.hpp:94
sycl::_V1::operator=
multi_ptr & operator=(const multi_ptr &)=default
pi.h
sycl::_V1::backend
backend
Definition:
backend_types.hpp:18
sycl
Definition:
access.hpp:18
noexcept
_Abi const simd< _Tp, _Abi > & noexcept
Definition:
simd.hpp:1324
sycl::_V1::event
An event object can be used to synchronize memory transfers, enqueues of kernels and signaling barrie...
Definition:
event.hpp:44
owner_less_base.hpp
export.hpp
defines_elementary.hpp
cl.h
std::hash< sycl::event >::operator()
size_t operator()(const sycl::event &e) const
Definition:
event.hpp:163
sycl::_V1::backend_return_t
typename backend_traits< Backend >::template return_type< SyclType > backend_return_t
Definition:
backend.hpp:87
sycl::_V1::detail::createSyclObjFromImpl
T createSyclObjFromImpl(decltype(T::impl) ImplObj)
Definition:
impl_utils.hpp:48
pi_native_handle
uintptr_t pi_native_handle
Definition:
pi.h:198
backend_types.hpp
std
Definition:
accessor.hpp:4171
info_desc_helpers.hpp
sycl::_V1::get_native
auto get_native(const SyclObjectT &Obj) -> backend_return_t< BackendName, SyclObjectT >
Definition:
backend.hpp:136
sycl::_V1::detail::getSyclObjImpl
decltype(Obj::impl) getSyclObjImpl(const Obj &SyclObject)
Definition:
impl_utils.hpp:30
sycl::_V1::context
The context class represents a SYCL context on which kernel functions may be executed.
Definition:
context.hpp:51
include
sycl
event.hpp
Generated by
1.8.17