Skip to content

Commit 7e74616

Browse files
authored
Update to SuiteSparse:GraphBLAS v8.0.0 (#76)
* Update to v8.0.0!
1 parent 892e2d2 commit 7e74616

File tree

7 files changed

+195
-3649
lines changed

7 files changed

+195
-3649
lines changed

.github/workflows/test.yml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
# os: ["ubuntu-latest"]
2020
# source: ["source"]
2121
python-version: ["3.8", "3.9", "3.10", "3.11"]
22-
graphblas-version: ["7.4.4"]
22+
graphblas-version: ["8.0.0"]
2323
steps:
2424
- name: Checkout
2525
uses: actions/checkout@v3
@@ -36,27 +36,26 @@ jobs:
3636
- name: GraphBLAS (from conda-forge)
3737
if: (contains(matrix.source, 'conda-forge'))
3838
run: |
39-
conda install -c conda-forge graphblas=${{ matrix.graphblas-version }} pytest pytest-randomly
39+
conda install -c conda-forge graphblas=${{ matrix.graphblas-version }} pytest-randomly
4040
- name: GraphBLAS (from source)
4141
if: (contains(matrix.source, 'source'))
4242
run: |
43-
# This isn't working! Why not?
44-
# sh suitesparse.sh refs/tags/${{ matrix.graphblas-version }}
43+
GRAPHBLAS_PREFIX=${CONDA_PREFIX} bash suitesparse.sh refs/tags/${{ matrix.graphblas-version }}.0
4544
4645
# From tag
47-
curl -L https://github.com/DrTimothyAldenDavis/GraphBLAS/archive/refs/tags/v${{ matrix.graphblas-version }}.tar.gz | tar xzf -
48-
pushd GraphBLAS-${{ matrix.graphblas-version }}/build
46+
# curl -L https://github.com/DrTimothyAldenDavis/GraphBLAS/archive/refs/tags/v${{ matrix.graphblas-version }}.tar.gz | tar xzf -
47+
# pushd GraphBLAS-${{ matrix.graphblas-version }}/build
4948
5049
# From branch
5150
# curl -L https://github.com/DrTimothyAldenDavis/GraphBLAS/tarball/${{ matrix.graphblas-version }} | tar xzf -
5251
# pushd DrTim*/build
5352
54-
echo ${CONDA_PREFIX}
55-
cmake -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release ..
56-
cat Makefile
57-
make all JOBS=16
58-
make install
59-
popd
53+
# echo ${CONDA_PREFIX}
54+
# cmake -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release ..
55+
# cat Makefile
56+
# make all JOBS=16
57+
# make install
58+
# popd
6059
- name: Build
6160
run: |
6261
pip install -e . --no-deps

suitesparse.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
#!/bin/bash
22

33
# parse SuiteSparse version from first argument, a git tag that ends in the version (no leading v)
4-
if [[ $1 =~ refs/tags/([0-9]*\.[0-9]*\.[0-9]*)\..*$ ]];
5-
then
4+
if [[ $1 =~ refs/tags/([0-9]*\.[0-9]*\.[0-9]*)\..*$ ]]; then
65
VERSION=${BASH_REMATCH[1]}
76
else
87
echo "Specify a SuiteSparse version, such as: $0 refs/tags/7.4.3.0"

suitesparse_graphblas/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ def libget(name):
181181
"struct GB_Type_opaque *": lib.GrB_Type_error,
182182
"struct GB_UnaryOp_opaque *": lib.GrB_UnaryOp_error,
183183
"struct GB_BinaryOp_opaque *": lib.GrB_BinaryOp_error,
184-
"struct GB_SelectOp_opaque *": lib.GxB_SelectOp_error,
185184
"struct GB_Monoid_opaque *": lib.GrB_Monoid_error,
186185
"struct GB_Semiring_opaque *": lib.GrB_Semiring_error,
187186
"struct GB_Scalar_opaque *": lib.GxB_Scalar_error,

suitesparse_graphblas/create_headers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,7 @@ def groupby(index, seq):
276276
"GRB_SUBVERSION",
277277
"GxB_NTHREADS",
278278
"GxB_CHUNK",
279-
"GxB_GPU_CONTROL",
280-
"GxB_GPU_CHUNK",
279+
"GxB_GPU_ID",
281280
"GxB_HYPERSPARSE",
282281
"GxB_SPARSE",
283282
"GxB_BITMAP",
@@ -294,7 +293,6 @@ def groupby(index, seq):
294293
"GxB_FAST_IMPORT",
295294
"GxB_MAX_NAME_LEN",
296295
"GxB_COMPRESSION_DEFAULT",
297-
"GxB_COMPRESSION_INTEL",
298296
"GxB_COMPRESSION_LZ4",
299297
"GxB_COMPRESSION_LZ4HC",
300298
"GxB_COMPRESSION_ZSTD",
@@ -316,6 +314,7 @@ def groupby(index, seq):
316314
"CMPLX",
317315
"CMPLXF",
318316
"GB_GLOBAL",
317+
"GB_HAS_CMPLX_MACROS",
319318
"GB_PUBLIC",
320319
"GB_restrict",
321320
"GRAPHBLAS_H",
@@ -625,6 +624,7 @@ def handle_function_node(node):
625624
"UnaryOp": "unary",
626625
"IndexUnaryOp": "indexunary",
627626
"Iterator": "iterator",
627+
"Context": "context",
628628
# "everything else" is "core"
629629
"getVersion": "core",
630630
"Global": "core",

suitesparse_graphblas/suitesparse_graphblas.h

Lines changed: 90 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ typedef uint64_t GrB_Index;
1515
/* GxB typedefs */
1616
typedef double _Complex GxB_FC64_t;
1717
typedef float _Complex GxB_FC32_t;
18+
typedef struct GB_Context_opaque *GxB_Context;
1819
typedef struct GB_Iterator_opaque *GxB_Iterator;
1920
typedef struct GB_Scalar_opaque *GxB_Scalar;
2021
typedef struct GB_SelectOp_opaque *GxB_SelectOp;
2122

2223
/* GxB typedefs (functions) */
23-
typedef bool (*GxB_select_function)(GrB_Index i, GrB_Index j, const void *x, const void *thunk);
2424
typedef void (*GxB_binary_function)(void *, const void *, const void *);
2525
typedef void (*GxB_index_unary_function)(void *z, const void *x, GrB_Index i, GrB_Index j, const void *y);
2626
typedef void (*GxB_unary_function)(void *, const void *);
@@ -32,14 +32,10 @@ typedef enum
3232
GrB_MASK = 1,
3333
GrB_INP0 = 2,
3434
GrB_INP1 = 3,
35-
GxB_DESCRIPTOR_NTHREADS = 5,
36-
GxB_DESCRIPTOR_CHUNK = 7,
37-
GxB_DESCRIPTOR_GPU_CONTROL = 21,
38-
GxB_DESCRIPTOR_GPU_CHUNK = 22,
39-
GxB_AxB_METHOD = 1000,
40-
GxB_SORT = 35,
41-
GxB_COMPRESSION = 36,
42-
GxB_IMPORT = 37
35+
GxB_AxB_METHOD = 7090,
36+
GxB_SORT = 7091,
37+
GxB_COMPRESSION = 7092,
38+
GxB_IMPORT = 7093
4339
} GrB_Desc_Field;
4440

4541
typedef enum
@@ -49,13 +45,11 @@ typedef enum
4945
GrB_COMP = 2,
5046
GrB_STRUCTURE = 4,
5147
GrB_TRAN = 3,
52-
GxB_GPU_ALWAYS = 2001,
53-
GxB_GPU_NEVER = 2002,
54-
GxB_AxB_GUSTAVSON = 1001,
55-
GxB_AxB_DOT = 1003,
56-
GxB_AxB_HASH = 1004,
57-
GxB_AxB_SAXPY = 1005,
58-
GxB_SECURE_IMPORT = 502
48+
GxB_AxB_GUSTAVSON = 7081,
49+
GxB_AxB_DOT = 7083,
50+
GxB_AxB_HASH = 7084,
51+
GxB_AxB_SAXPY = 7085,
52+
GxB_SECURE_IMPORT = 7080
5953
} GrB_Desc_Value;
6054

6155
typedef enum
@@ -69,7 +63,7 @@ typedef enum
6963
{
7064
GrB_SUCCESS = 0,
7165
GrB_NO_VALUE = 1,
72-
GxB_EXHAUSTED = 2,
66+
GxB_EXHAUSTED = 7089,
7367
GrB_UNINITIALIZED_OBJECT = -1,
7468
GrB_NULL_POINTER = -2,
7569
GrB_INVALID_VALUE = -3,
@@ -90,8 +84,8 @@ typedef enum
9084
{
9185
GrB_NONBLOCKING = 0,
9286
GrB_BLOCKING = 1,
93-
GxB_NONBLOCKING_GPU = 2,
94-
GxB_BLOCKING_GPU = 3
87+
GxB_NONBLOCKING_GPU = 7099,
88+
GxB_BLOCKING_GPU = 7098
9589
} GrB_Mode;
9690

9791
typedef enum
@@ -101,6 +95,13 @@ typedef enum
10195
} GrB_WaitMode;
10296

10397
/* GxB enums */
98+
typedef enum
99+
{
100+
GxB_CONTEXT_NTHREADS = 7086,
101+
GxB_CONTEXT_CHUNK = 7087,
102+
GxB_CONTEXT_GPU_ID = 7088
103+
} GxB_Context_Field;
104+
104105
typedef enum
105106
{
106107
GxB_BY_ROW = 0,
@@ -110,36 +111,58 @@ typedef enum
110111

111112
typedef enum
112113
{
113-
GxB_HYPER_SWITCH = 0,
114-
GxB_BITMAP_SWITCH = 34,
115-
GxB_FORMAT = 1,
116-
GxB_MODE = 2,
117-
GxB_LIBRARY_NAME = 8,
118-
GxB_LIBRARY_VERSION = 9,
119-
GxB_LIBRARY_DATE = 10,
120-
GxB_LIBRARY_ABOUT = 11,
121-
GxB_LIBRARY_URL = 12,
122-
GxB_LIBRARY_LICENSE = 13,
123-
GxB_LIBRARY_COMPILE_DATE = 14,
124-
GxB_LIBRARY_COMPILE_TIME = 15,
125-
GxB_API_VERSION = 16,
126-
GxB_API_DATE = 17,
127-
GxB_API_ABOUT = 18,
128-
GxB_API_URL = 19,
129-
GxB_COMPILER_VERSION = 23,
130-
GxB_COMPILER_NAME = 24,
131-
GxB_LIBRARY_OPENMP = 25,
132-
GxB_GLOBAL_NTHREADS = 5,
133-
GxB_GLOBAL_CHUNK = 7,
134-
GxB_BURBLE = 99,
135-
GxB_PRINTF = 101,
136-
GxB_FLUSH = 102,
137-
GxB_MEMORY_POOL = 103,
138-
GxB_PRINT_1BASED = 104,
139-
GxB_SPARSITY_STATUS = 33,
140-
GxB_SPARSITY_CONTROL = 32,
141-
GxB_GLOBAL_GPU_CONTROL = 21,
142-
GxB_GLOBAL_GPU_CHUNK = 22
114+
GxB_JIT_OFF = 0,
115+
GxB_JIT_PAUSE = 1,
116+
GxB_JIT_RUN = 2,
117+
GxB_JIT_LOAD = 3,
118+
GxB_JIT_ON = 4
119+
} GxB_JIT_Control;
120+
121+
typedef enum
122+
{
123+
GxB_HYPER_SWITCH = 7000,
124+
GxB_BITMAP_SWITCH = 7001,
125+
GxB_FORMAT = 7002,
126+
GxB_MODE = 7003,
127+
GxB_LIBRARY_NAME = 7004,
128+
GxB_LIBRARY_VERSION = 7005,
129+
GxB_LIBRARY_DATE = 7006,
130+
GxB_LIBRARY_ABOUT = 7007,
131+
GxB_LIBRARY_URL = 7008,
132+
GxB_LIBRARY_LICENSE = 7009,
133+
GxB_LIBRARY_COMPILE_DATE = 7010,
134+
GxB_LIBRARY_COMPILE_TIME = 7011,
135+
GxB_API_VERSION = 7012,
136+
GxB_API_DATE = 7013,
137+
GxB_API_ABOUT = 7014,
138+
GxB_API_URL = 7015,
139+
GxB_COMPILER_VERSION = 7016,
140+
GxB_COMPILER_NAME = 7017,
141+
GxB_LIBRARY_OPENMP = 7018,
142+
GxB_GLOBAL_NTHREADS = 7086,
143+
GxB_GLOBAL_CHUNK = 7087,
144+
GxB_GLOBAL_GPU_ID = 7088,
145+
GxB_BURBLE = 7019,
146+
GxB_PRINTF = 7020,
147+
GxB_FLUSH = 7021,
148+
GxB_MEMORY_POOL = 7022,
149+
GxB_PRINT_1BASED = 7023,
150+
GxB_JIT_C_COMPILER_NAME = 7024,
151+
GxB_JIT_C_COMPILER_FLAGS = 7025,
152+
GxB_JIT_C_LINKER_FLAGS = 7026,
153+
GxB_JIT_C_LIBRARIES = 7027,
154+
GxB_JIT_C_PREFACE = 7028,
155+
GxB_JIT_C_CONTROL = 7029,
156+
GxB_JIT_CACHE_PATH = 7030,
157+
GxB_JIT_C_CMAKE_LIBS = 7031,
158+
GxB_JIT_USE_CMAKE = 7032,
159+
GxB_JIT_ERROR_LOG = 7033,
160+
GxB_SPARSITY_STATUS = 7034,
161+
GxB_SPARSITY_CONTROL = 7036,
162+
GxB_MALLOC_FUNCTION = 7037,
163+
GxB_CALLOC_FUNCTION = 7038,
164+
GxB_REALLOC_FUNCTION = 7039,
165+
GxB_FREE_FUNCTION = 7040
143166
} GxB_Option_Field;
144167

145168
typedef enum
@@ -2603,6 +2626,7 @@ extern GrB_UnaryOp GxB_TRUNC_FP32;
26032626
extern GrB_UnaryOp GxB_TRUNC_FP64;
26042627

26052628
/* GxB objects */
2629+
extern GxB_Context GxB_CONTEXT_WORLD;
26062630
extern GxB_SelectOp GxB_DIAG;
26072631
extern GxB_SelectOp GxB_EQ_THUNK;
26082632
extern GxB_SelectOp GxB_EQ_ZERO;
@@ -3063,9 +3087,6 @@ GrB_Info GrB_Vector_wait(GrB_Vector v, GrB_WaitMode waitmode);
30633087
* GB functions *
30643088
***************/
30653089

3066-
/* binary */
3067-
GrB_Info GB_BinaryOp_new(GrB_BinaryOp *binaryop, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *binop_name);
3068-
30693090
/* iterator */
30703091
GrB_Info GB_Iterator_rc_bitmap_next(GxB_Iterator iterator);
30713092
GrB_Info GB_Iterator_rc_seek(GxB_Iterator iterator, GrB_Index j, bool jth_vector);
@@ -3074,15 +3095,6 @@ GrB_Info GB_Vector_Iterator_bitmap_seek(GxB_Iterator iterator, GrB_Index unused)
30743095
/* matrix */
30753096
GrB_Info GB_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, GxB_Format_Value format, GrB_Descriptor desc);
30763097

3077-
/* selectop */
3078-
GrB_Info GB_SelectOp_new(GxB_SelectOp *selectop, GxB_select_function function, GrB_Type xtype, GrB_Type ttype, const char *name);
3079-
3080-
/* type */
3081-
GrB_Info GB_Type_new(GrB_Type *type, size_t sizeof_ctype, const char *type_name);
3082-
3083-
/* unary */
3084-
GrB_Info GB_UnaryOp_new(GrB_UnaryOp *unaryop, GxB_unary_function function, GrB_Type ztype, GrB_Type xtype, const char *unop_name);
3085-
30863098
/****************
30873099
* GxB functions *
30883100
****************/
@@ -3097,14 +3109,28 @@ GrB_Info GxB_BinaryOp_ytype_name(char *type_name, const GrB_BinaryOp binaryop);
30973109
GrB_Info GxB_BinaryOp_ztype(GrB_Type *ztype, GrB_BinaryOp binaryop);
30983110
GrB_Info GxB_BinaryOp_ztype_name(char *type_name, const GrB_BinaryOp binaryop);
30993111

3112+
/* context */
3113+
GrB_Info GxB_Context_disengage(GxB_Context Context);
3114+
GrB_Info GxB_Context_engage(GxB_Context Context);
3115+
GrB_Info GxB_Context_fprint(GxB_Context Context, const char *name, GxB_Print_Level pr, FILE *f);
3116+
GrB_Info GxB_Context_free(GxB_Context *Context);
3117+
GrB_Info GxB_Context_get(GxB_Context Context, GxB_Context_Field field, ...);
3118+
GrB_Info GxB_Context_get_FP64(GxB_Context Context, GxB_Context_Field field, double *value);
3119+
GrB_Info GxB_Context_get_INT32(GxB_Context Context, GxB_Context_Field field, int32_t *value);
3120+
GrB_Info GxB_Context_new(GxB_Context *Context);
3121+
GrB_Info GxB_Context_set(GxB_Context Context, GxB_Context_Field field, ...);
3122+
GrB_Info GxB_Context_set_FP64(GxB_Context Context, GxB_Context_Field field, double value);
3123+
GrB_Info GxB_Context_set_INT32(GxB_Context Context, GxB_Context_Field field, int32_t value);
3124+
31003125
/* core */
31013126
GrB_Info GxB_Global_Option_get(GxB_Option_Field field, ...);
3102-
GrB_Info GxB_Global_Option_get_CHAR(GxB_Option_Field field, char **value);
3127+
GrB_Info GxB_Global_Option_get_CHAR(GxB_Option_Field field, const char **value);
31033128
GrB_Info GxB_Global_Option_get_FP64(GxB_Option_Field field, double *value);
31043129
GrB_Info GxB_Global_Option_get_FUNCTION(GxB_Option_Field field, void **value);
31053130
GrB_Info GxB_Global_Option_get_INT32(GxB_Option_Field field, int32_t *value);
31063131
GrB_Info GxB_Global_Option_get_INT64(GxB_Option_Field field, int64_t *value);
31073132
GrB_Info GxB_Global_Option_set(GxB_Option_Field field, ...);
3133+
GrB_Info GxB_Global_Option_set_CHAR(GxB_Option_Field field, const char *value);
31083134
GrB_Info GxB_Global_Option_set_FP64(GxB_Option_Field field, double value);
31093135
GrB_Info GxB_Global_Option_set_FP64_ARRAY(GxB_Option_Field field, double *value);
31103136
GrB_Info GxB_Global_Option_set_FUNCTION(GxB_Option_Field field, void *value);
@@ -3343,12 +3369,8 @@ GrB_Info GxB_Scalar_type_name(char *type_name, const GrB_Scalar s);
33433369
GrB_Info GxB_Scalar_wait(GrB_Scalar *s);
33443370

33453371
/* selectop */
3346-
GrB_Info GxB_SelectOp_error(const char **error, const GxB_SelectOp op);
3347-
GrB_Info GxB_SelectOp_fprint(GxB_SelectOp selectop, const char *name, GxB_Print_Level pr, FILE *f);
3348-
GrB_Info GxB_SelectOp_free(GxB_SelectOp *selectop);
3349-
GrB_Info GxB_SelectOp_new(GxB_SelectOp *selectop, GxB_select_function function, GrB_Type xtype, GrB_Type ttype);
3372+
GrB_Info GxB_SelectOp_fprint(GxB_SelectOp op, const char *name, GxB_Print_Level pr, FILE *f);
33503373
GrB_Info GxB_SelectOp_ttype(GrB_Type *ttype, GxB_SelectOp selectop);
3351-
GrB_Info GxB_SelectOp_wait(GxB_SelectOp op, GrB_WaitMode waitmode);
33523374
GrB_Info GxB_SelectOp_xtype(GrB_Type *xtype, GxB_SelectOp selectop);
33533375

33543376
/* semiring */
@@ -3453,16 +3475,14 @@ GrB_Info GxB_Vector_unpack_Full(GrB_Vector v, void **vx, GrB_Index *vx_size, boo
34533475
#define GxB_BITMAP ...
34543476
#define GxB_CHUNK ...
34553477
#define GxB_COMPRESSION_DEFAULT ...
3456-
#define GxB_COMPRESSION_INTEL ...
34573478
#define GxB_COMPRESSION_LZ4 ...
34583479
#define GxB_COMPRESSION_LZ4HC ...
34593480
#define GxB_COMPRESSION_NONE ...
34603481
#define GxB_COMPRESSION_ZSTD ...
34613482
#define GxB_END ...
34623483
#define GxB_FAST_IMPORT ...
34633484
#define GxB_FULL ...
3464-
#define GxB_GPU_CHUNK ...
3465-
#define GxB_GPU_CONTROL ...
3485+
#define GxB_GPU_ID ...
34663486
#define GxB_HYPERSPARSE ...
34673487
#define GxB_IMPLEMENTATION ...
34683488
#define GxB_IMPLEMENTATION_MAJOR ...

0 commit comments

Comments
 (0)