1 //------------------------------------------------------------------------------
2 // GB_type: hard-coded functions for each built-in type
3 //------------------------------------------------------------------------------
4
5 // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved.
6 // SPDX-License-Identifier: Apache-2.0
7
8 //------------------------------------------------------------------------------
9
10 // If this file is in the Generated/ folder, do not edit it (auto-generated).
11
12 #include "GB.h"
13 #ifndef GBCOMPACT
14 #include "GB_control.h"
15 #include "GB_ek_slice.h"
16 #include "GB_type__include.h"
17
18 // The operation is defined by the following types and operators:
19
20 // functions:
21 // C<M>=x (C is dense): GB (_Cdense_05d__int64)
22 // C<A>=A (C is dense): GB (_Cdense_06d__int64)
23 // C<M>=A (C is empty, A dense): GB (_Cdense_25__int64)
24 // convert sparse to bitmap: GB (_convert_s2b__int64)
25
26 // C type: int64_t
27
28 #define GB_CTYPE \
29 int64_t
30
31 // C must have the same type as A or the scalar x
32 #define GB_ATYPE GB_CTYPE
33
34 #define GB_CX(p) Cx [p]
35
36 // Cx [p] = scalar
37 #define GB_COPY_SCALAR_TO_C(p,x) Cx [p] = x
38
39 // Cx [p] = Ax [pA]
40 #define GB_COPY_A_TO_C(Cx,p,Ax,pA) Cx [p] = Ax [pA]
41
42 // test the mask condition with Ax [pA]
43 #define GB_AX_MASK(Ax,pA,asize) \
44 (Ax [pA] != 0)
45
46 // hard-coded loops can be vectorized
47 #define GB_PRAGMA_SIMD_VECTORIZE GB_PRAGMA_SIMD
48
49 // disable this operator and use the generic case if these conditions hold
50 #define GB_DISABLE \
51 (GxB_NO_INT64)
52
53 //------------------------------------------------------------------------------
54 // C<M>=x, when C is dense
55 //------------------------------------------------------------------------------
56
GB(_Cdense_05d__int64)57 GrB_Info GB (_Cdense_05d__int64)
58 (
59 GrB_Matrix C,
60 const GrB_Matrix M,
61 const bool Mask_struct,
62 const GB_void *p_cwork, // scalar of type C->type
63 const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads
64 )
65 {
66 #if GB_DISABLE
67 return (GrB_NO_VALUE) ;
68 #else
69 int64_t cwork = (*((int64_t *) p_cwork)) ;
70 #include "GB_dense_subassign_05d_template.c"
71 return (GrB_SUCCESS) ;
72 #endif
73 }
74
75 //------------------------------------------------------------------------------
76 // C<A>=A, when C is dense
77 //------------------------------------------------------------------------------
78
GB(_Cdense_06d__int64)79 GrB_Info GB (_Cdense_06d__int64)
80 (
81 GrB_Matrix C,
82 const GrB_Matrix A,
83 const bool Mask_struct,
84 const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads
85 )
86 {
87 #if GB_DISABLE
88 return (GrB_NO_VALUE) ;
89 #else
90 ASSERT (C->type == A->type) ;
91 #include "GB_dense_subassign_06d_template.c"
92 return (GrB_SUCCESS) ;
93 #endif
94 }
95
96 //------------------------------------------------------------------------------
97 // C<M>=A, when C is empty and A is dense
98 //------------------------------------------------------------------------------
99
GB(_Cdense_25__int64)100 GrB_Info GB (_Cdense_25__int64)
101 (
102 GrB_Matrix C,
103 const GrB_Matrix M,
104 const GrB_Matrix A,
105 const int64_t *M_ek_slicing, const int M_ntasks, const int M_nthreads
106 )
107 {
108 #if GB_DISABLE
109 return (GrB_NO_VALUE) ;
110 #else
111 ASSERT (C->type == A->type) ;
112 #include "GB_dense_subassign_25_template.c"
113 return (GrB_SUCCESS) ;
114 #endif
115 }
116
117 //------------------------------------------------------------------------------
118 // convert sparse to bitmap
119 //------------------------------------------------------------------------------
120
GB(_convert_s2b__int64)121 GrB_Info GB (_convert_s2b__int64)
122 (
123 GrB_Matrix A,
124 GB_void *restrict Ax_new_void,
125 int8_t *restrict Ab,
126 const int64_t *A_ek_slicing, const int A_ntasks, const int A_nthreads
127 )
128 {
129 #if GB_DISABLE
130 return (GrB_NO_VALUE) ;
131 #else
132 int64_t *restrict Ax_new = (int64_t *) Ax_new_void ;
133 #include "GB_convert_sparse_to_bitmap_template.c"
134 return (GrB_SUCCESS) ;
135 #endif
136 }
137
138 #endif
139
140