Skip to content

Commit f7b6300

Browse files
authored
Test against v8.0.1.beta1 (#90)
* Update to v8.0.1 * Print default JIT configs in CI (tests and wheels)
1 parent c45d27d commit f7b6300

File tree

6 files changed

+51
-6
lines changed

6 files changed

+51
-6
lines changed

.github/workflows/test.yml

+3-1
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: ["8.0.0"]
22+
graphblas-version: ["8.0.1"]
2323
steps:
2424
- name: Checkout
2525
uses: actions/checkout@v3
@@ -40,6 +40,7 @@ jobs:
4040
- name: GraphBLAS (from source)
4141
if: (contains(matrix.source, 'source'))
4242
run: |
43+
# From release (does not work with beta versions)
4344
GRAPHBLAS_PREFIX=${CONDA_PREFIX} bash suitesparse.sh refs/tags/${{ matrix.graphblas-version }}.0
4445
4546
# From tag
@@ -63,6 +64,7 @@ jobs:
6364
env:
6465
CYTHON_COVERAGE: true
6566
run: |
67+
pytest -s -k test_print_jit_config
6668
coverage run --branch -m pytest
6769
coverage run -a --branch suitesparse_graphblas/tests/test_initialize.py
6870
- name: create_headers.py check

.github/workflows/wheels.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ jobs:
148148
CIBW_TEST_EXTRAS: "test"
149149

150150
# run tests
151-
CIBW_TEST_COMMAND: "pytest -v --pyargs suitesparse_graphblas"
151+
CIBW_TEST_COMMAND: "pytest --pyargs suitesparse_graphblas -s -k test_print_jit_config && pytest -v --pyargs suitesparse_graphblas"
152152

153153
# GitHub Actions macOS Intel runner cannot run ARM tests. Uncomment to silence warning.
154154
# CIBW_TEST_SKIP: "*-macosx_arm64"

.pre-commit-config.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ repos:
2020
- id: mixed-line-ending
2121
# - id: trailing-whitespace
2222
- repo: https://github.com/abravalheri/validate-pyproject
23-
rev: v0.12.2
23+
rev: v0.13
2424
hooks:
2525
- id: validate-pyproject
2626
name: Validate pyproject.toml
@@ -34,7 +34,7 @@ repos:
3434
hooks:
3535
- id: isort
3636
- repo: https://github.com/asottile/pyupgrade
37-
rev: v3.3.2
37+
rev: v3.4.0
3838
hooks:
3939
- id: pyupgrade
4040
args: [--py38-plus]
@@ -55,8 +55,8 @@ repos:
5555
additional_dependencies: &flake8_dependencies
5656
# These versions need updated manually
5757
- flake8==6.0.0
58-
- flake8-comprehensions==3.11.1
59-
- flake8-bugbear==23.3.23
58+
- flake8-comprehensions==3.12.0
59+
- flake8-bugbear==23.5.9
6060
# - flake8-simplify==0.20.0
6161
- repo: https://github.com/asottile/yesqa
6262
rev: v1.4.0

suitesparse_graphblas/suitesparse_graphblas.h

+2
Original file line numberDiff line numberDiff line change
@@ -3112,6 +3112,7 @@ GrB_Info GxB_BinaryOp_ztype_name(char *type_name, const GrB_BinaryOp binaryop);
31123112
/* context */
31133113
GrB_Info GxB_Context_disengage(GxB_Context Context);
31143114
GrB_Info GxB_Context_engage(GxB_Context Context);
3115+
GrB_Info GxB_Context_error(const char **error, const GxB_Context Context);
31153116
GrB_Info GxB_Context_fprint(GxB_Context Context, const char *name, GxB_Print_Level pr, FILE *f);
31163117
GrB_Info GxB_Context_free(GxB_Context *Context);
31173118
GrB_Info GxB_Context_get(GxB_Context Context, GxB_Context_Field field, ...);
@@ -3121,6 +3122,7 @@ GrB_Info GxB_Context_new(GxB_Context *Context);
31213122
GrB_Info GxB_Context_set(GxB_Context Context, GxB_Context_Field field, ...);
31223123
GrB_Info GxB_Context_set_FP64(GxB_Context Context, GxB_Context_Field field, double value);
31233124
GrB_Info GxB_Context_set_INT32(GxB_Context Context, GxB_Context_Field field, int32_t value);
3125+
GrB_Info GxB_Context_wait(GxB_Context Context, GrB_WaitMode waitmode);
31243126

31253127
/* core */
31263128
GrB_Info GxB_Global_Option_get(GxB_Option_Field field, ...);

suitesparse_graphblas/suitesparse_graphblas_no_complex.h

+2
Original file line numberDiff line numberDiff line change
@@ -2938,6 +2938,7 @@ GrB_Info GxB_BinaryOp_ztype_name(char *type_name, const GrB_BinaryOp binaryop);
29382938
/* context */
29392939
GrB_Info GxB_Context_disengage(GxB_Context Context);
29402940
GrB_Info GxB_Context_engage(GxB_Context Context);
2941+
GrB_Info GxB_Context_error(const char **error, const GxB_Context Context);
29412942
GrB_Info GxB_Context_fprint(GxB_Context Context, const char *name, GxB_Print_Level pr, FILE *f);
29422943
GrB_Info GxB_Context_free(GxB_Context *Context);
29432944
GrB_Info GxB_Context_get(GxB_Context Context, GxB_Context_Field field, ...);
@@ -2947,6 +2948,7 @@ GrB_Info GxB_Context_new(GxB_Context *Context);
29472948
GrB_Info GxB_Context_set(GxB_Context Context, GxB_Context_Field field, ...);
29482949
GrB_Info GxB_Context_set_FP64(GxB_Context Context, GxB_Context_Field field, double value);
29492950
GrB_Info GxB_Context_set_INT32(GxB_Context Context, GxB_Context_Field field, int32_t value);
2951+
GrB_Info GxB_Context_wait(GxB_Context Context, GrB_WaitMode waitmode);
29502952

29512953
/* core */
29522954
GrB_Info GxB_Global_Option_get(GxB_Option_Field field, ...);
+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
from suitesparse_graphblas import ffi, lib
2+
3+
4+
def test_print_jit_config():
5+
print()
6+
print("===================================")
7+
print("Printing default JIT configurations")
8+
print("-----------------------------------")
9+
jit_c_control = {
10+
lib.GxB_JIT_OFF: "off",
11+
lib.GxB_JIT_PAUSE: "pause",
12+
lib.GxB_JIT_RUN: "run",
13+
lib.GxB_JIT_LOAD: "load",
14+
lib.GxB_JIT_ON: "on",
15+
}
16+
val_ptr = ffi.new("int32_t*")
17+
assert lib.GxB_Global_Option_get_INT32(lib.GxB_JIT_C_CONTROL, val_ptr) == lib.GrB_SUCCESS
18+
print("JIT_C_CONTROL", jit_c_control[val_ptr[0]])
19+
20+
assert lib.GxB_Global_Option_get_INT32(lib.GxB_JIT_USE_CMAKE, val_ptr) == lib.GrB_SUCCESS
21+
print("JIT_USE_CMAKE", bool(val_ptr[0]))
22+
23+
func = lib.GxB_Global_Option_get_CHAR
24+
names = [
25+
"JIT_C_COMPILER_NAME",
26+
"JIT_C_COMPILER_FLAGS",
27+
"JIT_C_LINKER_FLAGS",
28+
"JIT_C_LIBRARIES",
29+
"JIT_C_CMAKE_LIBS",
30+
"JIT_C_PREFACE",
31+
"JIT_ERROR_LOG",
32+
"JIT_CACHE_PATH",
33+
]
34+
val_ptr = ffi.new("char**")
35+
for name in names:
36+
obj = getattr(lib, f"GxB_{name}")
37+
assert func(obj, val_ptr) == lib.GrB_SUCCESS
38+
print(name, ffi.string(val_ptr[0]).decode())
39+
print("===================================")

0 commit comments

Comments
 (0)