Skip to content

Test against v8.0.1.beta1 #90

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
# os: ["ubuntu-latest"]
# source: ["source"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
graphblas-version: ["8.0.0"]
graphblas-version: ["8.0.1"]
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -40,6 +40,7 @@ jobs:
- name: GraphBLAS (from source)
if: (contains(matrix.source, 'source'))
run: |
# From release (does not work with beta versions)
GRAPHBLAS_PREFIX=${CONDA_PREFIX} bash suitesparse.sh refs/tags/${{ matrix.graphblas-version }}.0

# From tag
Expand All @@ -63,6 +64,7 @@ jobs:
env:
CYTHON_COVERAGE: true
run: |
pytest -s -k test_print_jit_config
coverage run --branch -m pytest
coverage run -a --branch suitesparse_graphblas/tests/test_initialize.py
- name: create_headers.py check
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ jobs:
CIBW_TEST_EXTRAS: "test"

# run tests
CIBW_TEST_COMMAND: "pytest -v --pyargs suitesparse_graphblas"
CIBW_TEST_COMMAND: "pytest --pyargs suitesparse_graphblas -s -k test_print_jit_config && pytest -v --pyargs suitesparse_graphblas"

# GitHub Actions macOS Intel runner cannot run ARM tests. Uncomment to silence warning.
# CIBW_TEST_SKIP: "*-macosx_arm64"
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ repos:
- id: mixed-line-ending
# - id: trailing-whitespace
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.12.2
rev: v0.13
hooks:
- id: validate-pyproject
name: Validate pyproject.toml
Expand All @@ -34,7 +34,7 @@ repos:
hooks:
- id: isort
- repo: https://github.com/asottile/pyupgrade
rev: v3.3.2
rev: v3.4.0
hooks:
- id: pyupgrade
args: [--py38-plus]
Expand All @@ -55,8 +55,8 @@ repos:
additional_dependencies: &flake8_dependencies
# These versions need updated manually
- flake8==6.0.0
- flake8-comprehensions==3.11.1
- flake8-bugbear==23.3.23
- flake8-comprehensions==3.12.0
- flake8-bugbear==23.5.9
# - flake8-simplify==0.20.0
- repo: https://github.com/asottile/yesqa
rev: v1.4.0
Expand Down
2 changes: 2 additions & 0 deletions suitesparse_graphblas/suitesparse_graphblas.h
Original file line number Diff line number Diff line change
Expand Up @@ -3112,6 +3112,7 @@ GrB_Info GxB_BinaryOp_ztype_name(char *type_name, const GrB_BinaryOp binaryop);
/* context */
GrB_Info GxB_Context_disengage(GxB_Context Context);
GrB_Info GxB_Context_engage(GxB_Context Context);
GrB_Info GxB_Context_error(const char **error, const GxB_Context Context);
GrB_Info GxB_Context_fprint(GxB_Context Context, const char *name, GxB_Print_Level pr, FILE *f);
GrB_Info GxB_Context_free(GxB_Context *Context);
GrB_Info GxB_Context_get(GxB_Context Context, GxB_Context_Field field, ...);
Expand All @@ -3121,6 +3122,7 @@ GrB_Info GxB_Context_new(GxB_Context *Context);
GrB_Info GxB_Context_set(GxB_Context Context, GxB_Context_Field field, ...);
GrB_Info GxB_Context_set_FP64(GxB_Context Context, GxB_Context_Field field, double value);
GrB_Info GxB_Context_set_INT32(GxB_Context Context, GxB_Context_Field field, int32_t value);
GrB_Info GxB_Context_wait(GxB_Context Context, GrB_WaitMode waitmode);

/* core */
GrB_Info GxB_Global_Option_get(GxB_Option_Field field, ...);
Expand Down
2 changes: 2 additions & 0 deletions suitesparse_graphblas/suitesparse_graphblas_no_complex.h
Original file line number Diff line number Diff line change
Expand Up @@ -2938,6 +2938,7 @@ GrB_Info GxB_BinaryOp_ztype_name(char *type_name, const GrB_BinaryOp binaryop);
/* context */
GrB_Info GxB_Context_disengage(GxB_Context Context);
GrB_Info GxB_Context_engage(GxB_Context Context);
GrB_Info GxB_Context_error(const char **error, const GxB_Context Context);
GrB_Info GxB_Context_fprint(GxB_Context Context, const char *name, GxB_Print_Level pr, FILE *f);
GrB_Info GxB_Context_free(GxB_Context *Context);
GrB_Info GxB_Context_get(GxB_Context Context, GxB_Context_Field field, ...);
Expand All @@ -2947,6 +2948,7 @@ GrB_Info GxB_Context_new(GxB_Context *Context);
GrB_Info GxB_Context_set(GxB_Context Context, GxB_Context_Field field, ...);
GrB_Info GxB_Context_set_FP64(GxB_Context Context, GxB_Context_Field field, double value);
GrB_Info GxB_Context_set_INT32(GxB_Context Context, GxB_Context_Field field, int32_t value);
GrB_Info GxB_Context_wait(GxB_Context Context, GrB_WaitMode waitmode);

/* core */
GrB_Info GxB_Global_Option_get(GxB_Option_Field field, ...);
Expand Down
39 changes: 39 additions & 0 deletions suitesparse_graphblas/tests/test_jit.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
from suitesparse_graphblas import ffi, lib


def test_print_jit_config():
print()
print("===================================")
print("Printing default JIT configurations")
print("-----------------------------------")
jit_c_control = {
lib.GxB_JIT_OFF: "off",
lib.GxB_JIT_PAUSE: "pause",
lib.GxB_JIT_RUN: "run",
lib.GxB_JIT_LOAD: "load",
lib.GxB_JIT_ON: "on",
}
val_ptr = ffi.new("int32_t*")
assert lib.GxB_Global_Option_get_INT32(lib.GxB_JIT_C_CONTROL, val_ptr) == lib.GrB_SUCCESS
print("JIT_C_CONTROL", jit_c_control[val_ptr[0]])

assert lib.GxB_Global_Option_get_INT32(lib.GxB_JIT_USE_CMAKE, val_ptr) == lib.GrB_SUCCESS
print("JIT_USE_CMAKE", bool(val_ptr[0]))

func = lib.GxB_Global_Option_get_CHAR
names = [
"JIT_C_COMPILER_NAME",
"JIT_C_COMPILER_FLAGS",
"JIT_C_LINKER_FLAGS",
"JIT_C_LIBRARIES",
"JIT_C_CMAKE_LIBS",
"JIT_C_PREFACE",
"JIT_ERROR_LOG",
"JIT_CACHE_PATH",
]
val_ptr = ffi.new("char**")
for name in names:
obj = getattr(lib, f"GxB_{name}")
assert func(obj, val_ptr) == lib.GrB_SUCCESS
print(name, ffi.string(val_ptr[0]).decode())
print("===================================")