Исходный код СУБД RuDB — свободной СУБД с открытым исходным кодом на базе PostgreSQL
rudb
3 days ago bd039d1e92813358c5c5a1e346b49074baf513f2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
 
#include "core/providers/op_kernel_type_control.h"
 
#include <cstdint>
 
#include "boost/mp11.hpp"
 
#include "core/common/type_list.h"
#include "core/common/type_set_utils.h"
 
namespace onnxruntime {
namespace test {
 
namespace {
// test types to match op_kernel_type_control::TypesHolder
template <typename... T>
struct TestTypesHolder {
  using types = TypeList<T...>;
};
 
struct TestTypesHolderUnspecified {
};
}  // namespace
 
// default
static_assert(
    utils::type_set::IsEqual<
        op_kernel_type_control::EnabledTypes<
            TestTypesHolder<int32_t, int64_t, float, double>,
            TestTypesHolderUnspecified,
            TypeList<
                TestTypesHolderUnspecified,
                TestTypesHolderUnspecified>>::types,
        TypeList<int32_t, int64_t, float, double>>::value,
    "unexpected enabled types");
 
// default + allowed for Op
static_assert(
    utils::type_set::IsEqual<
        op_kernel_type_control::EnabledTypes<
            TestTypesHolder<int32_t, int64_t, float, double>,
            TestTypesHolderUnspecified,
            TypeList<
                TestTypesHolder<float, int64_t>,
                TestTypesHolderUnspecified>>::types,
        TypeList<int64_t, float>>::value,
    "unexpected enabled types");
 
// default + allowed for Op, all enabled
static_assert(
    utils::type_set::IsEqual<
        op_kernel_type_control::EnabledTypes<
            TestTypesHolder<int32_t, int64_t, float, double>,
            TestTypesHolderUnspecified,
            TypeList<
                TestTypesHolder<float, double, int32_t, int64_t>,
                TestTypesHolderUnspecified>>::types,
        TypeList<int32_t, int64_t, float, double>>::value,
    "unexpected enabled types");
 
// default + allowed for Op, allowed not subset of default
static_assert(
    utils::type_set::IsEqual<
        op_kernel_type_control::EnabledTypes<
            TestTypesHolder<int32_t, int64_t, float, double>,
            TestTypesHolderUnspecified,
            TypeList<
                TestTypesHolder<double, int64_t, char>,
                TestTypesHolderUnspecified>>::types,
        TypeList<int64_t, double>>::value,
    "unexpected enabled types");
 
// default + allowed for Op, all disabled
static_assert(
    utils::type_set::IsEqual<
        op_kernel_type_control::EnabledTypes<
            TestTypesHolder<int32_t, int64_t, float, double>,
            TestTypesHolderUnspecified,
            TypeList<
                TestTypesHolder<>,
                TestTypesHolderUnspecified>>::types,
        TypeList<>>::value,
    "unexpected enabled types");
 
// default + allowed for Op + allowed globally
static_assert(
    utils::type_set::IsEqual<
        op_kernel_type_control::EnabledTypes<
            TestTypesHolder<int32_t, int64_t, float, double>,
            TestTypesHolderUnspecified,
            TypeList<
                TestTypesHolder<float, int64_t>,
                TestTypesHolder<int64_t>>>::types,
        TypeList<int64_t>>::value,
    "unexpected enabled types");
 
// default + required + allowed for Op
static_assert(
    utils::type_set::IsEqual<
        op_kernel_type_control::EnabledTypes<
            TestTypesHolder<int32_t, int64_t, float, double>,
            TestTypesHolder<int64_t>,
            TypeList<
                TestTypesHolder<int32_t, double>,
                TestTypesHolderUnspecified>>::types,
        TypeList<int32_t, int64_t, double>>::value,
    "unexpected enabled types");
 
// default + required + allowed for Op, only required enabled
static_assert(
    utils::type_set::IsEqual<
        op_kernel_type_control::EnabledTypes<
            TestTypesHolder<int32_t, int64_t, float, double>,
            TestTypesHolder<int64_t>,
            TypeList<
                TestTypesHolder<>,
                TestTypesHolderUnspecified>>::types,
        TypeList<int64_t>>::value,
    "unexpected enabled types");
 
// default + required + allowed for Op + allowed globally
static_assert(
    utils::type_set::IsEqual<
        op_kernel_type_control::EnabledTypes<
            TestTypesHolder<int32_t, int64_t, float, double>,
            TestTypesHolder<int64_t>,
            TypeList<
                TestTypesHolder<int32_t, double>,
                TestTypesHolder<double>>>::types,
        TypeList<int64_t, double>>::value,
    "unexpected enabled types");
 
}  // namespace test
}  // namespace onnxruntime