rexlib 0.1.0
Device-agnostic array computing library for CryoEM and CryoET image processing, with a pluggable backend architecture
Loading...
Searching...
No Matches
core_dimensions.hpp
1// SPDX-License-Identifier: GPL-3.0-only
2
3#pragma once
4
5#include <rexlib/core/operation/shape_rule/any_extent_domain.hpp>
6#include <rexlib/core/operation/shape_rule/axis_run.hpp>
7#include <rexlib/core/operation/shape_rule/extent_slot.hpp>
8
9#include <rexlib/core/meta/type_list.hpp>
10#include <rexlib/core/platform/constexpr.hpp>
11
12#include <cstddef>
13#include <type_traits>
14
15namespace rexlib
16{
17
18namespace detail
19{
20
21template <typename T>
23 : std::false_type
24{
25};
26
27template <typename Domain>
29 : std::true_type
30{
31};
32
33template <typename... Slots>
35{
36 static REXLIB_CONST_CONSTEXPR bool has_run = false;
37
39 using slot_list_type = type_list<Slots...>;
40};
41
42template <typename Domain, typename... Slots>
44{
45 static REXLIB_CONST_CONSTEXPR bool has_run = true;
46
47 using run_domain_type = Domain;
48 using slot_list_type = type_list<Slots...>;
49};
50
51template <typename Slots>
53
54template <typename... Slots>
56 : std::is_same<
57 type_list<std::false_type, typename is_axis_run<Slots>::type...>,
58 type_list<typename is_axis_run<Slots>::type..., std::false_type>
59 >
60{
61};
62
63} // namespace detail
64
76template <typename... Slots>
78{
79 using slot_list_type =
80 typename detail::core_run_split<Slots...>::slot_list_type;
81 using run_domain_type =
82 typename detail::core_run_split<Slots...>::run_domain_type;
83
84 static REXLIB_CONST_CONSTEXPR bool has_run =
85 detail::core_run_split<Slots...>::has_run;
86 static REXLIB_CONST_CONSTEXPR std::size_t axis_count =
88
89 static_assert(
91 "A run may only lead the core dimensions, so the axes of one cannot "
92 "be told from those of the other."
93 );
94};
95
96} // 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
Domain admitting every extent.
Definition any_extent_domain.hpp:16
Leading core axes as many as the operation instance names.
Definition axis_run.hpp:22
The core axes of one operand.
Definition core_dimensions.hpp:78
Definition core_dimensions.hpp:35
Definition core_dimensions.hpp:24
Definition core_dimensions.hpp:52
Utility class to obtain the size of a type_list.
Definition type_list.hpp:28
Helper class to pass a heterogeneous sequence of types to a function.
Definition type_list.hpp:20