File: GB_select_entry_factory.c

package info (click to toggle)
suitesparse 1%3A7.10.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 254,920 kB
  • sloc: ansic: 1,134,743; cpp: 46,133; makefile: 4,875; fortran: 2,087; java: 1,826; sh: 996; ruby: 725; python: 495; asm: 371; sed: 166; awk: 44
file content (167 lines) | stat: -rw-r--r-- 7,592 bytes parent folder | download | duplicates (2)
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
//------------------------------------------------------------------------------
// GB_select_entry_factory: switch factory for C=select(A,thunk)
//------------------------------------------------------------------------------

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

//------------------------------------------------------------------------------

// This factory is used for phase1 and phase2 for the sparse case.  None of
// these workers are used when A is iso.  C is always iso for the VALUEEQ
// selector.

ASSERT (!GB_IS_INDEXUNARYOP_CODE_POSITIONAL (opcode)) ;

switch (opcode)
{

    //--------------------------------------------------------------------------
    // nonzombie selectors: phase2 only; not for the bitmap case
    //--------------------------------------------------------------------------

    #if defined ( GB_SELECT_PHASE2 )

    case GB_NONZOMBIE_idxunop_code     :  // C = all entries A(i,j) not a zombie

        switch (acode)
        {
            case GB_BOOL_code   : GB_SEL_WORKER (_nonzombie, _bool  )
            case GB_INT8_code   : GB_SEL_WORKER (_nonzombie, _int8  )
            case GB_INT16_code  : GB_SEL_WORKER (_nonzombie, _int16 )
            case GB_INT32_code  : GB_SEL_WORKER (_nonzombie, _int32 )
            case GB_INT64_code  : GB_SEL_WORKER (_nonzombie, _int64 )
            case GB_UINT8_code  : GB_SEL_WORKER (_nonzombie, _uint8 )
            case GB_UINT16_code : GB_SEL_WORKER (_nonzombie, _uint16)
            case GB_UINT32_code : GB_SEL_WORKER (_nonzombie, _uint32)
            case GB_UINT64_code : GB_SEL_WORKER (_nonzombie, _uint64)
            case GB_FP32_code   : GB_SEL_WORKER (_nonzombie, _fp32  )
            case GB_FP64_code   : GB_SEL_WORKER (_nonzombie, _fp64  )
            case GB_FC32_code   : GB_SEL_WORKER (_nonzombie, _fc32  )
            case GB_FC64_code   : GB_SEL_WORKER (_nonzombie, _fc64  )
            default: ;
        }
        break ;

    #endif

    //--------------------------------------------------------------------------
    // none of these selectop workers are needed when A is iso
    //--------------------------------------------------------------------------

    case GB_VALUEEQ_idxunop_code : // A(i,j) == thunk (so C is iso)

        switch (acode)
        {
            case GB_BOOL_code   : GB_SEL_WORKER (_eq_thunk, _bool  )
            case GB_INT8_code   : GB_SEL_WORKER (_eq_thunk, _int8  )
            case GB_INT16_code  : GB_SEL_WORKER (_eq_thunk, _int16 )
            case GB_INT32_code  : GB_SEL_WORKER (_eq_thunk, _int32 )
            case GB_INT64_code  : GB_SEL_WORKER (_eq_thunk, _int64 )
            case GB_UINT8_code  : GB_SEL_WORKER (_eq_thunk, _uint8 )
            case GB_UINT16_code : GB_SEL_WORKER (_eq_thunk, _uint16)
            case GB_UINT32_code : GB_SEL_WORKER (_eq_thunk, _uint32)
            case GB_UINT64_code : GB_SEL_WORKER (_eq_thunk, _uint64)
            case GB_FP32_code   : GB_SEL_WORKER (_eq_thunk, _fp32  )
            case GB_FP64_code   : GB_SEL_WORKER (_eq_thunk, _fp64  )
            case GB_FC32_code   : GB_SEL_WORKER (_eq_thunk, _fc32  )
            case GB_FC64_code   : GB_SEL_WORKER (_eq_thunk, _fc64  )
            default: ;
        }
        break ;

    case GB_VALUENE_idxunop_code : // A(i,j) != thunk

        switch (acode)
        {
            case GB_INT8_code   : GB_SEL_WORKER (_ne_thunk, _int8  )
            case GB_INT16_code  : GB_SEL_WORKER (_ne_thunk, _int16 )
            case GB_INT32_code  : GB_SEL_WORKER (_ne_thunk, _int32 )
            case GB_INT64_code  : GB_SEL_WORKER (_ne_thunk, _int64 )
            case GB_UINT8_code  : GB_SEL_WORKER (_ne_thunk, _uint8 )
            case GB_UINT16_code : GB_SEL_WORKER (_ne_thunk, _uint16)
            case GB_UINT32_code : GB_SEL_WORKER (_ne_thunk, _uint32)
            case GB_UINT64_code : GB_SEL_WORKER (_ne_thunk, _uint64)
            case GB_FP32_code   : GB_SEL_WORKER (_ne_thunk, _fp32  )
            case GB_FP64_code   : GB_SEL_WORKER (_ne_thunk, _fp64  )
            case GB_FC32_code   : GB_SEL_WORKER (_ne_thunk, _fc32  )
            case GB_FC64_code   : GB_SEL_WORKER (_ne_thunk, _fc64  )
            default: ;
        }
        break ;

    case GB_VALUEGT_idxunop_code : // A(i,j) > thunk

        switch (acode)
        {
            case GB_INT8_code   : GB_SEL_WORKER (_gt_thunk, _int8  )
            case GB_INT16_code  : GB_SEL_WORKER (_gt_thunk, _int16 )
            case GB_INT32_code  : GB_SEL_WORKER (_gt_thunk, _int32 )
            case GB_INT64_code  : GB_SEL_WORKER (_gt_thunk, _int64 )
            case GB_UINT8_code  : GB_SEL_WORKER (_gt_thunk, _uint8 )
            case GB_UINT16_code : GB_SEL_WORKER (_gt_thunk, _uint16)
            case GB_UINT32_code : GB_SEL_WORKER (_gt_thunk, _uint32)
            case GB_UINT64_code : GB_SEL_WORKER (_gt_thunk, _uint64)
            case GB_FP32_code   : GB_SEL_WORKER (_gt_thunk, _fp32  )
            case GB_FP64_code   : GB_SEL_WORKER (_gt_thunk, _fp64  )
            default: ;
        }
        break ;

    case GB_VALUEGE_idxunop_code : // A(i,j) >= thunk

        switch (acode)
        {
            case GB_INT8_code   : GB_SEL_WORKER (_ge_thunk, _int8  )
            case GB_INT16_code  : GB_SEL_WORKER (_ge_thunk, _int16 )
            case GB_INT32_code  : GB_SEL_WORKER (_ge_thunk, _int32 )
            case GB_INT64_code  : GB_SEL_WORKER (_ge_thunk, _int64 )
            case GB_UINT8_code  : GB_SEL_WORKER (_ge_thunk, _uint8 )
            case GB_UINT16_code : GB_SEL_WORKER (_ge_thunk, _uint16)
            case GB_UINT32_code : GB_SEL_WORKER (_ge_thunk, _uint32)
            case GB_UINT64_code : GB_SEL_WORKER (_ge_thunk, _uint64)
            case GB_FP32_code   : GB_SEL_WORKER (_ge_thunk, _fp32  )
            case GB_FP64_code   : GB_SEL_WORKER (_ge_thunk, _fp64  )
            default: ;
        }
        break ;

    case GB_VALUELT_idxunop_code : // A(i,j) < thunk

        switch (acode)
        {
            case GB_INT8_code   : GB_SEL_WORKER (_lt_thunk, _int8  )
            case GB_INT16_code  : GB_SEL_WORKER (_lt_thunk, _int16 )
            case GB_INT32_code  : GB_SEL_WORKER (_lt_thunk, _int32 )
            case GB_INT64_code  : GB_SEL_WORKER (_lt_thunk, _int64 )
            case GB_UINT8_code  : GB_SEL_WORKER (_lt_thunk, _uint8 )
            case GB_UINT16_code : GB_SEL_WORKER (_lt_thunk, _uint16)
            case GB_UINT32_code : GB_SEL_WORKER (_lt_thunk, _uint32)
            case GB_UINT64_code : GB_SEL_WORKER (_lt_thunk, _uint64)
            case GB_FP32_code   : GB_SEL_WORKER (_lt_thunk, _fp32  )
            case GB_FP64_code   : GB_SEL_WORKER (_lt_thunk, _fp64  )
            default: ;
        }
        break ;

    case GB_VALUELE_idxunop_code : // A(i,j) <= thunk

        switch (acode)
        {
            case GB_INT8_code   : GB_SEL_WORKER (_le_thunk, _int8  )
            case GB_INT16_code  : GB_SEL_WORKER (_le_thunk, _int16 )
            case GB_INT32_code  : GB_SEL_WORKER (_le_thunk, _int32 )
            case GB_INT64_code  : GB_SEL_WORKER (_le_thunk, _int64 )
            case GB_UINT8_code  : GB_SEL_WORKER (_le_thunk, _uint8 )
            case GB_UINT16_code : GB_SEL_WORKER (_le_thunk, _uint16)
            case GB_UINT32_code : GB_SEL_WORKER (_le_thunk, _uint32)
            case GB_UINT64_code : GB_SEL_WORKER (_le_thunk, _uint64)
            case GB_FP32_code   : GB_SEL_WORKER (_le_thunk, _fp32  )
            case GB_FP64_code   : GB_SEL_WORKER (_le_thunk, _fp64  )
            default: ;
        }
        break ;

    default: ;
}