@@ -102,21 +102,23 @@ end
102102const valid_vec = [Bool, Int8, UInt8, Int16, UInt16, Int32, UInt32,
103103Int64, UInt64, Float32, Float64, ComplexF32, ComplexF64]
104104
105- @enum GrB_Info:: UInt32 begin
105+ @enum GrB_Info:: Int32 begin
106106 GrB_SUCCESS = 0
107107 GrB_NO_VALUE = 1
108- GrB_UNINITIALIZED_OBJECT = 2
109- GrB_INVALID_OBJECT = 3
110- GrB_NULL_POINTER = 4
111- GrB_INVALID_VALUE = 5
112- GrB_INVALID_INDEX = 6
113- GrB_DOMAIN_MISMATCH = 7
114- GrB_DIMENSION_MISMATCH = 8
115- GrB_OUTPUT_NOT_EMPTY = 9
116- GrB_OUT_OF_MEMORY = 10
117- GrB_INSUFFICIENT_SPACE = 11
118- GrB_INDEX_OUT_OF_BOUNDS = 12
119- GrB_PANIC = 13
108+ GrB_UNINITIALIZED_OBJECT = - 1
109+ GrB_NULL_POINTER = - 2
110+ GrB_INVALID_VALUE = - 3
111+ GrB_INVALID_INDEX = - 4
112+ GrB_DOMAIN_MISMATCH = - 5
113+ GrB_DIMENSION_MISMATCH = - 6
114+ GrB_OUTPUT_NOT_EMPTY = - 7
115+ GrB_NOT_IMPLEMENTED = - 8
116+ GrB_PANIC = - 101
117+ GrB_OUT_OF_MEMORY = - 102
118+ GrB_INSUFFICIENT_SPACE = - 103
119+ GrB_INVALID_OBJECT = - 104
120+ GrB_INDEX_OUT_OF_BOUNDS = - 105
121+ GrB_EMPTY_OBJECT = - 106
120122end
121123
122124@enum GrB_Mode:: UInt32 begin
@@ -128,8 +130,8 @@ function GrB_init(mode)
128130 @wraperror ccall ((:GrB_init , libgraphblas), GrB_Info, (GrB_Mode,), mode)
129131end
130132
131- function GxB_init (mode, user_malloc_function, user_calloc_function, user_realloc_function, user_free_function, user_malloc_is_thread_safe )
132- @wraperror ccall ((:GxB_init , libgraphblas), GrB_Info, (GrB_Mode, Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, Bool ), mode, user_malloc_function, user_calloc_function, user_realloc_function, user_free_function, user_malloc_is_thread_safe )
133+ function GxB_init (mode, user_malloc_function, user_calloc_function, user_realloc_function, user_free_function)
134+ @wraperror ccall ((:GxB_init , libgraphblas), GrB_Info, (GrB_Mode, Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}), mode, user_malloc_function, user_calloc_function, user_realloc_function, user_free_function)
133135end
134136
135137function GxB_cuda_init (mode)
@@ -308,6 +310,17 @@ function GB_SelectOp_new(selectop, _function, xtype, ttype, name)
308310 @wraperror ccall ((:GB_SelectOp_new , libgraphblas), GrB_Info, (Ptr{GxB_SelectOp}, GxB_select_function, GrB_Type, GrB_Type, Ptr{Cchar}), selectop, _function, xtype, ttype, name)
309311end
310312
313+ mutable struct GB_IndexUnaryOp_opaque end
314+
315+ const GrB_IndexUnaryOp = Ptr{GB_IndexUnaryOp_opaque}
316+
317+ # typedef void ( * GxB_index_unary_function ) ( void * z , // output value z, of type ztype const void * x , // input value x of type xtype; value of v(i) or A(i,j) GrB_Index i , // row index of A(i,j) GrB_Index j , // column index of A(i,j), or zero for v(i) const void * y // input scalar y )
318+ const GxB_index_unary_function = Ptr{Cvoid}
319+
320+ function GxB_IndexUnaryOp_new (op, _function, ztype, xtype, ytype, idxop_name, idxop_defn)
321+ ccall ((:GxB_IndexUnaryOp_new , libgraphblas), GrB_Info, (Ptr{GrB_IndexUnaryOp}, GxB_index_unary_function, GrB_Type, GrB_Type, GrB_Type, Ptr{Cchar}, Ptr{Cchar}), op, _function, ztype, xtype, ytype, idxop_name, idxop_defn)
322+ end
323+
311324function GxB_SelectOp_xtype (xtype, selectop)
312325 @wraperror ccall ((:GxB_SelectOp_xtype , libgraphblas), GrB_Info, (Ptr{GrB_Type}, GxB_SelectOp), xtype, selectop)
313326end
501514
502515mutable struct GB_Scalar_opaque end
503516
517+ const GrB_Scalar = Ptr{GB_Scalar_opaque}
504518const GxB_Scalar = Ptr{GB_Scalar_opaque}
505519
506520function GxB_Scalar_new (s, type)
@@ -1386,44 +1400,53 @@ end
13861400 GxB_NO_FORMAT = - 1
13871401end
13881402
1389- function GrB_Type_wait (type)
1390- @wraperror ccall ((:GrB_Type_wait , libgraphblas), GrB_Info, (Ptr{GrB_Type},), type)
1403+ @enum GrB_WaitMode:: UInt32 begin
1404+ GrB_COMPLETE = 0
1405+ GrB_MATERIALIZE = 1
1406+ end
1407+
1408+ function GrB_Type_wait (type, waitmode)
1409+ ccall ((:GrB_Type_wait , libgraphblas), GrB_Info, (GrB_Type, GrB_WaitMode), type, waitmode)
1410+ end
1411+
1412+ function GrB_UnaryOp_wait (op, waitmode)
1413+ ccall ((:GrB_UnaryOp_wait , libgraphblas), GrB_Info, (GrB_UnaryOp, GrB_WaitMode), op, waitmode)
13911414end
13921415
1393- function GrB_UnaryOp_wait (op)
1394- @wraperror ccall ((:GrB_UnaryOp_wait , libgraphblas), GrB_Info, (Ptr{GrB_UnaryOp}, ), op)
1416+ function GrB_BinaryOp_wait (op, waitmode )
1417+ ccall ((:GrB_BinaryOp_wait , libgraphblas), GrB_Info, (GrB_BinaryOp, GrB_WaitMode ), op, waitmode )
13951418end
13961419
1397- function GrB_BinaryOp_wait (op)
1398- @wraperror ccall ((:GrB_BinaryOp_wait , libgraphblas), GrB_Info, (Ptr{GrB_BinaryOp}, ), op)
1420+ function GxB_SelectOp_wait (op, waitmode )
1421+ ccall ((:GxB_SelectOp_wait , libgraphblas), GrB_Info, (GxB_SelectOp, GrB_WaitMode ), op, waitmode )
13991422end
14001423
1401- function GxB_SelectOp_wait (op)
1402- @wraperror ccall ((:GxB_SelectOp_wait , libgraphblas), GrB_Info, (Ptr{GxB_SelectOp}, ), op)
1424+ function GrB_IndexUnaryOp_wait (op, waitmode )
1425+ ccall ((:GrB_IndexUnaryOp_wait , libgraphblas), GrB_Info, (GrB_IndexUnaryOp, GrB_WaitMode ), op, waitmode )
14031426end
14041427
1405- function GrB_Monoid_wait (monoid)
1406- @wraperror ccall ((:GrB_Monoid_wait , libgraphblas), GrB_Info, (Ptr{ GrB_Monoid}, ), monoid)
1428+ function GrB_Monoid_wait (monoid, waitmode )
1429+ ccall ((:GrB_Monoid_wait , libgraphblas), GrB_Info, (GrB_Monoid, GrB_WaitMode ), monoid, waitmode )
14071430end
14081431
1409- function GrB_Semiring_wait (semiring)
1410- @wraperror ccall ((:GrB_Semiring_wait , libgraphblas), GrB_Info, (Ptr{ GrB_Semiring}, ), semiring)
1432+ function GrB_Semiring_wait (semiring, waitmode )
1433+ ccall ((:GrB_Semiring_wait , libgraphblas), GrB_Info, (GrB_Semiring, GrB_WaitMode ), semiring, waitmode )
14111434end
14121435
1413- function GrB_Descriptor_wait (desc )
1414- @wraperror ccall ((:GrB_Descriptor_wait , libgraphblas), GrB_Info, (Ptr{GrB_Descriptor}, ), desc )
1436+ function GrB_Scalar_wait (s, waitmode )
1437+ ccall ((:GrB_Scalar_wait , libgraphblas), GrB_Info, (GrB_Scalar, GrB_WaitMode ), s, waitmode )
14151438end
14161439
1417- function GxB_Scalar_wait (s )
1418- @wraperror ccall ((:GxB_Scalar_wait , libgraphblas), GrB_Info, (Ptr{GxB_Scalar}, ), s )
1440+ function GrB_Vector_wait (v, waitmode )
1441+ ccall ((:GrB_Vector_wait , libgraphblas), GrB_Info, (GrB_Vector, GrB_WaitMode ), v, waitmode )
14191442end
14201443
1421- function GrB_Vector_wait (v )
1422- @wraperror ccall ((:GrB_Vector_wait , libgraphblas), GrB_Info, (Ptr{GrB_Vector}, ), v )
1444+ function GrB_Matrix_wait (A, waitmode )
1445+ ccall ((:GrB_Matrix_wait , libgraphblas), GrB_Info, (GrB_Matrix, GrB_WaitMode ), A, waitmode )
14231446end
14241447
1425- function GrB_Matrix_wait (A )
1426- @wraperror ccall ((:GrB_Matrix_wait , libgraphblas), GrB_Info, (Ptr{GrB_Matrix}, ), A )
1448+ function GrB_Descriptor_wait (desc, waitmode )
1449+ ccall ((:GrB_Descriptor_wait , libgraphblas), GrB_Info, (GrB_Descriptor, GrB_WaitMode ), desc, waitmode )
14271450end
14281451
14291452function GrB_Type_error (type)
0 commit comments