OmniSciDB  85c2d10cdc
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TableFunctionsTesting.hpp
Go to the documentation of this file.
1 /*
2  This file contains tesing compile-time UDTFs. The unit-tests are
3  implemented within the RBC package.
4  */
5 
6 #define CPU_DEVICE_CODE 0x637075; // 'cpu' in hex
7 #define GPU_DEVICE_CODE 0x677075; // 'gpu' in hex
8 
9 // clang-format off
10 /*
11  UDTF: ct_device_selection_udtf_any(Cursor<int32_t>) -> Column<int32_t>
12  UDTF: ct_device_selection_udtf_cpu__cpu_(Cursor<int32_t>) -> Column<int32_t>
13  UDTF: ct_device_selection_udtf_gpu__gpu_(Cursor<int32_t>) -> Column<int32_t>
14  UDTF: ct_device_selection_udtf_both__cpu_(Cursor<int32_t>) -> Column<int32_t>
15  UDTF: ct_device_selection_udtf_both__gpu_(Cursor<int32_t>) -> Column<int32_t>
16 */
17 // clang-format on
18 
21 #ifdef __CUDACC__
22  out[0] = GPU_DEVICE_CODE;
23 #else
24  out[0] = CPU_DEVICE_CODE;
25 #endif
26  return 1;
27 }
28 
31  Column<int64_t>& out) {
32  out[0] = CPU_DEVICE_CODE;
33  return 1;
34 }
35 
38  Column<int64_t>& out) {
39  out[0] = GPU_DEVICE_CODE;
40  return 1;
41 }
42 
45  Column<int64_t>& out) {
46  out[0] = CPU_DEVICE_CODE;
47  return 1;
48 }
49 
52  Column<int64_t>& out) {
53  out[0] = GPU_DEVICE_CODE;
54  return 1;
55 }
56 
57 #undef CPU_DEVICE_CODE
58 #undef GPU_DEVICE_CODE
59 
60 // clang-format off
61 /*
62  Test functions for constant sizer parameter:
63 
64  UDTF: ct_binding_udtf__cpu_1(Cursor<int32_t>) -> Column<int32_t>
65  UDTF: ct_binding_udtf__cpu_2(Cursor<int32_t, int32_t>) -> Column<int32_t>
66  UDTF: ct_binding_udtf__cpu_3(Cursor<int32_t, int32_t, int32_t>) -> Column<int32_t>
67  UDTF: ct_binding_udtf__cpu_4(Cursor<int64_t, int32_t, int32_t>) -> Column<int32_t>
68  UDTF: ct_binding_udtf__cpu_5(Cursor<int64_t, int64_t, int32_t>) -> Column<int32_t>
69  UDTF: ct_binding_udtf__cpu_6(Cursor<int64_t, int32_t, int64_t>) -> Column<int32_t>
70  UDTF: ct_binding_udtf__cpu_7(Cursor<int32_t, ColumnList<int32_t>>) -> Column<int32_t>
71  UDTF: ct_binding_udtf__cpu_8(Cursor<ColumnList<int32_t>, int64_t>) -> Column<int32_t>
72  UDTF: ct_binding_udtf__cpu_9(Cursor<ColumnList<int32_t>, ColumnList<int64_t>>) -> Column<int32_t>
73  UDTF: ct_binding_udtf__cpu_10(Cursor<int64_t, ColumnList<int64_t>, int64_t>) -> Column<int32_t>
74 
75 
76  Test functions for row multiplier sizer parameter:
77 
78  UDTF: ct_binding_udtf__cpu_11(Cursor<int32_t>, RowMultiplier) -> Column<int32_t>
79  UDTF: ct_binding_udtf__cpu_12(Cursor<int32_t, int32_t>, RowMultiplier) -> Column<int32_t>
80  UDTF: ct_binding_udtf__cpu_13(Cursor<int32_t, int32_t, int32_t>, RowMultiplier) -> Column<int32_t>
81  UDTF: ct_binding_udtf__cpu_14(Cursor<int64_t, int32_t, int32_t>, RowMultiplier) -> Column<int32_t>
82  UDTF: ct_binding_udtf__cpu_15(Cursor<int64_t, int64_t, int32_t>, RowMultiplier) -> Column<int32_t>
83  UDTF: ct_binding_udtf__cpu_16(Cursor<int64_t, int32_t, int64_t>, RowMultiplier) -> Column<int32_t>
84  UDTF: ct_binding_udtf__cpu_17(Cursor<int32_t, ColumnList<int32_t>>, RowMultiplier) -> Column<int32_t>
85  UDTF: ct_binding_udtf__cpu_18(Cursor<ColumnList<int32_t>, int64_t>, RowMultiplier) -> Column<int32_t>
86  UDTF: ct_binding_udtf__cpu_19(Cursor<ColumnList<int32_t>, ColumnList<int64_t>>, RowMultiplier) -> Column<int32_t>
87  UDTF: ct_binding_udtf__cpu_20(Cursor<int64_t, ColumnList<int64_t>, int64_t>, RowMultiplier) -> Column<int32_t>
88 
89  UDTF: ct_binding_udtf2__cpu_21(RowMultiplier, Cursor<int32_t>) -> Column<int32_t>
90  UDTF: ct_binding_udtf__cpu_22(Cursor<int32_t>, RowMultiplier, int32_t) -> Column<int32_t>
91  UDTF: ct_binding_udtf__cpu_23(Cursor<ColumnList<int32_t>>, RowMultiplier, int32_t) -> Column<int32_t>
92  UDTF: ct_binding_udtf2__cpu_24(Cursor<ColumnList<int32_t>>, int32_t, RowMultiplier) -> Column<int32_t>
93  UDTF: ct_binding_udtf3__cpu_25(Cursor<Column<int32_t>>, int32_t, RowMultiplier) -> Column<int32_t>
94 */
95 // clang-format on
96 
98  Column<int32_t>& out) {
99  out[0] = 1;
100  return 1;
101 }
103  const Column<int32_t>& input2,
104  Column<int32_t>& out) {
105  out[0] = 11;
106  return 1;
107 }
109  const Column<int32_t>& input2,
110  const Column<int32_t>& input3,
111  Column<int32_t>& out) {
112  out[0] = 111;
113  return 1;
114 }
116  const Column<int32_t>& input2,
117  const Column<int32_t>& input3,
118  Column<int32_t>& out) {
119  out[0] = 211;
120  return 1;
121 }
123  const Column<int64_t>& input2,
124  const Column<int32_t>& input3,
125  Column<int32_t>& out) {
126  out[0] = 221;
127  return 1;
128 }
130  const Column<int32_t>& input2,
131  const Column<int64_t>& input3,
132  Column<int32_t>& out) {
133  out[0] = 212;
134  return 1;
135 }
137  const ColumnList<int32_t>& input2,
138  Column<int32_t>& out) {
139  out[0] = 13;
140  return 1;
141 }
143  const Column<int64_t>& input2,
144  Column<int32_t>& out) {
145  out[0] = 32;
146  return 1;
147 }
149  const ColumnList<int64_t>& input2,
150  Column<int32_t>& out) {
151  out[0] = 34;
152  return 1;
153 }
155  const ColumnList<int64_t>& input2,
156  const Column<int64_t>& input3,
157  Column<int64_t>& out) {
158  out[0] = 242;
159  return 1;
160 }
161 
163  const int32_t multiplier,
164  Column<int32_t>& out) {
165  out[0] = 1000 + 19;
166  return 1;
167 }
169  const Column<int32_t>& input2,
170  const int32_t multiplier,
171  Column<int32_t>& out) {
172  out[0] = 1000 + 119;
173  return 1;
174 }
176  const Column<int32_t>& input2,
177  const Column<int32_t>& input3,
178  const int32_t multiplier,
179  Column<int32_t>& out) {
180  out[0] = 1000 + 1119;
181  return 1;
182 }
184  const Column<int32_t>& input2,
185  const Column<int32_t>& input3,
186  const int32_t multiplier,
187  Column<int32_t>& out) {
188  out[0] = 1000 + 2119;
189  return 1;
190 }
192  const Column<int64_t>& input2,
193  const Column<int32_t>& input3,
194  const int32_t multiplier,
195  Column<int32_t>& out) {
196  out[0] = 1000 + 2219;
197  return 1;
198 }
200  const Column<int32_t>& input2,
201  const Column<int64_t>& input3,
202  const int32_t multiplier,
203  Column<int32_t>& out) {
204  out[0] = 1000 + 2129;
205  return 1;
206 }
208  const ColumnList<int32_t>& input2,
209  const int32_t multiplier,
210  Column<int32_t>& out) {
211  out[0] = 1000 + 139;
212  return 1;
213 }
215  const Column<int64_t>& input2,
216  const int32_t multiplier,
217  Column<int32_t>& out) {
218  out[0] = 1000 + 329;
219  return 1;
220 }
222  const ColumnList<int64_t>& input2,
223  const int32_t multiplier,
224  Column<int32_t>& out) {
225  out[0] = 1000 + 349;
226  return 1;
227 }
229  const ColumnList<int64_t>& input2,
230  const Column<int64_t>& input3,
231  const int32_t multiplier,
232  Column<int64_t>& out) {
233  out[0] = 1000 + 2429;
234  return 1;
235 }
236 
237 EXTENSION_NOINLINE int32_t ct_binding_udtf2__cpu_21(const int32_t multiplier,
238  const Column<int32_t>& input1,
239  Column<int32_t>& out) {
240  out[0] = 1000 + 91;
241  return 1;
242 }
244  const int32_t multiplier,
245  const int32_t input2,
246  Column<int32_t>& out) {
247  out[0] = 1000 + 196;
248  return 1;
249 }
251  const int32_t multiplier,
252  const int32_t input2,
253  Column<int32_t>& out) {
254  out[0] = 1000 + 396;
255  return 1;
256 }
258  const int32_t input2,
259  const int32_t multiplier,
260  Column<int32_t>& out) {
261  out[0] = 1000 + 369;
262  return 1;
263 }
265  const int32_t input2,
266  const int32_t multiplier,
267  Column<int32_t>& out) {
268  out[0] = 1000 + 169;
269  return 1;
270 }
EXTENSION_NOINLINE int32_t ct_binding_udtf__cpu_12(const Column< int32_t > &input1, const Column< int32_t > &input2, const int32_t multiplier, Column< int32_t > &out)
EXTENSION_NOINLINE int32_t ct_binding_udtf3__cpu_25(const Column< int32_t > &input1, const int32_t input2, const int32_t multiplier, Column< int32_t > &out)
EXTENSION_NOINLINE int32_t ct_binding_udtf__cpu_13(const Column< int32_t > &input1, const Column< int32_t > &input2, const Column< int32_t > &input3, const int32_t multiplier, Column< int32_t > &out)
EXTENSION_NOINLINE int32_t ct_binding_udtf2__cpu_21(const int32_t multiplier, const Column< int32_t > &input1, Column< int32_t > &out)
EXTENSION_NOINLINE int32_t ct_binding_udtf2__cpu_24(const ColumnList< int32_t > &input1, const int32_t input2, const int32_t multiplier, Column< int32_t > &out)
EXTENSION_NOINLINE int32_t ct_binding_udtf__cpu_3(const Column< int32_t > &input1, const Column< int32_t > &input2, const Column< int32_t > &input3, Column< int32_t > &out)
EXTENSION_NOINLINE int32_t ct_binding_udtf__cpu_11(const Column< int32_t > &input1, const int32_t multiplier, Column< int32_t > &out)
EXTENSION_NOINLINE int32_t ct_binding_udtf__cpu_15(const Column< int64_t > &input1, const Column< int64_t > &input2, const Column< int32_t > &input3, const int32_t multiplier, Column< int32_t > &out)
EXTENSION_NOINLINE int32_t ct_binding_udtf__cpu_7(const Column< int32_t > &input1, const ColumnList< int32_t > &input2, Column< int32_t > &out)
EXTENSION_NOINLINE int32_t ct_binding_udtf__cpu_17(const Column< int32_t > &input1, const ColumnList< int32_t > &input2, const int32_t multiplier, Column< int32_t > &out)
#define CPU_DEVICE_CODE
#define EXTENSION_NOINLINE
Definition: OmniSciTypes.h:27
EXTENSION_NOINLINE int32_t ct_binding_udtf__cpu_16(const Column< int64_t > &input1, const Column< int32_t > &input2, const Column< int64_t > &input3, const int32_t multiplier, Column< int32_t > &out)
EXTENSION_NOINLINE int32_t ct_binding_udtf__cpu_4(const Column< int64_t > &input1, const Column< int32_t > &input2, const Column< int32_t > &input3, Column< int32_t > &out)
EXTENSION_NOINLINE int32_t ct_binding_udtf__cpu_9(const ColumnList< int32_t > &input1, const ColumnList< int64_t > &input2, Column< int32_t > &out)
EXTENSION_NOINLINE int32_t ct_binding_udtf__cpu_20(const Column< int64_t > &input1, const ColumnList< int64_t > &input2, const Column< int64_t > &input3, const int32_t multiplier, Column< int64_t > &out)
EXTENSION_NOINLINE int32_t ct_binding_udtf__cpu_5(const Column< int64_t > &input1, const Column< int64_t > &input2, const Column< int32_t > &input3, Column< int32_t > &out)
EXTENSION_NOINLINE int32_t ct_binding_udtf__cpu_23(const ColumnList< int32_t > &input1, const int32_t multiplier, const int32_t input2, Column< int32_t > &out)
#define GPU_DEVICE_CODE
EXTENSION_NOINLINE int32_t ct_binding_udtf__cpu_18(const ColumnList< int32_t > &input1, const Column< int64_t > &input2, const int32_t multiplier, Column< int32_t > &out)
EXTENSION_NOINLINE int32_t ct_device_selection_udtf_cpu__cpu_(const Column< int32_t > &input, Column< int64_t > &out)
EXTENSION_NOINLINE int32_t ct_binding_udtf__cpu_8(const ColumnList< int32_t > &input1, const Column< int64_t > &input2, Column< int32_t > &out)
EXTENSION_NOINLINE int32_t ct_binding_udtf__cpu_10(const Column< int64_t > &input1, const ColumnList< int64_t > &input2, const Column< int64_t > &input3, Column< int64_t > &out)
EXTENSION_NOINLINE int32_t ct_device_selection_udtf_both__cpu_(const Column< int32_t > &input, Column< int64_t > &out)
EXTENSION_NOINLINE int32_t ct_binding_udtf__cpu_1(const Column< int32_t > &input1, Column< int32_t > &out)
EXTENSION_NOINLINE int32_t ct_device_selection_udtf_any(const Column< int32_t > &input, Column< int64_t > &out)
EXTENSION_NOINLINE int32_t ct_binding_udtf__cpu_22(const Column< int32_t > &input1, const int32_t multiplier, const int32_t input2, Column< int32_t > &out)
EXTENSION_NOINLINE int32_t ct_binding_udtf__cpu_14(const Column< int64_t > &input1, const Column< int32_t > &input2, const Column< int32_t > &input3, const int32_t multiplier, Column< int32_t > &out)
EXTENSION_NOINLINE int32_t ct_binding_udtf__cpu_19(const ColumnList< int32_t > &input1, const ColumnList< int64_t > &input2, const int32_t multiplier, Column< int32_t > &out)
EXTENSION_NOINLINE int32_t ct_device_selection_udtf_both__gpu_(const Column< int32_t > &input, Column< int64_t > &out)
EXTENSION_NOINLINE int32_t ct_device_selection_udtf_gpu__gpu_(const Column< int32_t > &input, Column< int64_t > &out)
EXTENSION_NOINLINE int32_t ct_binding_udtf__cpu_2(const Column< int32_t > &input1, const Column< int32_t > &input2, Column< int32_t > &out)
EXTENSION_NOINLINE int32_t ct_binding_udtf__cpu_6(const Column< int64_t > &input1, const Column< int32_t > &input2, const Column< int64_t > &input3, Column< int32_t > &out)