alpaka
Abstraction Library for Parallel Kernel Acceleration
Traits.hpp
Go to the documentation of this file.
1 /* Copyright 2022 Benjamin Worpitz, Bernhard Manfred Gruber
2  * SPDX-License-Identifier: MPL-2.0
3  */
4 
5 #pragma once
6 
7 #include "alpaka/core/Common.hpp"
9 
10 namespace alpaka
11 {
13  {
14  };
15 
16  //! The wait traits.
17  namespace trait
18  {
19  //! The thread wait trait.
20  template<typename TAwaited, typename TSfinae = void>
22 
23  //! The waiter wait trait.
24  template<typename TWaiter, typename TAwaited, typename TSfinae = void>
25  struct WaiterWaitFor;
26  } // namespace trait
27 
28  //! Waits the thread for the completion of the given awaited action to complete.
29  //!
30  //! Special Handling for events:
31  //! If the event is re-enqueued wait() will terminate when the re-enqueued event will be ready and previously
32  //! enqueued states of the event will be ignored.
33  template<typename TAwaited>
34  ALPAKA_FN_HOST auto wait(TAwaited const& awaited) -> void
35  {
38  }
39 
40  //! The waiter waits for the given awaited action to complete.
41  //!
42  //! Special Handling if \p waiter is a queue and \p awaited an event:
43  //! The \p waiter waits for the event state to become ready based on the recently captured event state at the
44  //! time of the API call even if the event is being re-enqueued later.
45  template<typename TWaiter, typename TAwaited>
46  ALPAKA_FN_HOST auto wait(TWaiter& waiter, TAwaited const& awaited) -> void
47  {
49  }
50 } // namespace alpaka
#define ALPAKA_FN_HOST
Definition: Common.hpp:40
typename detail::ImplementationBaseType< TConcept, TDerived >::type ImplementationBase
Returns the type that implements the given concept in the inheritance hierarchy.
Definition: Concepts.hpp:66
The alpaka accelerator library.
ALPAKA_FN_HOST auto wait(TAwaited const &awaited) -> void
Waits the thread for the completion of the given awaited action to complete.
Definition: Traits.hpp:34
The thread wait trait.
Definition: Traits.hpp:21
The waiter wait trait.
Definition: Traits.hpp:25