forked from DrTimothyAldenDavis/GraphBLAS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGraphBLAS.h
9193 lines (8054 loc) · 421 KB
/
GraphBLAS.h
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
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
//------------------------------------------------------------------------------
// GraphBLAS.h: definitions for the GraphBLAS package
//------------------------------------------------------------------------------
// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
//------------------------------------------------------------------------------
// SuiteSparse:GraphBLAS is a complete implementation of the GraphBLAS
// standard, which defines a set of sparse matrix operations on an extended
// algebra of semirings, using an almost unlimited variety of operators and
// types. When applied to sparse adjacency matrices, these algebraic
// operations are equivalent to computations on graphs. GraphBLAS provides a
// powerful and expressive framework creating graph algorithms based on the
// elegant mathematics of sparse matrix operations on a semiring.
// This GraphBLAS.h file contains GraphBLAS definitions for user applications
// to #include. A few functions and variables with the prefix GB_ need to be
// defined in this file and are thus technically visible to the user, but they
// must not be accessed in user code. They are here only so that the ANSI C11
// _Generic feature can be used in the user-accessible polymorphic functions.
// For example GrB_free is a macro that uses _Generic to select the right
// method, depending on the type of its argument.
// This implementation conforms to the GraphBLAS API Specification and also
// includes functions and features that are extensions to the spec, which are
// given names of the form GxB_* for functions, built-in objects, and macros,
// so it is clear which are in the spec and which are extensions. Extensions
// with the name GxB_* are user-accessible in SuiteSparse:GraphBLAS but cannot
// be guaranteed to appear in all GraphBLAS implementations.
// Regarding "historical" functions and symbols: when a GxB_* function or
// symbol is added to the C API Specification, the new GrB_* name should be
// used instead. The old GxB_* name will be kept for historical reasons,
// documented here and in working order; it might no longer be mentioned in the
// user guide. Historical functions and symbols would only be removed in the
// rare case that they cause a serious conflict with future methods.
#ifndef GRAPHBLAS_H
#define GRAPHBLAS_H
//==============================================================================
// include files required by GraphBLAS
//==============================================================================
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
#include <stdint.h>
#include <inttypes.h>
#include <stddef.h>
#include <limits.h>
#include <math.h>
#include <stdarg.h>
//==============================================================================
// renaming for use in R2021a or later
//==============================================================================
#define GB_CAT2(x,y) x ## y
#define GB_EVAL2(x,y) GB_CAT2 (x,y)
#ifdef GBRENAME
// All symbols must be renamed for the @GrB interface when using
// R2021a and following, since those versions include an earlier
// version of SuiteSparse:GraphBLAS.
#define GB(x) GB_EVAL2 (GM_, x)
#define GRB(x) GB_EVAL2 (GrM_, x)
#define GXB(x) GB_EVAL2 (GxM_, x)
#define GrB GrM
#define GxB GxM
#include "GB_rename.h"
#else
// Use the standard GraphBLAS prefix.
#define GB(x) GB_EVAL2 (GB_, x)
#define GRB(x) GB_EVAL2 (GrB_, x)
#define GXB(x) GB_EVAL2 (GxB_, x)
#endif
//==============================================================================
// compiler variations
//==============================================================================
// Exporting/importing symbols for Microsoft Visual Studio
#if ( _MSC_VER && !__INTEL_COMPILER )
#ifdef GB_LIBRARY
// compiling SuiteSparse:GraphBLAS itself, exporting symbols to user apps
#define GB_PUBLIC extern __declspec ( dllexport )
#else
// compiling the user application, importing symbols from SuiteSparse:GraphBLAS
#define GB_PUBLIC extern __declspec ( dllimport )
#endif
#else
// for other compilers
#define GB_PUBLIC extern
#endif
// GraphBLAS requires an ANSI C11 compiler for its polymorphic functions (using
// the _Generic keyword), but it can be used in an C90 compiler if those
// functions are disabled.
// With ANSI C11 and later, _Generic keyword and polymorphic functions can be
// used. Earlier versions of the language do not have this feature.
#ifdef __STDC_VERSION__
// ANSI C11: 201112L
// ANSI C99: 199901L
// ANSI C95: 199409L
#define GxB_STDC_VERSION __STDC_VERSION__
#else
// assume ANSI C90 / C89
#define GxB_STDC_VERSION 199001L
#endif
//------------------------------------------------------------------------------
// definitions for complex types
//------------------------------------------------------------------------------
// See:
// https://www.drdobbs.com/complex-arithmetic-in-the-intersection-o/184401628#
#if defined ( __cplusplus )
extern "C++" {
// C++ complex types
#include <cmath>
#include <complex>
#undef I
typedef std::complex<float> GxB_FC32_t ;
typedef std::complex<double> GxB_FC64_t ;
}
#define GxB_CMPLXF(r,i) GxB_FC32_t(r,i)
#define GxB_CMPLX(r,i) GxB_FC64_t(r,i)
#elif ( _MSC_VER && !__INTEL_COMPILER )
// Microsoft Windows complex types
#include <complex.h>
#undef I
typedef _Fcomplex GxB_FC32_t ;
typedef _Dcomplex GxB_FC64_t ;
#define GxB_CMPLXF(r,i) (_FCbuild (r,i))
#define GxB_CMPLX(r,i) ( _Cbuild (r,i))
#else
// ANSI C11 complex types
#include <complex.h>
#undef I
typedef float complex GxB_FC32_t ;
typedef double complex GxB_FC64_t ;
#ifndef CMPLX
// gcc 6.2 on the the Mac doesn't #define CMPLX
#define GxB_CMPLX(r,i) \
((GxB_FC64_t)((double)(r)) + (GxB_FC64_t)((double)(i) * _Complex_I))
#else
// use the ANSI C11 CMPLX macro
#define GxB_CMPLX(r,i) CMPLX (r,i)
#endif
#ifndef CMPLXF
// gcc 6.2 on the the Mac doesn't #define CMPLXF
#define GxB_CMPLXF(r,i) \
((GxB_FC32_t)((float)(r)) + (GxB_FC32_t)((float)(i) * _Complex_I))
#else
// use the ANSI C11 CMPLX macro
#define GxB_CMPLXF(r,i) CMPLXF (r,i)
#endif
#endif
//==============================================================================
// version control
//==============================================================================
// There are two version numbers that user codes can check against with
// compile-time #if tests: the version of this GraphBLAS implementation,
// and the version of the GraphBLAS specification it conforms to. User code
// can use tests like this:
//
// #if GxB_SPEC_VERSION >= GxB_VERSION (2,0,3)
// ... use features in GraphBLAS specification 2.0.3 ...
// #else
// ... only use features in early specifications
// #endif
//
// #if GxB_IMPLEMENTATION > GxB_VERSION (1,4,0)
// ... use features from version 1.4.0 of a GraphBLAS package
// #endif
// X_GRAPHBLAS: names this particular implementation:
#define GxB_SUITESPARSE_GRAPHBLAS
// GxB_VERSION: a single integer for comparing spec and version levels
#define GxB_VERSION(major,minor,sub) \
(((major)*1000ULL + (minor))*1000ULL + (sub))
// The version of this implementation, and the GraphBLAS API version:
#define GxB_IMPLEMENTATION_NAME "SuiteSparse:GraphBLAS"
#define GxB_IMPLEMENTATION_DATE "Aug 23, 2021"
#define GxB_IMPLEMENTATION_MAJOR 5
#define GxB_IMPLEMENTATION_MINOR 1
#define GxB_IMPLEMENTATION_SUB 7
#define GxB_SPEC_DATE "Sept 25, 2019"
#define GxB_SPEC_MAJOR 1
#define GxB_SPEC_MINOR 3
#define GxB_SPEC_SUB 0
#define GxB_IMPLEMENTATION \
GxB_VERSION (GxB_IMPLEMENTATION_MAJOR, \
GxB_IMPLEMENTATION_MINOR, \
GxB_IMPLEMENTATION_SUB)
// The 'about' string the describes this particular implementation of GraphBLAS:
#define GxB_IMPLEMENTATION_ABOUT \
"SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved." \
"\nhttp://suitesparse.com Dept of Computer Sci. & Eng, Texas A&M University.\n"
// The GraphBLAS license for this particular implementation of GraphBLAS:
#define GxB_IMPLEMENTATION_LICENSE \
"SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved." \
"\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may\n"\
"not use SuiteSparse:GraphBLAS except in compliance with the License. You\n" \
"may obtain a copy of the License at\n\n" \
" http://www.apache.org/licenses/LICENSE-2.0\n\n" \
"Unless required by applicable law or agreed to in writing, software\n" \
"distributed under the License is distributed on an \"AS IS\" BASIS,\n" \
"WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n" \
"See the License for the specific language governing permissions and\n" \
"limitations under the License.\n"
//------------------------------------------------------------------------------
// GraphBLAS C API version
//------------------------------------------------------------------------------
#define GxB_SPEC_VERSION GxB_VERSION(GxB_SPEC_MAJOR,GxB_SPEC_MINOR,GxB_SPEC_SUB)
// The 'spec' string describes the GraphBLAS spec:
#define GxB_SPEC_ABOUT \
"GraphBLAS C API, by Aydin Buluc, Timothy Mattson, Scott McMillan,\n" \
"Jose' Moreira, Carl Yang, and Benjamin Brock. Based on 'GraphBLAS\n" \
"Mathematics by Jeremy Kepner. See also 'Graph Algorithms in the Language\n" \
"of Linear Algebra,' edited by J. Kepner and J. Gilbert, SIAM, 2011.\n"
//==============================================================================
// GrB_Index: the GraphBLAS integer
//==============================================================================
// GrB_Index: row or column index, or matrix dimension. This typedef is used
// for row and column indices, or matrix and vector dimensions.
typedef uint64_t GrB_Index ;
// The largest valid dimension permitted in this implementation is 2^60.
#define GxB_INDEX_MAX ((GrB_Index) (1ULL << 60))
//==============================================================================
// GraphBLAS error and informational codes
//==============================================================================
// All GraphBLAS functions return a code that indicates if it was successful
// or not. If more information is required, the GrB_error function can be
// called, which returns a string that provides more information on the last
// return value from GraphBLAS.
typedef enum
{
GrB_SUCCESS = 0, // all is well
//--------------------------------------------------------------------------
// informational codes, not an error:
//--------------------------------------------------------------------------
GrB_NO_VALUE = 1, // A(i,j) requested but not there
//--------------------------------------------------------------------------
// API errors:
//--------------------------------------------------------------------------
GrB_UNINITIALIZED_OBJECT = 2, // object has not been initialized
GrB_INVALID_OBJECT = 3, // object is corrupted
GrB_NULL_POINTER = 4, // input pointer is NULL
GrB_INVALID_VALUE = 5, // generic error code; some value is bad
GrB_INVALID_INDEX = 6, // a row or column index is out of bounds
GrB_DOMAIN_MISMATCH = 7, // object domains are not compatible
GrB_DIMENSION_MISMATCH = 8, // matrix dimensions do not match
GrB_OUTPUT_NOT_EMPTY = 9, // output matrix already has values in it
//--------------------------------------------------------------------------
// execution errors:
//--------------------------------------------------------------------------
GrB_OUT_OF_MEMORY = 10, // out of memory
GrB_INSUFFICIENT_SPACE = 11, // output array not large enough
GrB_INDEX_OUT_OF_BOUNDS = 12, // a row or column index is out of bounds
GrB_PANIC = 13 // unknown error, or GrB_init not called.
}
GrB_Info ;
//==============================================================================
// GrB_init / GrB_finalize
//==============================================================================
// GrB_init must called before any other GraphBLAS operation. GrB_finalize
// must be called as the last GraphBLAS operation.
// GrB_init defines the mode that GraphBLAS will use: blocking or
// non-blocking. With blocking mode, all operations finish before returning to
// the user application. With non-blocking mode, operations can be left
// pending, and are computed only when needed.
// The extension GxB_init does the work of GrB_init, but it also defines the
// memory management functions that SuiteSparse:GraphBLAS will use internally.
typedef enum
{
GrB_NONBLOCKING = 0, // methods may return with pending computations
GrB_BLOCKING = 1 // no computations are ever left pending
}
GrB_Mode ;
GB_PUBLIC
GrB_Info GrB_init // start up GraphBLAS
(
GrB_Mode mode // blocking or non-blocking mode
) ;
GB_PUBLIC
GrB_Info GxB_init // start up GraphBLAS and also define malloc, etc
(
GrB_Mode mode, // blocking or non-blocking mode
// pointers to memory management functions
void * (* user_malloc_function ) (size_t),
void * (* user_calloc_function ) (size_t, size_t),
void * (* user_realloc_function ) (void *, size_t),
void (* user_free_function ) (void *),
bool user_malloc_is_thread_safe // ADDED in V3.0: thread_safe arg
) ;
GB_PUBLIC
GrB_Info GrB_finalize (void) ; // finish GraphBLAS
//==============================================================================
// GrB_getVersion: GraphBLAS C API version
//==============================================================================
// compile-time access to the C API Version number of this library.
#define GRB_VERSION GxB_SPEC_MAJOR
#define GRB_SUBVERSION GxB_SPEC_MINOR
// GrB_getVersion provides a runtime access of the C API Version.
GB_PUBLIC
GrB_Info GrB_getVersion // runtime access to C API version number
(
unsigned int *version, // returns GRB_VERSION
unsigned int *subversion // returns GRB_SUBVERSION
) ;
//==============================================================================
// GrB_Descriptor: the GraphBLAS descriptor
//==============================================================================
// The GrB_Descriptor is used to modify the behavior of GraphBLAS operations.
//
// GrB_OUTP: can be GxB_DEFAULT or GrB_REPLACE. If GrB_REPLACE, then C is
// cleared after taking part in the accum operation but before the mask.
// In other words, C<Mask> = accum (C,T) is split into Z = accum(C,T) ;
// C=0 ; C<Mask> = Z.
//
// GrB_MASK: can be GxB_DEFAULT, GrB_COMP, GrB_STRUCTURE, or set to both
// GrB_COMP and GrB_STRUCTURE. If GxB_DEFAULT, the mask is used
// normally, where Mask(i,j)=1 means C(i,j) can be modified by C<Mask>=Z,
// and Mask(i,j)=0 means it cannot be modified even if Z(i,j) is has been
// computed and differs from C(i,j). If GrB_COMP, this is the same as
// taking the logical complement of the Mask. If GrB_STRUCTURE is set,
// the value of the mask is not considered, just its pattern. The
// GrB_COMP and GrB_STRUCTURE settings can be combined.
//
// GrB_INP0: can be GxB_DEFAULT or GrB_TRAN. If GxB_DEFAULT, the first input
// is used as-is. If GrB_TRAN, it is transposed. Only matrices are
// transposed this way. Vectors are never transposed via the
// GrB_Descriptor.
//
// GrB_INP1: the same as GrB_INP0 but for the second input
//
// GxB_NTHREADS: the maximum number of threads to use in the current method.
// If <= GxB_DEFAULT (which is zero), then the number of threads is
// determined automatically. This is the default value.
//
// GxB_CHUNK: an integer parameter that determines the number of threads to use
// for a small problem. If w is the work to be performed, and chunk is
// the value of this parameter, then the # of threads is limited to floor
// (w/chunk). The default chunk is currently 64K, but this may change in
// the future. If chunk is set to <= GxB_DEFAULT (that is, zero), the
// default is used.
//
// GxB_AxB_METHOD: this is a hint to SuiteSparse:GraphBLAS on which algorithm
// it should use to compute C=A*B, in GrB_mxm, GrB_mxv, and GrB_vxm.
// SuiteSparse:GraphBLAS has four different heuristics, and the default
// method (GxB_DEFAULT) selects between them automatically. The complete
// rule is in the User Guide. The brief discussion here assumes all
// matrices are stored by column. All methods compute the same result,
// except that floating-point roundoff may differ when working on
// floating-point data types.
//
// GxB_AxB_SAXPY: C(:,j)=A*B(:,j) is computed using a mix of Gustavson
// and Hash methods. Each task in the parallel computation makes its
// own decision between these two methods, via a heuristic.
//
// GxB_AxB_GUSTAVSON: This is the same as GxB_AxB_SAXPY, except that
// every task uses Gustavon's method, computing C(:,j)=A*B(:,j) via a
// gather/scatter workspace of size equal to the number of rows of A.
// Very good general-purpose method, but sometimes the workspace can
// be too large when many threads are used.
//
// GxB_AxB_HASH: This is the same as GxB_AxB_SAXPY, except that every
// task uses the Hash method. It is very good for hypersparse
// matrices and uses very little workspace, and so it scales well to
// many threads.
//
// GxB_AxB_DOT: computes C(i,j) = A(:,i)'*B(:,j), for each entry C(i,j).
// A very specialized method that works well only if the mask is
// present, very sparse, and not complemented, or when C is a dense
// vector or matrix, or when C is small.
//
// GxB_SORT: GrB_mxm and other methods may return a matrix in a 'jumbled'
// state, with indices out of order. The sort is left pending. Some
// methods can tolerate jumbled matrices on input, so this can be faster.
// However, in some cases, it can be faster for GrB_mxm to sort its output
// as it is computed. With GxB_SORT set to GxB_DEFAULT, the sort is left
// pending. With GxB_SORT set to a nonzero value, GrB_mxm typically sorts
// the resulting matrix C (but not always; this is just a hint). If
// GrB_init is called with GrB_BLOCKING mode, the sort will always be
// done, and this setting has no effect.
// The following are enumerated values in both the GrB_Desc_Field and the
// GxB_Option_Field for global options. They are defined with the same integer
// value for both enums, so the user can use them for both.
#define GxB_NTHREADS 5
#define GxB_CHUNK 7
// GPU control (DRAFT: in progress, do not use)
#define GxB_GPU_CONTROL 21
#define GxB_GPU_CHUNK 22
typedef enum
{
GrB_OUTP = 0, // descriptor for output of a method
GrB_MASK = 1, // descriptor for the mask input of a method
GrB_INP0 = 2, // descriptor for the first input of a method
GrB_INP1 = 3, // descriptor for the second input of a method
GxB_DESCRIPTOR_NTHREADS = GxB_NTHREADS, // max number of threads to use.
// If <= GxB_DEFAULT, then GraphBLAS selects the number
// of threads automatically.
GxB_DESCRIPTOR_CHUNK = GxB_CHUNK, // chunk size for small problems.
// If <= GxB_DEFAULT, then the default is used.
// GPU control (DRAFT: in progress, do not use)
GxB_DESCRIPTOR_GPU_CONTROL = GxB_GPU_CONTROL,
GxB_DESCRIPTOR_GPU_CHUNK = GxB_GPU_CHUNK,
GxB_AxB_METHOD = 1000, // descriptor for selecting C=A*B algorithm
GxB_SORT = 35 // control sort in GrB_mxm
}
GrB_Desc_Field ;
typedef enum
{
// for all GrB_Descriptor fields:
GxB_DEFAULT = 0, // default behavior of the method
// for GrB_OUTP only:
GrB_REPLACE = 1, // clear the output before assigning new values to it
// for GrB_MASK only:
GrB_COMP = 2, // use the structural complement of the input
GrB_SCMP = 2, // same as GrB_COMP (historical; use GrB_COMP instead)
GrB_STRUCTURE = 4, // use the only pattern of the mask, not its values
// for GrB_INP0 and GrB_INP1 only:
GrB_TRAN = 3, // use the transpose of the input
// for GxB_GPU_CONTROL only (DRAFT: in progress, do not use)
GxB_GPU_ALWAYS = 2001,
GxB_GPU_NEVER = 2002,
// for GxB_AxB_METHOD only:
GxB_AxB_GUSTAVSON = 1001, // gather-scatter saxpy method
GxB_AxB_DOT = 1003, // dot product
GxB_AxB_HASH = 1004, // hash-based saxpy method
GxB_AxB_SAXPY = 1005 // saxpy method (any kind)
}
GrB_Desc_Value ;
typedef struct GB_Descriptor_opaque *GrB_Descriptor ;
GB_PUBLIC
GrB_Info GrB_Descriptor_new // create a new descriptor
(
GrB_Descriptor *descriptor // handle of descriptor to create
) ;
GB_PUBLIC
GrB_Info GrB_Descriptor_set // set a parameter in a descriptor
(
GrB_Descriptor desc, // descriptor to modify
GrB_Desc_Field field, // parameter to change
GrB_Desc_Value val // value to change it to
) ;
GB_PUBLIC
GrB_Info GxB_Descriptor_get // get a parameter from a descriptor
(
GrB_Desc_Value *val, // value of the parameter
GrB_Descriptor desc, // descriptor to query; NULL means defaults
GrB_Desc_Field field // parameter to query
) ;
GB_PUBLIC
GrB_Info GxB_Desc_set // set a parameter in a descriptor
(
GrB_Descriptor desc, // descriptor to modify
GrB_Desc_Field field, // parameter to change
... // value to change it to
) ;
GB_PUBLIC
GrB_Info GxB_Desc_get // get a parameter from a descriptor
(
GrB_Descriptor desc, // descriptor to query; NULL means defaults
GrB_Desc_Field field, // parameter to query
... // value of the parameter
) ;
GB_PUBLIC
GrB_Info GrB_Descriptor_free // free a descriptor
(
GrB_Descriptor *descriptor // handle of descriptor to free
) ;
// Predefined descriptors and their values:
GB_PUBLIC
GrB_Descriptor // OUTP MASK MASK INP0 INP1
// structural complement
// =========== ============== ========== ======== ========
// GrB_NULL // - - - - -
GrB_DESC_T1 , // - - - - GrB_TRAN
GrB_DESC_T0 , // - - - GrB_TRAN -
GrB_DESC_T0T1 , // - - - GrB_TRAN GrB_TRAN
GrB_DESC_C , // - - GrB_COMP - -
GrB_DESC_CT1 , // - - GrB_COMP - GrB_TRAN
GrB_DESC_CT0 , // - - GrB_COMP GrB_TRAN -
GrB_DESC_CT0T1 , // - - GrB_COMP GrB_TRAN GrB_TRAN
GrB_DESC_S , // - GrB_STRUCTURE - - -
GrB_DESC_ST1 , // - GrB_STRUCTURE - - GrB_TRAN
GrB_DESC_ST0 , // - GrB_STRUCTURE - GrB_TRAN -
GrB_DESC_ST0T1 , // - GrB_STRUCTURE - GrB_TRAN GrB_TRAN
GrB_DESC_SC , // - GrB_STRUCTURE GrB_COMP - -
GrB_DESC_SCT1 , // - GrB_STRUCTURE GrB_COMP - GrB_TRAN
GrB_DESC_SCT0 , // - GrB_STRUCTURE GrB_COMP GrB_TRAN -
GrB_DESC_SCT0T1 , // - GrB_STRUCTURE GrB_COMP GrB_TRAN GrB_TRAN
GrB_DESC_R , // GrB_REPLACE - - - -
GrB_DESC_RT1 , // GrB_REPLACE - - - GrB_TRAN
GrB_DESC_RT0 , // GrB_REPLACE - - GrB_TRAN -
GrB_DESC_RT0T1 , // GrB_REPLACE - - GrB_TRAN GrB_TRAN
GrB_DESC_RC , // GrB_REPLACE - GrB_COMP - -
GrB_DESC_RCT1 , // GrB_REPLACE - GrB_COMP - GrB_TRAN
GrB_DESC_RCT0 , // GrB_REPLACE - GrB_COMP GrB_TRAN -
GrB_DESC_RCT0T1 , // GrB_REPLACE - GrB_COMP GrB_TRAN GrB_TRAN
GrB_DESC_RS , // GrB_REPLACE GrB_STRUCTURE - - -
GrB_DESC_RST1 , // GrB_REPLACE GrB_STRUCTURE - - GrB_TRAN
GrB_DESC_RST0 , // GrB_REPLACE GrB_STRUCTURE - GrB_TRAN -
GrB_DESC_RST0T1 , // GrB_REPLACE GrB_STRUCTURE - GrB_TRAN GrB_TRAN
GrB_DESC_RSC , // GrB_REPLACE GrB_STRUCTURE GrB_COMP - -
GrB_DESC_RSCT1 , // GrB_REPLACE GrB_STRUCTURE GrB_COMP - GrB_TRAN
GrB_DESC_RSCT0 , // GrB_REPLACE GrB_STRUCTURE GrB_COMP GrB_TRAN -
GrB_DESC_RSCT0T1 ; // GrB_REPLACE GrB_STRUCTURE GrB_COMP GrB_TRAN GrB_TRAN
// GrB_NULL is the default descriptor, with all settings at their defaults:
//
// OUTP: do not replace the output
// MASK: mask is valued and not complemented
// INP0: first input not transposed
// INP1: second input not transposed
// Predefined descriptors may not be modified or freed. Attempting to modify
// them results in an error (GrB_INVALID_VALUE). Attempts to free them are
// silently ignored.
//==============================================================================
// GrB_Type: data types
//==============================================================================
typedef struct GB_Type_opaque *GrB_Type ;
// GraphBLAS predefined types and their counterparts in pure C:
GB_PUBLIC GrB_Type
GrB_BOOL , // in C: bool
GrB_INT8 , // in C: int8_t
GrB_INT16 , // in C: int16_t
GrB_INT32 , // in C: int32_t
GrB_INT64 , // in C: int64_t
GrB_UINT8 , // in C: uint8_t
GrB_UINT16 , // in C: uint16_t
GrB_UINT32 , // in C: uint32_t
GrB_UINT64 , // in C: uint64_t
GrB_FP32 , // in C: float
GrB_FP64 , // in C: double
GxB_FC32 , // in C: float complex
GxB_FC64 ; // in C: double complex
//------------------------------------------------------------------------------
// helper macros for polymorphic functions
//------------------------------------------------------------------------------
#define GB_CAT(w,x,y,z) w ## x ## y ## z
#define GB_CONCAT(w,x,y,z) GB_CAT (w, x, y, z)
#if GxB_STDC_VERSION >= 201112L
#define GB_CASES(p,prefix,func) \
const bool p : GB_CONCAT ( prefix, _, func, _BOOL ), \
bool p : GB_CONCAT ( prefix, _, func, _BOOL ), \
const int8_t p : GB_CONCAT ( prefix, _, func, _INT8 ), \
int8_t p : GB_CONCAT ( prefix, _, func, _INT8 ), \
const int16_t p : GB_CONCAT ( prefix, _, func, _INT16 ), \
int16_t p : GB_CONCAT ( prefix, _, func, _INT16 ), \
const int32_t p : GB_CONCAT ( prefix, _, func, _INT32 ), \
int32_t p : GB_CONCAT ( prefix, _, func, _INT32 ), \
const int64_t p : GB_CONCAT ( prefix, _, func, _INT64 ), \
int64_t p : GB_CONCAT ( prefix, _, func, _INT64 ), \
const uint8_t p : GB_CONCAT ( prefix, _, func, _UINT8 ), \
uint8_t p : GB_CONCAT ( prefix, _, func, _UINT8 ), \
const uint16_t p : GB_CONCAT ( prefix, _, func, _UINT16 ), \
uint16_t p : GB_CONCAT ( prefix, _, func, _UINT16 ), \
const uint32_t p : GB_CONCAT ( prefix, _, func, _UINT32 ), \
uint32_t p : GB_CONCAT ( prefix, _, func, _UINT32 ), \
const uint64_t p : GB_CONCAT ( prefix, _, func, _UINT64 ), \
uint64_t p : GB_CONCAT ( prefix, _, func, _UINT64 ), \
const float p : GB_CONCAT ( prefix, _, func, _FP32 ), \
float p : GB_CONCAT ( prefix, _, func, _FP32 ), \
const double p : GB_CONCAT ( prefix, _, func, _FP64 ), \
double p : GB_CONCAT ( prefix, _, func, _FP64 ), \
const GxB_FC32_t p : GB_CONCAT ( GxB , _, func, _FC32 ), \
GxB_FC32_t p : GB_CONCAT ( GxB , _, func, _FC32 ), \
const GxB_FC64_t p : GB_CONCAT ( GxB , _, func, _FC64 ), \
GxB_FC64_t p : GB_CONCAT ( GxB , _, func, _FC64 ), \
const void * : GB_CONCAT ( prefix, _, func, _UDT ), \
void * : GB_CONCAT ( prefix, _, func, _UDT )
#endif
//------------------------------------------------------------------------------
// GrB_Type_new: create a new type
//------------------------------------------------------------------------------
// GrB_Type_new is implemented both as a macro and a function. Both are
// user-callable. The default is to use the macro, since this allows the name
// of the type to be saved as a string, for subsequent error reporting by
// GrB_error.
#undef GrB_Type_new
#undef GrM_Type_new
GB_PUBLIC
GrB_Info GRB (Type_new) // create a new GraphBLAS type
(
GrB_Type *type, // handle of user type to create
size_t sizeof_ctype // size = sizeof (ctype) of the C type
) ;
// user code should not directly use GB_STR or GB_XSTR
// GB_STR: convert the content of x into a string "x"
#define GB_XSTR(x) GB_STR(x)
#define GB_STR(x) #x
// GrB_Type_new as a user-callable macro, which allows the name of the ctype
// to be added to the new type.
#define GrB_Type_new(utype, sizeof_ctype) \
GB_Type_new (utype, sizeof_ctype, GB_STR(sizeof_ctype))
#define GrM_Type_new(utype, sizeof_ctype) \
GM_Type_new (utype, sizeof_ctype, GB_STR(sizeof_ctype))
GB_PUBLIC
GrB_Info GB_Type_new // not user-callable; use GrB_Type_new instead
(
GrB_Type *type, // handle of user type to create
size_t sizeof_ctype, // size of the user type
const char *name // name of the type, as "sizeof (ctype)"
) ;
GB_PUBLIC
GrB_Info GxB_Type_size // determine the size of the type
(
size_t *size, // the sizeof the type
GrB_Type type // type to determine the sizeof
) ;
GB_PUBLIC
GrB_Info GrB_Type_free // free a user-defined type
(
GrB_Type *type // handle of user-defined type to free
) ;
//==============================================================================
// GrB_UnaryOp: unary operators
//==============================================================================
// GrB_UnaryOp: a function z=f(x). The function f must have the signature:
// void f (void *z, const void *x) ;
// The pointers are void * but they are always of pointers to objects of type
// ztype and xtype, respectively. The function must typecast its arguments as
// needed from void* to ztype* and xtype*.
typedef struct GB_UnaryOp_opaque *GrB_UnaryOp ;
//------------------------------------------------------------------------------
// built-in unary operators, z = f(x)
//------------------------------------------------------------------------------
GB_PUBLIC GrB_UnaryOp
// For these functions z=f(x), z and x have the same type.
// The suffix in the name is the type of x and z.
// z = x z = -x z = 1/x z = ! (x != 0)
// identity additive multiplicative logical
// inverse inverse negation
GrB_IDENTITY_BOOL, GrB_AINV_BOOL, GrB_MINV_BOOL, GxB_LNOT_BOOL,
GrB_IDENTITY_INT8, GrB_AINV_INT8, GrB_MINV_INT8, GxB_LNOT_INT8,
GrB_IDENTITY_INT16, GrB_AINV_INT16, GrB_MINV_INT16, GxB_LNOT_INT16,
GrB_IDENTITY_INT32, GrB_AINV_INT32, GrB_MINV_INT32, GxB_LNOT_INT32,
GrB_IDENTITY_INT64, GrB_AINV_INT64, GrB_MINV_INT64, GxB_LNOT_INT64,
GrB_IDENTITY_UINT8, GrB_AINV_UINT8, GrB_MINV_UINT8, GxB_LNOT_UINT8,
GrB_IDENTITY_UINT16, GrB_AINV_UINT16, GrB_MINV_UINT16, GxB_LNOT_UINT16,
GrB_IDENTITY_UINT32, GrB_AINV_UINT32, GrB_MINV_UINT32, GxB_LNOT_UINT32,
GrB_IDENTITY_UINT64, GrB_AINV_UINT64, GrB_MINV_UINT64, GxB_LNOT_UINT64,
GrB_IDENTITY_FP32, GrB_AINV_FP32, GrB_MINV_FP32, GxB_LNOT_FP32,
GrB_IDENTITY_FP64, GrB_AINV_FP64, GrB_MINV_FP64, GxB_LNOT_FP64,
// complex unary operators:
GxB_IDENTITY_FC32, GxB_AINV_FC32, GxB_MINV_FC32, // no LNOT
GxB_IDENTITY_FC64, GxB_AINV_FC64, GxB_MINV_FC64, // for complex
// z = 1 z = abs(x) z = bnot(x) z = signum
// one absolute value bitwise negation
GxB_ONE_BOOL, GrB_ABS_BOOL,
GxB_ONE_INT8, GrB_ABS_INT8, GrB_BNOT_INT8,
GxB_ONE_INT16, GrB_ABS_INT16, GrB_BNOT_INT16,
GxB_ONE_INT32, GrB_ABS_INT32, GrB_BNOT_INT32,
GxB_ONE_INT64, GrB_ABS_INT64, GrB_BNOT_INT64,
GxB_ONE_UINT8, GrB_ABS_UINT8, GrB_BNOT_UINT8,
GxB_ONE_UINT16, GrB_ABS_UINT16, GrB_BNOT_UINT16,
GxB_ONE_UINT32, GrB_ABS_UINT32, GrB_BNOT_UINT32,
GxB_ONE_UINT64, GrB_ABS_UINT64, GrB_BNOT_UINT64,
GxB_ONE_FP32, GrB_ABS_FP32,
GxB_ONE_FP64, GrB_ABS_FP64,
// complex unary operators:
GxB_ONE_FC32, // for complex types, z = abs(x)
GxB_ONE_FC64, // is real; listed below.
// Boolean negation, z = !x, where both z and x are boolean. There is no
// suffix since z and x are only boolean. This operator is identical to
// GxB_LNOT_BOOL; it just has a different name.
GrB_LNOT ;
// GxB_ABS is now in the v1.3 spec, the following names are historical:
GB_PUBLIC GrB_UnaryOp
// z = abs(x)
GxB_ABS_BOOL,
GxB_ABS_INT8,
GxB_ABS_INT16,
GxB_ABS_INT32,
GxB_ABS_INT64,
GxB_ABS_UINT8,
GxB_ABS_UINT16,
GxB_ABS_UINT32,
GxB_ABS_UINT64,
GxB_ABS_FP32,
GxB_ABS_FP64 ;
//------------------------------------------------------------------------------
// Unary operators for floating-point types only
//------------------------------------------------------------------------------
// The following floating-point unary operators and their ANSI C11 equivalents,
// are only defined for floating-point (real and complex) types.
GB_PUBLIC GrB_UnaryOp
//--------------------------------------------------------------------------
// z = f(x) where z and x have the same type (all 4 floating-point types)
//--------------------------------------------------------------------------
// z = sqrt (x) z = log (x) z = exp (x) z = log2 (x)
GxB_SQRT_FP32, GxB_LOG_FP32, GxB_EXP_FP32, GxB_LOG2_FP32,
GxB_SQRT_FP64, GxB_LOG_FP64, GxB_EXP_FP64, GxB_LOG2_FP64,
GxB_SQRT_FC32, GxB_LOG_FC32, GxB_EXP_FC32, GxB_LOG2_FC32,
GxB_SQRT_FC64, GxB_LOG_FC64, GxB_EXP_FC64, GxB_LOG2_FC64,
// z = sin (x) z = cos (x) z = tan (x)
GxB_SIN_FP32, GxB_COS_FP32, GxB_TAN_FP32,
GxB_SIN_FP64, GxB_COS_FP64, GxB_TAN_FP64,
GxB_SIN_FC32, GxB_COS_FC32, GxB_TAN_FC32,
GxB_SIN_FC64, GxB_COS_FC64, GxB_TAN_FC64,
// z = acos (x) z = asin (x) z = atan (x)
GxB_ACOS_FP32, GxB_ASIN_FP32, GxB_ATAN_FP32,
GxB_ACOS_FP64, GxB_ASIN_FP64, GxB_ATAN_FP64,
GxB_ACOS_FC32, GxB_ASIN_FC32, GxB_ATAN_FC32,
GxB_ACOS_FC64, GxB_ASIN_FC64, GxB_ATAN_FC64,
// z = sinh (x) z = cosh (x) z = tanh (x)
GxB_SINH_FP32, GxB_COSH_FP32, GxB_TANH_FP32,
GxB_SINH_FP64, GxB_COSH_FP64, GxB_TANH_FP64,
GxB_SINH_FC32, GxB_COSH_FC32, GxB_TANH_FC32,
GxB_SINH_FC64, GxB_COSH_FC64, GxB_TANH_FC64,
// z = acosh (x) z = asinh (x) z = atanh (x) z = signum (x)
GxB_ACOSH_FP32, GxB_ASINH_FP32, GxB_ATANH_FP32, GxB_SIGNUM_FP32,
GxB_ACOSH_FP64, GxB_ASINH_FP64, GxB_ATANH_FP64, GxB_SIGNUM_FP64,
GxB_ACOSH_FC32, GxB_ASINH_FC32, GxB_ATANH_FC32, GxB_SIGNUM_FC32,
GxB_ACOSH_FC64, GxB_ASINH_FC64, GxB_ATANH_FC64, GxB_SIGNUM_FC64,
// z = ceil (x) z = floor (x) z = round (x) z = trunc (x)
GxB_CEIL_FP32, GxB_FLOOR_FP32, GxB_ROUND_FP32, GxB_TRUNC_FP32,
GxB_CEIL_FP64, GxB_FLOOR_FP64, GxB_ROUND_FP64, GxB_TRUNC_FP64,
GxB_CEIL_FC32, GxB_FLOOR_FC32, GxB_ROUND_FC32, GxB_TRUNC_FC32,
GxB_CEIL_FC64, GxB_FLOOR_FC64, GxB_ROUND_FC64, GxB_TRUNC_FC64,
// z = exp2 (x) z = expm1 (x) z = log10 (x) z = log1p (x)
GxB_EXP2_FP32, GxB_EXPM1_FP32, GxB_LOG10_FP32, GxB_LOG1P_FP32,
GxB_EXP2_FP64, GxB_EXPM1_FP64, GxB_LOG10_FP64, GxB_LOG1P_FP64,
GxB_EXP2_FC32, GxB_EXPM1_FC32, GxB_LOG10_FC32, GxB_LOG1P_FC32,
GxB_EXP2_FC64, GxB_EXPM1_FC64, GxB_LOG10_FC64, GxB_LOG1P_FC64,
//--------------------------------------------------------------------------
// z = f(x) where z and x are the same type (floating-point real only)
//--------------------------------------------------------------------------
// z = lgamma (x) z = tgamma (x) z = erf (x) z = erfc (x)
GxB_LGAMMA_FP32, GxB_TGAMMA_FP32, GxB_ERF_FP32, GxB_ERFC_FP32,
GxB_LGAMMA_FP64, GxB_TGAMMA_FP64, GxB_ERF_FP64, GxB_ERFC_FP64,
// frexpx and frexpe return the mantissa and exponent, respectively,
// from the ANSI C11 frexp function. The exponent is returned as a
// floating-point value, not an integer.
// z = frexpx (x) z = frexpe (x)
GxB_FREXPX_FP32, GxB_FREXPE_FP32,
GxB_FREXPX_FP64, GxB_FREXPE_FP64,
//--------------------------------------------------------------------------
// z = f(x) where z and x are the same type (complex only)
//--------------------------------------------------------------------------
// z = conj (x)
GxB_CONJ_FC32,
GxB_CONJ_FC64,
//--------------------------------------------------------------------------
// z = f(x) where z is real and x is complex:
//--------------------------------------------------------------------------
// z = creal (x) z = cimag (x) z = carg (x) z = abs (x)
GxB_CREAL_FC32, GxB_CIMAG_FC32, GxB_CARG_FC32, GxB_ABS_FC32,
GxB_CREAL_FC64, GxB_CIMAG_FC64, GxB_CARG_FC64, GxB_ABS_FC64,
//--------------------------------------------------------------------------
// z = f(x) where z is bool and x is any floating-point type
//--------------------------------------------------------------------------
// z = isinf (x)
GxB_ISINF_FP32,
GxB_ISINF_FP64,
GxB_ISINF_FC32, // isinf (creal (x)) || isinf (cimag (x))
GxB_ISINF_FC64, // isinf (creal (x)) || isinf (cimag (x))
// z = isnan (x)
GxB_ISNAN_FP32,
GxB_ISNAN_FP64,
GxB_ISNAN_FC32, // isnan (creal (x)) || isnan (cimag (x))
GxB_ISNAN_FC64, // isnan (creal (x)) || isnan (cimag (x))
// z = isfinite (x)
GxB_ISFINITE_FP32,
GxB_ISFINITE_FP64,
GxB_ISFINITE_FC32, // isfinite (real (x)) && isfinite (cimag (x))
GxB_ISFINITE_FC64 ; // isfinite (real (x)) && isfinite (cimag (x))
//------------------------------------------------------------------------------
// methods for unary operators
//------------------------------------------------------------------------------
typedef void (*GxB_unary_function) (void *, const void *) ;
#undef GrB_UnaryOp_new
#undef GrM_UnaryOp_new
GB_PUBLIC
GrB_Info GRB (UnaryOp_new) // create a new user-defined unary operator
(
GrB_UnaryOp *unaryop, // handle for the new unary operator
GxB_unary_function function, // pointer to the unary function
GrB_Type ztype, // type of output z
GrB_Type xtype // type of input x
) ;
#define GrB_UnaryOp_new(op,f,z,x) GB_UnaryOp_new (op,f,z,x, GB_STR(f))
#define GrM_UnaryOp_new(op,f,z,x) GM_UnaryOp_new (op,f,z,x, GB_STR(f))
GB_PUBLIC
GrB_Info GB_UnaryOp_new // not user-callable; use GrB_UnaryOp_new
(
GrB_UnaryOp *unaryop, // handle for the new unary operator
GxB_unary_function function, // pointer to the unary function
GrB_Type ztype, // type of output z
GrB_Type xtype, // type of input x
const char *name // name of the underlying function
) ;
GB_PUBLIC
GrB_Info GxB_UnaryOp_ztype // return the type of z
(
GrB_Type *ztype, // return type of output z
GrB_UnaryOp unaryop // unary operator
) ;
GB_PUBLIC
GrB_Info GxB_UnaryOp_xtype // return the type of x
(
GrB_Type *xtype, // return type of input x
GrB_UnaryOp unaryop // unary operator
) ;
GB_PUBLIC
GrB_Info GrB_UnaryOp_free // free a user-created unary operator
(
GrB_UnaryOp *unaryop // handle of unary operator to free
) ;
//==============================================================================
// GrB_BinaryOp: binary operators
//==============================================================================
// GrB_BinaryOp: a function z=f(x,y). The function f must have the signature:
// void f (void *z, const void *x, const void *y) ;
// The pointers are void * but they are always of pointers to objects of type
// ztype, xtype, and ytype, respectively. See Demo/usercomplex.c for examples.
typedef struct GB_BinaryOp_opaque *GrB_BinaryOp ;
//------------------------------------------------------------------------------
// built-in binary operators, z = f(x,y), where x,y,z all have the same type
//------------------------------------------------------------------------------
GB_PUBLIC GrB_BinaryOp
// operators for all 13 types (including complex):
// z = x z = y z = pow (x,y)
GrB_FIRST_BOOL, GrB_SECOND_BOOL, GxB_POW_BOOL,
GrB_FIRST_INT8, GrB_SECOND_INT8, GxB_POW_INT8,
GrB_FIRST_INT16, GrB_SECOND_INT16, GxB_POW_INT16,
GrB_FIRST_INT32, GrB_SECOND_INT32, GxB_POW_INT32,
GrB_FIRST_INT64, GrB_SECOND_INT64, GxB_POW_INT64,
GrB_FIRST_UINT8, GrB_SECOND_UINT8, GxB_POW_UINT8,
GrB_FIRST_UINT16, GrB_SECOND_UINT16, GxB_POW_UINT16,
GrB_FIRST_UINT32, GrB_SECOND_UINT32, GxB_POW_UINT32,
GrB_FIRST_UINT64, GrB_SECOND_UINT64, GxB_POW_UINT64,
GrB_FIRST_FP32, GrB_SECOND_FP32, GxB_POW_FP32,
GrB_FIRST_FP64, GrB_SECOND_FP64, GxB_POW_FP64,
// complex:
GxB_FIRST_FC32, GxB_SECOND_FC32, GxB_POW_FC32,
GxB_FIRST_FC64, GxB_SECOND_FC64, GxB_POW_FC64,
// z = x+y z = x-y z = x*y z = x/y
GrB_PLUS_BOOL, GrB_MINUS_BOOL, GrB_TIMES_BOOL, GrB_DIV_BOOL,
GrB_PLUS_INT8, GrB_MINUS_INT8, GrB_TIMES_INT8, GrB_DIV_INT8,
GrB_PLUS_INT16, GrB_MINUS_INT16, GrB_TIMES_INT16, GrB_DIV_INT16,
GrB_PLUS_INT32, GrB_MINUS_INT32, GrB_TIMES_INT32, GrB_DIV_INT32,