Skip to content

Commit c560991

Browse files
committed
Undo changes to source.c handling
1 parent 86f3e02 commit c560991

File tree

5 files changed

+3
-57
lines changed

5 files changed

+3
-57
lines changed

suitesparse_graphblas/build.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,7 @@
88

99
ffibuilder = FFI()
1010

11-
if is_win:
12-
source_filename = "source_no_complex.c"
13-
else:
14-
source_filename = "source.c"
15-
16-
with open(os.path.join(thisdir, source_filename)) as f:
11+
with open(os.path.join(thisdir, "source.c")) as f:
1712
source = f.read()
1813

1914
include_dirs = [os.path.join(sys.prefix, "include")]

suitesparse_graphblas/create_headers.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,7 @@ def handle_funcs(group):
791791
text.append("****************/")
792792
text.extend(handle_funcs(groups["GxB methods"]))
793793

794-
# Cython doesn't like compiling this; add to source.c instead (may work?)
794+
# CFFI doesn't like compiling this
795795
# text.append("")
796796
# text.extend(handle_funcs(groups["static inline"]))
797797

@@ -816,10 +816,6 @@ def create_source_text(groups, *, char_defines=None):
816816
]
817817
for item in sorted(char_defines, key=sort_key):
818818
text.append(f"char *{item}_STR = {item};")
819-
# Don't define static inline twice
820-
# text.append("")
821-
# for node in groups["static inline"]:
822-
# text.append(node["text"])
823819
return text
824820

825821

@@ -847,7 +843,6 @@ def main():
847843
final_h = os.path.join(thisdir, "suitesparse_graphblas.h")
848844
final_no_complex_h = os.path.join(thisdir, "suitesparse_graphblas_no_complex.h")
849845
source_c = os.path.join(thisdir, "source.c")
850-
source_no_complex_c = os.path.join(thisdir, "source_no_complex.c")
851846

852847
# Copy original file
853848
print(f"Step 1: copy {args.graphblas} to {graphblas_h}")
@@ -886,14 +881,8 @@ def main():
886881
with open(source_c, "w") as f:
887882
f.write("\n".join(text))
888883

889-
# Create source (no complex)
890-
print(f"Step 6: create {source_no_complex_c}")
891-
text = create_source_text(groups_no_complex)
892-
with open(source_no_complex_c, "w") as f:
893-
f.write("\n".join(text))
894-
895884
# Check defines
896-
print("Step 7: check #define definitions")
885+
print("Step 6: check #define definitions")
897886
with open(graphblas_h) as f:
898887
text = f.read()
899888
define_lines = re.compile(r".*?#define\s+\w+\s+")

suitesparse_graphblas/source_no_complex.c

Lines changed: 0 additions & 8 deletions
This file was deleted.

suitesparse_graphblas/suitesparse_graphblas.h

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ 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_Iterator_opaque *GxB_Iterator;
1918
typedef struct GB_Scalar_opaque *GxB_Scalar;
2019
typedef struct GB_SelectOp_opaque *GxB_SelectOp;
2120

@@ -69,7 +68,6 @@ typedef enum
6968
{
7069
GrB_SUCCESS = 0,
7170
GrB_NO_VALUE = 1,
72-
GxB_EXHAUSTED = 2,
7371
GrB_UNINITIALIZED_OBJECT = -1,
7472
GrB_NULL_POINTER = -2,
7573
GrB_INVALID_VALUE = -3,
@@ -3061,12 +3059,6 @@ extern GrB_Info GrB_Vector_wait(GrB_Vector v, GrB_WaitMode waitmode);
30613059
/* binary */
30623060
extern 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);
30633061

3064-
/* iterator */
3065-
extern GrB_Info GB_Iterator_rc_seek(GxB_Iterator iterator, GrB_Index j, bool jth_vector);
3066-
3067-
/* matrix */
3068-
extern GrB_Info GB_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, GxB_Format_Value format, GrB_Descriptor desc);
3069-
30703062
/* selectop */
30713063
extern GrB_Info GB_SelectOp_new(GxB_SelectOp *selectop, GxB_select_function function, GrB_Type xtype, GrB_Type ttype, const char *name);
30723064

@@ -3109,14 +3101,8 @@ extern GrB_Info GxB_IndexUnaryOp_xtype_name(char *type_name, const GrB_IndexUnar
31093101
extern GrB_Info GxB_IndexUnaryOp_ytype_name(char *type_name, const GrB_IndexUnaryOp op);
31103102
extern GrB_Info GxB_IndexUnaryOp_ztype_name(char *type_name, const GrB_IndexUnaryOp op);
31113103

3112-
/* iterator */
3113-
extern GrB_Info GxB_Iterator_free(GxB_Iterator *iterator);
3114-
extern GrB_Info GxB_Iterator_new(GxB_Iterator *iterator);
3115-
31163104
/* matrix */
31173105
extern GrB_Info GxB_Col_subassign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc);
3118-
extern GrB_Info GxB_Matrix_Iterator_next(GxB_Iterator iterator);
3119-
extern GrB_Info GxB_Matrix_Iterator_seek(GxB_Iterator iterator, GrB_Index p);
31203106
extern GrB_Info GxB_Matrix_Option_get(GrB_Matrix A, GxB_Option_Field field, ...);
31213107
extern GrB_Info GxB_Matrix_Option_set(GrB_Matrix A, GxB_Option_Field field, ...);
31223108
extern GrB_Info GxB_Matrix_apply_BinaryOp1st(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Matrix A, const GrB_Descriptor desc);
@@ -3303,7 +3289,6 @@ extern GrB_Info GxB_UnaryOp_ztype(GrB_Type *ztype, GrB_UnaryOp unaryop);
33033289
extern GrB_Info GxB_UnaryOp_ztype_name(char *type_name, const GrB_UnaryOp unaryop);
33043290

33053291
/* vector */
3306-
extern GrB_Info GxB_Vector_Iterator_attach(GxB_Iterator iterator, GrB_Vector v, GrB_Descriptor desc);
33073292
extern GrB_Info GxB_Vector_Option_get(GrB_Vector A, GxB_Option_Field field, ...);
33083293
extern GrB_Info GxB_Vector_Option_set(GrB_Vector A, GxB_Option_Field field, ...);
33093294
extern GrB_Info GxB_Vector_apply_BinaryOp1st(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Vector u, const GrB_Descriptor desc);

suitesparse_graphblas/suitesparse_graphblas_no_complex.h

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ typedef struct GB_Vector_opaque *GrB_Vector;
1313
typedef uint64_t GrB_Index;
1414

1515
/* GxB typedefs */
16-
typedef struct GB_Iterator_opaque *GxB_Iterator;
1716
typedef struct GB_Scalar_opaque *GxB_Scalar;
1817
typedef struct GB_SelectOp_opaque *GxB_SelectOp;
1918

@@ -67,7 +66,6 @@ typedef enum
6766
{
6867
GrB_SUCCESS = 0,
6968
GrB_NO_VALUE = 1,
70-
GxB_EXHAUSTED = 2,
7169
GrB_UNINITIALIZED_OBJECT = -1,
7270
GrB_NULL_POINTER = -2,
7371
GrB_INVALID_VALUE = -3,
@@ -2887,12 +2885,6 @@ extern GrB_Info GrB_Vector_wait(GrB_Vector v, GrB_WaitMode waitmode);
28872885
/* binary */
28882886
extern 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);
28892887

2890-
/* iterator */
2891-
extern GrB_Info GB_Iterator_rc_seek(GxB_Iterator iterator, GrB_Index j, bool jth_vector);
2892-
2893-
/* matrix */
2894-
extern GrB_Info GB_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, GxB_Format_Value format, GrB_Descriptor desc);
2895-
28962888
/* selectop */
28972889
extern GrB_Info GB_SelectOp_new(GxB_SelectOp *selectop, GxB_select_function function, GrB_Type xtype, GrB_Type ttype, const char *name);
28982890

@@ -2935,14 +2927,8 @@ extern GrB_Info GxB_IndexUnaryOp_xtype_name(char *type_name, const GrB_IndexUnar
29352927
extern GrB_Info GxB_IndexUnaryOp_ytype_name(char *type_name, const GrB_IndexUnaryOp op);
29362928
extern GrB_Info GxB_IndexUnaryOp_ztype_name(char *type_name, const GrB_IndexUnaryOp op);
29372929

2938-
/* iterator */
2939-
extern GrB_Info GxB_Iterator_free(GxB_Iterator *iterator);
2940-
extern GrB_Info GxB_Iterator_new(GxB_Iterator *iterator);
2941-
29422930
/* matrix */
29432931
extern GrB_Info GxB_Col_subassign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc);
2944-
extern GrB_Info GxB_Matrix_Iterator_next(GxB_Iterator iterator);
2945-
extern GrB_Info GxB_Matrix_Iterator_seek(GxB_Iterator iterator, GrB_Index p);
29462932
extern GrB_Info GxB_Matrix_Option_get(GrB_Matrix A, GxB_Option_Field field, ...);
29472933
extern GrB_Info GxB_Matrix_Option_set(GrB_Matrix A, GxB_Option_Field field, ...);
29482934
extern GrB_Info GxB_Matrix_apply_BinaryOp1st(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Matrix A, const GrB_Descriptor desc);
@@ -3095,7 +3081,6 @@ extern GrB_Info GxB_UnaryOp_ztype(GrB_Type *ztype, GrB_UnaryOp unaryop);
30953081
extern GrB_Info GxB_UnaryOp_ztype_name(char *type_name, const GrB_UnaryOp unaryop);
30963082

30973083
/* vector */
3098-
extern GrB_Info GxB_Vector_Iterator_attach(GxB_Iterator iterator, GrB_Vector v, GrB_Descriptor desc);
30993084
extern GrB_Info GxB_Vector_Option_get(GrB_Vector A, GxB_Option_Field field, ...);
31003085
extern GrB_Info GxB_Vector_Option_set(GrB_Vector A, GxB_Option_Field field, ...);
31013086
extern GrB_Info GxB_Vector_apply_BinaryOp1st(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Vector u, const GrB_Descriptor desc);

0 commit comments

Comments
 (0)