File: codegen_sel.m

package info (click to toggle)
suitesparse-graphblas 7.4.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 67,112 kB
  • sloc: ansic: 1,072,243; cpp: 8,081; sh: 512; makefile: 506; asm: 369; python: 125; awk: 10
file content (317 lines) | stat: -rw-r--r-- 18,400 bytes parent folder | download | duplicates (3)
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
function codegen_sel
%CODEGEN_SEL create functions for all selection operators
%
% This function creates all files of the form GB_sel__*.c,
% and the include file GB_sel__include.h.

% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2022, All Rights Reserved.
% SPDX-License-Identifier: Apache-2.0

fprintf ('\nselection operators:\n') ;
addpath ('../Test') ;

f = fopen ('Generated1/GB_sel__include.h', 'w') ;
fprintf (f, '//------------------------------------------------------------------------------\n') ;
fprintf (f, '// GB_sel__include.h: definitions for GB_sel__*.c\n') ;
fprintf (f, '//------------------------------------------------------------------------------\n') ;
fprintf (f, '\n') ;
fprintf (f, '// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2022, All Rights Reserved.\n') ;
fprintf (f, '// SPDX-License-Identifier: Apache-2.0\n\n') ;
fprintf (f, '// This file has been automatically generated from Generator/GB_sel.h') ;
fprintf (f, '\n\n') ;
fclose (f) ;

%===============================================================================
% select ops where A is either iso or non-iso
%===============================================================================

%-------------------------------------------------------------------------------
% USER selectop:
%-------------------------------------------------------------------------------

fprintf ('\nselop      ') ;

% user select op, A is not iso, no typecasting
test_value {1} = 'GxB_select_function selop_func = op->selop_function ;' ;
test_value {2} = 'bool keep = selop_func (flipij ? j : i, flipij ? i : j, Ax +(p)*asize, ythunk)' ;
codegen_sel_method ('user', test_value, 'GB_void') ;

% user select op, A is iso, no typecasting
test_value {1} = 'GxB_select_function selop_func = op->selop_function ;' ;
test_value {2} = 'bool keep = selop_func (flipij ? j : i, flipij ? i : j, Ax, ythunk)' ;
codegen_sel_method ('user', test_value, 'GB_void', [ ], 1) ;

%-------------------------------------------------------------------------------
% GrB_IndexUnaryOp:
%-------------------------------------------------------------------------------

fprintf ('\nidxunop    ') ;

% index_unaryop op, A is not iso, with typecasting
s1 = 'GxB_index_unary_function idxunop_func = op->idxunop_function ; ' ;
s2 = 'GB_cast_function cast_A_to_X = GB_cast_factory (xcode, acode) ; ' ;
s3 = 'GB_cast_function cast_Z_to_bool = GB_cast_factory (GB_BOOL_code, zcode) ; ' ;
test_value {1} = [s1 s2 s3] ;
zx = 'GB_void z [GB_VLA(zsize)] ; GB_void x [GB_VLA(xsize)] ; ' ;
ca = 'cast_A_to_X (x, Ax +(p)*asize, asize) ; ' ;
fn = 'idxunop_func (z, x, flipij ? j : i, flipij ? i : j, ythunk) ; ' ;
ke = 'bool keep ; cast_Z_to_bool (&keep, z, zsize) ;' ;
test_value {2} = [zx ca fn ke] ;
codegen_sel_method ('idxunop_cast', test_value, 'GB_void') ;

% index_unaryop op, A is not iso, no typecasting
s1 = 'GxB_index_unary_function idxunop_func = op->idxunop_function ; ' ;
test_value {1} = [s1] ;
test_value {2} = 'bool keep ; idxunop_func (&keep, Ax +(p)*asize, flipij ? j : i, flipij ? i : j, ythunk) ; ' ;
codegen_sel_method ('idxunop', test_value, 'GB_void') ;

% index_unaryop op, A is iso, with typecasting 
s1 = 'GxB_index_unary_function idxunop_func = op->idxunop_function ; ' ;
s2 = 'GB_void x [GB_VLA(xsize)] ; GB_cast_scalar (x, xcode, A->x, acode, A->type->size) ; ' ;
s3 = 'GB_cast_function cast_Z_to_bool = GB_cast_factory (GB_BOOL_code, zcode) ; ' ;
test_value {1} = [s1 s2 s3] ;
zx = 'GB_void z [GB_VLA(zsize)] ; ' ;
fn = 'idxunop_func (z, x, flipij ? j : i, flipij ? i : j, ythunk) ; ' ;
ke = 'bool keep ; cast_Z_to_bool (&keep, z, zsize) ;' ;
test_value {2} = [zx fn ke] ;
codegen_sel_method ('idxunop_cast', test_value, 'GB_void', [ ], 1) ;

% index_unaryop op, A is iso, no typecast
s1 = 'GxB_index_unary_function idxunop_func = op->idxunop_function ; ' ;
s2 = 'GB_void x [GB_VLA(xsize)] ; GB_cast_scalar (x, xcode, A->x, acode, A->type->size) ; ' ;
test_value {1} = [s1 s2] ;
test_value {2} = 'bool keep ; idxunop_func (&keep, x, flipij ? j : i, flipij ? i : j, ythunk) ; ' ;
codegen_sel_method ('idxunop', test_value, 'GB_void', [ ], 1) ;

%-------------------------------------------------------------------------------
% TRIL, TRIU, DIAG, OFFIDIAG, ...
%-------------------------------------------------------------------------------

fprintf ('\ntril       ') ;
codegen_sel_method ('tril'      , [ ], 'GB_void' , 'GB_TRIL_SELECTOR'    ) ;
codegen_sel_method ('tril'      , [ ], 'GB_void' , 'GB_TRIL_SELECTOR'    , 1) ;

fprintf ('\ntriu       ') ;
codegen_sel_method ('triu'      , [ ], 'GB_void' , 'GB_TRIU_SELECTOR'    ) ;
codegen_sel_method ('triu'      , [ ], 'GB_void' , 'GB_TRIU_SELECTOR'    , 1) ;

fprintf ('\ndiag       ') ;
codegen_sel_method ('diag'      , [ ], 'GB_void' , 'GB_DIAG_SELECTOR'    ) ;
codegen_sel_method ('diag'      , [ ], 'GB_void' , 'GB_DIAG_SELECTOR'    , 1) ;

fprintf ('\noffdiag    ') ;
codegen_sel_method ('offdiag'   , [ ], 'GB_void' , 'GB_OFFDIAG_SELECTOR' ) ;
codegen_sel_method ('offdiag'   , [ ], 'GB_void' , 'GB_OFFDIAG_SELECTOR' , 1) ;

fprintf ('\nrowindex   ') ;
codegen_sel_method ('rowindex'  , [ ], 'GB_void' , 'GB_ROWINDEX_SELECTOR') ;
codegen_sel_method ('rowindex'  , [ ], 'GB_void' , 'GB_ROWINDEX_SELECTOR', 1) ;

fprintf ('\nrowle      ') ; % was called resize
codegen_sel_method ('rowle'     , [ ], 'GB_void' , 'GB_ROWLE_SELECTOR'   ) ;
codegen_sel_method ('rowle'     , [ ], 'GB_void' , 'GB_ROWLE_SELECTOR'   , 1) ;

fprintf ('\nrowgt      ') ;
codegen_sel_method ('rowgt'     , [ ], 'GB_void' , 'GB_ROWGT_SELECTOR'   ) ;
codegen_sel_method ('rowgt'     , [ ], 'GB_void' , 'GB_ROWGT_SELECTOR'   , 1) ;

fprintf ('\ncolindex   ') ;
codegen_sel_method ('colindex'  , [ ], 'GB_void' , 'GB_COLINDEX_SELECTOR') ;
codegen_sel_method ('colindex'  , [ ], 'GB_void' , 'GB_COLINDEX_SELECTOR', 1) ;

fprintf ('\ncolle      ') ; % was called resize
codegen_sel_method ('colle'     , [ ], 'GB_void' , 'GB_COLLE_SELECTOR'   ) ;
codegen_sel_method ('colle'     , [ ], 'GB_void' , 'GB_COLLE_SELECTOR'   , 1) ;

fprintf ('\ncolgt      ') ;
codegen_sel_method ('colgt'     , [ ], 'GB_void' , 'GB_COLGT_SELECTOR'   ) ;
codegen_sel_method ('colgt'     , [ ], 'GB_void' , 'GB_COLGT_SELECTOR'   , 1) ;

% NONZOMBIE:         name         selector                     type
% phase1: depends on Ai only, so only nonzombie_iso is used
% phase2: use all 15 workers
% TODO NONZOMBIE can use cases 1, 2, 4, 8, 16, other
fprintf ('\nnonzombie  ') ;
test_value = 'bool keep = (Ai [p] >= 0)' ;
codegen_sel_method ('nonzombie', test_value, 'bool'      ) ;
codegen_sel_method ('nonzombie', test_value, 'int8_t'    ) ;
codegen_sel_method ('nonzombie', test_value, 'int16_t'   ) ;
codegen_sel_method ('nonzombie', test_value, 'int32_t'   ) ;
codegen_sel_method ('nonzombie', test_value, 'int64_t'   ) ;
codegen_sel_method ('nonzombie', test_value, 'uint8_t'   ) ;
codegen_sel_method ('nonzombie', test_value, 'uint16_t'  ) ;
codegen_sel_method ('nonzombie', test_value, 'uint32_t'  ) ;
codegen_sel_method ('nonzombie', test_value, 'uint64_t'  ) ;
codegen_sel_method ('nonzombie', test_value, 'float'     ) ;
codegen_sel_method ('nonzombie', test_value, 'double'    ) ;
codegen_sel_method ('nonzombie', test_value, 'GxB_FC32_t') ;
codegen_sel_method ('nonzombie', test_value, 'GxB_FC64_t') ;
codegen_sel_method ('nonzombie', test_value, 'GB_void'   ) ;
codegen_sel_method ('nonzombie', test_value, 'GB_void'   , [ ], 1) ;

%===============================================================================
% select ops with no iso variants
%===============================================================================

% None of these selectops require an iso variant for the selectop worker.  They
% are only used when A is non-iso.  The iso case is handled in GB_selector,
% where either C is all of A, or C is empty.

% TODO NONZERO, EQ_ZERO, NE_THUNK, EQ_THUNK can use cases 1, 2, 4, 8, 16, other

% NONZERO            name         selector       type
fprintf ('\nnonzero    ') ;
codegen_sel_method ('nonzero'  , 'bool keep = (Ax [p])',      'bool'    ) ;
codegen_sel_method ('nonzero'  , 'bool keep = (Ax [p] != 0)', 'int8_t'  ) ;
codegen_sel_method ('nonzero'  , 'bool keep = (Ax [p] != 0)', 'int16_t' ) ;
codegen_sel_method ('nonzero'  , 'bool keep = (Ax [p] != 0)', 'int32_t' ) ;
codegen_sel_method ('nonzero'  , 'bool keep = (Ax [p] != 0)', 'int64_t' ) ;
codegen_sel_method ('nonzero'  , 'bool keep = (Ax [p] != 0)', 'uint8_t' ) ;
codegen_sel_method ('nonzero'  , 'bool keep = (Ax [p] != 0)', 'uint16_t') ;
codegen_sel_method ('nonzero'  , 'bool keep = (Ax [p] != 0)', 'uint32_t') ;
codegen_sel_method ('nonzero'  , 'bool keep = (Ax [p] != 0)', 'uint64_t') ;
codegen_sel_method ('nonzero'  , 'bool keep = (Ax [p] != 0)', 'float'   ) ;
codegen_sel_method ('nonzero'  , 'bool keep = (Ax [p] != 0)', 'double'  ) ;
codegen_sel_method ('nonzero'  , 'bool keep = GB_FC32_ne0 (Ax [p])', 'GxB_FC32_t') ;
codegen_sel_method ('nonzero'  , 'bool keep = GB_FC64_ne0 (Ax [p])', 'GxB_FC64_t') ;
codegen_sel_method ('nonzero'  , 'bool keep = GB_is_nonzero (Ax +((p)*asize), asize)', 'GB_void') ;

% EQ_ZERO            name         selector       type
fprintf ('\neq_zero    ') ;
codegen_sel_method ('eq_zero'  , 'bool keep = (!(Ax [p]))',   'bool'    ) ;
codegen_sel_method ('eq_zero'  , 'bool keep = (Ax [p] == 0)', 'int8_t'  ) ;
codegen_sel_method ('eq_zero'  , 'bool keep = (Ax [p] == 0)', 'int16_t' ) ;
codegen_sel_method ('eq_zero'  , 'bool keep = (Ax [p] == 0)', 'int32_t' ) ;
codegen_sel_method ('eq_zero'  , 'bool keep = (Ax [p] == 0)', 'int64_t' ) ;
codegen_sel_method ('eq_zero'  , 'bool keep = (Ax [p] == 0)', 'uint8_t' ) ;
codegen_sel_method ('eq_zero'  , 'bool keep = (Ax [p] == 0)', 'uint16_t') ;
codegen_sel_method ('eq_zero'  , 'bool keep = (Ax [p] == 0)', 'uint32_t') ;
codegen_sel_method ('eq_zero'  , 'bool keep = (Ax [p] == 0)', 'uint64_t') ;
codegen_sel_method ('eq_zero'  , 'bool keep = (Ax [p] == 0)', 'float'   ) ;
codegen_sel_method ('eq_zero'  , 'bool keep = (Ax [p] == 0)', 'double'  ) ;
codegen_sel_method ('eq_zero'  , 'bool keep = GB_FC32_eq0 (Ax [p])', 'GxB_FC32_t') ;
codegen_sel_method ('eq_zero'  , 'bool keep = GB_FC64_eq0 (Ax [p])', 'GxB_FC64_t') ;
codegen_sel_method ('eq_zero'  , 'bool keep = (!GB_is_nonzero (Ax +((p)*asize), asize))', 'GB_void') ;

% GT_ZERO            name         selector       type
fprintf ('\ngt_zero    ') ;
codegen_sel_method ('gt_zero'  , 'bool keep = (Ax [p] > 0)', 'int8_t'  ) ;
codegen_sel_method ('gt_zero'  , 'bool keep = (Ax [p] > 0)', 'int16_t' ) ;
codegen_sel_method ('gt_zero'  , 'bool keep = (Ax [p] > 0)', 'int32_t' ) ;
codegen_sel_method ('gt_zero'  , 'bool keep = (Ax [p] > 0)', 'int64_t' ) ;
codegen_sel_method ('gt_zero'  , 'bool keep = (Ax [p] > 0)', 'float'   ) ;
codegen_sel_method ('gt_zero'  , 'bool keep = (Ax [p] > 0)', 'double'  ) ;

% GE_ZERO            name         selector       type
fprintf ('\nge_zero    ') ;
codegen_sel_method ('ge_zero'  , 'bool keep = (Ax [p] >= 0)', 'int8_t'  ) ;
codegen_sel_method ('ge_zero'  , 'bool keep = (Ax [p] >= 0)', 'int16_t' ) ;
codegen_sel_method ('ge_zero'  , 'bool keep = (Ax [p] >= 0)', 'int32_t' ) ;
codegen_sel_method ('ge_zero'  , 'bool keep = (Ax [p] >= 0)', 'int64_t' ) ;
codegen_sel_method ('ge_zero'  , 'bool keep = (Ax [p] >= 0)', 'float'   ) ;
codegen_sel_method ('ge_zero'  , 'bool keep = (Ax [p] >= 0)', 'double'  ) ;

% LT_ZERO            name         selector       type
fprintf ('\nlt_zero    ') ;
codegen_sel_method ('lt_zero'  , 'bool keep = (Ax [p] < 0)', 'int8_t'  ) ;
codegen_sel_method ('lt_zero'  , 'bool keep = (Ax [p] < 0)', 'int16_t' ) ;
codegen_sel_method ('lt_zero'  , 'bool keep = (Ax [p] < 0)', 'int32_t' ) ;
codegen_sel_method ('lt_zero'  , 'bool keep = (Ax [p] < 0)', 'int64_t' ) ;
codegen_sel_method ('lt_zero'  , 'bool keep = (Ax [p] < 0)', 'float'   ) ;
codegen_sel_method ('lt_zero'  , 'bool keep = (Ax [p] < 0)', 'double'  ) ;

% LE_ZERO            name         selector       type
fprintf ('\nle_zero    ') ;
codegen_sel_method ('le_zero'  , 'bool keep = (Ax [p] <= 0)', 'int8_t'  ) ;
codegen_sel_method ('le_zero'  , 'bool keep = (Ax [p] <= 0)', 'int16_t' ) ;
codegen_sel_method ('le_zero'  , 'bool keep = (Ax [p] <= 0)', 'int32_t' ) ;
codegen_sel_method ('le_zero'  , 'bool keep = (Ax [p] <= 0)', 'int64_t' ) ;
codegen_sel_method ('le_zero'  , 'bool keep = (Ax [p] <= 0)', 'float'   ) ;
codegen_sel_method ('le_zero'  , 'bool keep = (Ax [p] <= 0)', 'double'  ) ;

% NE_THUNK           name         selector            type
fprintf ('\nne_thunk   ') ;
codegen_sel_method ('ne_thunk'  , 'bool keep = (Ax [p] != thunk)', 'int8_t'  ) ;
codegen_sel_method ('ne_thunk'  , 'bool keep = (Ax [p] != thunk)', 'int16_t' ) ;
codegen_sel_method ('ne_thunk'  , 'bool keep = (Ax [p] != thunk)', 'int32_t' ) ;
codegen_sel_method ('ne_thunk'  , 'bool keep = (Ax [p] != thunk)', 'int64_t' ) ;
codegen_sel_method ('ne_thunk'  , 'bool keep = (Ax [p] != thunk)', 'uint8_t' ) ;
codegen_sel_method ('ne_thunk'  , 'bool keep = (Ax [p] != thunk)', 'uint16_t') ;
codegen_sel_method ('ne_thunk'  , 'bool keep = (Ax [p] != thunk)', 'uint32_t') ;
codegen_sel_method ('ne_thunk'  , 'bool keep = (Ax [p] != thunk)', 'uint64_t') ;
codegen_sel_method ('ne_thunk'  , 'bool keep = (Ax [p] != thunk)', 'float'   ) ;
codegen_sel_method ('ne_thunk'  , 'bool keep = (Ax [p] != thunk)', 'double'  ) ;
codegen_sel_method ('ne_thunk'  , 'bool keep = GB_FC32_ne (Ax [p], thunk)', 'GxB_FC32_t') ;
codegen_sel_method ('ne_thunk'  , 'bool keep = GB_FC64_ne (Ax [p], thunk)', 'GxB_FC64_t') ;
codegen_sel_method ('ne_thunk'  , 'bool keep = (memcmp (Ax +((p)*asize), athunk, asize) != 0)', 'GB_void') ;

% EQ_THUNK           name         selector            type
fprintf ('\neq_thunk   ') ;
codegen_sel_method ('eq_thunk'  , 'bool keep = (Ax [p] == thunk)', 'int8_t'  ) ;
codegen_sel_method ('eq_thunk'  , 'bool keep = (Ax [p] == thunk)', 'int16_t' ) ;
codegen_sel_method ('eq_thunk'  , 'bool keep = (Ax [p] == thunk)', 'int32_t' ) ;
codegen_sel_method ('eq_thunk'  , 'bool keep = (Ax [p] == thunk)', 'int64_t' ) ;
codegen_sel_method ('eq_thunk'  , 'bool keep = (Ax [p] == thunk)', 'uint8_t' ) ;
codegen_sel_method ('eq_thunk'  , 'bool keep = (Ax [p] == thunk)', 'uint16_t') ;
codegen_sel_method ('eq_thunk'  , 'bool keep = (Ax [p] == thunk)', 'uint32_t') ;
codegen_sel_method ('eq_thunk'  , 'bool keep = (Ax [p] == thunk)', 'uint64_t') ;
codegen_sel_method ('eq_thunk'  , 'bool keep = (Ax [p] == thunk)', 'float'   ) ;
codegen_sel_method ('eq_thunk'  , 'bool keep = (Ax [p] == thunk)', 'double'  ) ;
codegen_sel_method ('eq_thunk'  , 'bool keep = GB_FC32_eq (Ax [p], thunk)', 'GxB_FC32_t') ;
codegen_sel_method ('eq_thunk'  , 'bool keep = GB_FC64_eq (Ax [p], thunk)', 'GxB_FC64_t') ;
codegen_sel_method ('eq_thunk'  , 'bool keep = (memcmp (Ax +((p)*asize), athunk, asize) == 0)', 'GB_void') ;

% GT_THUNK           name         selector            type
fprintf ('\ngt_thunk   ') ;
codegen_sel_method ('gt_thunk'  , 'bool keep = (Ax [p] > thunk)', 'int8_t'  ) ;
codegen_sel_method ('gt_thunk'  , 'bool keep = (Ax [p] > thunk)', 'int16_t' ) ;
codegen_sel_method ('gt_thunk'  , 'bool keep = (Ax [p] > thunk)', 'int32_t' ) ;
codegen_sel_method ('gt_thunk'  , 'bool keep = (Ax [p] > thunk)', 'int64_t' ) ;
codegen_sel_method ('gt_thunk'  , 'bool keep = (Ax [p] > thunk)', 'uint8_t' ) ;
codegen_sel_method ('gt_thunk'  , 'bool keep = (Ax [p] > thunk)', 'uint16_t') ;
codegen_sel_method ('gt_thunk'  , 'bool keep = (Ax [p] > thunk)', 'uint32_t') ;
codegen_sel_method ('gt_thunk'  , 'bool keep = (Ax [p] > thunk)', 'uint64_t') ;
codegen_sel_method ('gt_thunk'  , 'bool keep = (Ax [p] > thunk)', 'float'   ) ;
codegen_sel_method ('gt_thunk'  , 'bool keep = (Ax [p] > thunk)', 'double'  ) ;

% GE_THUNK           name         selector            type
fprintf ('\nge_thunk   ') ;
codegen_sel_method ('ge_thunk'  , 'bool keep = (Ax [p] >= thunk)', 'int8_t'  ) ;
codegen_sel_method ('ge_thunk'  , 'bool keep = (Ax [p] >= thunk)', 'int16_t' ) ;
codegen_sel_method ('ge_thunk'  , 'bool keep = (Ax [p] >= thunk)', 'int32_t' ) ;
codegen_sel_method ('ge_thunk'  , 'bool keep = (Ax [p] >= thunk)', 'int64_t' ) ;
codegen_sel_method ('ge_thunk'  , 'bool keep = (Ax [p] >= thunk)', 'uint8_t' ) ;
codegen_sel_method ('ge_thunk'  , 'bool keep = (Ax [p] >= thunk)', 'uint16_t') ;
codegen_sel_method ('ge_thunk'  , 'bool keep = (Ax [p] >= thunk)', 'uint32_t') ;
codegen_sel_method ('ge_thunk'  , 'bool keep = (Ax [p] >= thunk)', 'uint64_t') ;
codegen_sel_method ('ge_thunk'  , 'bool keep = (Ax [p] >= thunk)', 'float'   ) ;
codegen_sel_method ('ge_thunk'  , 'bool keep = (Ax [p] >= thunk)', 'double'  ) ;

% LT_THUNK           name         selector            type
fprintf ('\nlt_thunk   ') ;
codegen_sel_method ('lt_thunk'  , 'bool keep = (Ax [p] < thunk)', 'int8_t'  ) ;
codegen_sel_method ('lt_thunk'  , 'bool keep = (Ax [p] < thunk)', 'int16_t' ) ;
codegen_sel_method ('lt_thunk'  , 'bool keep = (Ax [p] < thunk)', 'int32_t' ) ;
codegen_sel_method ('lt_thunk'  , 'bool keep = (Ax [p] < thunk)', 'int64_t' ) ;
codegen_sel_method ('lt_thunk'  , 'bool keep = (Ax [p] < thunk)', 'uint8_t' ) ;
codegen_sel_method ('lt_thunk'  , 'bool keep = (Ax [p] < thunk)', 'uint16_t') ;
codegen_sel_method ('lt_thunk'  , 'bool keep = (Ax [p] < thunk)', 'uint32_t') ;
codegen_sel_method ('lt_thunk'  , 'bool keep = (Ax [p] < thunk)', 'uint64_t') ;
codegen_sel_method ('lt_thunk'  , 'bool keep = (Ax [p] < thunk)', 'float'   ) ;
codegen_sel_method ('lt_thunk'  , 'bool keep = (Ax [p] < thunk)', 'double'  ) ;

% LE_THUNK           name         selector            type
fprintf ('\nle_thunk   ') ;
codegen_sel_method ('le_thunk'  , 'bool keep = (Ax [p] <= thunk)', 'int8_t'  ) ;
codegen_sel_method ('le_thunk'  , 'bool keep = (Ax [p] <= thunk)', 'int16_t' ) ;
codegen_sel_method ('le_thunk'  , 'bool keep = (Ax [p] <= thunk)', 'int32_t' ) ;
codegen_sel_method ('le_thunk'  , 'bool keep = (Ax [p] <= thunk)', 'int64_t' ) ;
codegen_sel_method ('le_thunk'  , 'bool keep = (Ax [p] <= thunk)', 'uint8_t' ) ;
codegen_sel_method ('le_thunk'  , 'bool keep = (Ax [p] <= thunk)', 'uint16_t') ;
codegen_sel_method ('le_thunk'  , 'bool keep = (Ax [p] <= thunk)', 'uint32_t') ;
codegen_sel_method ('le_thunk'  , 'bool keep = (Ax [p] <= thunk)', 'uint64_t') ;
codegen_sel_method ('le_thunk'  , 'bool keep = (Ax [p] <= thunk)', 'float'   ) ;
codegen_sel_method ('le_thunk'  , 'bool keep = (Ax [p] <= thunk)', 'double'  ) ;

fprintf ('\n') ;