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
{
36
return
trait::IsComplete<TEvent>::isComplete
(event);
37
}
38
}
// namespace alpaka
Common.hpp
ALPAKA_FN_HOST
#define ALPAKA_FN_HOST
Definition:
Common.hpp:40
Traits.hpp
alpaka
The alpaka accelerator library.
Definition:
AccCpuOmp2Blocks.hpp:49
alpaka::Event
typename trait::EventType< T >::type Event
The event type trait alias template to remove the ::type.
Definition:
Traits.hpp:26
alpaka::isComplete
ALPAKA_FN_HOST auto isComplete(TEvent const &event) -> bool
Tests if the given event has already been completed.
Definition:
Traits.hpp:34
alpaka::trait::EventType
The event type trait.
Definition:
Traits.hpp:17
alpaka::trait::IsComplete
The event tester trait.
Definition:
Traits.hpp:21
include
alpaka
event
Traits.hpp
Generated on Thu Nov 21 2024 22:46:14 for alpaka by
1.9.1