Skip to content

Commit 5a21c46

Browse files
revise type/op names to gaurd against name collisions (LAGraph and GraphBLAS)
1 parent b425881 commit 5a21c46

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+2680
-2314
lines changed

GraphBLAS/Demo/Include/usercomplex.c

Lines changed: 173 additions & 173 deletions
Large diffs are not rendered by default.

GraphBLAS/Demo/Include/usercomplex.h

Lines changed: 59 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
#ifndef USERCOMPLEX_H
1111
#define USERCOMPLEX_H
1212

13-
typedef struct { double re ; double im ; } mycx ;
13+
typedef struct { double re ; double im ; } gb_mycx ;
1414
#define MYCX_DEFN \
15-
"typedef struct { double re ; double im ; } mycx ;"
15+
"typedef struct { double re ; double im ; } gb_mycx ;"
1616

1717
//------------------------------------------------------------------------------
1818
// 10 binary functions, z=f(x,y), where CxC -> C
@@ -93,63 +93,63 @@ GrB_Info Complex_finalize (void) ;
9393
// function prototypes
9494
//------------------------------------------------------------------------------
9595

96-
void mycx_first (mycx *z, const mycx *x, const mycx *y) ;
97-
void mycx_second (mycx *z, const mycx *x, const mycx *y) ;
98-
void mycx_pair (mycx *z, const mycx *x, const mycx *y) ;
99-
void mycx_plus (mycx *z, const mycx *x, const mycx *y) ;
100-
void mycx_minus (mycx *z, const mycx *x, const mycx *y) ;
101-
void mycx_rminus (mycx *z, const mycx *x, const mycx *y) ;
102-
void mycx_times (mycx *z, const mycx *x, const mycx *y) ;
103-
void mycx_div (mycx *z, const mycx *x, const mycx *y) ;
104-
void mycx_rdiv (mycx *z, const mycx *x, const mycx *y) ;
105-
void fx64_min (GxB_FC64_t *z, const GxB_FC64_t *x, const GxB_FC64_t *y) ;
106-
void mycx_min (mycx *z, const mycx *x, const mycx *y) ;
107-
void fx64_max (GxB_FC64_t *z, const GxB_FC64_t *x, const GxB_FC64_t *y) ;
108-
void mycx_max (mycx *z, const mycx *x, const mycx *y) ;
109-
void mycx_iseq (mycx *z, const mycx *x, const mycx *y) ;
110-
void mycx_isne (mycx *z, const mycx *x, const mycx *y) ;
111-
void fx64_isgt (GxB_FC64_t *z, const GxB_FC64_t *x, const GxB_FC64_t *y) ;
112-
void mycx_isgt (mycx *z, const mycx *x, const mycx *y) ;
113-
void fx64_islt (GxB_FC64_t *z, const GxB_FC64_t *x, const GxB_FC64_t *y) ;
114-
void mycx_islt (mycx *z, const mycx *x, const mycx *y) ;
115-
void fx64_isge (GxB_FC64_t *z, const GxB_FC64_t *x, const GxB_FC64_t *y) ;
116-
void mycx_isge (mycx *z, const mycx *x, const mycx *y) ;
117-
void fx64_isle (GxB_FC64_t *z, const GxB_FC64_t *x, const GxB_FC64_t *y) ;
118-
void mycx_isle (mycx *z, const mycx *x, const mycx *y) ;
119-
void fx64_or (GxB_FC64_t *z, const GxB_FC64_t *x, const GxB_FC64_t *y) ;
120-
void mycx_or (mycx *z, const mycx *x, const mycx *y) ;
121-
void fx64_and (GxB_FC64_t *z, const GxB_FC64_t *x, const GxB_FC64_t *y) ;
122-
void mycx_and (mycx *z, const mycx *x, const mycx *y) ;
123-
void fx64_xor (GxB_FC64_t *z, const GxB_FC64_t *x, const GxB_FC64_t *y) ;
124-
void mycx_xor (mycx *z, const mycx *x, const mycx *y) ;
125-
void mycx_eq (bool *z, const mycx *x, const mycx *y) ;
126-
void mycx_ne (bool *z, const mycx *x, const mycx *y) ;
127-
void fx64_gt (bool *z, const GxB_FC64_t *x, const GxB_FC64_t *y) ;
128-
void mycx_gt (bool *z, const mycx *x, const mycx *y) ;
129-
void fx64_lt (bool *z, const GxB_FC64_t *x, const GxB_FC64_t *y) ;
130-
void mycx_lt (bool *z, const mycx *x, const mycx *y) ;
131-
void fx64_ge (bool *z, const GxB_FC64_t *x, const GxB_FC64_t *y) ;
132-
void mycx_ge (bool *z, const mycx *x, const mycx *y) ;
133-
void fx64_le (bool *z, const GxB_FC64_t *x, const GxB_FC64_t *y) ;
134-
void mycx_le (bool *z, const mycx *x, const mycx *y) ;
135-
void mycx_cmplx (mycx *z, const double *x, const double *y) ;
136-
void mycx_one (mycx *z, const mycx *x) ;
137-
void mycx_identity (mycx *z, const mycx *x) ;
138-
void mycx_ainv (mycx *z, const mycx *x) ;
139-
void mycx_minv (mycx *z, const mycx *x) ;
140-
void mycx_conj (mycx *z, const mycx *x) ;
141-
void fx64_abs (GxB_FC64_t *z, const GxB_FC64_t *x) ;
142-
void mycx_abs (mycx *z, const mycx *x) ;
143-
void fx64_not (GxB_FC64_t *z, const GxB_FC64_t *x) ;
144-
void mycx_not (mycx *z, const mycx *x) ;
145-
void mycx_real (double *z, const mycx *x) ;
146-
void mycx_imag (double *z, const mycx *x) ;
147-
void mycx_cabs (double *z, const mycx *x) ;
148-
void mycx_angle (double *z, const mycx *x) ;
149-
void fx64_cmplx_real (GxB_FC64_t *z, const double *x) ;
150-
void mycx_cmplx_real (mycx *z, const double *x) ;
151-
void fx64_cmplx_imag (GxB_FC64_t *z, const double *x) ;
152-
void mycx_cmplx_imag (mycx *z, const double *x) ;
96+
void gb_mycx_first (gb_mycx *z, const gb_mycx *x, const gb_mycx *y) ;
97+
void gb_mycx_second (gb_mycx *z, const gb_mycx *x, const gb_mycx *y) ;
98+
void gb_mycx_pair (gb_mycx *z, const gb_mycx *x, const gb_mycx *y) ;
99+
void gb_mycx_plus (gb_mycx *z, const gb_mycx *x, const gb_mycx *y) ;
100+
void gb_mycx_minus (gb_mycx *z, const gb_mycx *x, const gb_mycx *y) ;
101+
void gb_mycx_rminus (gb_mycx *z, const gb_mycx *x, const gb_mycx *y) ;
102+
void gb_mycx_times (gb_mycx *z, const gb_mycx *x, const gb_mycx *y) ;
103+
void gb_mycx_div (gb_mycx *z, const gb_mycx *x, const gb_mycx *y) ;
104+
void gb_mycx_rdiv (gb_mycx *z, const gb_mycx *x, const gb_mycx *y) ;
105+
void gb_fx64_min (GxB_FC64_t *z, const GxB_FC64_t *x, const GxB_FC64_t *y) ;
106+
void gb_mycx_min (gb_mycx *z, const gb_mycx *x, const gb_mycx *y) ;
107+
void gb_fx64_max (GxB_FC64_t *z, const GxB_FC64_t *x, const GxB_FC64_t *y) ;
108+
void gb_mycx_max (gb_mycx *z, const gb_mycx *x, const gb_mycx *y) ;
109+
void gb_mycx_iseq (gb_mycx *z, const gb_mycx *x, const gb_mycx *y) ;
110+
void gb_mycx_isne (gb_mycx *z, const gb_mycx *x, const gb_mycx *y) ;
111+
void gb_fx64_isgt (GxB_FC64_t *z, const GxB_FC64_t *x, const GxB_FC64_t *y) ;
112+
void gb_mycx_isgt (gb_mycx *z, const gb_mycx *x, const gb_mycx *y) ;
113+
void gb_fx64_islt (GxB_FC64_t *z, const GxB_FC64_t *x, const GxB_FC64_t *y) ;
114+
void gb_mycx_islt (gb_mycx *z, const gb_mycx *x, const gb_mycx *y) ;
115+
void gb_fx64_isge (GxB_FC64_t *z, const GxB_FC64_t *x, const GxB_FC64_t *y) ;
116+
void gb_mycx_isge (gb_mycx *z, const gb_mycx *x, const gb_mycx *y) ;
117+
void gb_fx64_isle (GxB_FC64_t *z, const GxB_FC64_t *x, const GxB_FC64_t *y) ;
118+
void gb_mycx_isle (gb_mycx *z, const gb_mycx *x, const gb_mycx *y) ;
119+
void gb_fx64_or (GxB_FC64_t *z, const GxB_FC64_t *x, const GxB_FC64_t *y) ;
120+
void gb_mycx_or (gb_mycx *z, const gb_mycx *x, const gb_mycx *y) ;
121+
void gb_fx64_and (GxB_FC64_t *z, const GxB_FC64_t *x, const GxB_FC64_t *y) ;
122+
void gb_mycx_and (gb_mycx *z, const gb_mycx *x, const gb_mycx *y) ;
123+
void gb_fx64_xor (GxB_FC64_t *z, const GxB_FC64_t *x, const GxB_FC64_t *y) ;
124+
void gb_mycx_xor (gb_mycx *z, const gb_mycx *x, const gb_mycx *y) ;
125+
void gb_mycx_eq (bool *z, const gb_mycx *x, const gb_mycx *y) ;
126+
void gb_mycx_ne (bool *z, const gb_mycx *x, const gb_mycx *y) ;
127+
void gb_fx64_gt (bool *z, const GxB_FC64_t *x, const GxB_FC64_t *y) ;
128+
void gb_mycx_gt (bool *z, const gb_mycx *x, const gb_mycx *y) ;
129+
void gb_fx64_lt (bool *z, const GxB_FC64_t *x, const GxB_FC64_t *y) ;
130+
void gb_mycx_lt (bool *z, const gb_mycx *x, const gb_mycx *y) ;
131+
void gb_fx64_ge (bool *z, const GxB_FC64_t *x, const GxB_FC64_t *y) ;
132+
void gb_mycx_ge (bool *z, const gb_mycx *x, const gb_mycx *y) ;
133+
void gb_fx64_le (bool *z, const GxB_FC64_t *x, const GxB_FC64_t *y) ;
134+
void gb_mycx_le (bool *z, const gb_mycx *x, const gb_mycx *y) ;
135+
void gb_mycx_cmplx (gb_mycx *z, const double *x, const double *y) ;
136+
void gb_mycx_one (gb_mycx *z, const gb_mycx *x) ;
137+
void gb_mycx_identity (gb_mycx *z, const gb_mycx *x) ;
138+
void gb_mycx_ainv (gb_mycx *z, const gb_mycx *x) ;
139+
void gb_mycx_minv (gb_mycx *z, const gb_mycx *x) ;
140+
void gb_mycx_conj (gb_mycx *z, const gb_mycx *x) ;
141+
void gb_fx64_abs (GxB_FC64_t *z, const GxB_FC64_t *x) ;
142+
void gb_mycx_abs (gb_mycx *z, const gb_mycx *x) ;
143+
void gb_fx64_not (GxB_FC64_t *z, const GxB_FC64_t *x) ;
144+
void gb_mycx_not (gb_mycx *z, const gb_mycx *x) ;
145+
void gb_mycx_real (double *z, const gb_mycx *x) ;
146+
void gb_mycx_imag (double *z, const gb_mycx *x) ;
147+
void gb_mycx_cabs (double *z, const gb_mycx *x) ;
148+
void gb_mycx_angle (double *z, const gb_mycx *x) ;
149+
void gb_fx64_cmplx_real (GxB_FC64_t *z, const double *x) ;
150+
void gb_mycx_cmplx_real (gb_mycx *z, const double *x) ;
151+
void gb_fx64_cmplx_imag (GxB_FC64_t *z, const double *x) ;
152+
void gb_mycx_cmplx_imag (gb_mycx *z, const double *x) ;
153153

154154
//------------------------------------------------------------------------------
155155
// C++ compatibility

GraphBLAS/Doc/ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ July 25, 2025: version 10.1.1
88
* JIT file lock/unlock: removed; if multiple user processes use
99
GraphBLAS at the same time, each must set their own unique JIT cache.
1010
* (65) bug fix: theta type definitions for user-defined index binary ops
11+
were incorrectly typedef'd in the JIT kernels.
1112

1213
June 1, 2025: version 10.1.0
1314

511 Bytes
Binary file not shown.

GraphBLAS/Doc/UserGuide/GrB_objects_BinaryOp.tex

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,9 @@ \subsubsection{{\sf GxB\_BinaryOp\_new:} create a named user-defined binary oper
426426
"void absdiff (double *z, double *x, double *y) { (*z) = fabs ((*x) - (*y)) ; }",
427427
GxB_JIT_C_DEFINITION) ;\end{verbatim}}
428428

429+
To avoid name collisions with LAGraph and GraphBLAS, avoid
430+
function names that start with \verb'LG_' and \verb'gb_'.
431+
429432
%-------------------------------------------------------------------------------
430433
\subsubsection{{\sf GrB\_BinaryOp\_wait:} wait for a binary operator}
431434
%-------------------------------------------------------------------------------

GraphBLAS/Doc/UserGuide/GrB_objects_IndexBinaryOp.tex

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,9 @@ \subsubsection{{\sf GxB\_IndexBinaryOp\_new:} create a user-defined index-binary
194194
GrB_Vector_new (&c, Tuple, nrows, 1)) ;
195195
GrB_mxv (c, NULL, NULL, Semiring, A, y, NULL) ; \end{verbatim}}
196196

197+
To avoid name collisions with LAGraph and GraphBLAS, avoid
198+
function names that start with \verb'LG_' and \verb'gb_'.
199+
197200
\newpage
198201
%-------------------------------------------------------------------------------
199202
\subsubsection{{\sf GxB\_IndexBinaryOp\_wait:} wait for an index-binary operator}

GraphBLAS/Doc/UserGuide/GrB_objects_IndexUnaryOp.tex

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,10 @@ \subsubsection{{\sf GxB\_IndexUnaryOp\_new:} create a named user-defined index-u
219219
GrB_set (Banded, "banded_idx", GxB_JIT_C_NAME)) ;
220220
GrB_set (Banded, BANDED_IDX_DEFN, GxB_JIT_C_DEFINITION)) ;\end{verbatim}}
221221

222+
To avoid name collisions with LAGraph and GraphBLAS, avoid
223+
function names that start with \verb'LG_' and \verb'gb_'.
224+
225+
\newpage
222226
%-------------------------------------------------------------------------------
223227
\subsubsection{{\sf GrB\_IndexUnaryOp\_wait:} wait for an index-unary operator}
224228
%-------------------------------------------------------------------------------
@@ -240,7 +244,6 @@ \subsubsection{{\sf GrB\_IndexUnaryOp\_wait:} wait for an index-unary operator}
240244
SuiteSparse:GraphBLAS currently does nothing except to ensure that the
241245
\verb'op' is valid.
242246

243-
\newpage
244247
%-------------------------------------------------------------------------------
245248
\subsubsection{{\sf GrB\_IndexUnaryOp\_free:} free a user-defined index-unary operator}
246249
%-------------------------------------------------------------------------------

GraphBLAS/Doc/UserGuide/GrB_objects_Type.tex

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,9 @@ \subsubsection{{\sf GxB\_Type\_new:} create a user-defined type (with name and d
212212
GrB_set (MyQtype, "typedef struct { float x [4][4] ; int color ; } myquaternion ;"
213213
GxB_JIT_C_DEFINITION) ; \end{verbatim}}
214214

215+
To avoid name collisions with LAGraph and GraphBLAS, avoid
216+
type names that start with \verb'LG_' and \verb'gb_'.
217+
215218
%-------------------------------------------------------------------------------
216219
\subsubsection{{\sf GrB\_Type\_wait:} wait for a type}
217220
%-------------------------------------------------------------------------------

GraphBLAS/Doc/UserGuide/GrB_objects_UnaryOp.tex

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,9 @@ \subsubsection{{\sf GxB\_UnaryOp\_new:} create a named user-defined unary operat
313313
GrB_set (Square, "void square (double *z, double *x) { (*z) = (*x) * (*x) ; } ;",
314314
GxB_JIT_C_DEFINITION) ; \end{verbatim}}
315315

316+
To avoid name collisions with LAGraph and GraphBLAS, avoid
317+
function names that start with \verb'LG_' and \verb'gb_'.
318+
316319
% \newpage
317320
%-------------------------------------------------------------------------------
318321
\subsubsection{{\sf GrB\_UnaryOp\_wait:} wait for a unary operator}

GraphBLAS/Doc/UserGuide/GrB_release.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ \section{Release Notes}
1616
\item JIT file lock/unlock: removed; if multiple user processes use
1717
GraphBLAS at the same time, each must set their own unique JIT cache.
1818
\item (65) bug fix: theta type definitions for user-defined index
19-
binary ops.
19+
binary ops were incorrectly typedef'd in the JIT kernels.
2020
\end{itemize}
2121

2222
\item June 1, 2025: version 10.1.0

0 commit comments

Comments
 (0)