alpaka
Abstraction Library for Parallel Kernel Acceleration
Loading...
Searching...
No Matches
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
8
9#include <concepts>
10
11namespace 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>
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
Concept to check for APIs.
Definition api.hpp:42
main alpaka namespace.
Definition alpaka.hpp:76
constexpr bool isApi_v
Definition api.hpp:29