alpaka
Abstraction Library for Parallel Kernel Acceleration
Loading...
Searching...
No Matches
include
alpaka
api
concepts
api.hpp
Go to the documentation of this file.
1
/* Copyright 2024 René Widera
2
* SPDX-License-Identifier: MPL-2.0
3
*/
4
5
#pragma once
6
7
#include "
alpaka/concepts/hasName.hpp
"
8
9
#include <concepts>
10
11
namespace
alpaka
12
{
13
namespace
detail
14
{
15
struct
ApiBase
16
{
17
};
18
}
// namespace detail
19
20
namespace
trait
21
{
22
template
<
typename
T_Type>
23
struct
IsApi
: std::is_base_of<detail::ApiBase, T_Type>
24
{
25
};
26
}
// namespace trait
27
28
template
<
typename
T_Type>
29
constexpr
bool
isApi_v
=
trait::IsApi<T_Type>::value
;
30
31
namespace
concepts
32
{
33
/** @brief Concept to check for APIs
34
*
35
* @details
36
* This concept requires that the template is an API. An API in alpaka is the representation of a software
37
* library that can target one or multiple accelerators. Examples of APIs are alpaka::api::Cuda and
38
* alpaka::api::Host. An Api together with an alpaka::concepts::DeviceKind can make up an
39
* alpaka::onHost::Device.
40
*/
41
template
<
typename
T>
42
concept
Api
=
isApi_v<T>
&&
requires
(T t) {
requires
HasStaticName<T>
; };
43
}
// namespace concepts
44
}
// namespace alpaka
alpaka::concepts::Api
Concept to check for APIs.
Definition
api.hpp:42
alpaka::concepts::HasStaticName
Definition
hasName.hpp:17
hasName.hpp
alpaka::concepts
Definition
api.hpp:32
alpaka::detail
Definition
api.hpp:14
alpaka::trait
Definition
api.hpp:21
alpaka
main alpaka namespace.
Definition
alpaka.hpp:76
alpaka::isApi_v
constexpr bool isApi_v
Definition
api.hpp:29
alpaka::detail::ApiBase
Definition
api.hpp:16
alpaka::trait::IsApi
Definition
api.hpp:24
Generated on
for alpaka by
1.16.1