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"
8 #include "alpaka/dev/Traits.hpp"
9 
10 namespace alpaka
11 {
12  //! The event management traits.
13  namespace trait
14  {
15  //! The event type trait.
16  template<typename T, typename TSfinae = void>
17  struct EventType;
18 
19  //! The event tester trait.
20  template<typename TEvent, typename TSfinae = void>
21  struct IsComplete;
22  } // namespace trait
23 
24  //! The event type trait alias template to remove the ::type.
25  template<typename T>
26  using Event = typename trait::EventType<T>::type;
27 
28  //! Tests if the given event has already been completed.
29  //!
30  //! \warning This function is allowed to return false negatives. An already completed event can reported as
31  //! uncompleted because the status information are not fully propagated by the used alpaka backend.
32  //! \return true event is finished/complete else false.
33  template<typename TEvent>
34  ALPAKA_FN_HOST auto isComplete(TEvent const& event) -> bool
35  {
37  }
38 } // namespace alpaka
#define ALPAKA_FN_HOST
Definition: Common.hpp:40
The alpaka accelerator library.
typename trait::EventType< T >::type Event
The event type trait alias template to remove the ::type.
Definition: Traits.hpp:26
ALPAKA_FN_HOST auto isComplete(TEvent const &event) -> bool
Tests if the given event has already been completed.
Definition: Traits.hpp:34
The event type trait.
Definition: Traits.hpp:17
The event tester trait.
Definition: Traits.hpp:21