rexlib 0.1.0
Device-agnostic array computing library for CryoEM and CryoET image processing, with a pluggable backend architecture
Loading...
Searching...
No Matches
operand_names.hpp
1// SPDX-License-Identifier: GPL-3.0-only
2
3#pragma once
4
5#include <rexlib/core/platform/constexpr.hpp>
6#include <rexlib/core/span.hpp>
7
8#include <array>
9#include <cstddef>
10#include <type_traits>
11
12namespace rexlib
13{
14
26template <std::size_t N>
28{
29 static REXLIB_CONST_CONSTEXPR std::size_t count = N;
30
31 std::array<const char*, N> values;
32
39 {
40 return make_span(values.data(), N);
41 }
42};
43
50template <typename... Names>
51REXLIB_CONSTEXPR
52operand_names<sizeof...(Names)> make_operand_names(Names... names) noexcept
53{
54 return operand_names<sizeof...(Names)>{ { names... } };
55}
56
65template <typename T>
67 : std::integral_constant<
68 std::size_t,
69 std::decay<T>::type::count
70 >
71{
72};
73
74} // namespace rexlib
Container for multidimensional numeric data.
Definition array.hpp:31
Arrays, the operations on them and the devices that run those operations.
Definition cpu_device.hpp:10
REXLIB_CONSTEXPR operand_names< sizeof...(Names)> make_operand_names(Names... names) noexcept
Build an operand name list.
Definition operand_names.hpp:52
Get the operand count of an operand name list.
Definition operand_names.hpp:71
Compile time list of operand names.
Definition operand_names.hpp:28
span< const char *const > get() const noexcept
Get the names as a span.
Definition operand_names.hpp:38